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