dsh-office-kit 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/assets/skills/excel-live-control/SKILL.md +120 -148
  2. package/assets/skills/excel-live-control/container_tools/live_excel.py +9 -0
  3. package/assets/skills/excel-live-control/domain_guidance/financial_models.md +42 -58
  4. package/assets/skills/excel-live-control/domain_guidance/healthcare.md +36 -42
  5. package/assets/skills/excel-live-control/domain_guidance/marketing_advertising.md +33 -34
  6. package/assets/skills/excel-live-control/domain_guidance/scientific_research.md +34 -36
  7. package/assets/skills/excel-live-control/references/office-automation.md +127 -153
  8. package/assets/skills/excel-live-control/references/read_only_qna.md +40 -45
  9. package/assets/skills/excel-live-control/style_guidelines.md +56 -64
  10. package/assets/skills/excel-live-control/workflows/create_workflows.md +40 -47
  11. package/assets/skills/excel-live-control/workflows/edit_workflows.md +37 -45
  12. package/assets/skills/office-documents/SKILL.md +24 -60
  13. package/assets/skills/office-documents/examples/end_to_end_smoke_test.md +5 -5
  14. package/assets/skills/office-documents/ooxml/comments.md +8 -8
  15. package/assets/skills/office-documents/ooxml/hyperlinks_and_fields.md +10 -10
  16. package/assets/skills/office-documents/ooxml/rels_and_content_types.md +7 -7
  17. package/assets/skills/office-documents/ooxml/tracked_changes.md +12 -12
  18. package/assets/skills/office-documents/references/docx-structure.md +11 -13
  19. package/assets/skills/office-documents/references/template-elicitation.md +11 -13
  20. package/assets/skills/office-documents/references/writing-quality.md +20 -20
  21. package/assets/skills/office-documents/tasks/accessibility_a11y.md +16 -22
  22. package/assets/skills/office-documents/tasks/captions_crossrefs.md +23 -26
  23. package/assets/skills/office-documents/tasks/clean_tracked_changes.md +17 -22
  24. package/assets/skills/office-documents/tasks/comments_manage.md +9 -11
  25. package/assets/skills/office-documents/tasks/compare_diff.md +10 -16
  26. package/assets/skills/office-documents/tasks/create_edit.md +14 -16
  27. package/assets/skills/office-documents/tasks/equations.md +17 -28
  28. package/assets/skills/office-documents/tasks/fields_update.md +14 -16
  29. package/assets/skills/office-documents/tasks/fixtures_edge_cases.md +19 -33
  30. package/assets/skills/office-documents/tasks/footnotes_endnotes.md +12 -14
  31. package/assets/skills/office-documents/tasks/forms_content_controls.md +16 -20
  32. package/assets/skills/office-documents/tasks/headings_numbering.md +17 -22
  33. package/assets/skills/office-documents/tasks/images_figures.md +15 -25
  34. package/assets/skills/office-documents/tasks/multi_doc_merge.md +13 -23
  35. package/assets/skills/office-documents/tasks/navigation_internal_links.md +18 -21
  36. package/assets/skills/office-documents/tasks/privacy_scrub_metadata.md +16 -22
  37. package/assets/skills/office-documents/tasks/protection_restrict_editing.md +19 -21
  38. package/assets/skills/office-documents/tasks/read_review.md +9 -20
  39. package/assets/skills/office-documents/tasks/redaction_anonymization.md +17 -18
  40. package/assets/skills/office-documents/tasks/sections_layout.md +16 -23
  41. package/assets/skills/office-documents/tasks/style_lint_normalize.md +18 -22
  42. package/assets/skills/office-documents/tasks/tables_spreadsheets.md +21 -31
  43. package/assets/skills/office-documents/tasks/templates_style_packs.md +17 -21
  44. package/assets/skills/office-documents/tasks/toc_workflow.md +10 -14
  45. package/assets/skills/office-documents/tasks/verify_render.md +11 -23
  46. package/assets/skills/office-documents/tasks/watermarks_background.md +11 -15
  47. package/assets/skills/office-documents/troubleshooting/libreoffice_headless.md +9 -9
  48. package/assets/skills/office-documents/troubleshooting/run_splitting.md +12 -12
  49. package/assets/skills/office-pdf/SKILL.md +36 -51
  50. package/assets/skills/office-pdf/references/form-fields.md +20 -20
  51. package/assets/skills/office-pdf/references/geometry.md +10 -10
  52. package/assets/skills/office-pdf/references/layout-quality.md +13 -13
  53. package/assets/skills/office-pdf/references/limits.md +12 -56
  54. package/assets/skills/office-pdf/tasks/annotations.md +5 -5
  55. package/assets/skills/office-pdf/tasks/create.md +6 -9
  56. package/assets/skills/office-pdf/tasks/edit-pages.md +14 -14
  57. package/assets/skills/office-pdf/tasks/forms.md +15 -15
  58. package/assets/skills/office-pdf/tasks/read.md +9 -9
  59. package/assets/skills/office-pdf/tasks/redact.md +18 -18
  60. package/assets/skills/office-pdf/tasks/stamp.md +10 -10
  61. package/assets/skills/office-presentations/SKILL.md +71 -91
  62. package/assets/skills/office-presentations/container_tools/render_slides.py +1 -1
  63. package/assets/skills/office-presentations/domain_guidance/finance.md +16 -16
  64. package/assets/skills/office-presentations/recipes/README.md +24 -35
  65. package/assets/skills/office-presentations/recipes/autolayout.md +12 -13
  66. package/assets/skills/office-presentations/recipes/connectors.md +11 -12
  67. package/assets/skills/office-presentations/recipes/images.md +11 -12
  68. package/assets/skills/office-presentations/recipes/master-and-layouts.md +18 -18
  69. package/assets/skills/office-presentations/recipes/native-charts.md +8 -8
  70. package/assets/skills/office-presentations/recipes/rich-text-runs.md +13 -13
  71. package/assets/skills/office-presentations/recipes/speaker-notes.md +7 -7
  72. package/assets/skills/office-presentations/recipes/tables.md +14 -14
  73. package/assets/skills/office-presentations/recipes/textbox-at-coordinate.md +9 -9
  74. package/assets/skills/office-presentations/recipes/theme-tokens.md +7 -8
  75. package/assets/skills/office-presentations/references/authoring-workflow.md +38 -43
  76. package/assets/skills/office-presentations/references/finalization.md +10 -12
  77. package/assets/skills/office-presentations/references/native-bullets.md +14 -18
  78. package/assets/skills/office-presentations/references/native-evidence.md +18 -32
  79. package/assets/skills/office-presentations/references/style-guidelines.md +27 -32
  80. package/assets/skills/office-presentations/references/templates.md +31 -60
  81. package/assets/skills/office-presentations/routing/google_slides.md +4 -4
  82. package/assets/skills/office-presentations/tasks/apply-annotations.md +17 -17
  83. package/assets/skills/office-presentations/tasks/charts-tables-notes.md +20 -23
  84. package/assets/skills/office-presentations/tasks/create-deck.md +19 -19
  85. package/assets/skills/office-presentations/tasks/edit-deck.md +14 -16
  86. package/assets/skills/office-presentations/tasks/inspect-and-verify.md +31 -34
  87. package/assets/skills/office-presentations/tasks/template-following.md +23 -28
  88. package/assets/skills/office-spreadsheets/SKILL.md +32 -39
  89. package/assets/skills/office-spreadsheets/recipes/charts.md +8 -26
  90. package/assets/skills/office-spreadsheets/recipes/conditional-formats.md +9 -26
  91. package/assets/skills/office-spreadsheets/recipes/data-tables.md +7 -23
  92. package/assets/skills/office-spreadsheets/recipes/named-ranges.md +8 -21
  93. package/assets/skills/office-spreadsheets/recipes/number-formats.md +7 -23
  94. package/assets/skills/office-spreadsheets/recipes/sparklines.md +7 -20
  95. package/assets/skills/office-spreadsheets/references/charts.md +15 -34
  96. package/assets/skills/office-spreadsheets/references/domain/financial-models.md +10 -25
  97. package/assets/skills/office-spreadsheets/references/domain/healthcare.md +8 -19
  98. package/assets/skills/office-spreadsheets/references/domain/marketing.md +8 -22
  99. package/assets/skills/office-spreadsheets/references/domain/research.md +8 -19
  100. package/assets/skills/office-spreadsheets/references/formula-patterns.md +20 -50
  101. package/assets/skills/office-spreadsheets/references/style-guidelines.md +19 -44
  102. package/assets/skills/office-spreadsheets/references/workbook-structure.md +12 -35
  103. package/assets/skills/office-spreadsheets/routing/google-sheets.md +11 -26
  104. package/assets/skills/office-spreadsheets/tasks/analyze-workbook.md +10 -25
  105. package/assets/skills/office-spreadsheets/tasks/annotations.md +12 -30
  106. package/assets/skills/office-spreadsheets/tasks/create-workbook.md +5 -5
  107. package/assets/skills/office-spreadsheets/tasks/diff-workbooks.md +2 -2
  108. package/assets/skills/office-spreadsheets/tasks/edit-workbook.md +5 -5
  109. package/assets/skills/office-spreadsheets/tasks/inspect-workbook.md +9 -9
  110. package/assets/skills/office-spreadsheets/tasks/recalc-and-check.md +10 -30
  111. package/assets/skills/shared/annotation-recipes.md +98 -120
  112. package/assets/skills/shared/common-workflow.md +70 -80
  113. package/dist/index.js +105 -29
  114. package/package.json +1 -1
  115. package/postinstall.mjs +58 -17
  116. package/python/office_cli.py +70 -7
@@ -1,87 +1,79 @@
1
1
  # Style guidelines for a live sheet
2
2
 
3
- Style is subordinate to content and to the user's own file. Precedence, strongest first:
3
+ Style is subordinate to content and the user's file. Precedence, strongest first:
4
4
 
5
- 1. What the user asked for, in this conversation.
5
+ 1. What the user asked for in this conversation.
6
6
  2. The workbook's existing conventions — fonts, colours, borders, tab colours, number
7
7
  formats. Match them; do not impose a house style on someone else's document.
8
- 3. The domain guidance for the kind of model (`domain_guidance/`).
8
+ 3. The domain guidance for the model (`domain_guidance/`).
9
9
  4. The defaults below.
10
10
 
11
- Look before you paint: `info` for tab colours and structure, `read_range` for the formats
12
- a neighbouring block already uses. Restyling a user's sheet because your defaults are
13
- tidier is a defect, not a service.
11
+ Look before you paint: `info` for tab colours and structure, `read_range` for neighbouring
12
+ formats. Restyling because your defaults are tidier is a defect, not a service.
14
13
 
15
14
  ## Defaults that are safe anywhere
16
15
 
17
- - **Font family**: one per workbook. If it has none, Helvetica Neue → Helvetica → Arial →
18
- Aptos. **Two sizes**: 10 pt body, 14 pt title, 16 pt ceiling. Never introduce a third
19
- family or a decorative size.
16
+ - **Font**: one family per workbook. If it has none, Helvetica Neue → Helvetica → Arial →
17
+ Aptos. Two sizes: 10 pt body, 14 pt title, 16 pt ceiling. Never a third family or a
18
+ decorative size.
20
19
  - **Alignment**: text left, numbers right, headers centred horizontally and middle
21
- vertically. Do not centre numbers to look neat; they lose their decimal alignment.
20
+ vertically. Never centre numbers — they lose decimal alignment.
22
21
  - **Headers**: bold, one rule under the last header row (`border: "outline"` on the header
23
- block, or a bottom border on the row). No merged cells in working headers — merge only a
24
- single spanning title, and prefer Center Across Selection for that.
25
- - **Inputs vs calculations**: an input cell the user is expected to type into gets a light
26
- fill (`#FFF2CC` amber) and a thin border; calculated cells keep a plain fill. If the
27
- whole block is inputs, one header note beats painting every cell.
28
- - **Gridlines**: a clean output or dashboard sheet hides them (`ActiveWindow.DisplayGridlines
29
- = $false`, a view setting, not a cell format) and uses thin structural borders instead.
30
- A working sheet keeps them.
22
+ block, or a bottom border on the row). No merged cells in working headers; merge only a
23
+ single spanning title, preferring Center Across Selection.
24
+ - **Inputs vs calculations**: cells the user types into get a light fill (`#FFF2CC` amber)
25
+ and thin border; calculated cells stay plain. If the whole block is inputs, one header
26
+ note beats painting every cell.
27
+ - **Gridlines**: a clean output or dashboard hides them
28
+ (`ActiveWindow.DisplayGridlines = $false`, a view setting, not a cell format) and uses
29
+ thin structural borders; a working sheet keeps them.
31
30
  - **Borders**: outline a block, hairline between header and body. No box around every cell,
32
- no double lines, no thick decorative frames.
33
- - **Column widths**: set them once per block (`column_width` in `style_range`), not per
34
- cell. Widen for the formatted value, then check with `read_range --display` for `###`.
35
- - **Conditional formatting**: bounded to the data range, one or two rules. Never a whole
36
- column, never a rule that paints a user input cell.
37
- - **Freeze panes** are not a styling nicety; the tool cannot set them on a hidden window.
38
- If scrolling is the complaint, say so and let the user freeze the row.
31
+ no double or thick decorative frames.
32
+ - **Column widths**: once per block (`column_width` in `style_range`), not per cell; widen
33
+ for the formatted value, then check `###` with `read_range --display`.
34
+ - **Conditional formatting**: bounded to the data range, one or two rules; never a whole
35
+ column, never paint a user input cell.
36
+ - **Freeze panes** are a view setting, not styling. The tool cannot set them on a hidden
37
+ window; if scrolling is the complaint, say so and let the user freeze the row.
39
38
 
40
39
  ## Model layouts
41
40
 
42
- - Summary above detail, outputs before workings, assumptions grouped in one block rather
43
- than scattered. A reader should be able to look at the top-left and understand the sheet.
44
- - One blank row at the top of a new output sheet, the title in an unfilled cell on the
45
- left, a thin rule under it. No logo, no merged banner, no slogan.
46
- - Rows of commentary go to the right of the numbers, separated by one blank column; they
47
- never sit between a label and its value.
48
- - Helper rows: italic, grouped under the block they serve, collapsed if the workbook
49
- already uses grouping. Helper columns live outside the printed range or on a separate
50
- helper sheet.
51
- - A case or scenario selector is a visible label plus a validated cell: `Case Selected:`
52
- and the value on display. Do not hide the control in a defined name.
53
- - Section bands (a filled row spanning the table) get one outline around the whole
54
- section, not per row.
55
- - Dark header fill with white text, or plain text with a rule. Pick one per workbook.
41
+ - Summary above detail, outputs before workings, assumptions grouped in one block. The
42
+ top-left should explain the sheet.
43
+ - New output sheet: one blank row at the top, title in an unfilled left cell, thin rule
44
+ under it. No logo, merged banner or slogan.
45
+ - Commentary goes right of the numbers, separated by one blank column; never between a
46
+ label and its value.
47
+ - Helper rows: italic, grouped under their block, collapsed if the workbook already groups.
48
+ Helper columns outside the print range or on a separate helper sheet.
49
+ - Scenario selector: a visible label plus a validated cell (`Case Selected:` and the value);
50
+ never hidden in a defined name.
51
+ - Section bands: one outline around the whole section, not per row.
52
+ - Dark header fill with white text, or plain with a rule — one per workbook.
56
53
 
57
54
  ## Finance conventions
58
55
 
59
- These are long-standing reader expectations in financial models; a reviewer notices when
60
- they are violated.
61
-
62
- - **Colour encodes provenance.** Blue font for editable hard-coded inputs, black for
63
- formulas on the same sheet, green for links to another sheet, red for links to an
64
- external workbook. Results on an output view stay black or the brand dark colour.
65
- - **Number formats**: `#,##0` for amounts, `#,##0.00` for per-share and price data,
66
- `0.0%` for rates, `( )` for negatives and `-` for zero in accounting views
67
- (`#,##0;(#,##0);"-"`). Currency symbol on the first monetary row and on totals, not on
68
- every row.
69
- - **Indent formats** (` @` for text labels, `_(`-style spacing) map a hierarchy without
70
- empty columns.
71
- - **Totals** sit flush left in the label column, bold, with the rule above them. A total
72
- that is a hard number rather than a formula is a finding, not a style choice.
73
- - **Period labels** follow `mmm-yy`, `d-mmm`, `yyyy`, `Q#:YY`, `FY:YY` as the workbook
74
- already does. A date column has one format down its whole length.
75
- - **Actuals vs forecast**: the change of basis is visible — a divide, a different fill, or
76
- a label — and never inferred from a colour alone.
77
- - A model that needs a gutter between the row labels and the numbers gets columns A:B
78
- reserved for it. Do not retrofit a gutter onto a sheet that does not have one.
56
+ - **Colour = provenance**: blue font for hard-coded inputs, black for same-sheet formulas,
57
+ green for links to another sheet, red for links to an external workbook. Output views
58
+ stay black or brand dark.
59
+ - **Number formats**: `#,##0` amounts, `#,##0.00` per-share/price, `0.0%` rates,
60
+ `#,##0;(#,##0);"-"` for accounting (parentheses for negatives, dash for zero). Currency
61
+ symbol on the first monetary row and on totals, not every row.
62
+ - **Indent formats** (` @` for text labels, `_(`-style spacing) map hierarchy without empty
63
+ columns.
64
+ - **Totals** flush left in the label column, bold, rule above. A hard-number total instead
65
+ of a formula is a finding.
66
+ - **Period labels** follow `mmm-yy`, `d-mmm`, `yyyy`, `Q#:YY`, `FY:YY` as the workbook does;
67
+ one date format down a column.
68
+ - **Actuals vs forecast**: a visible change of basis (divide, fill, label), never colour
69
+ alone.
70
+ - A needed gutter between row labels and numbers gets columns A:B reserved; do not retrofit
71
+ one onto a sheet that lacks it.
79
72
 
80
73
  ## Warning colour, used sparingly
81
74
 
82
75
  - Input that must be refreshed: amber fill (`#FFF2CC`), normal font.
83
- - Critical error or failed check: light red fill (`#FFC7CE`) plus bold red text
84
- (`#9C0006`).
85
- - Passing checks: neutral. A green wash over every PASS makes the one red row invisible.
86
- - Never encode a value only in colour — a reader with a monochrome printout, or a colour
87
- vision deficiency, must still see the meaning. Put the flag in a cell.
76
+ - Critical error or failed check: light red fill (`#FFC7CE`) plus bold red text (`#9C0006`).
77
+ - Passing checks: neutral. A green wash over every PASS hides the one red row.
78
+ - Never encode meaning in colour alone; put the flag in a cell so a monochrome printout or
79
+ colour-vision deficiency still reads it.
@@ -1,44 +1,39 @@
1
1
  # Creating content in a live workbook
2
2
 
3
- The user is watching, so the order you do things in is visible. Plan on paper first, then
4
- make a small number of writes.
3
+ The user sees every step. Plan on paper first, then write in a few batches.
5
4
 
6
- ## 1. Decide what is actually being created
5
+ ## 1. Decide what is being created
7
6
 
8
- Before you write a cell, you should be able to answer:
7
+ Answer these before writing a cell:
9
8
 
10
- - **Who reads it, and what decision does it support?** A one-page summary for a committee
11
- and a working model for an analyst are different sheets.
12
- - **What are the outputs?** Name them. Each output is a number with a label, a period and
13
- a unit.
14
- - **What are the inputs?** Name them, with their sources. Inputs nobody will update are
9
+ - **Who reads it, and what decision does it support?** A committee summary and an analyst's
10
+ working model are different sheets.
11
+ - **What are the outputs?** Name each one: a number with a label, a period and a unit.
12
+ - **What are the inputs?** Name them with their sources. Inputs nobody updates are
15
13
  decoration.
16
- - **What is calculated in between?** The steps between input and output are what a reviewer
17
- audits; if you cannot name them, the model is not designed yet.
18
- - **What would make it wrong?** A check or a reconciliation, even one line: totals tie,
19
- parts sum to the whole, cash ends at the right balance.
14
+ - **What is calculated in between?** A reviewer audits these steps; if you cannot name them,
15
+ the model is not designed yet.
16
+ - **What would make it wrong?** At least one check: totals tie, parts sum to the whole, cash
17
+ ends at the right balance.
20
18
 
21
- If the request leaves two of these open, ask one short question rather than guessing —
22
- a live edit is expensive to unpick.
19
+ If two are still open, ask one short question — a live edit is expensive to unpick.
23
20
 
24
21
  ## 2. Where it goes
25
22
 
26
- - Roles, not a fixed tab count: inputs, assumptions, calculations, outputs. A small sheet
27
- can carry several roles; a large model separates them.
28
- - Outputs at the left of the tab strip, workings in the middle, inputs at the right; a
29
- check/audit tab last if the model warrants one. Do not add a Checks tab to a simple
30
- sheet — a labelled verification row is enough.
31
- - Keep inputs next to the calculations they feed when the model is small; move them to a
32
- dedicated input sheet only when more than one sheet consumes them.
23
+ - Organise by role, not tab count: inputs, assumptions, calculations, outputs. Small sheets
24
+ merge roles; large models separate them.
25
+ - Outputs left of the tab strip, workings middle, inputs right; a check/audit tab last if
26
+ warranted.
27
+ - No separate Checks tab on a simple sheet — a labelled verification row is enough.
28
+ - Keep inputs beside their calculations; use a dedicated input sheet once several sheets
29
+ consume them.
33
30
  - Calculate once, link everywhere else. Two cells computing the same number is a future
34
31
  disagreement.
35
- - Insights (a short comment or a highlighted conclusion) go next to the result they
36
- explain, not in a separate "insights" area.
32
+ - Put insights next to the result they explain, never in a separate area.
37
33
 
38
- **Adding a tab is not an operation of this skill.** The tool writes into sheets that
39
- already exist. If the job needs a new sheet, ask the user to insert one (Right-click a tab
40
- → Insert), or use the file route in `../../office-spreadsheets/SKILL.md` and tell them to
41
- reopen. Do not repurpose an existing sheet as scratch space.
34
+ **This skill cannot add a tab** — it writes into existing sheets. Ask the user to insert one
35
+ (right-click a tab → Insert), or use the file route in `../../office-spreadsheets/SKILL.md`
36
+ and tell them to reopen. Never repurpose a sheet as scratch space.
42
37
 
43
38
  ## 3. Write it
44
39
 
@@ -51,28 +46,26 @@ recalc
51
46
  read_range --sheet "Inputs" --range B3:D9 --formulas
52
47
  ```
53
48
 
54
- - One `write_range` per block with its real shape. The array is rows × columns; do not pad
55
- with empty strings to make it rectangular — use `null` for a genuinely empty cell.
56
- - Write the labels and the units with the numbers. A block of bare numbers is not done.
57
- - Default formats in the write step, not afterwards: `number_format` in `style_range`
58
- applied to the whole block is one call and keeps every cell consistent.
59
- - Formulas as text starting with `=`, absolute where they must stay put (`$C$4`), relative
60
- where the fill should walk (`D5`). Test one cell before filling a column.
61
- - If the sheet already has content, check the used range first and write beside it, not
62
- over it.
49
+ - One `write_range` per block, in its real shape (rows × columns). No empty-string padding;
50
+ use `null` for an empty cell.
51
+ - Write labels and units with the numbers. Bare numbers are not done.
52
+ - Apply `number_format` in one `style_range` over the block, not cell by cell.
53
+ - Formulas start with `=`: absolute where fixed (`$C$4`), relative where the fill walks
54
+ (`D5`). Test one cell before filling.
55
+ - If the sheet has content, check the used range and write beside it, not over it.
63
56
 
64
57
  ## 4. Check it, then say what you did
65
58
 
66
- - `read_range --formulas` over everything you wrote; `errors` must be empty.
67
- - `recalc`, then read the outputs again — a formula that never calculated proves nothing.
68
- - `info` if you added tables or charts, to confirm they landed on the sheet you meant.
69
- - Report the ranges and the state of the document (unsaved, or saved where). See the
70
- Delivery section of `../SKILL.md`.
59
+ - `read_range --formulas` over everything written; `errors` must be empty.
60
+ - `recalc`, then re-read the outputs — an uncalculated formula proves nothing.
61
+ - `info` after adding tables or charts, to confirm the target sheet.
62
+ - Report the ranges and document state (unsaved, or saved where). See Delivery in
63
+ `../SKILL.md`.
71
64
 
72
65
  ## 5. Sizing and layout
73
66
 
74
- - Set column widths after the content exists, from the widest formatted value, then
75
- re-read with `--display` to catch `###`.
76
- - Wrap long text labels instead of widening a column to half the screen.
77
- - Helper calculations go in their own block or sheet, labelled, not buried between two
78
- output rows.
67
+ - Set widths after content, sized to the widest formatted value; check `###` with
68
+ `--display`.
69
+ - Wrap long labels instead of widening a column to half the screen.
70
+ - Give helper calculations their own labelled block or sheet, never a row buried between
71
+ outputs.
@@ -1,47 +1,41 @@
1
1
  # Editing a workbook the user already built
2
2
 
3
- The existing workbook is the reference. Its structure, formula style, formats, labels and
4
- navigation are what the user expects to keep seeing; your job is to make one change that
5
- looks like it was always there.
3
+ The existing workbook is the reference. Keep its structure, formula style, formats, labels
4
+ and navigation; make one change that looks native.
6
5
 
7
6
  ## Read the ground first
8
7
 
9
- Nothing below works without this step, and it is cheap:
8
+ Cheap, and nothing below works without it:
10
9
 
11
- 1. `info` — workbook name and path, `saved` flag (unsaved work in progress!), sheets,
12
- used ranges, tables, charts, pivots, protection.
13
- 2. `read_range --formulas` over the block you are about to touch **and its neighbours**.
14
- You need to know the pattern a formula follows before you extend it.
15
- 3. `read_range --display` when the change is formatting — it tells you the current number
16
- format's effect, not just the stored value.
17
- 4. Read the labels around the block: period, unit, actual/forecast. A number is only
18
- meaningful with its label, and your new row must match the surrounding convention.
10
+ 1. `info` — workbook name/path, `saved` flag (unsaved work!), sheets, used ranges, tables,
11
+ charts, pivots, protection.
12
+ 2. `read_range --formulas` over the target block **and its neighbours**. Know the formula
13
+ pattern before extending it.
14
+ 3. `read_range --display` when changing formatting: it shows the format's effect, not the
15
+ stored value.
16
+ 4. Read the surrounding labels: period, unit, actual/forecast. Match the convention.
19
17
 
20
- If the target block holds values you cannot explain from the request, stop and ask. On a
21
- live document, "I thought it was empty" is how an analyst's afternoon disappears.
18
+ If the block holds values you cannot explain from the request, stop and ask.
22
19
 
23
20
  ## Rules of the edit
24
21
 
25
- - **Change the cells the request names, and the formulas those cells feed.** A changed
26
- input propagates on its own; do not hand-edit downstream totals.
27
- - **Do not add, remove, rename, reorder or split sheets/tabs** unless the request says so
28
- or the change genuinely cannot be expressed otherwise (a new output with no home).
22
+ - **Change the cells the request names and the formulas those cells feed.** A changed input
23
+ propagates; do not hand-edit downstream totals.
24
+ - **Do not add, remove, rename, reorder or split sheets** unless requested, or the change
25
+ cannot otherwise be expressed (a new output with no home).
29
26
  - **Preserve everything you did not create**: other sheets, formulas, named ranges,
30
- comments, protection, hidden or grouped rows, freeze panes (user-set), native tables and
31
- their structured references, pivot sources, shared formulas, filters, external links,
27
+ comments, protection, hidden/grouped rows, user freeze panes, native tables and their
28
+ structured references, pivot sources, shared formulas, filters, external links,
32
29
  `INDIRECT` routing, calculation settings.
33
- - **Never flatten formulas to values.** Not to "simplify", not to "fix" a display problem.
34
- - **Extend, do not replace.** When a row or column is added to a block that has a table,
35
- conditional format or chart on it, extend the object to cover the new cells instead of
36
- building a parallel object beside it. `ListObject.Resize` and the chart's
37
- `SetSourceData` are the tools.
38
- - **Small visual fixes stay local.** Widen the one column that clips. Do not autofit the
39
- sheet, do not restyle a header because it is not your default style.
40
- - **Match the existing formula conventions** — anchoring style, `SUMIFS` vs `SUMPRODUCT`,
41
- rounding, the workbook's error handling. A locally "better" formula that reads
42
- differently is a maintenance cost the user did not ask for.
43
- - **Pre-existing errors are not yours to fix.** Report them with the cell and the formula
44
- and ask. Silently repairing a `#REF!` can change a number the user relies on.
30
+ - **Never flatten formulas to values** — not to "simplify", not to "fix" a display problem.
31
+ - **Extend, do not replace.** A row or column added under a table, conditional format or
32
+ chart extends that object (`ListObject.Resize`, `SetSourceData`), never a parallel one.
33
+ - **Keep visual fixes local.** Widen the one clipped column. No sheet-wide autofit, no
34
+ restyle because it is not your default.
35
+ - **Match formula conventions**: anchoring style, `SUMIFS` vs `SUMPRODUCT`, rounding, error
36
+ handling. A "better" formula that reads differently costs maintenance.
37
+ - **Pre-existing errors are not yours to fix.** Report the cell, its formula and ask;
38
+ silently repairing `#REF!` can change a number the user relies on.
45
39
 
46
40
  ## Doing it
47
41
 
@@ -54,19 +48,17 @@ recalc
54
48
  read_range --sheet "Build" --range D5:G13 --formulas # prove it
55
49
  ```
56
50
 
57
- - Keep writes to the named rectangle; `--clear` only on a range whose previous contents
58
- you have read and can restore.
59
- - Style by copying the neighbouring block's codes: read a cell you want to match, mirror
60
- its `number_format`, and apply it to the new cells. Do not invent a new format for one
61
- row.
62
- - If a formula in the new cell must differ from the pattern (a different anchor, a
63
- one-off), say why in the reply — a reviewer will find it.
51
+ - Keep writes to the named rectangle. `--clear` only a range whose contents you have read
52
+ and can restore.
53
+ - Copy style codes from the neighbouring block: read a matching cell, mirror its
54
+ `number_format`, apply to the new cells. Do not invent a format for one row.
55
+ - A formula that must differ from the pattern (different anchor, one-off): say why in the
56
+ reply.
64
57
 
65
58
  ## When you are done
66
59
 
67
- - `read_range --formulas` over every cell you changed and its immediate neighbours.
68
- - `recalc` after formulas, then re-read the outputs that depend on them.
69
- - `info` if tables, charts or pivots were extended, to confirm the objects still exist and
70
- cover the new cells.
71
- - Report: sheet, exact ranges, cell counts, and what the document's saved state is. If the
72
- edit touched a formula graph, say which outputs were affected.
60
+ - `read_range --formulas` over every changed cell and its neighbours.
61
+ - `recalc` after formulas, then re-read dependents.
62
+ - `info` if tables, charts or pivots were extended, to confirm coverage of the new cells.
63
+ - Report sheet, exact ranges, cell counts and saved state. If the formula graph changed,
64
+ name the affected outputs.
@@ -1,77 +1,39 @@
1
1
  ---
2
- description: Build, inspect, revise, and visually verify Word .docx files using the Office helper CLI and the bundled XML scripts.
2
+ description: Create, read, edit, render, and verify Word documents (.docx) — build new files, revise existing ones, and check the rendered pages.
3
3
  ---
4
4
 
5
5
  # Documents (.docx)
6
6
 
7
- A `.docx` is a zip of XML parts: `word/document.xml` holds the body, and headers, footers, footnotes, comments, styles and numbering live beside it. Two routes reach every part of it:
8
-
9
- - **Fast path** — the helper CLI inspects, renders and creates: `docx create`, `docx read`, `docx render`. It performs no in-place mutation.
10
- - **Structural path** — `scripts/*.py` in this skill do all editing: replace text, append blocks, set properties, and everything structural — comments, tracked changes, fields, protection, watermarks.
11
-
12
- Pick the cheapest route that produces the structure the user asked for, then verify it visually. Never invent content, and never deliver a file you have not looked at.
7
+ A `.docx` is a zip of XML parts: `word/document.xml` holds the body, with headers, footers, footnotes, comments, styles and numbering beside it. Two routes reach them: the helper CLI (`docx create`, `docx read`, `docx render`, no in-place mutation) and `scripts/*.py`, which edits everything structural — text, blocks, properties, comments, tracked changes, fields, protection, watermarks. Pick the cheapest route that yields the requested structure, then look at the pages. Never invent content; never deliver a file you have not looked at.
13
8
 
14
9
  ## Before any file work
15
10
 
16
- 1. Call the `office_status` tool.
17
- 2. Read the `## Office runtime` block at the end of this file for the verified `python`, `cli`, `skill` and `shared` paths.
18
- 3. If that block says no runtime is available, stop and give the user the `node "..."` remedy command it names, then call `office_status` again. Do not fake a document or claim success.
19
-
20
- Quote every path. Spaces, non-ASCII names and `&` are normal on Windows.
11
+ Call `office_status`, then read the `## Office runtime` block at the end of this file — it holds the verified `python`, `cli`, `skill` and `shared` paths for this install. If there is no runtime, stop, give the user the `node "..."` remedy command, and call `office_status` again — never fake a document or claim success. Quote every path: spaces, non-ASCII names and `&` are normal on Windows.
21
12
 
22
13
  ## Delivery
23
14
 
24
- Always hand the finished file to the user with the `present` tool, then summarise in one sentence what changed. A bare path is not delivery: the chat transcript renders `.docx`/`.pptx`/`.xlsx`/`.pdf` links as "二进制文件,无法显示改动" and the user cannot open them.
25
-
26
- - Creating a file: write it into the user's workspace, verify it, then `present`.
27
- - Editing an existing file: never overwrite the original. Write `<original>-edited.<ext>` (or a name the user asked for), verify it, `present` it, and state both paths.
15
+ Deliver with `present` plus a one-sentence summary. A bare path is not delivery: the transcript renders `.docx`/`.pptx`/`.xlsx`/`.pdf` links as "二进制文件,无法显示改动". Write new files into the workspace, verify, `present`. Never overwrite an original — write `<original>-edited.<ext>` (or the user's name), verify, `present`, and state both paths.
28
16
 
29
17
  ## Annotations
30
18
 
31
- The user may reply with an `office-annotations` block: `[{ page, text, requirement, region: { left, top, width, height } }]`. `region` is normalised 0–1 against the rendered preview page the user drew on; `requirement` is free-form natural language. Treat it as a change request, not as editor state: locate what the region covers, apply the smallest edit that satisfies `requirement`, re-render, and confirm the region now looks right.
32
-
33
- When the payload cannot be mapped to a concrete object (the region is empty or the file has no geometry), do not guess silently — say what you could not locate.
34
-
35
- For `.docx`, `page` is the page of the *rendered PDF preview*, not a Word page. Use `text` (and the paragraph text near it) to locate the target; the region is a hint for near-misses only. A region that lands on a table row, a caption or a header is ambiguous — state which object you picked before editing.
19
+ An `office-annotations` payload is `[{ page, text, requirement, region: { left, top, width, height } }]`: `region` normalised 0–1 against the rendered preview page, `requirement` free-form. Treat it as a change request, not editor state — find what the region covers, apply the smallest edit that satisfies `requirement`, re-render, confirm. Unmappable payload (empty region, no geometry): say what you could not locate; never guess. For `.docx`, `page` is a rendered PDF page, not a Word page: locate by `text` and its neighbouring paragraphs, use the region only for near-misses, and name the object you picked when a region lands on a table row, caption or header.
36
20
 
37
21
  ## Verify
38
22
 
39
- Rendering is the only proof that a document looks right.
40
-
41
23
  ```bash
42
24
  "<python>" "<cli>" docx render --input "<file.docx>" --out-dir "<render-dir>"
43
25
  ```
44
26
 
45
- The command writes a PDF plus one PNG per page and prints the paths. Open each PNG with `read_image` and check: heading hierarchy, table width and cell wrapping, page breaks, header/footer, clipped or overflowing text, missing glyphs (dashes, CJK, symbols), equation rendering, and caption placement.
46
-
47
- - Iterate until the pages look correct, then deliver. "It parses" is not verification.
48
- - If the runtime reports no renderer (`renderers.can_render.docx: false` — the DSH LibreOffice kit is missing), ask the user to fix the install, or fall back to `docx read` plus the audit scripts. Say plainly that layout was not visually verified — do not describe a page you did not see.
49
- - After a script edits XML, re-render. A package can stay valid while the page it produces is broken.
50
-
51
- ## Choosing a route
52
-
53
- | Job | Fast path | Structural path |
54
- |---|---|---|
55
- | New document from scratch | `docx create --spec` | `python-docx` snippet in `tasks/create_edit.md` |
56
- | Replace or append text and blocks | — | `scripts/replace_text.py`, `scripts/append_blocks.py` |
57
- | Document properties | — | `scripts/core_properties.py` |
58
- | Read structure | `docx read` | `scripts/docx_kit.py text`, `style_lint`, audits |
59
- | Comments, tracked changes | — | `scripts/comments_*.py`, `scripts/*tracked*.py` |
60
- | Fields, TOC, cross-references | — | `scripts/insert_toc.py`, `insert_ref_fields.py`, `fields_*.py` |
61
- | Footnotes, endnotes | — | `scripts/insert_note.py`, `footnotes_report.py` |
62
- | Tables, layout geometry | `docx create` table block | `scripts/table_geometry.py`, `docx_table_to_csv.py` |
63
- | Styles, templates | — | `scripts/style_*.py`, `apply_template_styles.py` |
64
- | Protection, watermarks, privacy | — | `scripts/set_protection.py`, `watermark_*.py`, `privacy_scrub.py`, `redact_docx.py` |
65
-
66
- Where no verb exists, the fallback is the listed script or a short `python-docx`/`lxml` snippet. Both are runnable with the runtime `python`; neither needs a new dependency.
27
+ Writes a PDF and one PNG per page and prints the paths. Open each PNG with `read_image`; check heading hierarchy, table width and cell wrapping, page breaks, header/footer, clipped or overflowing text, missing glyphs (dashes, CJK, symbols), equations, caption placement. Iterate, then deliver — "it parses" is not verification. Without a renderer (`office_status` reports `renderers.available: false`, with a `remedy`) ask the user to fix the install or fall back to `docx read` plus the audit scripts; say layout was not visually verified and never describe an unseen page. Re-render after every script edit: a package can be valid while its page is broken. Details: `tasks/verify_render.md`. Setup: `troubleshooting/libreoffice_headless.md`.
67
28
 
68
29
  ## Task index
69
30
 
70
- | Task | Read | Main tool |
31
+ | Job | Task doc | CLI or main tool |
71
32
  |---|---|---|
72
- | Create or edit a document | `tasks/create_edit.md` | CLI create, `replace_text.py`, `append_blocks.py`, `core_properties.py` |
73
- | Read and review a file | `tasks/read_review.md` | CLI read, `docx_kit.py text` |
74
- | Comments | `tasks/comments_manage.md` | `comments_add/extract/apply_patch/strip.py` |
33
+ | Create a document | `tasks/create_edit.md` | `docx create --spec`, `python-docx` snippet, `append_blocks.py` |
34
+ | Read and review a file | `tasks/read_review.md` | `docx read`, `docx_kit.py text`, `style_lint`, audits |
35
+ | Edit text, blocks or properties | `tasks/create_edit.md` | `replace_text.py`, `append_blocks.py`, `core_properties.py` |
36
+ | Comments | `tasks/comments_manage.md` | `comments_*.py` |
75
37
  | Tracked changes | `tasks/clean_tracked_changes.md` | `accept_tracked_changes.py`, `add_tracked_replacements.py` |
76
38
  | Fields and updates | `tasks/fields_update.md` | `fields_report.py`, `fields_materialize.py` |
77
39
  | Table of contents | `tasks/toc_workflow.md` | `insert_toc.py`, `fields_*.py` |
@@ -79,7 +41,7 @@ Where no verb exists, the fallback is the listed script or a short `python-docx`
79
41
  | Navigation links | `tasks/navigation_internal_links.md` | `internal_nav.py` |
80
42
  | Footnotes and endnotes | `tasks/footnotes_endnotes.md` | `insert_note.py`, `footnotes_report.py` |
81
43
  | Headings and numbering | `tasks/headings_numbering.md` | `heading_audit.py` |
82
- | Tables | `tasks/tables_spreadsheets.md` | `table_geometry.py`, `docx_table_to_csv.py`, `xlsx_to_docx_table.py` |
44
+ | Tables and geometry | `tasks/tables_spreadsheets.md` | `docx create` table block, `table_geometry.py`, `docx_table_to_csv.py`, `xlsx_to_docx_table.py` |
83
45
  | Images and figures | `tasks/images_figures.md` | `images_audit.py` |
84
46
  | Sections and page setup | `tasks/sections_layout.md` | `section_audit.py` |
85
47
  | Styles | `tasks/style_lint_normalize.md` | `style_lint.py`, `style_normalize.py` |
@@ -91,24 +53,26 @@ Where no verb exists, the fallback is the listed script or a short `python-docx`
91
53
  | Privacy and metadata | `tasks/privacy_scrub_metadata.md` | `privacy_scrub.py` |
92
54
  | Redaction | `tasks/redaction_anonymization.md` | `redact_docx.py` |
93
55
  | Merging documents | `tasks/multi_doc_merge.md` | `merge_docx_append.py` |
94
- | Comparing versions | `tasks/compare_diff.md` | `render_and_diff.py` |
95
- | Equations | `tasks/equations.md` | CLI `equation` block |
96
- | Visual verification | `tasks/verify_render.md` | `render_docx.py` (skill root) |
56
+ | Comparing versions | `tasks/compare_diff.md` | `docx render`, `render_and_diff.py` |
57
+ | Equations | `tasks/equations.md` | `docx create` `equation` block |
58
+ | Visual verification | `tasks/verify_render.md` | `docx render`, `render_docx.py` (skill root) |
97
59
  | Fixtures and edge cases | `tasks/fixtures_edge_cases.md` | `make_fixtures.py` |
98
60
 
61
+ Where no verb exists, use the listed script or a short `python-docx`/`lxml` snippet — both run on the runtime `python` without a new dependency.
62
+
99
63
  ## Document defaults
100
64
 
101
65
  - Letter 8.5×11 portrait (A4 when the user or template says so), 1in margins, body 11–12pt, single column.
102
- - Black headings and body text; colour only for deliberate emphasis, links and chart series.
103
- - Tables: light grey `#D9D9D9` borders, a bold header row, `w:tblHeader` so the header repeats across pages, no vertical merges in wide tables.
104
- - No decorative callout boxes, drop shadows or coloured sidebars. Structure comes from headings, lists and tables.
105
- - Captions sit under figures and above tables, in the `Caption` style, and stay with their object.
106
- - Prefer native structures — heading styles, real lists, real tables, OMML equations — over hand-positioned runs, because the next edit depends on that structure.
66
+ - Black headings and body; colour only for deliberate emphasis, links and chart series.
67
+ - Tables: `#D9D9D9` borders, bold header row, `w:tblHeader` repeat, no vertical merges in wide tables.
68
+ - No callout boxes, drop shadows or coloured sidebars — structure comes from headings, lists and tables.
69
+ - Captions under figures and above tables, `Caption` style, staying with the object.
70
+ - Prefer native headings, lists, tables and OMML equations over hand-positioned runs: the next edit depends on that structure.
107
71
 
108
72
  ## Writing quality
109
73
 
110
- Write the content the user asked for, in plain sentences, without filler. `references/writing-quality.md` holds the checklist; `references/docx-structure.md` explains which package part each feature lives in before you touch XML.
74
+ Plain sentences, no filler. Checklist `references/writing-quality.md`; package parts `references/docx-structure.md`.
111
75
 
112
76
  ## Shared workflow
113
77
 
114
- Cross-format habits, the review loop and how to read annotation payloads live in `"<shared>/common-workflow.md"` and `"<shared>/annotation-recipes.md"`; read them when the job spans more than one Office format.
78
+ Cross-format habits and annotation payloads: `"<shared>/common-workflow.md"`, `"<shared>/annotation-recipes.md"`.
@@ -1,6 +1,6 @@
1
1
  # End-to-end smoke test
2
2
 
3
- A short job that touches creation, inspection, structural changes and verification. Run it once after a runtime change, or as a template for "is this environment healthy".
3
+ A short job touching creation, inspection, structural change and verification. Run it after a runtime change, or as a template for "is this environment healthy".
4
4
 
5
5
  ```bash
6
6
  PY="<python>"; CLI="<cli>"; S="<skill>/scripts"; R="<skill>"; W="/tmp/docx-smoke"
@@ -41,7 +41,7 @@ Expect `ok: true` and non-zero `headings`, `tables`, `equations`.
41
41
  "$PY" "$S/style_lint.py" "$W/base.docx"
42
42
  ```
43
43
 
44
- Expect the sections, the parts list to include `word/document.xml`, Letter 8.5×11 portrait, and an empty style-lint `counts`.
44
+ Expect the sections, `word/document.xml` in the parts list, Letter 8.5×11 portrait, and an empty style-lint `counts`.
45
45
 
46
46
  ## 3. Change it structurally
47
47
 
@@ -63,7 +63,7 @@ Expect the sections, the parts list to include `word/document.xml`, Letter 8.5×
63
63
  "$PY" "$S/table_geometry.py" "$W/with-toc.docx"
64
64
  ```
65
65
 
66
- Audits may exit 1 with findings — that is a report, not a failure of the environment. Every finding should be explainable.
66
+ Audits may exit 1 with findings: that is a report, not an environment failure. Every finding should be explainable.
67
67
 
68
68
  ## 5. Verify visually
69
69
 
@@ -71,7 +71,7 @@ Audits may exit 1 with findings — that is a report, not a failure of the envir
71
71
  "$PY" "$R/render_docx.py" "$W/with-toc.docx" --output_dir "$W/render" --dpi 150
72
72
  ```
73
73
 
74
- Then open each PNG with `read_image`. Without the DSH LibreOffice kit the command exits 3 with `no_renderer`; that is a setup problem, not a document problem, and the rest of the test still stands.
74
+ Open each PNG with `read_image`. Without the DSH LibreOffice kit the command exits 3 with `no_renderer`: a setup problem, not a document problem, and the rest of the test still stands.
75
75
 
76
76
  ## 6. Deliver
77
77
 
@@ -83,4 +83,4 @@ Copy the final file into the user's workspace, `present` it, and state what chan
83
83
  rm -rf "$W"
84
84
  ```
85
85
 
86
- Nothing under the workspace should be left behind from a smoke test.
86
+ Nothing under the workspace should be left behind by a smoke test.
@@ -1,6 +1,6 @@
1
1
  # Comments in the package
2
2
 
3
- A comment is three pieces that must agree: `word/comments.xml` holds the content, `word/document.xml` holds a range marking which text is discussed, and the relationship plus content-type override make the part exist at all.
3
+ A comment is three pieces that must agree: `word/comments.xml` holds the content, `word/document.xml` holds a range marking which text is discussed, and a relationship plus content-type override make the part exist at all.
4
4
 
5
5
  ## The markup
6
6
 
@@ -20,21 +20,21 @@ A comment is three pieces that must agree: `word/comments.xml` holds the content
20
20
 
21
21
  Rules that matter in practice:
22
22
 
23
- - `w:id` must be unique across comments **and** match in all three places. A range start without an end leaves Word showing a comment with no anchor; an end without a start can make the file refuse to open.
24
- - The comment reference run belongs at the end of the range, not somewhere else in the paragraph.
23
+ - `w:id` is unique across comments **and** matches in all three places. A range start without an end leaves Word showing a comment with no anchor; an end without a start can make the file refuse to open.
24
+ - The comment reference run belongs at the end of the range, not elsewhere in the paragraph.
25
25
  - `word/comments.xml` needs an override in `[Content_Types].xml` and a relationship from `word/document.xml`; without both, the part is ignored or the file is corrupt.
26
- - The file's root has `mc:Ignorable` listing `w14`/`w15` etc.; a `w15:done` attribute (the "resolved" flag) is only legal when those namespaces are declared.
26
+ - The file root lists `w14`/`w15` in `mc:Ignorable`; the `w15:done` "resolved" attribute is only legal with those namespaces declared.
27
27
 
28
28
  ## Resolved versus deleted
29
29
 
30
- `w15:done="1"` on the `w:comment` keeps the comment in the file and shows it as resolved. Removing the comment is a different operation: delete the `w:comment`, both range markers and the reference run. Resolving hides it from the default pane; it does not remove the text from the file.
30
+ `w15:done="1"` on `w:comment` keeps the comment in the file and shows it as resolved. Removing it is a different operation: delete the `w:comment`, both range markers and the reference run. Resolving hides the comment from the default pane; it does not remove the text from the file.
31
31
 
32
32
  ## Where comments hide
33
33
 
34
- - Replies are comments too, linked by `w15:paraIdParent`; a strip that removes the parent leaves an orphan.
34
+ - Replies are comments too, linked by `w15:paraIdParent`; removing the parent leaves an orphan.
35
35
  - Anchors can sit in headers, footnotes and text boxes as well as the body.
36
- - A comment deleted in Word leaves no trace; a comment whose range was deleted may remain in `comments.xml` with nothing anchoring it. That is why extraction reports anchors: a comment with empty anchored text is evidence of drift.
36
+ - A comment deleted in Word leaves no trace, but a comment whose range was deleted may remain in `comments.xml` with nothing anchoring it. That is why extraction reports anchors: a comment with empty anchored text is evidence of drift.
37
37
 
38
38
  ## Working from the scripts
39
39
 
40
- `comments_extract.py` reads the pairing and prints anchored text per comment; `comments_add.py` writes all three pieces; `comments_apply_patch.py` edits content and the resolved flag; `comments_strip.py` removes every trace and the part itself. Use `docx_kit.py xml '<file.docx>' word/comments.xml` when you need to see the raw part.
40
+ `comments_extract.py` reads the pairing and prints anchored text per comment; `comments_add.py` writes all three pieces; `comments_apply_patch.py` edits content and the resolved flag; `comments_strip.py` removes every trace and the part itself. Use `docx_kit.py xml '<file.docx>' word/comments.xml` for the raw part.