docrev 0.9.13 → 0.9.14

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 (126) hide show
  1. package/.claude/settings.local.json +9 -9
  2. package/.gitattributes +1 -1
  3. package/CHANGELOG.md +149 -149
  4. package/PLAN-tables-and-postprocess.md +850 -850
  5. package/README.md +391 -391
  6. package/bin/rev.js +11 -11
  7. package/bin/rev.ts +145 -145
  8. package/completions/rev.bash +127 -127
  9. package/completions/rev.ps1 +210 -210
  10. package/completions/rev.zsh +207 -207
  11. package/dev_notes/stress2/build_adversarial.ts +186 -186
  12. package/dev_notes/stress2/drift_matcher.ts +62 -62
  13. package/dev_notes/stress2/probe_anchors.ts +35 -35
  14. package/dev_notes/stress2/project/discussion.before.md +3 -3
  15. package/dev_notes/stress2/project/discussion.md +3 -3
  16. package/dev_notes/stress2/project/methods.before.md +20 -20
  17. package/dev_notes/stress2/project/methods.md +20 -20
  18. package/dev_notes/stress2/project/rev.yaml +5 -5
  19. package/dev_notes/stress2/project/sections.yaml +4 -4
  20. package/dev_notes/stress2/sections.yaml +5 -5
  21. package/dev_notes/stress2/trace_placement.ts +50 -50
  22. package/dev_notes/stresstest_boundaries.ts +27 -27
  23. package/dev_notes/stresstest_drift_apply.ts +43 -43
  24. package/dev_notes/stresstest_drift_compare.ts +43 -43
  25. package/dev_notes/stresstest_drift_v2.ts +54 -54
  26. package/dev_notes/stresstest_inspect.ts +54 -54
  27. package/dev_notes/stresstest_pstyle.ts +55 -55
  28. package/dev_notes/stresstest_section_debug.ts +23 -23
  29. package/dev_notes/stresstest_split.ts +70 -70
  30. package/dev_notes/stresstest_trace.ts +19 -19
  31. package/dev_notes/stresstest_verify_no_overwrite.ts +40 -40
  32. package/dist/lib/build.d.ts +38 -1
  33. package/dist/lib/build.d.ts.map +1 -1
  34. package/dist/lib/build.js +68 -30
  35. package/dist/lib/build.js.map +1 -1
  36. package/dist/lib/commands/build.d.ts.map +1 -1
  37. package/dist/lib/commands/build.js +38 -5
  38. package/dist/lib/commands/build.js.map +1 -1
  39. package/dist/lib/commands/utilities.js +164 -164
  40. package/dist/lib/commands/word-tools.js +8 -8
  41. package/dist/lib/grammar.js +3 -3
  42. package/dist/lib/pdf-comments.js +44 -44
  43. package/dist/lib/plugins.js +57 -57
  44. package/dist/lib/pptx-themes.js +115 -115
  45. package/dist/lib/spelling.js +2 -2
  46. package/dist/lib/templates.js +387 -387
  47. package/dist/lib/themes.js +51 -51
  48. package/eslint.config.js +27 -27
  49. package/lib/anchor-match.ts +276 -276
  50. package/lib/annotations.ts +644 -644
  51. package/lib/build.ts +1300 -1251
  52. package/lib/citations.ts +160 -160
  53. package/lib/commands/build.ts +833 -801
  54. package/lib/commands/citations.ts +515 -515
  55. package/lib/commands/comments.ts +1050 -1050
  56. package/lib/commands/context.ts +174 -174
  57. package/lib/commands/core.ts +309 -309
  58. package/lib/commands/doi.ts +435 -435
  59. package/lib/commands/file-ops.ts +372 -372
  60. package/lib/commands/history.ts +320 -320
  61. package/lib/commands/index.ts +87 -87
  62. package/lib/commands/init.ts +259 -259
  63. package/lib/commands/merge-resolve.ts +378 -378
  64. package/lib/commands/preview.ts +178 -178
  65. package/lib/commands/project-info.ts +244 -244
  66. package/lib/commands/quality.ts +517 -517
  67. package/lib/commands/response.ts +454 -454
  68. package/lib/commands/section-boundaries.ts +82 -82
  69. package/lib/commands/sections.ts +451 -451
  70. package/lib/commands/sync.ts +706 -706
  71. package/lib/commands/text-ops.ts +449 -449
  72. package/lib/commands/utilities.ts +448 -448
  73. package/lib/commands/verify-anchors.ts +272 -272
  74. package/lib/commands/word-tools.ts +340 -340
  75. package/lib/comment-realign.ts +517 -517
  76. package/lib/config.ts +84 -84
  77. package/lib/crossref.ts +781 -781
  78. package/lib/csl.ts +191 -191
  79. package/lib/dependencies.ts +98 -98
  80. package/lib/diff-engine.ts +465 -465
  81. package/lib/doi-cache.ts +115 -115
  82. package/lib/doi.ts +897 -897
  83. package/lib/equations.ts +506 -506
  84. package/lib/errors.ts +346 -346
  85. package/lib/format.ts +541 -541
  86. package/lib/git.ts +326 -326
  87. package/lib/grammar.ts +303 -303
  88. package/lib/image-registry.ts +180 -180
  89. package/lib/import.ts +911 -911
  90. package/lib/journals.ts +543 -543
  91. package/lib/merge.ts +633 -633
  92. package/lib/orcid.ts +144 -144
  93. package/lib/pdf-comments.ts +263 -263
  94. package/lib/pdf-import.ts +524 -524
  95. package/lib/plugins.ts +362 -362
  96. package/lib/postprocess.ts +188 -188
  97. package/lib/pptx-color-filter.lua +37 -37
  98. package/lib/pptx-template.ts +469 -469
  99. package/lib/pptx-themes.ts +483 -483
  100. package/lib/protect-restore.ts +520 -520
  101. package/lib/rate-limiter.ts +94 -94
  102. package/lib/response.ts +197 -197
  103. package/lib/restore-references.ts +240 -240
  104. package/lib/review.ts +327 -327
  105. package/lib/schema.ts +417 -417
  106. package/lib/scientific-words.ts +73 -73
  107. package/lib/sections.ts +335 -335
  108. package/lib/slides.ts +756 -756
  109. package/lib/spelling.ts +334 -334
  110. package/lib/templates.ts +526 -526
  111. package/lib/themes.ts +742 -742
  112. package/lib/trackchanges.ts +247 -247
  113. package/lib/tui.ts +450 -450
  114. package/lib/types.ts +550 -550
  115. package/lib/undo.ts +250 -250
  116. package/lib/utils.ts +69 -69
  117. package/lib/variables.ts +179 -179
  118. package/lib/word-extraction.ts +806 -806
  119. package/lib/word.ts +643 -643
  120. package/lib/wordcomments.ts +817 -817
  121. package/package.json +137 -137
  122. package/scripts/postbuild.js +28 -28
  123. package/skill/REFERENCE.md +431 -431
  124. package/skill/SKILL.md +258 -258
  125. package/tsconfig.json +26 -26
  126. package/types/index.d.ts +525 -525
@@ -1,431 +1,431 @@
1
- # docrev Command Reference
2
-
3
- ## Project Creation
4
-
5
- ### rev new
6
- Create a new document project.
7
- ```bash
8
- rev new my-document # Creates my-document/ with section files
9
- rev new my-document --template apa
10
- ```
11
-
12
- ## Document Import/Export
13
-
14
- ### rev import
15
- Import a Word document with track changes and comments.
16
- ```bash
17
- rev import manuscript.docx
18
- rev import manuscript.docx --output ./project
19
- ```
20
-
21
- ### rev sync
22
- Sync feedback from a reviewed Word document into existing markdown sections.
23
- ```bash
24
- rev sync reviewed.docx # Updates markdown with track changes/comments
25
- rev sync # Auto-detect most recent .docx
26
- rev sync reviewed.docx methods # Sync only methods section
27
- rev sync reviewed.docx --comments-only # Insert comments only; never modify prose
28
- ```
29
-
30
- `--comments-only` skips the Word→Markdown diff entirely. Use it when the
31
- markdown has been revised between sending the docx out for review and
32
- receiving it back: applying track changes from a stale draft would clobber
33
- newer edits, but comments still need to land. Comments are placed at
34
- fuzzy-matched anchors against the current prose. Pair with
35
- `rev verify-anchors` to see which ones won't fit before you run sync.
36
-
37
- ### rev verify-anchors
38
- Report drift between Word comment anchors and the current markdown.
39
- ```bash
40
- rev verify-anchors reviewed.docx # Print per-comment match quality
41
- rev verify-anchors reviewed.docx --json # Machine-readable report
42
- ```
43
-
44
- Each comment is classified by how well its anchor still matches the current
45
- section prose:
46
-
47
- - `clean` – exact or whitespace-normalized hit
48
- - `drift` – anchor only matches via stripped-CriticMarkup or partial-prefix fallbacks
49
- - `context-only` – anchor text is gone, only surrounding context survives
50
- - `ambiguous` – multiple candidate positions; needs context to disambiguate
51
- - `unmatched` – nothing maps; user must place the comment manually
52
-
53
- Useful before `rev sync --comments-only` to plan which comments will land
54
- automatically and which need manual placement.
55
-
56
- ### rev build
57
- Build output documents from markdown sections.
58
- ```bash
59
- rev build # Build PDF and DOCX
60
- rev build pdf # PDF only
61
- rev build docx # DOCX only
62
- rev build --toc # Include table of contents
63
- rev build docx --dual # Clean + annotated versions
64
- ```
65
-
66
- The `--dual` flag produces:
67
- - `paper.docx` — clean, for submission
68
- - `paper_comments.docx` — includes comment threads as Word comments
69
-
70
- ### rev preview
71
- Build and open document in default app.
72
- ```bash
73
- rev preview pdf # Build and open PDF
74
- rev preview docx # Build and open Word
75
- ```
76
-
77
- ### rev export
78
- Export project as distributable zip.
79
- ```bash
80
- rev export # Creates project.zip (no node_modules)
81
- ```
82
-
83
- ### rev backup
84
- Create timestamped project backup.
85
- ```bash
86
- rev backup # Creates backup-2024-12-29.zip
87
- rev backup --name v1-draft # Creates v1-draft.zip
88
- ```
89
-
90
- ## Comments & Annotations
91
-
92
- ### rev comments
93
- List all comments with context.
94
- ```bash
95
- rev comments methods.md # Show comments
96
- rev comments methods.md --export out.csv # Export to CSV
97
- ```
98
-
99
- ### rev reply
100
- Reply to a specific comment (non-interactive).
101
- ```bash
102
- rev reply methods.md -n 1 -m "Added clarification"
103
- rev reply results.md -n 3 -m "Updated figure"
104
- ```
105
-
106
- ### rev resolve
107
- Mark a comment as resolved.
108
- ```bash
109
- rev resolve methods.md -n 1
110
- rev resolve methods.md -n 1,2,3 # Multiple comments
111
- ```
112
-
113
- ### rev status
114
- Show project overview or annotation counts for a file.
115
- ```bash
116
- rev status # Project overview (words, comments, changes)
117
- rev status methods.md # Specific file annotations
118
- ```
119
-
120
- ### rev next / rev prev
121
- Navigate pending comments.
122
- ```bash
123
- rev next # Show next pending comment
124
- rev next -n 3 # Show 3rd pending comment
125
- rev prev # Show last pending comment
126
- rev first methods # First comment in methods section
127
- rev last # Last comment overall
128
- ```
129
-
130
- ### rev todo
131
- List all pending comments as a checklist.
132
- ```bash
133
- rev todo # List all pending
134
- rev todo --by-author # Group by author
135
- ```
136
-
137
- ### rev accept / rev reject
138
- Accept or reject track changes.
139
- ```bash
140
- rev accept methods.md # List all changes
141
- rev accept methods.md -n 1 # Accept change #1
142
- rev accept methods.md -a # Accept all
143
- rev reject methods.md -n 2 # Reject change #2
144
- ```
145
-
146
- ### rev archive
147
- Archive reviewer .docx files.
148
- ```bash
149
- rev archive # Move all .docx to archive/
150
- rev archive --by Smith # Specify reviewer name
151
- rev archive --dry-run # Preview without moving
152
- ```
153
-
154
- ### rev strip
155
- Remove all annotations from markdown.
156
- ```bash
157
- rev strip methods.md --output clean.md
158
- rev strip methods.md --accept # Accept all changes
159
- rev strip methods.md --reject # Reject all changes
160
- ```
161
-
162
- ## Response Letter
163
-
164
- ### rev response
165
- Generate point-by-point response letter from comments.
166
- ```bash
167
- rev response # Generate response letter
168
- ```
169
-
170
- ## Validation & Checks
171
-
172
- ### rev check
173
- Run all pre-submission checks (lint + grammar + citations).
174
- ```bash
175
- rev check # Run all checks
176
- rev check --fix # Auto-fix where possible
177
- ```
178
-
179
- ### rev lint
180
- Check for common issues.
181
- ```bash
182
- rev lint # Run all checks
183
- rev lint --fix # Auto-fix where possible
184
- ```
185
- Checks: broken cross-references, missing citations, orphaned figures, unresolved comments.
186
-
187
- ### rev grammar
188
- Check grammar and style.
189
- ```bash
190
- rev grammar # Check all sections
191
- rev grammar --rules # List available rules
192
- rev grammar --learn word # Add to custom dictionary
193
- rev grammar --forget word # Remove from dictionary
194
- rev grammar --list # Show custom dictionary
195
- rev grammar -s warning # Filter by severity
196
- ```
197
-
198
- ### rev spelling
199
- Check spelling in all sections.
200
- ```bash
201
- rev spelling # Check all sections
202
- rev spelling --british # Use British English dictionary
203
- rev spelling --learn word # Add to global dictionary (~/.rev-dictionary)
204
- rev spelling --learn-project word # Add to project dictionary
205
- rev spelling --forget word # Remove from global dictionary
206
- rev spelling --list # Show global dictionary
207
- rev spelling --list-all # Show global + project dictionaries
208
- ```
209
- Built-in scientific vocabulary reduces false positives. Possible author names are shown separately for easy review.
210
-
211
- ### rev validate
212
- Check against journal requirements.
213
- ```bash
214
- rev validate --journal nature
215
- rev validate --list # List 22 available journals
216
- ```
217
-
218
- ### rev citations
219
- Validate citations against bibliography.
220
- ```bash
221
- rev citations
222
- ```
223
-
224
- ## DOI Management
225
-
226
- ### rev doi check
227
- Validate DOIs in bibliography.
228
- ```bash
229
- rev doi check references.bib
230
- rev doi check references.bib --strict # Fail if articles missing DOIs
231
- ```
232
-
233
- ### rev doi lookup
234
- Find missing DOIs by title/author/year.
235
- ```bash
236
- rev doi lookup references.bib
237
- rev doi lookup references.bib --confidence high
238
- ```
239
-
240
- ### rev doi fetch
241
- Get BibTeX from a DOI.
242
- ```bash
243
- rev doi fetch 10.1234/example
244
- ```
245
-
246
- ### rev doi add
247
- Add citation to .bib file from DOI.
248
- ```bash
249
- rev doi add 10.1234/example
250
- rev doi add 10.1234/example --file references.bib
251
- ```
252
-
253
- ## Content Analysis
254
-
255
- ### rev word-count
256
- Show word counts per section.
257
- ```bash
258
- rev word-count # Per-section counts
259
- rev word-count --limit 5000 # Warn if over limit
260
- rev word-count -j nature # Use journal word limit
261
- ```
262
-
263
- ### rev stats
264
- Project dashboard showing overview.
265
- ```bash
266
- rev stats # Words, figures, citations, comments
267
- ```
268
-
269
- ### rev search
270
- Search across all section files.
271
- ```bash
272
- rev search "climate change"
273
- rev search -i "method" # Case-insensitive
274
- ```
275
-
276
- ### rev figures
277
- List figures with reference counts.
278
- ```bash
279
- rev figures methods.md
280
- ```
281
-
282
- ### rev equations
283
- Work with LaTeX equations.
284
- ```bash
285
- rev equations list # List all equations
286
- rev equations from-word manuscript.docx # Extract from Word
287
- ```
288
-
289
- ## Direct DOCX Editing (Layout Workflow)
290
-
291
- ### rev annotate
292
- Add comments directly to Word document.
293
- ```bash
294
- rev annotate paper.docx -m "Comment" -s "text to find"
295
- ```
296
-
297
- ### rev apply
298
- Apply MD annotations as Word track changes.
299
- ```bash
300
- rev apply paper.md output.docx
301
- ```
302
-
303
- ### rev comment
304
- Interactive comment mode for Word documents.
305
- ```bash
306
- rev comment paper.docx
307
- ```
308
-
309
- ## Project Management
310
-
311
- ### rev clean
312
- Remove generated files.
313
- ```bash
314
- rev clean # Remove paper.md, PDFs, DOCXs
315
- rev clean --dry-run # Show what would be deleted
316
- rev clean --all # Also remove backups and exports
317
- ```
318
-
319
- ### rev open
320
- Open project folder or file.
321
- ```bash
322
- rev open # Open project folder
323
- rev open paper.pdf # Open specific file
324
- ```
325
-
326
- ### rev watch
327
- Auto-rebuild on file changes.
328
- ```bash
329
- rev watch # Watch and rebuild
330
- rev watch pdf # Only rebuild PDF
331
- rev watch --no-open # Don't open after build
332
- ```
333
-
334
- ## Configuration
335
-
336
- ### rev config
337
- Configure user settings.
338
- ```bash
339
- rev config user "Your Name" # Set author name for replies
340
- rev config # Show current config
341
- ```
342
-
343
- ## rev.yaml Settings
344
-
345
- ### Tables
346
-
347
- Configure table formatting for PDF output:
348
-
349
- ```yaml
350
- tables:
351
- nowrap:
352
- - Prior # Column headers to keep on one line
353
- - "$\\widehat{R}$"
354
- ```
355
-
356
- In `nowrap` columns, distribution notation is auto-converted to LaTeX math:
357
- - `Normal(0, 0.5)` → `$\mathcal{N}(0, 0.5)$`
358
- - `Student-t(3, 0, 1)` → `$t_3(0, 1)$`
359
- - `Gamma(2, 0.5)` → `$\text{Gamma}(2, 0.5)$`
360
- - `Half-Normal(0, 1)` → `$\text{Half-Normal}(0, 1)$`
361
- - `Exponential(1)` → `$\text{Exp}(1)$`
362
-
363
- **Tip:** For complex tables, use simple tables (space-aligned with dashes) instead of pipe tables to avoid column width issues:
364
-
365
- ```markdown
366
- Parameter Prior Description
367
- ---------- ------------------------- ------------------
368
- alpha $\mathcal{N}(0, 0.5)$ Intercept prior
369
- beta $t_3(0, 2.5)$ Slope prior
370
- ```
371
-
372
- ### Postprocess Scripts
373
-
374
- Run custom scripts after output generation:
375
-
376
- ```yaml
377
- postprocess:
378
- pdf: ./scripts/fix-pdf.py # Runs after PDF
379
- docx: ./scripts/add-meta.js # Runs after DOCX
380
- tex: ./scripts/tweak-latex.sh # Runs after TEX
381
- pptx: ./scripts/fix-slides.ps1 # Runs after PPTX
382
- all: ./scripts/notify.js # Runs after ANY format
383
- ```
384
-
385
- **Environment variables** available to scripts:
386
-
387
- | Variable | Description |
388
- |----------|-------------|
389
- | `OUTPUT_FILE` | Full path to generated file |
390
- | `OUTPUT_FORMAT` | Format: `pdf`, `docx`, `tex`, `pptx`, `beamer` |
391
- | `PROJECT_DIR` | Directory containing rev.yaml |
392
- | `CONFIG_PATH` | Full path to rev.yaml |
393
-
394
- **Supported script types:** `.js`, `.mjs` (Node), `.py` (Python), `.ps1` (PowerShell), `.sh` (Bash)
395
-
396
- **Example Python script** (add DOCX metadata):
397
- ```python
398
- import os
399
- from docx import Document
400
- doc = Document(os.environ['OUTPUT_FILE'])
401
- doc.core_properties.author = "Research Team"
402
- doc.save(os.environ['OUTPUT_FILE'])
403
- ```
404
-
405
- Use `--verbose` flag to see script output:
406
- ```bash
407
- rev build pdf --verbose
408
- ```
409
-
410
- ## Shell Completions
411
-
412
- ### rev completions
413
- Output shell completions.
414
- ```bash
415
- eval "$(rev completions bash)" # Bash
416
- eval "$(rev completions zsh)" # Zsh
417
- ```
418
-
419
- ## AI Skill Installation
420
-
421
- ### rev install-cli-skill
422
- Install the docrev skill for AI coding assistants.
423
- ```bash
424
- rev install-cli-skill # Install to ~/.claude/skills/docrev
425
- ```
426
-
427
- ### rev uninstall-cli-skill
428
- Remove the installed skill.
429
- ```bash
430
- rev uninstall-cli-skill
431
- ```
1
+ # docrev Command Reference
2
+
3
+ ## Project Creation
4
+
5
+ ### rev new
6
+ Create a new document project.
7
+ ```bash
8
+ rev new my-document # Creates my-document/ with section files
9
+ rev new my-document --template apa
10
+ ```
11
+
12
+ ## Document Import/Export
13
+
14
+ ### rev import
15
+ Import a Word document with track changes and comments.
16
+ ```bash
17
+ rev import manuscript.docx
18
+ rev import manuscript.docx --output ./project
19
+ ```
20
+
21
+ ### rev sync
22
+ Sync feedback from a reviewed Word document into existing markdown sections.
23
+ ```bash
24
+ rev sync reviewed.docx # Updates markdown with track changes/comments
25
+ rev sync # Auto-detect most recent .docx
26
+ rev sync reviewed.docx methods # Sync only methods section
27
+ rev sync reviewed.docx --comments-only # Insert comments only; never modify prose
28
+ ```
29
+
30
+ `--comments-only` skips the Word→Markdown diff entirely. Use it when the
31
+ markdown has been revised between sending the docx out for review and
32
+ receiving it back: applying track changes from a stale draft would clobber
33
+ newer edits, but comments still need to land. Comments are placed at
34
+ fuzzy-matched anchors against the current prose. Pair with
35
+ `rev verify-anchors` to see which ones won't fit before you run sync.
36
+
37
+ ### rev verify-anchors
38
+ Report drift between Word comment anchors and the current markdown.
39
+ ```bash
40
+ rev verify-anchors reviewed.docx # Print per-comment match quality
41
+ rev verify-anchors reviewed.docx --json # Machine-readable report
42
+ ```
43
+
44
+ Each comment is classified by how well its anchor still matches the current
45
+ section prose:
46
+
47
+ - `clean` – exact or whitespace-normalized hit
48
+ - `drift` – anchor only matches via stripped-CriticMarkup or partial-prefix fallbacks
49
+ - `context-only` – anchor text is gone, only surrounding context survives
50
+ - `ambiguous` – multiple candidate positions; needs context to disambiguate
51
+ - `unmatched` – nothing maps; user must place the comment manually
52
+
53
+ Useful before `rev sync --comments-only` to plan which comments will land
54
+ automatically and which need manual placement.
55
+
56
+ ### rev build
57
+ Build output documents from markdown sections.
58
+ ```bash
59
+ rev build # Build PDF and DOCX
60
+ rev build pdf # PDF only
61
+ rev build docx # DOCX only
62
+ rev build --toc # Include table of contents
63
+ rev build docx --dual # Clean + annotated versions
64
+ ```
65
+
66
+ The `--dual` flag produces:
67
+ - `paper.docx` — clean, for submission
68
+ - `paper_comments.docx` — includes comment threads as Word comments
69
+
70
+ ### rev preview
71
+ Build and open document in default app.
72
+ ```bash
73
+ rev preview pdf # Build and open PDF
74
+ rev preview docx # Build and open Word
75
+ ```
76
+
77
+ ### rev export
78
+ Export project as distributable zip.
79
+ ```bash
80
+ rev export # Creates project.zip (no node_modules)
81
+ ```
82
+
83
+ ### rev backup
84
+ Create timestamped project backup.
85
+ ```bash
86
+ rev backup # Creates backup-2024-12-29.zip
87
+ rev backup --name v1-draft # Creates v1-draft.zip
88
+ ```
89
+
90
+ ## Comments & Annotations
91
+
92
+ ### rev comments
93
+ List all comments with context.
94
+ ```bash
95
+ rev comments methods.md # Show comments
96
+ rev comments methods.md --export out.csv # Export to CSV
97
+ ```
98
+
99
+ ### rev reply
100
+ Reply to a specific comment (non-interactive).
101
+ ```bash
102
+ rev reply methods.md -n 1 -m "Added clarification"
103
+ rev reply results.md -n 3 -m "Updated figure"
104
+ ```
105
+
106
+ ### rev resolve
107
+ Mark a comment as resolved.
108
+ ```bash
109
+ rev resolve methods.md -n 1
110
+ rev resolve methods.md -n 1,2,3 # Multiple comments
111
+ ```
112
+
113
+ ### rev status
114
+ Show project overview or annotation counts for a file.
115
+ ```bash
116
+ rev status # Project overview (words, comments, changes)
117
+ rev status methods.md # Specific file annotations
118
+ ```
119
+
120
+ ### rev next / rev prev
121
+ Navigate pending comments.
122
+ ```bash
123
+ rev next # Show next pending comment
124
+ rev next -n 3 # Show 3rd pending comment
125
+ rev prev # Show last pending comment
126
+ rev first methods # First comment in methods section
127
+ rev last # Last comment overall
128
+ ```
129
+
130
+ ### rev todo
131
+ List all pending comments as a checklist.
132
+ ```bash
133
+ rev todo # List all pending
134
+ rev todo --by-author # Group by author
135
+ ```
136
+
137
+ ### rev accept / rev reject
138
+ Accept or reject track changes.
139
+ ```bash
140
+ rev accept methods.md # List all changes
141
+ rev accept methods.md -n 1 # Accept change #1
142
+ rev accept methods.md -a # Accept all
143
+ rev reject methods.md -n 2 # Reject change #2
144
+ ```
145
+
146
+ ### rev archive
147
+ Archive reviewer .docx files.
148
+ ```bash
149
+ rev archive # Move all .docx to archive/
150
+ rev archive --by Smith # Specify reviewer name
151
+ rev archive --dry-run # Preview without moving
152
+ ```
153
+
154
+ ### rev strip
155
+ Remove all annotations from markdown.
156
+ ```bash
157
+ rev strip methods.md --output clean.md
158
+ rev strip methods.md --accept # Accept all changes
159
+ rev strip methods.md --reject # Reject all changes
160
+ ```
161
+
162
+ ## Response Letter
163
+
164
+ ### rev response
165
+ Generate point-by-point response letter from comments.
166
+ ```bash
167
+ rev response # Generate response letter
168
+ ```
169
+
170
+ ## Validation & Checks
171
+
172
+ ### rev check
173
+ Run all pre-submission checks (lint + grammar + citations).
174
+ ```bash
175
+ rev check # Run all checks
176
+ rev check --fix # Auto-fix where possible
177
+ ```
178
+
179
+ ### rev lint
180
+ Check for common issues.
181
+ ```bash
182
+ rev lint # Run all checks
183
+ rev lint --fix # Auto-fix where possible
184
+ ```
185
+ Checks: broken cross-references, missing citations, orphaned figures, unresolved comments.
186
+
187
+ ### rev grammar
188
+ Check grammar and style.
189
+ ```bash
190
+ rev grammar # Check all sections
191
+ rev grammar --rules # List available rules
192
+ rev grammar --learn word # Add to custom dictionary
193
+ rev grammar --forget word # Remove from dictionary
194
+ rev grammar --list # Show custom dictionary
195
+ rev grammar -s warning # Filter by severity
196
+ ```
197
+
198
+ ### rev spelling
199
+ Check spelling in all sections.
200
+ ```bash
201
+ rev spelling # Check all sections
202
+ rev spelling --british # Use British English dictionary
203
+ rev spelling --learn word # Add to global dictionary (~/.rev-dictionary)
204
+ rev spelling --learn-project word # Add to project dictionary
205
+ rev spelling --forget word # Remove from global dictionary
206
+ rev spelling --list # Show global dictionary
207
+ rev spelling --list-all # Show global + project dictionaries
208
+ ```
209
+ Built-in scientific vocabulary reduces false positives. Possible author names are shown separately for easy review.
210
+
211
+ ### rev validate
212
+ Check against journal requirements.
213
+ ```bash
214
+ rev validate --journal nature
215
+ rev validate --list # List 22 available journals
216
+ ```
217
+
218
+ ### rev citations
219
+ Validate citations against bibliography.
220
+ ```bash
221
+ rev citations
222
+ ```
223
+
224
+ ## DOI Management
225
+
226
+ ### rev doi check
227
+ Validate DOIs in bibliography.
228
+ ```bash
229
+ rev doi check references.bib
230
+ rev doi check references.bib --strict # Fail if articles missing DOIs
231
+ ```
232
+
233
+ ### rev doi lookup
234
+ Find missing DOIs by title/author/year.
235
+ ```bash
236
+ rev doi lookup references.bib
237
+ rev doi lookup references.bib --confidence high
238
+ ```
239
+
240
+ ### rev doi fetch
241
+ Get BibTeX from a DOI.
242
+ ```bash
243
+ rev doi fetch 10.1234/example
244
+ ```
245
+
246
+ ### rev doi add
247
+ Add citation to .bib file from DOI.
248
+ ```bash
249
+ rev doi add 10.1234/example
250
+ rev doi add 10.1234/example --file references.bib
251
+ ```
252
+
253
+ ## Content Analysis
254
+
255
+ ### rev word-count
256
+ Show word counts per section.
257
+ ```bash
258
+ rev word-count # Per-section counts
259
+ rev word-count --limit 5000 # Warn if over limit
260
+ rev word-count -j nature # Use journal word limit
261
+ ```
262
+
263
+ ### rev stats
264
+ Project dashboard showing overview.
265
+ ```bash
266
+ rev stats # Words, figures, citations, comments
267
+ ```
268
+
269
+ ### rev search
270
+ Search across all section files.
271
+ ```bash
272
+ rev search "climate change"
273
+ rev search -i "method" # Case-insensitive
274
+ ```
275
+
276
+ ### rev figures
277
+ List figures with reference counts.
278
+ ```bash
279
+ rev figures methods.md
280
+ ```
281
+
282
+ ### rev equations
283
+ Work with LaTeX equations.
284
+ ```bash
285
+ rev equations list # List all equations
286
+ rev equations from-word manuscript.docx # Extract from Word
287
+ ```
288
+
289
+ ## Direct DOCX Editing (Layout Workflow)
290
+
291
+ ### rev annotate
292
+ Add comments directly to Word document.
293
+ ```bash
294
+ rev annotate paper.docx -m "Comment" -s "text to find"
295
+ ```
296
+
297
+ ### rev apply
298
+ Apply MD annotations as Word track changes.
299
+ ```bash
300
+ rev apply paper.md output.docx
301
+ ```
302
+
303
+ ### rev comment
304
+ Interactive comment mode for Word documents.
305
+ ```bash
306
+ rev comment paper.docx
307
+ ```
308
+
309
+ ## Project Management
310
+
311
+ ### rev clean
312
+ Remove generated files.
313
+ ```bash
314
+ rev clean # Remove paper.md, PDFs, DOCXs
315
+ rev clean --dry-run # Show what would be deleted
316
+ rev clean --all # Also remove backups and exports
317
+ ```
318
+
319
+ ### rev open
320
+ Open project folder or file.
321
+ ```bash
322
+ rev open # Open project folder
323
+ rev open paper.pdf # Open specific file
324
+ ```
325
+
326
+ ### rev watch
327
+ Auto-rebuild on file changes.
328
+ ```bash
329
+ rev watch # Watch and rebuild
330
+ rev watch pdf # Only rebuild PDF
331
+ rev watch --no-open # Don't open after build
332
+ ```
333
+
334
+ ## Configuration
335
+
336
+ ### rev config
337
+ Configure user settings.
338
+ ```bash
339
+ rev config user "Your Name" # Set author name for replies
340
+ rev config # Show current config
341
+ ```
342
+
343
+ ## rev.yaml Settings
344
+
345
+ ### Tables
346
+
347
+ Configure table formatting for PDF output:
348
+
349
+ ```yaml
350
+ tables:
351
+ nowrap:
352
+ - Prior # Column headers to keep on one line
353
+ - "$\\widehat{R}$"
354
+ ```
355
+
356
+ In `nowrap` columns, distribution notation is auto-converted to LaTeX math:
357
+ - `Normal(0, 0.5)` → `$\mathcal{N}(0, 0.5)$`
358
+ - `Student-t(3, 0, 1)` → `$t_3(0, 1)$`
359
+ - `Gamma(2, 0.5)` → `$\text{Gamma}(2, 0.5)$`
360
+ - `Half-Normal(0, 1)` → `$\text{Half-Normal}(0, 1)$`
361
+ - `Exponential(1)` → `$\text{Exp}(1)$`
362
+
363
+ **Tip:** For complex tables, use simple tables (space-aligned with dashes) instead of pipe tables to avoid column width issues:
364
+
365
+ ```markdown
366
+ Parameter Prior Description
367
+ ---------- ------------------------- ------------------
368
+ alpha $\mathcal{N}(0, 0.5)$ Intercept prior
369
+ beta $t_3(0, 2.5)$ Slope prior
370
+ ```
371
+
372
+ ### Postprocess Scripts
373
+
374
+ Run custom scripts after output generation:
375
+
376
+ ```yaml
377
+ postprocess:
378
+ pdf: ./scripts/fix-pdf.py # Runs after PDF
379
+ docx: ./scripts/add-meta.js # Runs after DOCX
380
+ tex: ./scripts/tweak-latex.sh # Runs after TEX
381
+ pptx: ./scripts/fix-slides.ps1 # Runs after PPTX
382
+ all: ./scripts/notify.js # Runs after ANY format
383
+ ```
384
+
385
+ **Environment variables** available to scripts:
386
+
387
+ | Variable | Description |
388
+ |----------|-------------|
389
+ | `OUTPUT_FILE` | Full path to generated file |
390
+ | `OUTPUT_FORMAT` | Format: `pdf`, `docx`, `tex`, `pptx`, `beamer` |
391
+ | `PROJECT_DIR` | Directory containing rev.yaml |
392
+ | `CONFIG_PATH` | Full path to rev.yaml |
393
+
394
+ **Supported script types:** `.js`, `.mjs` (Node), `.py` (Python), `.ps1` (PowerShell), `.sh` (Bash)
395
+
396
+ **Example Python script** (add DOCX metadata):
397
+ ```python
398
+ import os
399
+ from docx import Document
400
+ doc = Document(os.environ['OUTPUT_FILE'])
401
+ doc.core_properties.author = "Research Team"
402
+ doc.save(os.environ['OUTPUT_FILE'])
403
+ ```
404
+
405
+ Use `--verbose` flag to see script output:
406
+ ```bash
407
+ rev build pdf --verbose
408
+ ```
409
+
410
+ ## Shell Completions
411
+
412
+ ### rev completions
413
+ Output shell completions.
414
+ ```bash
415
+ eval "$(rev completions bash)" # Bash
416
+ eval "$(rev completions zsh)" # Zsh
417
+ ```
418
+
419
+ ## AI Skill Installation
420
+
421
+ ### rev install-cli-skill
422
+ Install the docrev skill for AI coding assistants.
423
+ ```bash
424
+ rev install-cli-skill # Install to ~/.claude/skills/docrev
425
+ ```
426
+
427
+ ### rev uninstall-cli-skill
428
+ Remove the installed skill.
429
+ ```bash
430
+ rev uninstall-cli-skill
431
+ ```