wtf-p 0.3.0 → 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.
Files changed (183) hide show
  1. package/README.md +146 -208
  2. package/bin/commands/doctor.js +88 -2
  3. package/bin/commands/install-logic.js +127 -36
  4. package/bin/commands/status.js +22 -4
  5. package/bin/commands/update.js +5 -4
  6. package/bin/install.js +66 -26
  7. package/bin/lib/analyze-impact.js +105 -0
  8. package/bin/lib/bib-format.js +161 -0
  9. package/bin/lib/bib-index.js +104 -0
  10. package/bin/lib/checkpoint.js +183 -0
  11. package/bin/lib/citation-fetcher.js +299 -0
  12. package/bin/lib/citation-ranker.js +133 -0
  13. package/bin/lib/context-primer.js +214 -0
  14. package/bin/lib/manifest.js +80 -2
  15. package/bin/lib/scholar-lookup.js +188 -0
  16. package/bin/lib/semantic-scholar.js +184 -0
  17. package/bin/lib/utils.js +22 -1
  18. package/bin/uninstall.js +270 -111
  19. package/core/write-the-f-paper/references/agent-model-matrix.md +62 -0
  20. package/core/write-the-f-paper/references/checkpoints.md +160 -9
  21. package/core/write-the-f-paper/references/context-fidelity.md +153 -0
  22. package/core/write-the-f-paper/references/deviation-rules.md +150 -0
  23. package/core/write-the-f-paper/references/git-integration.md +80 -0
  24. package/core/write-the-f-paper/references/orchestrator-pattern.md +167 -0
  25. package/core/write-the-f-paper/references/planning-config.md +135 -0
  26. package/core/write-the-f-paper/references/ui-brand.md +186 -0
  27. package/core/write-the-f-paper/templates/UAT.md +80 -0
  28. package/core/write-the-f-paper/templates/base-prefs.yaml +42 -0
  29. package/core/write-the-f-paper/templates/config.json +31 -5
  30. package/core/write-the-f-paper/workflows/create-outline.wcn.md +1 -1
  31. package/core/write-the-f-paper/workflows/execute-outline.md +163 -0
  32. package/core/write-the-f-paper/workflows/execute-outline.wcn.md +73 -0
  33. package/core/write-the-f-paper/workflows/execute-section.wcn.md +141 -169
  34. package/core/write-the-f-paper/workflows/plan-section.wcn.md +96 -103
  35. package/core/write-the-f-paper/workflows/research-gap.md +27 -3
  36. package/core/write-the-f-paper/workflows/research-gap.wcn.md +18 -1
  37. package/core/write-the-f-paper/workflows/verify-work.md +251 -0
  38. package/core/write-the-f-paper/workflows/verify-work.wcn.md +74 -0
  39. package/package.json +19 -7
  40. package/vendors/claude/.claude-plugin/plugin.json +2 -2
  41. package/vendors/claude/agents/wtfp/argument-verifier.md +189 -0
  42. package/vendors/claude/agents/wtfp/citation-expert.md +45 -0
  43. package/vendors/claude/agents/wtfp/citation-formatter.md +42 -0
  44. package/vendors/claude/agents/wtfp/coherence-checker.md +167 -0
  45. package/vendors/claude/agents/wtfp/outliner.md +259 -0
  46. package/vendors/claude/agents/wtfp/plan-checker.md +249 -0
  47. package/vendors/claude/agents/wtfp/prose-polisher.md +166 -0
  48. package/vendors/claude/agents/wtfp/research-synthesizer.md +215 -0
  49. package/vendors/claude/agents/wtfp/section-planner.md +364 -0
  50. package/vendors/claude/agents/wtfp/section-reviewer.md +182 -0
  51. package/vendors/claude/agents/wtfp/section-writer.md +312 -0
  52. package/vendors/claude/commands/wtfp/add-todo.md +108 -0
  53. package/vendors/claude/commands/wtfp/analyze-bib.md +60 -249
  54. package/vendors/claude/commands/wtfp/audit-milestone.md +286 -0
  55. package/vendors/claude/commands/wtfp/check-refs.md +60 -131
  56. package/vendors/claude/commands/wtfp/check-todos.md +152 -0
  57. package/vendors/claude/commands/wtfp/checkpoint.md +105 -0
  58. package/vendors/claude/commands/wtfp/contribute.md +1 -1
  59. package/vendors/claude/commands/wtfp/create-outline.md +109 -195
  60. package/vendors/claude/commands/wtfp/create-poster.md +1 -1
  61. package/vendors/claude/commands/wtfp/create-slides.md +1 -1
  62. package/vendors/claude/commands/wtfp/discuss-section.md +1 -1
  63. package/vendors/claude/commands/wtfp/execute-outline.md +257 -0
  64. package/vendors/claude/commands/wtfp/export-latex.md +1 -1
  65. package/vendors/claude/commands/wtfp/help.md +174 -280
  66. package/vendors/claude/commands/wtfp/insert-section.md +1 -1
  67. package/vendors/claude/commands/wtfp/list-assumptions.md +1 -1
  68. package/vendors/claude/commands/wtfp/map-project.md +35 -124
  69. package/vendors/claude/commands/wtfp/new-paper.md +88 -362
  70. package/vendors/claude/commands/wtfp/pause-writing.md +1 -1
  71. package/vendors/claude/commands/wtfp/plan-milestone-gaps.md +255 -0
  72. package/vendors/claude/commands/wtfp/plan-revision.md +1 -1
  73. package/vendors/claude/commands/wtfp/plan-section.md +165 -190
  74. package/vendors/claude/commands/wtfp/polish-prose.md +66 -118
  75. package/vendors/claude/commands/wtfp/progress.md +82 -254
  76. package/vendors/claude/commands/wtfp/quick.md +107 -0
  77. package/vendors/claude/commands/wtfp/remove-section.md +1 -1
  78. package/vendors/claude/commands/wtfp/report-bug.md +1 -1
  79. package/vendors/claude/commands/wtfp/request-feature.md +1 -1
  80. package/vendors/claude/commands/wtfp/research-gap.md +138 -151
  81. package/vendors/claude/commands/wtfp/resume-writing.md +1 -1
  82. package/vendors/claude/commands/wtfp/review-section.md +55 -333
  83. package/vendors/claude/commands/wtfp/settings.md +197 -0
  84. package/vendors/claude/commands/wtfp/submit-milestone.md +248 -99
  85. package/vendors/claude/commands/wtfp/update.md +112 -0
  86. package/vendors/claude/commands/wtfp/verify-work.md +254 -0
  87. package/vendors/claude/commands/wtfp/write-section.md +144 -180
  88. package/vendors/claude/mcp/research-server/package.json +13 -0
  89. package/vendors/claude/mcp/research-server/src/index.js +133 -0
  90. package/vendors/gemini/agents/wtfp/argument-verifier.md +184 -0
  91. package/vendors/gemini/agents/wtfp/citation-expert.md +41 -0
  92. package/vendors/gemini/agents/wtfp/citation-formatter.md +38 -0
  93. package/vendors/gemini/agents/wtfp/coherence-checker.md +162 -0
  94. package/vendors/gemini/agents/wtfp/outliner.md +252 -0
  95. package/vendors/gemini/agents/wtfp/plan-checker.md +244 -0
  96. package/vendors/gemini/agents/wtfp/prose-polisher.md +158 -0
  97. package/vendors/gemini/agents/wtfp/research-synthesizer.md +205 -0
  98. package/vendors/gemini/agents/wtfp/section-planner.md +355 -0
  99. package/vendors/gemini/agents/wtfp/section-reviewer.md +175 -0
  100. package/vendors/gemini/agents/wtfp/section-writer.md +304 -0
  101. package/vendors/gemini/commands/wtfp/add-todo.toml +102 -0
  102. package/vendors/gemini/commands/wtfp/analyze-bib.toml +126 -0
  103. package/vendors/gemini/commands/wtfp/audit-milestone.toml +278 -0
  104. package/vendors/gemini/commands/wtfp/check-refs.toml +123 -0
  105. package/vendors/gemini/commands/wtfp/check-todos.toml +145 -0
  106. package/vendors/gemini/commands/wtfp/checkpoint.toml +96 -0
  107. package/vendors/gemini/commands/wtfp/contribute.toml +269 -0
  108. package/vendors/gemini/commands/wtfp/create-outline.toml +180 -0
  109. package/vendors/gemini/commands/wtfp/create-poster.toml +36 -0
  110. package/vendors/gemini/commands/wtfp/create-slides.toml +35 -0
  111. package/vendors/gemini/commands/wtfp/discuss-section.toml +62 -0
  112. package/vendors/gemini/commands/wtfp/execute-outline.toml +247 -0
  113. package/vendors/gemini/commands/wtfp/export-latex.toml +209 -0
  114. package/vendors/gemini/commands/wtfp/help.toml +184 -0
  115. package/vendors/gemini/commands/wtfp/insert-section.toml +123 -0
  116. package/vendors/gemini/commands/wtfp/list-assumptions.toml +104 -0
  117. package/vendors/gemini/commands/wtfp/map-project.toml +99 -0
  118. package/vendors/gemini/commands/wtfp/new-paper.toml +160 -0
  119. package/vendors/gemini/commands/wtfp/pause-writing.toml +140 -0
  120. package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +249 -0
  121. package/vendors/gemini/commands/wtfp/plan-revision.toml +171 -0
  122. package/vendors/gemini/commands/wtfp/plan-section.toml +212 -0
  123. package/vendors/gemini/commands/wtfp/polish-prose.toml +114 -0
  124. package/vendors/gemini/commands/wtfp/progress.toml +145 -0
  125. package/vendors/gemini/commands/wtfp/quick.toml +96 -0
  126. package/vendors/gemini/commands/wtfp/remove-section.toml +140 -0
  127. package/vendors/gemini/commands/wtfp/report-bug.toml +126 -0
  128. package/vendors/gemini/commands/wtfp/request-feature.toml +155 -0
  129. package/vendors/gemini/commands/wtfp/research-gap.toml +214 -0
  130. package/vendors/gemini/commands/wtfp/resume-writing.toml +136 -0
  131. package/vendors/gemini/commands/wtfp/review-section.toml +121 -0
  132. package/vendors/gemini/commands/wtfp/settings.toml +191 -0
  133. package/vendors/gemini/commands/wtfp/submit-milestone.toml +351 -0
  134. package/vendors/gemini/commands/wtfp/update.toml +107 -0
  135. package/vendors/gemini/commands/wtfp/verify-work.toml +245 -0
  136. package/vendors/gemini/commands/wtfp/write-section.toml +228 -0
  137. package/vendors/opencode/agents/wtfp/argument-verifier.md +184 -0
  138. package/vendors/opencode/agents/wtfp/citation-expert.md +41 -0
  139. package/vendors/opencode/agents/wtfp/citation-formatter.md +38 -0
  140. package/vendors/opencode/agents/wtfp/coherence-checker.md +162 -0
  141. package/vendors/opencode/agents/wtfp/outliner.md +252 -0
  142. package/vendors/opencode/agents/wtfp/plan-checker.md +244 -0
  143. package/vendors/opencode/agents/wtfp/prose-polisher.md +158 -0
  144. package/vendors/opencode/agents/wtfp/research-synthesizer.md +205 -0
  145. package/vendors/opencode/agents/wtfp/section-planner.md +355 -0
  146. package/vendors/opencode/agents/wtfp/section-reviewer.md +175 -0
  147. package/vendors/opencode/agents/wtfp/section-writer.md +304 -0
  148. package/vendors/opencode/commands/wtfp/add-todo.md +103 -0
  149. package/vendors/opencode/commands/wtfp/analyze-bib.md +127 -0
  150. package/vendors/opencode/commands/wtfp/audit-milestone.md +279 -0
  151. package/vendors/opencode/commands/wtfp/check-refs.md +124 -0
  152. package/vendors/opencode/commands/wtfp/check-todos.md +146 -0
  153. package/vendors/opencode/commands/wtfp/checkpoint.md +97 -0
  154. package/vendors/opencode/commands/wtfp/contribute.md +266 -0
  155. package/vendors/opencode/commands/wtfp/create-outline.md +181 -0
  156. package/vendors/opencode/commands/wtfp/create-poster.md +37 -0
  157. package/vendors/opencode/commands/wtfp/create-slides.md +36 -0
  158. package/vendors/opencode/commands/wtfp/discuss-section.md +63 -0
  159. package/vendors/opencode/commands/wtfp/execute-outline.md +248 -0
  160. package/vendors/opencode/commands/wtfp/export-latex.md +210 -0
  161. package/vendors/opencode/commands/wtfp/help.md +185 -0
  162. package/vendors/opencode/commands/wtfp/insert-section.md +124 -0
  163. package/vendors/opencode/commands/wtfp/list-assumptions.md +105 -0
  164. package/vendors/opencode/commands/wtfp/map-project.md +100 -0
  165. package/vendors/opencode/commands/wtfp/new-paper.md +161 -0
  166. package/vendors/opencode/commands/wtfp/pause-writing.md +141 -0
  167. package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +250 -0
  168. package/vendors/opencode/commands/wtfp/plan-revision.md +174 -0
  169. package/vendors/opencode/commands/wtfp/plan-section.md +214 -0
  170. package/vendors/opencode/commands/wtfp/polish-prose.md +115 -0
  171. package/vendors/opencode/commands/wtfp/progress.md +146 -0
  172. package/vendors/opencode/commands/wtfp/quick.md +97 -0
  173. package/vendors/opencode/commands/wtfp/remove-section.md +141 -0
  174. package/vendors/opencode/commands/wtfp/report-bug.md +127 -0
  175. package/vendors/opencode/commands/wtfp/request-feature.md +156 -0
  176. package/vendors/opencode/commands/wtfp/research-gap.md +215 -0
  177. package/vendors/opencode/commands/wtfp/resume-writing.md +137 -0
  178. package/vendors/opencode/commands/wtfp/review-section.md +123 -0
  179. package/vendors/opencode/commands/wtfp/settings.md +192 -0
  180. package/vendors/opencode/commands/wtfp/submit-milestone.md +352 -0
  181. package/vendors/opencode/commands/wtfp/update.md +108 -0
  182. package/vendors/opencode/commands/wtfp/verify-work.md +246 -0
  183. package/vendors/opencode/commands/wtfp/write-section.md +228 -0
@@ -0,0 +1,279 @@
1
+ ---
2
+ name: wtfp:audit-milestone
3
+ description: Run pre-submission checks on sections, citations, and word counts
4
+ ---
5
+
6
+ <objective>
7
+ Check paper readiness before submission.
8
+
9
+ Runs 5 audit checks:
10
+ 1. Section completion status
11
+ 2. Argument coverage (all claims addressed)
12
+ 3. Word targets (within tolerance)
13
+ 4. Citation completeness (all resolved)
14
+ 5. Review status (all sections reviewed)
15
+
16
+ Produces MILESTONE-AUDIT.md with pass/gap for each criterion.
17
+ </objective>
18
+
19
+ <process>
20
+
21
+ <step name="validate">
22
+ **Step 1: Validate Environment**
23
+
24
+ ```bash
25
+ [ ! -f .planning/PROJECT.md ] && echo "ERROR: No PROJECT.md found" && exit 1
26
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No ROADMAP.md found" && exit 1
27
+ [ ! -f .planning/STATE.md ] && echo "ERROR: No STATE.md found" && exit 1
28
+ ```
29
+
30
+ </step>
31
+
32
+ <step name="banner">
33
+ **Step 2: Display Banner**
34
+
35
+ ```
36
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
37
+ WTF-P ► AUDITING MILESTONE
38
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
39
+
40
+ Running 5 pre-submission checks...
41
+ ```
42
+
43
+ </step>
44
+
45
+ <step name="check_sections">
46
+ **Check 1: Section Completion**
47
+
48
+ Read ROADMAP.md. For each section entry:
49
+ - Is it marked `[x]` complete?
50
+ - Extract section name and completion status
51
+
52
+ Count:
53
+ - `TOTAL_SECTIONS`: Number of section entries
54
+ - `COMPLETE_SECTIONS`: Number with `[x]`
55
+ - `INCOMPLETE_SECTIONS`: Number with `[ ]`
56
+
57
+ **Result:**
58
+ - PASS if `COMPLETE_SECTIONS == TOTAL_SECTIONS`
59
+ - GAP if any sections incomplete
60
+
61
+ Store result:
62
+ ```
63
+ CHECK_1_STATUS="{PASS|GAP}"
64
+ CHECK_1_DETAIL="{M}/{N} complete"
65
+ CHECK_1_GAPS="{list of incomplete section names, if any}"
66
+ ```
67
+
68
+ </step>
69
+
70
+ <step name="check_arguments">
71
+ **Check 2: Argument Coverage**
72
+
73
+ Read `.planning/structure/argument-map.md` if it exists.
74
+
75
+ Extract all claims (lines starting with `- **Claim**:` or numbered claims).
76
+
77
+ For each claim:
78
+ - Search paper content files (`paper/` directory or equivalent)
79
+ - Check if evidence of the claim being addressed exists
80
+
81
+ **Result:**
82
+ - PASS if all claims addressed
83
+ - GAP listing unaddressed claims
84
+
85
+ Store result:
86
+ ```
87
+ CHECK_2_STATUS="{PASS|GAP}"
88
+ CHECK_2_DETAIL="{M}/{N} claims addressed"
89
+ CHECK_2_GAPS="{list of unaddressed claims, if any}"
90
+ ```
91
+
92
+ If argument-map.md doesn't exist:
93
+ ```
94
+ CHECK_2_STATUS="SKIP"
95
+ CHECK_2_DETAIL="No argument-map.md found"
96
+ ```
97
+
98
+ </step>
99
+
100
+ <step name="check_words">
101
+ **Check 3: Word Targets**
102
+
103
+ Read `.planning/structure/outline.md` for word budget per section.
104
+
105
+ For each section:
106
+ - Count actual words in the paper content file
107
+ - Compare to target from outline
108
+
109
+ **Tolerance:** +/- 15% of target per section
110
+
111
+ **Result:**
112
+ - PASS if all sections within range
113
+ - GAP listing sections outside range (with actual vs target)
114
+
115
+ Store result:
116
+ ```
117
+ CHECK_3_STATUS="{PASS|GAP}"
118
+ CHECK_3_DETAIL="{N}/{M} sections within range"
119
+ CHECK_3_GAPS="{list of sections outside range: 'Section X: Y words (target: Z, variance: +/-W%)'}"
120
+ ```
121
+
122
+ If outline.md doesn't exist or has no word targets:
123
+ ```
124
+ CHECK_3_STATUS="SKIP"
125
+ CHECK_3_DETAIL="No word targets defined in outline.md"
126
+ ```
127
+
128
+ </step>
129
+
130
+ <step name="check_citations">
131
+ **Check 4: Citation Completeness**
132
+
133
+ Scan all paper content files for citation patterns:
134
+ - `(Author, Year)` - APA style
135
+ - `\cite{key}` - LaTeX style
136
+ - `[@key]` - Pandoc/markdown style
137
+ - `[N]` - IEEE style
138
+
139
+ Cross-reference with bibliography file:
140
+ - `references.bib` (BibTeX)
141
+ - `.planning/sources/bibliography.md`
142
+ - Any `.bib` files in project
143
+
144
+ Check for:
145
+ 1. **Uncited references**: Entries in bibliography not cited in text
146
+ 2. **Undefined citations**: Citations in text not in bibliography
147
+
148
+ **Result:**
149
+ - PASS if all citations resolved
150
+ - GAP listing issues
151
+
152
+ Store result:
153
+ ```
154
+ CHECK_4_STATUS="{PASS|GAP}"
155
+ CHECK_4_DETAIL="{N} issues found"
156
+ CHECK_4_GAPS="{list: 'Uncited: [keys]', 'Undefined: [keys]'}"
157
+ ```
158
+
159
+ If no bibliography file found:
160
+ ```
161
+ CHECK_4_STATUS="SKIP"
162
+ CHECK_4_DETAIL="No bibliography file found"
163
+ ```
164
+
165
+ </step>
166
+
167
+ <step name="check_reviews">
168
+ **Check 5: Review Status**
169
+
170
+ For each section:
171
+ - Check if review SUMMARY.md exists in `.planning/sections/{section}/`
172
+ - Or check if "review: pass" noted in section summary
173
+
174
+ **Result:**
175
+ - PASS if all sections reviewed
176
+ - GAP listing unreviewed sections
177
+
178
+ Store result:
179
+ ```
180
+ CHECK_5_STATUS="{PASS|GAP}"
181
+ CHECK_5_DETAIL="{M}/{N} sections reviewed"
182
+ CHECK_5_GAPS="{list of unreviewed sections}"
183
+ ```
184
+
185
+ </step>
186
+
187
+ <step name="write_audit">
188
+ **Step 3: Write MILESTONE-AUDIT.md**
189
+
190
+ Determine overall status:
191
+ - `OVERALL="PASS"` if all checks pass or skip
192
+ - `OVERALL="GAPS FOUND"` if any check has GAP status
193
+
194
+ Write `.planning/MILESTONE-AUDIT.md`:
195
+
196
+ ```markdown
197
+ # Milestone Audit
198
+
199
+ **Date:** {YYYY-MM-DD}
200
+ **Overall:** {PASS | GAPS FOUND}
201
+
202
+ ## Results
203
+
204
+ | Check | Status | Details |
205
+ |-------|--------|---------|
206
+ | Section Completion | {PASS/GAP/SKIP} | {CHECK_1_DETAIL} |
207
+ | Argument Coverage | {PASS/GAP/SKIP} | {CHECK_2_DETAIL} |
208
+ | Word Targets | {PASS/GAP/SKIP} | {CHECK_3_DETAIL} |
209
+ | Citation Completeness | {PASS/GAP/SKIP} | {CHECK_4_DETAIL} |
210
+ | Review Status | {PASS/GAP/SKIP} | {CHECK_5_DETAIL} |
211
+
212
+ ## Gaps
213
+
214
+ {For each GAP status, create a subsection:}
215
+
216
+ ### {Check Name}
217
+ - **Status:** gap
218
+ - **Finding:** {what's missing}
219
+ - **Affected:** {sections/claims/files}
220
+ - **Recommendation:** {what to do}
221
+
222
+ {If no gaps:}
223
+ No gaps found. Paper is ready for submission.
224
+
225
+ ## Summary
226
+
227
+ {If PASS: "Paper is ready for submission. Run `/wtfp:submit-milestone {version}` to archive."}
228
+ {If GAPS: "Found {N} gaps requiring attention. Run `/wtfp:plan-milestone-gaps` to create fix plans."}
229
+ ```
230
+
231
+ </step>
232
+
233
+ <step name="present_results">
234
+ **Step 4: Present Results**
235
+
236
+ ```
237
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
238
+ WTF-P ► AUDIT COMPLETE
239
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
240
+
241
+ Overall: {PASS | GAPS FOUND}
242
+
243
+ Results:
244
+ ✓ Section Completion: {details}
245
+ ✓ Argument Coverage: {details}
246
+ ✓ Word Targets: {details}
247
+ ✓ Citation Completeness: {details}
248
+ ✓ Review Status: {details}
249
+
250
+ {Use ✓ for PASS, ✗ for GAP, — for SKIP}
251
+
252
+ Audit saved to: .planning/MILESTONE-AUDIT.md
253
+
254
+ ───────────────────────────────────────────
255
+
256
+ ## Next Up
257
+
258
+ {If PASS:}
259
+ **Ready to submit:**
260
+ `/wtfp:submit-milestone {version}`
261
+
262
+ {If GAPS:}
263
+ **Fix gaps first:**
264
+ `/wtfp:plan-milestone-gaps` - Create fix plans from audit
265
+
266
+ ───────────────────────────────────────────
267
+ ```
268
+
269
+ </step>
270
+
271
+ </process>
272
+
273
+ <success_criteria>
274
+ - [ ] Environment validated
275
+ - [ ] 5 audit checks run (section, argument, word, citation, review)
276
+ - [ ] MILESTONE-AUDIT.md created with pass/gap per check
277
+ - [ ] Gaps include actionable recommendations
278
+ - [ ] Next steps offered based on result
279
+ </success_criteria>
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: wtfp:check-refs
3
+ description: Audit BibTeX for missing, duplicate, or broken references
4
+ ---
5
+
6
+ <objective>
7
+ Audit citations for completeness and consistency.
8
+
9
+ **Orchestrator role:** Locate bib and draft files, run deterministic indexer, resolve model profile, spawn citation-formatter agent for cross-referencing, present results, apply fixes.
10
+
11
+ Ensures all in-text citations have BibTeX entries, all entries are cited, and references are properly formatted.
12
+ </objective>
13
+
14
+ <context>
15
+ BibTeX file: $ARGUMENTS (optional — auto-detects .bib files)
16
+
17
+ **Load project state:**
18
+ @.planning/STATE.md
19
+ </context>
20
+
21
+ <process>
22
+
23
+ ## 1. Validate Environment and Resolve Model Profile
24
+
25
+ ```bash
26
+ find . -name "*.bib" -type f 2>/dev/null | head -20
27
+ grep -rl "\\\\cite\|\\[@\|\\[.*\\]" --include="*.tex" --include="*.md" . 2>/dev/null
28
+ ```
29
+
30
+ ```bash
31
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
32
+ ```
33
+
34
+ | Agent | quality | balanced | budget |
35
+ |-------|---------|----------|--------|
36
+ | citation-formatter | sonnet | sonnet | haiku |
37
+
38
+ ## 2. Run Deterministic Indexer
39
+
40
+ ```bash
41
+ node ~/.opencode/bin/bib-index.js index "$BIB_FILE"
42
+ ```
43
+
44
+ ## 3. Spawn citation-formatter Agent
45
+
46
+ ```
47
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
48
+ WTF-P ► AUDITING CITATIONS
49
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
50
+ ```
51
+
52
+ ```
53
+ Task(
54
+ prompt="First, read ~/.opencode/agents/wtfp/citation-formatter.md for your role.\n\n" + audit_prompt,
55
+ subagent_type="general-purpose",
56
+ model="{formatter_model}",
57
+ description="Audit citations"
58
+ )
59
+ ```
60
+
61
+ Audit prompt includes: `<bib_index>` with parsed entries, `<draft_files>` with paths to files containing citations, `<state>` with STATE.md.
62
+
63
+ Agent performs: extract in-text citations, cross-reference vs BibTeX keys, check required fields by entry type, identify duplicates, flag suspicious years.
64
+
65
+ ## 4. Handle Formatter Return
66
+
67
+ Present findings:
68
+ - Missing BibTeX entries (cited but not in .bib)
69
+ - Unused references (in .bib but never cited)
70
+ - Incomplete entries (missing required fields)
71
+ - Valid citation count
72
+
73
+ **`## AUDIT BLOCKED`:** Present blocker (no .bib found, no .tex/.md to scan), ask user to provide file paths.
74
+
75
+ ## 5. Offer Fixes
76
+
77
+ Ask via the question tool:
78
+ - header: "Fixes"
79
+ - question: "How should I handle unused references?"
80
+ - options: "Remove unused" | "Keep all" | "Comment out"
81
+
82
+ For missing entries, search using `node ~/.opencode/bin/citation-fetcher.js "title"`.
83
+
84
+ ## 6. Apply Fixes and Commit
85
+
86
+ ```bash
87
+ cp references.bib references.bib.backup
88
+ # Apply approved edits
89
+ git add *.bib
90
+ git commit -m "refs: audit and clean bibliography"
91
+ ```
92
+
93
+ </process>
94
+
95
+ <offer_next>
96
+
97
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
98
+ WTF-P ► CITATION AUDIT COMPLETE ✓
99
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
100
+
101
+ - Citations in text: [N]
102
+ - BibTeX entries: [N]
103
+ - Issues fixed: [N]
104
+ - Issues flagged: [N]
105
+
106
+ ───────────────────────────────────────────
107
+
108
+ ## Next Up
109
+
110
+ - `/wtfp:polish-prose` — Refine writing
111
+ - `/wtfp:export-latex` — Generate LaTeX
112
+ - `/wtfp:review-section` — Get reviewer feedback
113
+
114
+ ───────────────────────────────────────────
115
+
116
+ </offer_next>
117
+
118
+ <success_criteria>
119
+ - [ ] All in-text citations cross-referenced
120
+ - [ ] Missing entries identified and searched
121
+ - [ ] Incomplete entries flagged
122
+ - [ ] Unused references handled per user choice
123
+ - [ ] Changes committed to git
124
+ </success_criteria>
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: wtfp:check-todos
3
+ description: Review pending todos and act on, defer, or dismiss each
4
+ ---
5
+
6
+ <objective>
7
+ Review pending todos. For each, user decides: act on it, defer it, dismiss it, or mark done.
8
+ </objective>
9
+
10
+ <context>
11
+ No arguments. Reads from .planning/todos/pending/.
12
+ </context>
13
+
14
+ <process>
15
+
16
+ ## 1. Validate Environment
17
+
18
+ ```bash
19
+ ls .planning/ 2>/dev/null
20
+ ```
21
+
22
+ If `.planning/` does not exist, output error and exit:
23
+ ```
24
+ Error: No project found. Run /wtfp:new-paper first.
25
+ ```
26
+
27
+ ## 2. List Pending Todos
28
+
29
+ ```bash
30
+ ls -1 .planning/todos/pending/*.md 2>/dev/null
31
+ ```
32
+
33
+ If no files found:
34
+ ```
35
+ No pending todos.
36
+ ```
37
+ Exit.
38
+
39
+ ## 3. Display Banner
40
+
41
+ ```
42
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
43
+ WTF-P ► PENDING TODOS ({N})
44
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45
+ ```
46
+
47
+ ## 4. Process Each Todo
48
+
49
+ Initialize counters:
50
+ - acted = 0
51
+ - deferred = 0
52
+ - dismissed = 0
53
+ - done = 0
54
+
55
+ For each file in `.planning/todos/pending/`:
56
+
57
+ 1. Read the file. Parse frontmatter (created, context) and body (description).
58
+
59
+ 2. Present via the question tool:
60
+ - header: "Todo #{N}"
61
+ - question: "{todo description}\n\nCreated: {date} | Context: {context}"
62
+ - options:
63
+ - "Act on it now"
64
+ - "Defer"
65
+ - "Dismiss"
66
+ - "Done"
67
+ - "Skip rest"
68
+
69
+ 3. Handle response:
70
+
71
+ **"Act on it now":**
72
+ - Display the full todo content
73
+ - Output: "What would you like to do with this? (describe action or command)"
74
+ - Let user take action manually
75
+ - Increment acted counter
76
+ - Keep file in pending (user will mark done when complete)
77
+
78
+ **"Defer":**
79
+ - Keep file in pending
80
+ - Increment deferred counter
81
+ - Continue to next
82
+
83
+ **"Dismiss":**
84
+ ```bash
85
+ mkdir -p .planning/todos/dismissed
86
+ mv {file} .planning/todos/dismissed/
87
+ ```
88
+ - Increment dismissed counter
89
+ - Continue to next
90
+
91
+ **"Done":**
92
+ ```bash
93
+ mkdir -p .planning/todos/done
94
+ mv {file} .planning/todos/done/
95
+ ```
96
+ - Increment done counter
97
+ - Continue to next
98
+
99
+ **"Skip rest":**
100
+ - Break out of loop
101
+ - All remaining todos stay deferred
102
+
103
+ ## 5. Update STATE.md
104
+
105
+ Count remaining pending todos:
106
+ ```bash
107
+ ls -1 .planning/todos/pending/*.md 2>/dev/null | wc -l
108
+ ```
109
+
110
+ Read STATE.md. Update "### Pending Todos" section with new count:
111
+ ```
112
+ ### Pending Todos
113
+
114
+ {N} pending todo(s).
115
+ ```
116
+
117
+ Or if N = 0:
118
+ ```
119
+ ### Pending Todos
120
+
121
+ None.
122
+ ```
123
+
124
+ ## 6. Summary
125
+
126
+ ```
127
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
128
+ WTF-P ► TODOS REVIEWED ✓
129
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
130
+
131
+ Acted on: {N}
132
+ Deferred: {N}
133
+ Dismissed: {N}
134
+ Done: {N}
135
+ Still pending: {N}
136
+ ```
137
+
138
+ </process>
139
+
140
+ <success_criteria>
141
+ - [ ] Pending todos listed with count
142
+ - [ ] Each todo presented with act/defer/dismiss/done/skip options
143
+ - [ ] Files moved to dismissed/ or done/ subdirectories as appropriate
144
+ - [ ] STATE.md pending count updated after review
145
+ - [ ] Summary shows actions taken
146
+ </success_criteria>
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: wtfp:checkpoint
3
+ description: Save, restore, or list paper state snapshots
4
+ ---
5
+
6
+ <objective>
7
+ Save full paper state as a git-tagged checkpoint or restore from a previous one.
8
+
9
+ **Orchestrator role:** Parse subcommand, execute checkpoint operation via bin/lib/checkpoint.js, report result.
10
+
11
+ Enables session continuity — save state before `/clear`, restore in next session.
12
+ </objective>
13
+
14
+ <context>
15
+ Subcommand: $ARGUMENTS
16
+ - `save [label]` — Create checkpoint with label (e.g., "pre-discussion", "draft-1")
17
+ - `restore [tag]` — Restore from a checkpoint tag
18
+ - `list` — Show available checkpoints
19
+
20
+ **Load project state:**
21
+ @.planning/STATE.md
22
+ </context>
23
+
24
+ <process>
25
+
26
+ ## 1. Parse Subcommand
27
+
28
+ Extract subcommand and arguments from $ARGUMENTS.
29
+
30
+ Default: `save` if no subcommand provided, with auto-generated label from STATE.md position.
31
+
32
+ ## 2. Execute Operation
33
+
34
+ ### Save
35
+
36
+ ```bash
37
+ node -e "
38
+ const cp = require('$HOME/.opencode/bin/lib/checkpoint.js');
39
+ const result = cp.createCheckpoint({
40
+ planningDir: '.planning',
41
+ label: '[label]',
42
+ note: '[current position from STATE.md]'
43
+ });
44
+ console.log(JSON.stringify(result));
45
+ "
46
+ ```
47
+
48
+ ### Restore
49
+
50
+ If no tag provided, list checkpoints and ask via the question tool:
51
+ - header: "Checkpoint"
52
+ - question: "Which checkpoint to restore?"
53
+ - options: [list of available checkpoints]
54
+
55
+ ```bash
56
+ node -e "
57
+ const cp = require('$HOME/.opencode/bin/lib/checkpoint.js');
58
+ cp.restoreCheckpoint('[tag]');
59
+ "
60
+ ```
61
+
62
+ ### List
63
+
64
+ ```bash
65
+ node -e "
66
+ const cp = require('$HOME/.opencode/bin/lib/checkpoint.js');
67
+ const list = cp.listCheckpoints();
68
+ list.forEach(c => console.log(c.tag + ' — ' + c.message));
69
+ "
70
+ ```
71
+
72
+ ## 3. Present Result
73
+
74
+ </process>
75
+
76
+ <offer_next>
77
+
78
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
79
+ WTF-P ► CHECKPOINT [SAVED|RESTORED] ✓
80
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
81
+
82
+ Tag: [tag]
83
+ Files: [N]
84
+
85
+ ───────────────────────────────────────────
86
+
87
+ Resume with `/wtfp:progress` after restoring.
88
+
89
+ ───────────────────────────────────────────
90
+
91
+ </offer_next>
92
+
93
+ <success_criteria>
94
+ - [ ] Checkpoint created/restored/listed successfully
95
+ - [ ] Git tag created (for save)
96
+ - [ ] State verified after restore
97
+ </success_criteria>