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,247 @@
1
+ description = "Write all sections in parallel, then check coherence"
2
+
3
+ prompt = '''
4
+ <execution_context>
5
+ @~/.config/gemini/write-the-f-paper/workflows/execute-outline.md
6
+ @~/.config/gemini/write-the-f-paper/references/checkpoints.md
7
+ @~/.config/gemini/write-the-f-paper/references/ui-brand.md
8
+ </execution_context>
9
+
10
+ <objective>
11
+ Execute all sections of a paper in wave-based parallel execution, then verify cross-section coherence.
12
+
13
+ **Orchestrator role:** Load roadmap and all plans, group sections by wave, spawn parallel write-section Task() calls per wave, collect results, handle checkpoints between waves, spawn coherence-checker after final wave, present results.
14
+
15
+ **Why wave execution:** Sections within the same wave have no dependencies and can be written in parallel. Sections in later waves depend on earlier waves completing. This maximizes throughput while respecting logical ordering.
16
+ </objective>
17
+
18
+ <context>
19
+ No arguments. Requires `.planning/ROADMAP.md` and PLAN.md files to exist.
20
+ </context>
21
+
22
+ <process>
23
+
24
+ ## 1. Validate Environment and Resolve Model Profile
25
+
26
+ ```bash
27
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No outline. Run /wtfp:create-outline" && exit 1
28
+ ls .planning/sections/*/ 2>/dev/null
29
+ ls .planning/sections/*/*-PLAN.md 2>/dev/null
30
+ ```
31
+
32
+ **Resolve model profile:**
33
+
34
+ ```bash
35
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
36
+ ```
37
+
38
+ **Model lookup table:**
39
+
40
+ | Agent | quality | balanced | budget |
41
+ |-------|---------|----------|--------|
42
+ | section-writer | opus | sonnet | sonnet |
43
+ | coherence-checker | sonnet | sonnet | haiku |
44
+
45
+ **Resolve config flags:**
46
+ ```bash
47
+ WORKFLOW_VERIFIER=$(cat .planning/config.json 2>/dev/null | grep -o '"verifier"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
48
+ ```
49
+
50
+ ## 2. Read Context Files
51
+
52
+ ```bash
53
+ ROADMAP_CONTENT=$(cat .planning/ROADMAP.md)
54
+ STATE_CONTENT=$(cat .planning/STATE.md)
55
+ PROJECT_CONTENT=$(cat .planning/PROJECT.md)
56
+ ARGMAP_CONTENT=$(cat .planning/structure/argument-map.md 2>/dev/null)
57
+ OUTLINE_CONTENT=$(cat .planning/structure/outline.md 2>/dev/null)
58
+ NARRATIVE_CONTENT=$(cat .planning/structure/narrative-arc.md 2>/dev/null)
59
+ ```
60
+
61
+ ## 3. Build Wave Execution Plan
62
+
63
+ Parse ROADMAP.md and all PLAN.md files to build wave groups:
64
+
65
+ ```bash
66
+ # Find all plans and their wave assignments
67
+ for plan in .planning/sections/*/*-PLAN.md; do
68
+ section=$(basename $(dirname "$plan"))
69
+ wave=$(grep -o 'wave:.*' "$plan" | head -1)
70
+ echo "$wave $section $plan"
71
+ done | sort
72
+ ```
73
+
74
+ Group sections by wave number:
75
+ - Wave 1: [sections with wave: 1] (independent, no dependencies)
76
+ - Wave 2: [sections with wave: 2] (depend on wave 1)
77
+ - ...
78
+ - Wave N: [final sections] (depend on all previous)
79
+
80
+ Present execution plan:
81
+
82
+ ```
83
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
84
+ WTF-P ► EXECUTING OUTLINE
85
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
86
+
87
+ Execution plan:
88
+ Wave 1: [sections] (parallel)
89
+ Wave 2: [sections] (after wave 1)
90
+ Wave 3: [sections] (after wave 2)
91
+ ...
92
+
93
+ Total: [N] sections, [W] words target
94
+ ```
95
+
96
+ ## 4. Wave Execution Loop
97
+
98
+ For each wave (1 to max_wave):
99
+
100
+ **4a. Display wave banner:**
101
+ ```
102
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
103
+ WTF-P ► WRITING WAVE {N}
104
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
105
+ ```
106
+
107
+ **4b. Spawn parallel writers:**
108
+
109
+ For each section in the current wave, for each PLAN.md in that section:
110
+
111
+ ```
112
+ Task(
113
+ prompt="First, read ~/.config/gemini/agents/wtfp/section-writer.md for your role and instructions.\n\n" + filled_writing_prompt,
114
+ subagent_type="general-purpose",
115
+ model="{writer_model}",
116
+ description="Write Section {X}: {Name}"
117
+ )
118
+ ```
119
+
120
+ Sections within the same wave are spawned in parallel (multiple Task() calls).
121
+
122
+ **4c. Collect all returns:**
123
+
124
+ For each completed writer, check return:
125
+ - `## WRITING COMPLETE` -- Record success, update STATE.md
126
+ - `## CHECKPOINT REACHED` -- Queue for user presentation
127
+ - `## WRITING BLOCKED` -- Queue for user presentation
128
+
129
+ **4d. Handle checkpoints between waves:**
130
+
131
+ If any CHECKPOINT returns from this wave:
132
+ - Present each checkpoint to user sequentially
133
+ - Get user response for each
134
+ - If checkpoint was blocking and user provides direction, note for re-execution
135
+
136
+ If any BLOCKED returns:
137
+ - Present blocker to user
138
+ - Options: retry section, skip section (continue to next wave without it), abort execution
139
+
140
+ **4e. Update progress:**
141
+
142
+ ```bash
143
+ # Update STATE.md with wave completion
144
+ # Update ROADMAP.md section statuses
145
+ ```
146
+
147
+ **4f. Continue to next wave** (only if all sections in current wave are COMPLETE or user chose to skip blocked ones).
148
+
149
+ ## 5. Post-Execution Summary
150
+
151
+ After all waves complete:
152
+
153
+ ```
154
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
155
+ WTF-P ► ALL WAVES COMPLETE
156
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
157
+
158
+ Sections written: [N]/[total]
159
+ Words written: [W]
160
+ Skipped: [list if any]
161
+ ```
162
+
163
+ ## 6. Spawn wtfp-coherence-checker
164
+
165
+ After the final wave, spawn coherence-checker with explicit inline context:
166
+
167
+ ```
168
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
169
+ WTF-P ► VERIFYING COHERENCE
170
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
171
+ ```
172
+
173
+ Read all written content:
174
+ ```bash
175
+ ALL_PAPER_CONTENT=$(cat paper/*.md 2>/dev/null)
176
+ ```
177
+
178
+ Spawn with inline context (NOT file references -- provide actual content):
179
+
180
+ ```
181
+ Task(
182
+ prompt="First, read ~/.config/gemini/agents/wtfp/coherence-checker.md for your role and instructions.\n\n" +
183
+ "<paper_content>\n" + ALL_PAPER_CONTENT + "\n</paper_content>\n" +
184
+ "<argument_map>\n" + ARGMAP_CONTENT + "\n</argument_map>\n" +
185
+ "<narrative_arc>\n" + NARRATIVE_CONTENT + "\n</narrative_arc>\n" +
186
+ "<outline>\n" + OUTLINE_CONTENT + "\n</outline>\n" +
187
+ "Run all 5 verification passes and return structured results.",
188
+ subagent_type="general-purpose",
189
+ model="{checker_model}",
190
+ description="Verify Cross-Section Coherence"
191
+ )
192
+ ```
193
+
194
+ ## 7. Handle Coherence Check Return
195
+
196
+ **`## COHERENT`:** All sections pass. Present success summary.
197
+
198
+ **`## GAPS FOUND`:** Present gaps to user with options:
199
+ - Fix now: Re-spawn writers for affected sections with gap context
200
+ - Accept: Note gaps, proceed to review
201
+ - Plan revision: Create revision plans for affected sections
202
+
203
+ ## 8. Present Final Status
204
+
205
+ </process>
206
+
207
+ <offer_next>
208
+
209
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
210
+ WTF-P ► OUTLINE EXECUTED ✓
211
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
212
+
213
+ **Document: {Title}** — {N} sections, {W} words
214
+
215
+ Coherence: {Verified | Gaps found | Skipped}
216
+
217
+ ───────────────────────────────────────────
218
+
219
+ ## ▶ Next Up
220
+
221
+ **Verify sections** — acceptance testing
222
+
223
+ `/wtfp:verify-work [section]`
224
+
225
+ <sub>`/clear` first → fresh context window</sub>
226
+
227
+ ───────────────────────────────────────────
228
+
229
+ **Also available:**
230
+ - `/wtfp:review-section [N]` — detailed section review
231
+ - `/wtfp:polish-prose [N]` — improve prose quality
232
+ - `/wtfp:submit-draft` — prepare for submission
233
+
234
+ </offer_next>
235
+
236
+ <success_criteria>
237
+ - [ ] Roadmap and plans validated
238
+ - [ ] Wave execution plan built from section dependencies
239
+ - [ ] Parallel writers spawned per wave
240
+ - [ ] All waves executed in order
241
+ - [ ] Checkpoints handled between waves
242
+ - [ ] Coherence-checker spawned after final wave with inline content
243
+ - [ ] Coherence result handled (COHERENT or GAPS FOUND)
244
+ - [ ] STATE.md and ROADMAP.md updated
245
+ - [ ] User knows next steps
246
+ </success_criteria>
247
+ '''
@@ -0,0 +1,209 @@
1
+ description = "Export paper to LaTeX with bibliography and formatting"
2
+
3
+ prompt = '''
4
+ <objective>
5
+ Export the paper to LaTeX format.
6
+
7
+ Generates:
8
+ - paper.tex from markdown sections
9
+ - references.bib from literature index
10
+ - Applies journal/conference template
11
+
12
+ Outputs to paper/ directory.
13
+ </objective>
14
+
15
+ <process>
16
+
17
+ <step name="verify">
18
+ **Verify content exists:**
19
+
20
+ ```bash
21
+ [ ! -d paper ] && echo "ERROR: No paper/ directory found. Write sections first." && exit 1
22
+ ls paper/*.md 2>/dev/null || echo "WARNING: No markdown content in paper/"
23
+ ```
24
+
25
+ </step>
26
+
27
+ <step name="template">
28
+ **Select template:**
29
+
30
+ Use interactive prompting:
31
+ - header: "LaTeX Template"
32
+ - question: "Which LaTeX template should we use?"
33
+ - options:
34
+ - "Article (generic)" — Standard article class
35
+ - "IEEE" — IEEE conference/journal format
36
+ - "ACM" — ACM conference format
37
+ - "Custom" — I have a specific template
38
+ - "None" — Plain LaTeX, no special template
39
+
40
+ If "Custom":
41
+ - Ask for template path or template name
42
+ </step>
43
+
44
+ <step name="gather">
45
+ **Gather content:**
46
+
47
+ - Read all section files from paper/
48
+ - Read PROJECT.md for title, authors (if specified)
49
+ - Read sources/literature.md for bibliography
50
+ - Identify figures referenced
51
+ </step>
52
+
53
+ <step name="convert">
54
+ **Convert to LaTeX:**
55
+
56
+ Create paper/paper.tex:
57
+
58
+ ```latex
59
+ % Generated by WTF-P
60
+ % [timestamp]
61
+
62
+ \documentclass[template-options]{article-or-template}
63
+
64
+ % Packages
65
+ \usepackage[utf8]{inputenc}
66
+ \usepackage{amsmath}
67
+ \usepackage{graphicx}
68
+ \usepackage{hyperref}
69
+ \usepackage{cite}
70
+
71
+ \title{[Title from PROJECT.md]}
72
+ \author{[Author if specified]}
73
+ \date{[Date]}
74
+
75
+ \begin{document}
76
+
77
+ \maketitle
78
+
79
+ % Abstract
80
+ \begin{abstract}
81
+ [Abstract content]
82
+ \end{abstract}
83
+
84
+ % Sections
85
+ \section{Introduction}
86
+ [Introduction content converted to LaTeX]
87
+
88
+ \section{Methods}
89
+ [Methods content]
90
+
91
+ % ... remaining sections ...
92
+
93
+ % References
94
+ \bibliographystyle{[style]}
95
+ \bibliography{references}
96
+
97
+ \end{document}
98
+ ```
99
+
100
+ Conversion rules:
101
+ - `## Heading` → `\section{Heading}`
102
+ - `### Subheading` → `\subsection{Subheading}`
103
+ - `**bold**` → `\textbf{bold}`
104
+ - `*italic*` → `\textit{italic}`
105
+ - `[citation]` → `\cite{citation}`
106
+ - `![figure](path)` → `\includegraphics{path}` with figure environment
107
+ - Math: `$inline$` → `$inline$`, `$$display$$` → equation environment
108
+
109
+ </step>
110
+
111
+ <step name="bibliography">
112
+ **Generate bibliography:**
113
+
114
+ Create paper/references.bib from sources/literature.md:
115
+
116
+ ```bibtex
117
+ @article{key1,
118
+ author = {Author Name},
119
+ title = {Paper Title},
120
+ journal = {Journal Name},
121
+ year = {2024},
122
+ volume = {1},
123
+ pages = {1-10}
124
+ }
125
+
126
+ % ... additional entries ...
127
+ ```
128
+
129
+ </step>
130
+
131
+ <step name="compile_check">
132
+ **Optional: Test compilation:**
133
+
134
+ Use interactive prompting:
135
+ - header: "Compile"
136
+ - question: "Try to compile the LaTeX?"
137
+ - options:
138
+ - "Yes, compile" — Run pdflatex
139
+ - "No, just export" — Skip compilation
140
+
141
+ If yes:
142
+ ```bash
143
+ cd paper && pdflatex paper.tex && bibtex paper && pdflatex paper.tex && pdflatex paper.tex
144
+ ```
145
+
146
+ Report any errors.
147
+
148
+ </step>
149
+
150
+ <step name="commit">
151
+ ```bash
152
+ git add paper/paper.tex paper/references.bib
153
+ git commit -m "$(cat <<'EOF'
154
+ export: generate LaTeX output
155
+
156
+ Template: [template]
157
+ Sections: [N]
158
+ References: [N]
159
+ EOF
160
+ )"
161
+ ```
162
+
163
+ </step>
164
+
165
+ <step name="done">
166
+ **Present completion:**
167
+
168
+ ```
169
+ LaTeX export complete:
170
+
171
+ - Document: paper/paper.tex
172
+ - Bibliography: paper/references.bib
173
+ - Template: [template]
174
+
175
+ ## Files Generated
176
+ - paper.tex: [N] sections, [X] words
177
+ - references.bib: [N] entries
178
+ [If compiled:] - paper.pdf: Generated successfully
179
+
180
+ ## Manual Steps
181
+ 1. Review paper/paper.tex for any conversion issues
182
+ 2. Add any custom LaTeX packages needed
183
+ 3. Compile: `cd paper && pdflatex paper.tex && bibtex paper && pdflatex paper.tex`
184
+
185
+ ---
186
+
187
+ ## ▶ Next Up
188
+
189
+ **Review output** — check formatting and fix issues
190
+
191
+ Or if ready:
192
+ `/wtfp:submit-milestone "draft-1"` — archive this version
193
+
194
+ ---
195
+ ```
196
+
197
+ </step>
198
+
199
+ </process>
200
+
201
+ <success_criteria>
202
+ - [ ] All sections converted to LaTeX
203
+ - [ ] Bibliography generated
204
+ - [ ] Template applied correctly
205
+ - [ ] Figures referenced properly
206
+ - [ ] Citations converted
207
+ - [ ] Committed to git
208
+ </success_criteria>
209
+ '''
@@ -0,0 +1,184 @@
1
+ description = "Show all WTF-P commands and how to use them"
2
+
3
+ prompt = '''
4
+ <objective>
5
+ Display the complete WTF-P command reference.
6
+
7
+ Output ONLY the reference content below. Do NOT add:
8
+
9
+ - Project-specific analysis
10
+ - Git status or file context
11
+ - Next-step suggestions
12
+ - Any commentary beyond the reference
13
+ </objective>
14
+
15
+ <process>
16
+ <reference>
17
+ # WTF-P Command Reference
18
+
19
+ **WTF-P** (Write The F***ing Paper) gives you structured commands for writing academic papers, proposals, and presentations. You define your research vision. WTF-P breaks it into plannable, writable, reviewable sections — then tracks everything across sessions.
20
+
21
+ ## Happy Path
22
+
23
+ New here? Follow these five commands in order:
24
+
25
+ | Step | Command | What it does |
26
+ |------|---------|-------------|
27
+ | 1 | `/wtfp:new-paper` | Start a new paper with guided interview and setup |
28
+ | 2 | `/wtfp:create-outline` | Build section outline, argument map, and word budgets |
29
+ | 3 | `/wtfp:plan-section 1` | Create detailed writing plan for a section |
30
+ | 4 | `/wtfp:write-section` | Write a section by executing its plan |
31
+ | 5 | `/wtfp:review-section 1` | Review section for citations, coherence, and requirements |
32
+
33
+ Repeat steps 3-5 for each section. Run `/wtfp:progress` anytime to see where you are and what to do next.
34
+
35
+ ## All Commands
36
+
37
+ ### Setup
38
+
39
+ | Command | Description |
40
+ |---------|-------------|
41
+ | `/wtfp:new-paper` | Start a new paper with guided interview and setup |
42
+ | `/wtfp:create-outline` | Build section outline, argument map, and word budgets |
43
+ | `/wtfp:map-project` | Index existing drafts, data, and references for a project |
44
+
45
+ ### Planning
46
+
47
+ | Command | Description |
48
+ |---------|-------------|
49
+ | `/wtfp:discuss-section [N]` | Discuss your vision for a section before planning it |
50
+ | `/wtfp:research-gap [N]` | Research literature and domain knowledge for a section |
51
+ | `/wtfp:list-assumptions [N]` | Preview intended approach for a section before writing |
52
+ | `/wtfp:plan-section [N]` | Create detailed writing plan for a section |
53
+
54
+ ### Writing
55
+
56
+ | Command | Description |
57
+ |---------|-------------|
58
+ | `/wtfp:write-section <path>` | Write a section by executing its plan |
59
+ | `/wtfp:execute-outline` | Write all sections in parallel, then check coherence |
60
+ | `/wtfp:quick <task>` | Run a small writing fix without full planning overhead |
61
+
62
+ ### Review and Revision
63
+
64
+ | Command | Description |
65
+ |---------|-------------|
66
+ | `/wtfp:review-section [N]` | Review section for citations, coherence, and requirements |
67
+ | `/wtfp:verify-work [N]` | Test a written section against its plan, one check at a time |
68
+ | `/wtfp:plan-revision [N]` | Create revision plan from review issues |
69
+ | `/wtfp:polish-prose [N]` | Improve clarity, flow, and academic voice in written prose |
70
+
71
+ ### Citations
72
+
73
+ | Command | Description |
74
+ |---------|-------------|
75
+ | `/wtfp:analyze-bib` | Analyze bibliography and map citations to sections |
76
+ | `/wtfp:check-refs` | Audit BibTeX for missing, duplicate, or broken references |
77
+
78
+ ### Progress and Sessions
79
+
80
+ | Command | Description |
81
+ |---------|-------------|
82
+ | `/wtfp:progress` | Show writing progress and suggest next step |
83
+ | `/wtfp:pause-writing` | Save current progress so you can resume later |
84
+ | `/wtfp:resume-writing` | Resume writing from a previous session |
85
+ | `/wtfp:checkpoint <save/restore/list>` | Save, restore, or list paper state snapshots |
86
+
87
+ ### Outline Management
88
+
89
+ | Command | Description |
90
+ |---------|-------------|
91
+ | `/wtfp:insert-section <after> <desc>` | Insert a new section between existing sections |
92
+ | `/wtfp:remove-section [N]` | Remove an unwritten section and renumber the rest |
93
+
94
+ ### Export and Submission
95
+
96
+ | Command | Description |
97
+ |---------|-------------|
98
+ | `/wtfp:export-latex` | Export paper to LaTeX with bibliography and formatting |
99
+ | `/wtfp:audit-milestone` | Run pre-submission checks on sections, citations, and word counts |
100
+ | `/wtfp:plan-milestone-gaps` | Create fix plans for gaps found by audit-milestone |
101
+ | `/wtfp:submit-milestone <version>` | Archive a completed draft or submission version |
102
+
103
+ ### Presentations and Posters
104
+
105
+ | Command | Description |
106
+ |---------|-------------|
107
+ | `/wtfp:create-slides` | Generate presentation slides from paper content |
108
+ | `/wtfp:create-poster` | Generate academic poster from paper content |
109
+
110
+ ### Todos
111
+
112
+ | Command | Description |
113
+ |---------|-------------|
114
+ | `/wtfp:add-todo <description>` | Capture a quick note or task without breaking your flow |
115
+ | `/wtfp:check-todos` | Review pending todos and act on, defer, or dismiss each |
116
+
117
+ ### Settings and Utilities
118
+
119
+ | Command | Description |
120
+ |---------|-------------|
121
+ | `/wtfp:settings` | View and edit project settings interactively |
122
+ | `/wtfp:update` | Check for updates and install newer version |
123
+ | `/wtfp:help` | Show all WTF-P commands and how to use them |
124
+
125
+ ### Contributing
126
+
127
+ | Command | Description |
128
+ |---------|-------------|
129
+ | `/wtfp:report-bug` | Report a bug via GitHub issue |
130
+ | `/wtfp:request-feature` | Request a new feature via GitHub issue |
131
+ | `/wtfp:contribute` | Walk through contributing code to WTF-P via pull request |
132
+
133
+ ## Files and Structure
134
+
135
+ WTF-P creates a `.planning/` directory in your project:
136
+
137
+ ```
138
+ .planning/
139
+ PROJECT.md Paper vision and requirements
140
+ ROADMAP.md Section breakdown with status
141
+ STATE.md Writing progress and session context
142
+ config.json Project settings
143
+ structure/
144
+ argument-map.md Claims mapped to evidence and sections
145
+ outline.md Section structure and word budgets
146
+ narrative-arc.md Story flow across sections
147
+ sections/
148
+ 01-introduction/
149
+ 01-01-PLAN.md Writing plan for section 1
150
+ 01-01-SUMMARY.md Completion record
151
+
152
+ paper/ Written output
153
+ paper.md Assembled paper
154
+ references.bib Bibliography
155
+ ```
156
+
157
+ ## Common Workflows
158
+
159
+ **Resuming after a break:**
160
+ ```
161
+ /wtfp:progress
162
+ ```
163
+
164
+ **Reviving a stalled project:**
165
+ ```
166
+ /wtfp:map-project
167
+ /wtfp:new-paper
168
+ ```
169
+
170
+ **Handling reviewer comments:**
171
+ ```
172
+ /wtfp:plan-revision 02-01
173
+ /wtfp:write-section .planning/sections/02-methods/02-01-PLAN.md
174
+ ```
175
+
176
+ ## Getting Help
177
+
178
+ - `/wtfp:progress` — See where you are and what to do next
179
+ - `/wtfp:report-bug` — Report a bug
180
+ - `/wtfp:request-feature` — Request a feature
181
+ - GitHub: https://github.com/akougkas/wtf-p
182
+ </reference>
183
+ </process>
184
+ '''