Skip to main content
AI/MLplurigrid

docx

Comprehensive document creation, editing, and analysis with support for

Stars
23
Source
plurigrid/asi
Updated
2026-04-26
Slug
plurigrid--asi--docx
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/plurigrid/asi/HEAD/plugins/asi/skills/docx/SKILL.md -o .claude/skills/docx.md

Drops the SKILL.md into .claude/skills/docx.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

DOCX Processing

Workflow Decision Tree

  • Reading/Analyzing: Use text extraction or raw XML access
  • Creating New Document: Use docx-js (JavaScript)
  • Editing Existing: Use OOXML editing or redlining workflow

Reading Content

Text Extraction with Pandoc

# Convert to markdown with tracked changes
pandoc --track-changes=all file.docx -o output.md

Raw XML Access

# Unpack document
unzip document.docx -d unpacked/
# Key files:
# word/document.xml - Main content
# word/comments.xml - Comments
# word/media/ - Images

Creating New Documents (docx-js)

import { Document, Paragraph, TextRun, Packer } from 'docx';
import fs from 'fs';

const doc = new Document({
  sections: [{
    children: [
      new Paragraph({
        children: [
          new TextRun({ text: "Hello ", bold: true }),
          new TextRun({ text: "World", italics: true })
        ]
      })
    ]
  }]
});

const buffer = await Packer.toBuffer(doc);
fs.writeFileSync('document.docx', buffer);

Editing Existing Documents

Simple Edits

  1. Unpack: unzip doc.docx -d unpacked/
  2. Edit word/document.xml
  3. Repack: cd unpacked && zip -r ../edited.docx .

Tracked Changes (Redlining)

For professional documents, use tracked changes:

<!-- Deletion -->
<w:del w:author="Author" w:date="2025-01-01T00:00:00Z">
  <w:r><w:delText>old text</w:delText></w:r>
</w:del>

<!-- Insertion -->
<w:ins w:author="Author" w:date="2025-01-01T00:00:00Z">
  <w:r><w:t>new text</w:t></w:r>
</w:ins>

Converting to Images

# DOCX to PDF
soffice --headless --convert-to pdf document.docx

# PDF to images
pdftoppm -jpeg -r 150 document.pdf page

Best Practices

  • Use Pandoc for text extraction
  • Use docx-js for creating new documents
  • For legal/business docs, always use tracked changes
  • Preserve original RSIDs when editing

Scientific Skill Interleaving

This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:

Graph Theory

  • networkx [○] via bicomodule
    • Universal graph hub

Bibliography References

  • general: 734 citations in bib.duckdb

Cat# Integration

This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:

Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826

GF(3) Naturality

The skill participates in triads satisfying:

(-1) + (0) + (+1) ≡ 0 (mod 3)

This ensures compositional coherence in the Cat# equipment structure.