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