You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
che-word-mcp exposes ~218 OOXML editing tools over MCP stdio JSON-RPC. Two real-world workflows have hit the limits of going through the MCP transport:
Replicable docx-edit pipelines — running the same edit plan against different docx baselines (e.g. template-population, content backfill, batch caption fix-ups) currently means either:
Manually re-driving 30+ MCP calls per run (lossy, error-prone), or
Writing one-off Python/Bash scripts that wrap MCP stdio (fragile, JSON-escape pain especially for CJK anchor text).
che-word-mcp integration testing — RealWorldDocxRoundTripSmokeTests covers open → save round-trip but not edit-path tests with non-trivial sequences (insert+replace+insert with anchors). A scriptable surface that drives the same ooxml-swift API che-word-mcp uses would let us assert end-to-end behaviour declaratively.
Both share the same need: a declarative way to describe a docx edit plan and execute it against ooxml-swift directly (no MCP transport overhead, no JSON escaping). MCP and this CLI become two front-ends on the same library.
Type
feature
Proposal
A new CLI + library inside macdoc/, sibling to mcp/che-word-mcp/:
Why this lives in macdoc/ rather than a separate repo
Same SPM dep graph as che-word-mcp (both depend on ooxml-swift)
CLI changes often co-evolve with ooxml-swift API changes — atomic commits possible
che-word-mcp integration tests can shell out to dxedit for declarative E2E coverage
Workspace-style monorepo already established (macdoc/mcp/, macdoc/lib/, etc.)
A separate repo can be extracted later if the CLI grows beyond docx (e.g. unified dxedit / pxedit / pptedit toolkit), following the same pattern as #78 (NoteCore extraction) and #79 (pdf-to-latex-swift extraction).
Use cases
Template population — given a docx template with anchor markers, populate with structured content from a manifest.
Batch fix-up — apply caption format normalization across many docx files.
Reproducible workflows — a docx-edit pipeline checked into a project repo (scripts/edit/manifest.yaml + dxedit apply) is replayable and version-controlled.
che-word-mcp integration tests — declarative assertions about edit-path behaviour that supplement the existing round-trip XCTest suite.
Manifest format choice (YAML vs JSON): leaning YAML for CJK anchor readability; JSON has stricter parsing but worse for human-edited multi-line strings. Open for discussion.
Priority
P2 — useful for downstream replicable workflows; not blocking any current work.
Related
PsychQuant/che-word-mcp — same ooxml-swift dep, alternate MCP front-end
Phase: diagnosed Last updated: 2026-06-01 by /idd-diagnose --rediagnose
Key Decisions
(2026-06-01) Re-diagnosed per /idd-diagnose #92 --rediagnose. Verdict: Spectra (Layer 2+3 both fire). User routed to /spectra-discuss (default) to align on 3 open decisions before authoring proposal.
(2026-05-02 by Codex, historical) Original intent: integrated macdoc docx ... subcommands over standalone dxedit binary, JSON-Codable manifest first. Status: superseded by re-diagnosis — these are now open discuss-stage decisions, not locked.
Awaiting /spectra-discuss session to lock CLI placement (standalone dxedit vs macdoc docx integrated), manifest format (YAML vs JSON), and Phase 1 step-type scope given Phase 2c Reducer gaps.
Problem
che-word-mcpexposes ~218 OOXML editing tools over MCP stdio JSON-RPC. Two real-world workflows have hit the limits of going through the MCP transport:che-word-mcpintegration testing —RealWorldDocxRoundTripSmokeTestscoversopen → saveround-trip but not edit-path tests with non-trivial sequences (insert+replace+insert with anchors). A scriptable surface that drives the sameooxml-swiftAPI che-word-mcp uses would let us assert end-to-end behaviour declaratively.Both share the same need: a declarative way to describe a docx edit plan and execute it against
ooxml-swiftdirectly (no MCP transport overhead, no JSON escaping). MCP and this CLI become two front-ends on the same library.Type
feature
Proposal
A new CLI + library inside
macdoc/, sibling tomcp/che-word-mcp/:CLI surface
Manifest sketch
Why this lives in
macdoc/rather than a separate repoche-word-mcp(both depend onooxml-swift)ooxml-swiftAPI changes — atomic commits possibleche-word-mcpintegration tests can shell out todxeditfor declarative E2E coveragemacdoc/mcp/,macdoc/lib/, etc.)A separate repo can be extracted later if the CLI grows beyond docx (e.g. unified
dxedit / pxedit / pptedittoolkit), following the same pattern as #78 (NoteCoreextraction) and #79 (pdf-to-latex-swiftextraction).Use cases
scripts/edit/manifest.yaml+dxedit apply) is replayable and version-controlled.che-word-mcpintegration tests — declarative assertions about edit-path behaviour that supplement the existing round-trip XCTest suite.Implementation phases
applycommand, supportsinsert_image,replace_text,replace_text_batch,insert_paragraphsteps. YAML manifest. SPM library target.verifycommand with post-condition harness (libxml2 validity, byte-preservation checks, content presence).plan(dry-run),diff(using ooxml-swift compare),archive-firstintegration (auto-snapshot baseline before mutating writes).ooxml-swiftAPI matures —insert_equation,wrap_caption_seq(depends on P2: helper to wrap plain-text captions in SEQ field for downstream TOF/TOT generation che-word-mcp#62), section/header/footer manipulation.Caveats
ooxml-swifttext-anchor support being uniform across all step types. P2: insert_paragraph / insert_equation lack after_text/before_text anchors — paragraph_index alone unreliable in real-world docx che-word-mcp#61 tracks the gap whereinsert_paragraph/insert_equationlackafter_text/before_textanchors thatinsert_image_from_pathalready has. Phase 1 ofdxeditmay have to ship withparagraph_indexonly for those step types until feat: add --full and --css flags to SRT→HTML and MD→HTML output #61 is resolved.Priority
P2 — useful for downstream replicable workflows; not blocking any current work.
Related
ooxml-swiftdep, alternate MCP front-enddxedit verify)insert_paragraph/insert_equation— affectsdxeditstep type completeness)dxeditstep type once available)dxeditcould be extracted similarly later)dxeditis the "reader" half of that pipeline)Current Status
Phase: diagnosed
Last updated: 2026-06-01 by /idd-diagnose --rediagnose
Key Decisions
/idd-diagnose #92 --rediagnose. Verdict: Spectra (Layer 2+3 both fire). User routed to/spectra-discuss(default) to align on 3 open decisions before authoring proposal./idd-all-chainclose was administrative theatre (per the errata comment).macdoc docx ...subcommands over standalonedxeditbinary, JSON-Codable manifest first. Status: superseded by re-diagnosis — these are now open discuss-stage decisions, not locked.ooxml-edit-isomorphism-foundation; YAML manifest compiles toWordEditscript.Scope Changes
LensDocument+@_exported import OOXMLSwiftis now the Layer 3 ergonomic adapter. Phase 1 of feat: dxedit — declarative docx edit CLI + library (manifest-driven, ooxml-swift direct, peer to che-word-mcp MCP front-end) #92 should be authored on top of this surface, not retrofitted.Blocking
/spectra-discusssession to lock CLI placement (standalonedxeditvsmacdoc docxintegrated), manifest format (YAML vs JSON), and Phase 1 step-type scope given Phase 2c Reducer gaps.PR Propose macdoc docx workflow CLI #94 review/merge— superseded: PR Propose macdoc docx workflow CLI #94 was closed without merging 2026-05-25, openspec changemacdoc-docx-workflow-clino longer exists. New Spectra change will pick a fresh name (suggested:docx-edit-manifest-cli).Commits