Documents
Use the bundled deterministic CLI for repeatable DOCX operations. Keep source files unchanged and write results to a new path.
Runtime
Prefer the Python executable returned by the workspace dependency loader. Otherwise use an available Python 3 executable. Set SKILL_DIR to this skill directory and invoke:
On macOS/Linux use python3; on Windows PowerShell use py -3 (or the
workspace dependency loader's absolute python.exe path). On Windows set the
skill directory with $env:SKILL_DIR = '<skill-directory>'. Every python3
example below uses this platform-specific launcher substitution.
python3 "$SKILL_DIR/scripts/bootstrap.py" <command> [arguments]
py -3 "$env:SKILL_DIR\scripts\bootstrap.py" <command> [arguments]
The bootstrap reuses compatible workspace packages. When packages are missing, it installs the hashed lock file into ~/.wegent-executor/plugin-envs/wework-public/documents/; it never installs globally.
Workflow
- Run
inspectbefore modifying an existing DOCX. - For new files, write a JSON specification following spec.md, then run
create. - Use
replaceonly for deliberate text substitutions. It preserves the first run's formatting when a replacement spans multiple runs, so visually verify affected paragraphs. - Run
validateafter every create or edit operation. - Run
render --images, inspect every generated page image, and correct clipping, unexpected pagination, or weak hierarchy before delivery.
Commands
python3 "$SKILL_DIR/scripts/bootstrap.py" inspect --input source.docx --output inspection.json
python3 "$SKILL_DIR/scripts/bootstrap.py" create --spec document.json --output result.docx
python3 "$SKILL_DIR/scripts/bootstrap.py" replace --input source.docx --old 'Draft' --new 'Final' --output result.docx
python3 "$SKILL_DIR/scripts/bootstrap.py" validate --input result.docx
python3 "$SKILL_DIR/scripts/bootstrap.py" render --input result.docx --output-dir rendered --images
Quality rules
- Use headings, short paragraphs, lists, and tables intentionally; do not simulate structure with spaces.
- Preserve the original file when editing and use descriptive output names.
- Treat a successful package validation as structural evidence, not visual evidence; rendering and page review remain required.
- Do not claim tracked-change, comment, field-code, or macro preservation unless independently verified for the specific file.
- Use user-provided templates and images only from paths the user placed in scope.