Word Editor

GitHub

基于SuperDoc CLI处理.docx文件的技能,支持读写、搜索、修改格式、批注及修订追踪。适用于合同修订、模板填充等场景,强调使用追踪模式并实时保存更改。

skills/docx-processing-lawvable/SKILL.md lawve-ai/awesome-legal-skills

Trigger Scenarios

用户请求读取或搜索Word文档内容 用户要求修改、格式化或替换Word文本 用户需要添加批注、追踪或审核修订 涉及合同标记、模板填充或批量编辑任务

Install

npx skills add lawve-ai/awesome-legal-skills --skill Word Editor -g -y
More Options

Use without installing

npx skills use lawve-ai/awesome-legal-skills@Word Editor

指定 Agent (Claude Code)

npx skills add lawve-ai/awesome-legal-skills --skill Word Editor -a claude-code -g -y

安装 repo 全部 skill

npx skills add lawve-ai/awesome-legal-skills --all -g -y

预览 repo 内 skill

npx skills add lawve-ai/awesome-legal-skills --list

SKILL.md

Frontmatter
{
    "name": "Word Editor",
    "metadata": {
        "author": "Dr. Antoine Louis",
        "license": "agpl-3.0",
        "version": "2026-04-10"
    },
    "description": "Edit, query, and transform Word documents (.docx) with the SuperDoc CLI. Use when the user asks to read, search, modify, format, comment, track changes, or review changes in .docx files. Triggers on any task involving Word documents — text replacement, redlining, contract markup, template filling, bulk edits, content extraction, or document review."
}

SuperDoc CLI (v1)

Use SuperDoc CLI for DOCX work. Use v1 commands (canonical operations and their helper wrappers). Do not default to legacy commands unless explicitly needed for v0-style bulk workflows.

Use superdoc if installed, or npx @superdoc-dev/cli@latest as a fallback.

Auto-Open in VS Code

Before starting any edit workflow, check if running inside VS Code by testing VSCODE_PID. If set, open the target document so the user sees changes live:

if [ -n "$VSCODE_PID" ]; then
  for cmd in code code-insiders cursor; do
    if command -v "$cmd" > /dev/null 2>&1; then "$cmd" "$DOC_PATH"; break; fi
  done
fi
  • VSCODE_PID is set by VS Code itself — works for any agent extension (Claude Code, Codex, Cline, etc.) and the integrated terminal.
  • Skip silently if not set. Idempotent: re-opening focuses the existing tab.

Edit Identity: Ask Before Starting

Before opening a document for editing, ask the user under which name tracked changes should be attributed:

  1. Their own name (e.g., the lawyer reviewing the document)
  2. The AI agent's name as default (e.g., "Claude", "Codex", "Gemini")

Use the chosen name in --user-name on open. Convention for email: <name>@lawvable.com.

Default Edit Mode: Tracked Changes

Always use --tracked on every mutating command unless the user explicitly asks for direct edits.

  • --tracked is shorthand for --change-mode tracked.
  • If a command returns TRACK_CHANGE_COMMAND_UNAVAILABLE, fall back to direct edit for that command only.

Save After Every Mutation

The CLI and the VS Code SuperDoc extension run separate engines — the only sync point is the file on disk.

Call superdoc save after every mutation so changes appear live.

  • Single mutation → save immediately.
  • Tight group of 2-3 related mutations (e.g., replace + format) → save once after the group.
  • Never defer save to end of session.

Command Reference

Read references/index.md first — it lists all reference files by topic. Then read only the relevant file for your task (e.g., references/track-changes.md for accepting/rejecting changes, references/mutations-apply.md for batch find-and-replace).

Do NOT read all reference files at once — pick only what you need.

For commands not covered in any reference file, use superdoc describe command "<name>" as fallback.

Common Patterns

Global find & replace (most common)

Use mutations apply with text.rewrite + require: "all". Do NOT manually find → parse → build steps.

superdoc open ./contract.docx --user-name "Claude" --user-email "claude@lawvable.com"

superdoc mutations apply --atomic true --change-mode tracked --steps-json '[
  {"id":"s1","op":"text.rewrite",
   "where":{"by":"select","select":{"type":"text","pattern":"Lawvable"},"require":"all"},
   "args":{"replacement":{"text":"Google"}}}
]'
superdoc save
superdoc close
  • require: "all" → every match. "first" → first only. "exactlyOne" → fails if != 1.
  • Batch multiple replacements in the same steps array (see references/commands.md).

Targeted single edit

Use query match (not find) to locate a target, then replace:

superdoc open ./contract.docx --user-name "Claude" --user-email "claude@lawvable.com"

superdoc query match --select-json '{"type":"text","pattern":"termination"}' --require exactlyOne
superdoc replace --tracked --target-json '{"kind":"text","blockId":"p1","range":{"start":0,"end":11}}' --text "expiration"
superdoc save

superdoc close
  • query match returns exact addresses with cardinality guarantees. find does not — use it only for exploration.
  • After open, commands run against the active session when <doc> is omitted.

Tight group of related mutations

superdoc open ./contract.docx --user-name "Claude" --user-email "claude@lawvable.com"

superdoc query match --select-json '{"type":"text","pattern":"ACME Corp"}' --require exactlyOne
superdoc replace --tracked --target-json '{"kind":"text","blockId":"p2","range":{"start":0,"end":9}}' --text "NewCo Inc."
superdoc format bold --tracked --block-id p2 --start 0 --end 10
superdoc save

superdoc close

Stateless reads (no session needed)

superdoc get-text ./proposal.docx
superdoc get-markdown ./proposal.docx
superdoc info ./proposal.docx

Stateless mutation

superdoc replace --tracked ./proposal.docx \
  --target-json '{"kind":"text","blockId":"p1","range":{"start":0,"end":5}}' \
  --text "Updated" --out ./proposal.updated.docx

Stateless mutating commands require --out unless using --dry-run.

Safety

  • --dry-run to preview any mutation without applying.
  • --expected-revision <n> for optimistic concurrency checks.

Important Notes

  • Telemetry on stdout: The CLI may print [super-editor] Telemetry: enabled. Use 2>/dev/null when piping JSON. Prefer declarative selectors (mutations apply) over find | parse pipelines.
  • Legacy commands (search, replace-legacy, read) exist for v0 compatibility. Use only for multi-file glob workflows.
  • Session cleanup: close on dirty state requires --discard or a prior save.

Version History

  • 7f58aaf Current 2026-07-05 11:49

Same Skill Collection

skills/assignation-refere-recouvrement-creance-selim-brihi/SKILL.md
skills/canned-responses-anthropic/SKILL.md
skills/compliance-anthropic/SKILL.md
skills/contract-review-anthropic/SKILL.md
skills/contract-risk-analyzer-sneha-ganapavarapu/SKILL.md
skills/docx-processing-openai/SKILL.md
skills/docx-processing-superdoc/SKILL.md
skills/dpdpa-gdpr-review-parth-desai/SKILL.md
skills/dpia-sentinel-oliver-schmidt-prietz/SKILL.md
skills/eu-ai-act-report-oliver-schmidt-prietz/SKILL.md
skills/eu-ai-act-roles-oliver-schmidt-prietz/SKILL.md
skills/eu-ai-act-triage-oliver-schmidt-prietz/SKILL.md
skills/french-text-proofreading-christophe-quezel-ambrunaz/SKILL.md
skills/icelandic-company-formation-magnus-smari-smarason/SKILL.md
skills/icelandic-contract-review-magnus-smari-smarason/SKILL.md
skills/icelandic-court-case-finder-magnus-smarason/SKILL.md
skills/icelandic-eea-gap-analysis-magnus-smari-smarason/SKILL.md
skills/icelandic-labour-law-magnus-smari-smarason/SKILL.md
skills/icelandic-legal-terminology-magnus-smari-smarason/SKILL.md
skills/icelandic-privacy-review-magnus-smari-smarason/SKILL.md
skills/legal-data-hunter-zacharie-laik/SKILL.md
skills/legal-risk-assessment-anthropic/SKILL.md
skills/lgpd-sentinel-rafael-mastronardi/SKILL.md
skills/mcq-generator-christophe-quezel-ambrunaz/SKILL.md
skills/meeting-briefing-anthropic/SKILL.md
skills/nda-review-jamie-tso/SKILL.md
skills/nda-triage-anthropic/SKILL.md
skills/notification-licenciement-selim-brihi/SKILL.md
skills/outlook-emails-lawvable/SKILL.md
skills/outside-counsel-billing-and-performance-reviewer-carl-ditzler/SKILL.md
skills/pdf-processing-anthropic/SKILL.md
skills/pdf-processing-openai/SKILL.md
skills/politique-confidentialite-malik-taiar/SKILL.md
skills/politique-cookies-malik-taiar/SKILL.md
skills/politique-lanceur-alerte-malik-taiar/SKILL.md
skills/privilege-sentinel-emily-cabrera/SKILL.md
skills/requete-cph-licenciement-faute-grave-selim-brihi/SKILL.md
skills/security-review-openai/SKILL.md
skills/skill-creator-anthropic/SKILL.md
skills/skill-creator-openai/SKILL.md
skills/skill-optimizer-lawvable/SKILL.md
skills/swiss-legal-source-authority-triage-enrique-g-zbinden/SKILL.md
skills/tabular-review-lawvable/SKILL.md
skills/tech-contract-review-parth-desai/SKILL.md
skills/vscode-extension-builder-lawvable/SKILL.md
skills/xlsx-processing-manus/SKILL.md
skills/xlsx-processing-openai/SKILL.md
skills/ai-governance-reviewer-carl-ditzler/SKILL.md
skills/analyse-rgpd-dpa-fournisseur-hugo-salard/SKILL.md
skills/assignation-refere-communication-associe-selim-brihi/SKILL.md
skills/audit-de-conformite-rgpd-site-internet-hugo-salard/SKILL.md
skills/bacen-compliance-sentinel-rafael-mastronardi/SKILL.md
skills/billable-time-stephane-boghossian/SKILL.md
skills/billing-cycle-manager-scott-margetts/SKILL.md
skills/budget-and-fee-manager-scott-margetts/SKILL.md
skills/climate-aligned-contracts-tclp/SKILL.md
skills/collaboration-platform-advisor-scott-margetts/SKILL.md
skills/continuous-improvement-engine-scott-margetts/SKILL.md
skills/customs-trade-law-onur-kafkas/SKILL.md
skills/divorce-ct-stephane-boghossian/SKILL.md
skills/doctrinal-research-allison-fiorentino/SKILL.md
skills/document-approval-tracker-scott-margetts/SKILL.md
skills/docx-processing-anthropic/SKILL.md
skills/employment-law-research-yue-deng-wu/SKILL.md
skills/en-us-legal-translation-wouter-van-den-berg/SKILL.md
skills/engagement-terms-billing-guidelines-scott-margetts/SKILL.md
skills/eu-ai-act-classification-oliver-schmidt-prietz/SKILL.md
skills/eu-ai-act-high-risk-implementation-readiness-werner-plutat/SKILL.md
skills/eu-ai-act-obligations-oliver-schmidt-prietz/SKILL.md
skills/eu-data-act-compliance-assessment-werner-plutat/SKILL.md
skills/eu-data-act-ryan-malek/SKILL.md
skills/fee-arrangement-structuring-scott-margetts/SKILL.md
skills/flash-case-law-research-giovanna-panucci/SKILL.md
skills/fria-eu-ai-act-article-27-werner-plutat/SKILL.md
skills/gdpr-breach-sentinel-oliver-schmidt-prietz/SKILL.md
skills/gdpr-privacy-notice-eu-oliver-schmidt-prietz/SKILL.md
skills/https-www-lawvable-com-en-author-patrick-munro-2/SKILL.md
skills/https-www-lawvable-com-en-author-patrick-munro-3/SKILL.md
skills/https-www-lawvable-com-en-author-patrick-munro/SKILL.md
skills/indian-foreign-investment-approval-assessment-siddhi-kudalkar/SKILL.md
skills/invoice-review-compliance-scott-margetts/SKILL.md
skills/judicial-first-impression-larissa-meredith-flister/SKILL.md
skills/jurisrank-argentine-supreme-court-analysis-adrian-lerer/SKILL.md
skills/lawyerscrib-garry-haas/SKILL.md
skills/legal-assistant-christophe-quezel-ambrunaz/SKILL.md
skills/legal-document-drafting-formatting-alessandro-dardano/SKILL.md
skills/legal-guidance-vault-michael-cremata/SKILL.md
skills/legal-risk-assessment-zacharie-laik/SKILL.md
skills/legal-simulation-patrick-munro/SKILL.md
skills/legal-translation-uk-english-wouter-van-den-berg/SKILL.md
skills/legitimate-interest-oliver-schmidt-prietz/SKILL.md
skills/litigation-deadline-calendar-dave-marcus/SKILL.md
skills/local-counsel-manager-scott-margetts/SKILL.md
skills/mandarinat-christophe-quezel-ambrunaz/SKILL.md
skills/mandatory-verification-larissa-meredith-flister/SKILL.md
skills/matter-allocation-instruction-scott-margetts/SKILL.md
skills/matter-intake-scoping-scott-margetts/SKILL.md
skills/matter-plan-builder-scott-margetts/SKILL.md
skills/mediation-dispute-analysis-jinzhe-tan/SKILL.md
skills/new-designation-screening-test-amir-fadavi/SKILL.md
skills/nil-contract-analysis-samir-patel/SKILL.md
skills/nis2-navigator-oliver-schmidt-prietz/SKILL.md
skills/nist-ai-rmf-rafal-fryc/SKILL.md
skills/opposing-counsel-review-larissa-meredith-flister/SKILL.md
skills/oral-argument-stephane-boghossian/SKILL.md
skills/originality-in-european-copyright-joris-deene/SKILL.md
skills/panel-design-selection-scott-margetts/SKILL.md
skills/panel-review-rationalisation-scott-margetts/SKILL.md
skills/performance-scorecard-scott-margetts/SKILL.md
skills/persuasive-legal-writing-larissa-meredith-flister/SKILL.md
skills/pptx-processing-anthropic/SKILL.md
skills/raisonnement-juridique-amaury-fouret/SKILL.md
skills/recherche-theses-allison-fiorentino/SKILL.md
skills/red-team-verifier-patrick-munro/SKILL.md
skills/resource-planner-scott-margetts/SKILL.md
skills/rfp-pitch-management-scott-margetts/SKILL.md
skills/risk-and-issues-manager-scott-margetts/SKILL.md
skills/sanctions-screening-gillan-saleh/SKILL.md
skills/sanctions-screening-legal-analysis-skill-english-gillan-saleh/SKILL.md
skills/scope-change-controller-scott-margetts/SKILL.md
skills/screening-alert-adjudication-amir-fadavi/SKILL.md
skills/skill-injection-defense-ignacio-adrian-lerer/SKILL.md
skills/skill-security-auditor-antoine-louis/SKILL.md
skills/source-locked-verification-larissa-meredith-flister/SKILL.md
skills/stakeholder-comms-planner-scott-margetts/SKILL.md
skills/status-report-drafter-scott-margetts/SKILL.md
skills/statute-analysis-rafal-fryc/SKILL.md
skills/tech-contract-negotiation-patrick-munro/SKILL.md
skills/timeline-generator-scott-margetts/SKILL.md
skills/vendor-due-diligence-patrick-munro/SKILL.md
skills/victor-wang-yc-saas-drafter/SKILL.md
skills/xlsx-processing-anthropic/SKILL.md

Metadata

Files
0
Version
7f58aaf
Hash
bf099545
Indexed
2026-07-05 11:49

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-10 21:56
浙ICP备14020137号-1 $Carte des visiteurs$