docrev 0.2.1 → 0.5.0

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.
@@ -0,0 +1,279 @@
1
+ # docrev Command Reference
2
+
3
+ ## Document Import/Export
4
+
5
+ ### rev import
6
+ Import a Word document with track changes and comments.
7
+ ```bash
8
+ rev import --file manuscript.docx
9
+ rev import -f manuscript.docx --output ./project
10
+ ```
11
+
12
+ ### rev build
13
+ Build output documents from markdown sections.
14
+ ```bash
15
+ rev build # Build PDF and DOCX
16
+ rev build pdf # PDF only
17
+ rev build docx # DOCX only
18
+ rev build --toc # Include table of contents
19
+ ```
20
+
21
+ ### rev preview
22
+ Build and open document in default app.
23
+ ```bash
24
+ rev preview pdf # Build and open PDF
25
+ rev preview docx # Build and open Word
26
+ ```
27
+
28
+ ### rev export
29
+ Export project as distributable zip.
30
+ ```bash
31
+ rev export # Creates project.zip (no node_modules)
32
+ ```
33
+
34
+ ### rev backup
35
+ Create timestamped project backup.
36
+ ```bash
37
+ rev backup # Creates backup-2024-12-29.zip
38
+ rev backup --name v1-draft # Creates v1-draft.zip
39
+ ```
40
+
41
+ ## Comments & Annotations
42
+
43
+ ### rev comments
44
+ List all comments with context.
45
+ ```bash
46
+ rev comments methods.md # Show comments
47
+ rev comments methods.md --export out.csv # Export to CSV
48
+ ```
49
+
50
+ ### rev reply
51
+ Reply to a specific comment (non-interactive).
52
+ ```bash
53
+ rev reply methods.md -n 1 -m "Added clarification"
54
+ rev reply results.md -n 3 -m "Updated figure"
55
+ ```
56
+
57
+ ### rev resolve
58
+ Mark a comment as resolved.
59
+ ```bash
60
+ rev resolve methods.md -n 1
61
+ rev resolve methods.md -n 1,2,3 # Multiple comments
62
+ ```
63
+
64
+ ### rev status
65
+ Show annotation counts for a file.
66
+ ```bash
67
+ rev status methods.md
68
+ ```
69
+
70
+ ### rev strip
71
+ Remove all annotations from markdown.
72
+ ```bash
73
+ rev strip methods.md --output clean.md
74
+ rev strip methods.md --accept # Accept all changes
75
+ rev strip methods.md --reject # Reject all changes
76
+ ```
77
+
78
+ ## Response Letter
79
+
80
+ ### rev response
81
+ Generate point-by-point response letter from comments.
82
+ ```bash
83
+ rev response # Generate response letter
84
+ ```
85
+
86
+ ## Validation & Checks
87
+
88
+ ### rev check
89
+ Run all pre-submission checks (lint + grammar + citations).
90
+ ```bash
91
+ rev check # Run all checks
92
+ rev check --fix # Auto-fix where possible
93
+ ```
94
+
95
+ ### rev lint
96
+ Check for common issues.
97
+ ```bash
98
+ rev lint # Run all checks
99
+ rev lint --fix # Auto-fix where possible
100
+ ```
101
+ Checks: broken cross-references, missing citations, orphaned figures, unresolved comments.
102
+
103
+ ### rev grammar
104
+ Check grammar and style.
105
+ ```bash
106
+ rev grammar # Check all sections
107
+ rev grammar --rules # List available rules
108
+ rev grammar --learn word # Add to custom dictionary
109
+ rev grammar --forget word # Remove from dictionary
110
+ rev grammar --list # Show custom dictionary
111
+ rev grammar -s warning # Filter by severity
112
+ ```
113
+
114
+ ### rev spelling
115
+ Check spelling in all sections.
116
+ ```bash
117
+ rev spelling # Check all sections
118
+ rev spelling --british # Use British English dictionary
119
+ rev spelling --learn word # Add to global dictionary (~/.rev-dictionary)
120
+ rev spelling --learn-project word # Add to project dictionary
121
+ rev spelling --forget word # Remove from global dictionary
122
+ rev spelling --list # Show global dictionary
123
+ rev spelling --list-all # Show global + project dictionaries
124
+ ```
125
+ Built-in scientific vocabulary reduces false positives. Possible author names are shown separately for easy review.
126
+
127
+ ### rev validate
128
+ Check against journal requirements.
129
+ ```bash
130
+ rev validate --journal nature
131
+ rev validate --list # List 21 available journals
132
+ ```
133
+
134
+ ### rev citations
135
+ Validate citations against bibliography.
136
+ ```bash
137
+ rev citations
138
+ ```
139
+
140
+ ## DOI Management
141
+
142
+ ### rev doi check
143
+ Validate DOIs in bibliography.
144
+ ```bash
145
+ rev doi check references.bib
146
+ rev doi check references.bib --strict # Fail if articles missing DOIs
147
+ ```
148
+
149
+ ### rev doi lookup
150
+ Find missing DOIs by title/author/year.
151
+ ```bash
152
+ rev doi lookup references.bib
153
+ rev doi lookup references.bib --confidence high
154
+ ```
155
+
156
+ ### rev doi fetch
157
+ Get BibTeX from a DOI.
158
+ ```bash
159
+ rev doi fetch 10.1234/example
160
+ ```
161
+
162
+ ### rev doi add
163
+ Add citation to .bib file from DOI.
164
+ ```bash
165
+ rev doi add 10.1234/example
166
+ rev doi add 10.1234/example --file references.bib
167
+ ```
168
+
169
+ ## Content Analysis
170
+
171
+ ### rev word-count
172
+ Show word counts per section.
173
+ ```bash
174
+ rev word-count # Per-section counts
175
+ rev word-count --limit 5000 # Warn if over limit
176
+ rev word-count -j nature # Use journal word limit
177
+ ```
178
+
179
+ ### rev stats
180
+ Project dashboard showing overview.
181
+ ```bash
182
+ rev stats # Words, figures, citations, comments
183
+ ```
184
+
185
+ ### rev search
186
+ Search across all section files.
187
+ ```bash
188
+ rev search "climate change"
189
+ rev search -i "method" # Case-insensitive
190
+ ```
191
+
192
+ ### rev figures
193
+ List figures with reference counts.
194
+ ```bash
195
+ rev figures methods.md
196
+ ```
197
+
198
+ ### rev equations
199
+ Work with LaTeX equations.
200
+ ```bash
201
+ rev equations list # List all equations
202
+ rev equations from-word manuscript.docx # Extract from Word
203
+ ```
204
+
205
+ ## Direct DOCX Editing
206
+
207
+ ### rev annotate
208
+ Add comments directly to Word document.
209
+ ```bash
210
+ rev annotate paper.docx -m "Comment" -s "text to find"
211
+ ```
212
+
213
+ ### rev apply
214
+ Apply MD annotations as Word track changes.
215
+ ```bash
216
+ rev apply paper.md output.docx
217
+ ```
218
+
219
+ ### rev comment
220
+ Interactive comment mode for Word documents.
221
+ ```bash
222
+ rev comment paper.docx
223
+ ```
224
+
225
+ ## Project Management
226
+
227
+ ### rev init
228
+ Initialize a new paper project.
229
+ ```bash
230
+ rev init my-paper
231
+ rev init my-paper --template apa
232
+ ```
233
+
234
+ ### rev sections
235
+ List and manage section files.
236
+ ```bash
237
+ rev sections # List all sections
238
+ ```
239
+
240
+ ### rev clean
241
+ Remove generated files.
242
+ ```bash
243
+ rev clean # Remove paper.md, PDFs, DOCXs
244
+ rev clean --dry-run # Show what would be deleted
245
+ rev clean --all # Also remove backups and exports
246
+ ```
247
+
248
+ ### rev open
249
+ Open project folder or file.
250
+ ```bash
251
+ rev open # Open project folder
252
+ rev open paper.pdf # Open specific file
253
+ ```
254
+
255
+ ### rev watch
256
+ Auto-rebuild on file changes.
257
+ ```bash
258
+ rev watch # Watch and rebuild
259
+ rev watch pdf # Only rebuild PDF
260
+ rev watch --no-open # Don't open after build
261
+ ```
262
+
263
+ ## Configuration
264
+
265
+ ### rev config
266
+ Configure user settings.
267
+ ```bash
268
+ rev config user "Your Name" # Set author name for replies
269
+ rev config # Show current config
270
+ ```
271
+
272
+ ## Shell Completions
273
+
274
+ ### rev completions
275
+ Output shell completions.
276
+ ```bash
277
+ eval "$(rev completions bash)" # Bash
278
+ eval "$(rev completions zsh)" # Zsh
279
+ ```
package/skill/SKILL.md ADDED
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: docrev
3
+ description: "Academic paper revision workflow tool (CLI: `rev`). Use when working with Word documents containing reviewer comments, importing track changes to markdown, replying to reviewer comments, building PDF/DOCX outputs, generating response letters, validating citations/DOIs, or any academic paper revision task."
4
+ ---
5
+
6
+ # docrev - Academic Paper Revision Tool
7
+
8
+ `rev` is a CLI tool for academic paper workflows with Word ↔ Markdown round-trips.
9
+
10
+ ## Core Workflow
11
+
12
+ ### 1. Import reviewed Word document
13
+
14
+ ```bash
15
+ rev import --file manuscript-reviewed.docx
16
+ ```
17
+
18
+ This extracts track changes and comments as CriticMarkup annotations in markdown files.
19
+
20
+ ### 2. View and address comments
21
+
22
+ ```bash
23
+ rev comments methods.md # List all comments with context
24
+ rev status methods.md # Show annotation counts
25
+ ```
26
+
27
+ ### 3. Reply to reviewer comments
28
+
29
+ **Always use the non-interactive reply mode:**
30
+
31
+ ```bash
32
+ rev reply methods.md -n 1 -m "Added clarification about sampling methodology"
33
+ rev reply results.md -n 3 -m "Updated figure to include 95% CI"
34
+ ```
35
+
36
+ Replies appear as: `{>>Reviewer: Original<<} {>>User: Reply<<}`
37
+
38
+ ### 4. Resolve addressed comments
39
+
40
+ ```bash
41
+ rev resolve methods.md -n 1 # Mark comment #1 as resolved
42
+ ```
43
+
44
+ ### 5. Build output documents
45
+
46
+ ```bash
47
+ rev build # Build both PDF and DOCX
48
+ rev build docx # Word only
49
+ rev build pdf # PDF only
50
+ rev build --toc # Include table of contents
51
+ ```
52
+
53
+ ### 6. Generate response letter
54
+
55
+ ```bash
56
+ rev response # Generate point-by-point response letter
57
+ ```
58
+
59
+ ## Annotation Syntax (CriticMarkup)
60
+
61
+ - `{++inserted text++}` - Additions
62
+ - `{--deleted text--}` - Deletions
63
+ - `{~~old~>new~~}` - Substitutions
64
+ - `{>>Author: comment<<}` - Comments
65
+ - `{>>Author: comment [RESOLVED]<<}` - Resolved comment
66
+
67
+ ## Quick Commands
68
+
69
+ | Task | Command |
70
+ |------|---------|
71
+ | Word count per section | `rev word-count` |
72
+ | Word count with limit | `rev word-count --limit 5000` |
73
+ | Project dashboard | `rev stats` |
74
+ | Search all sections | `rev search "query"` |
75
+ | Pre-submission check | `rev check` |
76
+ | Validate citations | `rev citations` |
77
+ | Check grammar/style | `rev grammar` |
78
+ | Check spelling | `rev spelling` |
79
+ | Open PDF preview | `rev preview pdf` |
80
+ | Auto-rebuild on changes | `rev watch` |
81
+
82
+ ## DOI Management
83
+
84
+ ```bash
85
+ rev doi check references.bib # Validate DOIs
86
+ rev doi lookup references.bib # Find missing DOIs
87
+ rev doi add 10.1234/example # Add citation from DOI
88
+ ```
89
+
90
+ ## Validation
91
+
92
+ ```bash
93
+ rev validate --journal nature # Check journal requirements
94
+ rev validate --list # List 21 available journal profiles
95
+ rev lint # Check broken refs, missing citations
96
+ ```
97
+
98
+ ## Cross-References
99
+
100
+ Use in markdown files:
101
+ - `@fig:label` - Figure reference (becomes "Figure 1" in Word)
102
+ - `@tbl:label` - Table reference
103
+ - `@eq:label` - Equation reference
104
+ - `{#fig:label}` - Anchor for figures
105
+
106
+ ## Template Variables
107
+
108
+ Available in section files (processed during build):
109
+ - `{{date}}` - Current date (YYYY-MM-DD)
110
+ - `{{date:MMMM D, YYYY}}` - Custom format
111
+ - `{{title}}` - Document title
112
+ - `{{author}}` - First author
113
+ - `{{word_count}}` - Total word count
114
+
115
+ ## Project Structure
116
+
117
+ ```
118
+ my-paper/
119
+ ├── rev.yaml # Project config
120
+ ├── introduction.md # Section files with annotations
121
+ ├── methods.md
122
+ ├── results.md
123
+ ├── discussion.md
124
+ ├── references.bib # Bibliography
125
+ ├── figures/ # Images
126
+ └── paper.docx # Built output
127
+ ```
128
+
129
+ ## When Helping Users
130
+
131
+ 1. **Import phase**: Run `rev import` to get track changes as markdown
132
+ 2. **Review phase**: Use `rev comments` to see all comments, then `rev reply` to respond
133
+ 3. **Build phase**: Run `rev build docx` to generate the updated Word document
134
+ 4. **Validation phase**: Run `rev check` before submission (lint + grammar + citations)
135
+ 5. **Response letter**: Use `rev response` to generate point-by-point responses
136
+
137
+ For complete command reference, see [REFERENCE.md](REFERENCE.md).