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,250 @@
1
+ ---
2
+ name: wtfp:plan-milestone-gaps
3
+ description: Create fix plans for gaps found by audit-milestone
4
+ ---
5
+
6
+ <objective>
7
+ Read MILESTONE-AUDIT.md and create targeted fix plans for each gap.
8
+
9
+ Each gap becomes a fix plan in the appropriate section directory.
10
+ Plans follow the standard plan-format.md structure.
11
+ User can execute fix plans with existing writing commands.
12
+ </objective>
13
+
14
+ <process>
15
+
16
+ <step name="validate">
17
+ **Step 1: Validate Audit Exists**
18
+
19
+ ```bash
20
+ [ ! -f .planning/MILESTONE-AUDIT.md ] && echo "ERROR: No MILESTONE-AUDIT.md found. Run /wtfp:audit-milestone first." && exit 1
21
+ ```
22
+
23
+ </step>
24
+
25
+ <step name="banner">
26
+ **Step 2: Display Banner**
27
+
28
+ ```
29
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30
+ WTF-P ► PLANNING GAP FIXES
31
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
32
+
33
+ Reading MILESTONE-AUDIT.md...
34
+ ```
35
+
36
+ </step>
37
+
38
+ <step name="parse_audit">
39
+ **Step 3: Parse MILESTONE-AUDIT.md**
40
+
41
+ Read `.planning/MILESTONE-AUDIT.md`.
42
+
43
+ Extract all gaps (sections under "## Gaps" with "Status: gap"):
44
+ - Gap name (check name)
45
+ - Finding (what's missing)
46
+ - Affected (sections/claims/files)
47
+ - Recommendation (what to do)
48
+
49
+ If no gaps found (Overall: PASS):
50
+ ```
51
+ No gaps found in audit. Paper is ready for submission.
52
+ Run /wtfp:submit-milestone {version} to archive.
53
+ ```
54
+ Exit early.
55
+
56
+ </step>
57
+
58
+ <step name="classify_gaps">
59
+ **Step 4: Classify Gaps by Fix Type**
60
+
61
+ For each gap, determine fix type:
62
+
63
+ | Gap Type | Fix Type | Action |
64
+ |----------|----------|--------|
65
+ | Section incomplete | section-write | Generate writing plan for incomplete section |
66
+ | Argument not covered | targeted-write | Generate task to address specific claim in relevant section |
67
+ | Word count over | revision-trim | Generate revision task to reduce word count |
68
+ | Word count under | revision-expand | Generate revision task to expand content |
69
+ | Citation undefined | citation-fix | Generate task to add missing citation |
70
+ | Citation uncited | citation-fix | Generate task to cite or remove reference |
71
+ | Section unreviewed | review-route | Route to /wtfp:review-section |
72
+
73
+ </step>
74
+
75
+ <step name="group_gaps">
76
+ **Step 5: Group Related Gaps**
77
+
78
+ Group gaps that affect the same section:
79
+ - Multiple issues in Section 2 -> one fix plan for Section 2
80
+ - Word count + argument issues in same section -> combined plan
81
+
82
+ Create plan groupings:
83
+ ```
84
+ PLAN_1: Section 02 - {word count issue, argument issue}
85
+ PLAN_2: Section 04 - {incomplete}
86
+ PLAN_3: Citations - {undefined citations across multiple sections}
87
+ ```
88
+
89
+ </step>
90
+
91
+ <step name="generate_plans">
92
+ **Step 6: Generate Fix Plans**
93
+
94
+ For each grouped plan, create a fix plan file.
95
+
96
+ **Location:** `.planning/sections/XX-name/{section}-fix-{N}-PLAN.md`
97
+
98
+ **Plan structure (following plan-format.md):**
99
+
100
+ ```markdown
101
+ ---
102
+ section: {section-number}
103
+ plan: fix-{N}
104
+ type: revision
105
+ depends_on: []
106
+ files_modified:
107
+ - {paper content file}
108
+ autonomous: true
109
+ ---
110
+
111
+ <objective>
112
+ Fix {N} gap(s) identified in milestone audit:
113
+ - {gap 1 summary}
114
+ - {gap 2 summary}
115
+
116
+ Purpose: Address audit findings before submission.
117
+ </objective>
118
+
119
+ <context>
120
+ @.planning/MILESTONE-AUDIT.md
121
+ @.planning/sections/XX-name/{relevant summaries}
122
+ @{paper content file}
123
+ </context>
124
+
125
+ <tasks>
126
+
127
+ <task type="auto">
128
+ <name>{fix task name}</name>
129
+ <files>
130
+ {file to modify}
131
+ </files>
132
+ <action>
133
+ {Specific fix instructions based on gap type:}
134
+
135
+ **For section incomplete:**
136
+ Complete the section draft following the outline.
137
+ - Address all planned subsections
138
+ - Meet word target: {X} words
139
+ - Include required citations
140
+
141
+ **For argument not covered:**
142
+ Add content to address claim: "{claim}"
143
+ - Insert in section: {section}
144
+ - Location: {suggested location}
145
+ - Approximate addition: {X} words
146
+
147
+ **For word count over:**
148
+ Reduce word count in {section} by {N} words.
149
+ - Current: {X} words
150
+ - Target: {Y} words
151
+ - Suggested cuts: {areas}
152
+
153
+ **For word count under:**
154
+ Expand content in {section} by {N} words.
155
+ - Current: {X} words
156
+ - Target: {Y} words
157
+ - Suggested expansions: {areas}
158
+
159
+ **For citation undefined:**
160
+ Add citation for: {key}
161
+ - Add to bibliography file
162
+ - Verify citation format matches style guide
163
+
164
+ **For citation uncited:**
165
+ Either cite or remove: {key}
166
+ - If relevant: add citation in appropriate section
167
+ - If not relevant: remove from bibliography
168
+ </action>
169
+ <verify>
170
+ {Verification for fix type:}
171
+
172
+ For section: Word count meets target, all subsections complete.
173
+ For argument: Claim is now addressed in text.
174
+ For word count: Section is within +/- 15% of target.
175
+ For citation: Citation resolves correctly.
176
+ </verify>
177
+ <done>
178
+ {Done criteria: Gap resolved per audit check}
179
+ </done>
180
+ </task>
181
+
182
+ </tasks>
183
+
184
+ <verification>
185
+ - Gap addressed per MILESTONE-AUDIT.md finding
186
+ - No new issues introduced
187
+ </verification>
188
+
189
+ <success_criteria>
190
+ - [ ] {Gap 1} resolved
191
+ - [ ] {Gap 2} resolved
192
+ </success_criteria>
193
+ ```
194
+
195
+ **For unreviewed sections (review-route):**
196
+
197
+ Don't generate a fix plan. Instead, note:
198
+ ```
199
+ Section {X} needs review. Run: /wtfp:review-section {section}
200
+ ```
201
+
202
+ </step>
203
+
204
+ <step name="summary">
205
+ **Step 7: Present Summary**
206
+
207
+ ```
208
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
209
+ WTF-P ► GAP PLANS CREATED ✓
210
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
211
+
212
+ Plans created: {N}
213
+
214
+ | Plan | Section | Gaps Addressed |
215
+ |------|---------|----------------|
216
+ | {path} | {section} | {gap list} |
217
+ | {path} | {section} | {gap list} |
218
+
219
+ {If any review-route gaps:}
220
+ Sections needing review (no plan created):
221
+ - Section {X}: Run `/wtfp:review-section {section}`
222
+
223
+ ───────────────────────────────────────────
224
+
225
+ ## Next Up
226
+
227
+ Execute fix plans:
228
+ `/wtfp:write-section {path-to-fix-plan}`
229
+
230
+ Or fix one at a time:
231
+ Read the plan, then execute tasks manually
232
+
233
+ After all fixes:
234
+ `/wtfp:audit-milestone` - Re-run audit to verify
235
+
236
+ ───────────────────────────────────────────
237
+ ```
238
+
239
+ </step>
240
+
241
+ </process>
242
+
243
+ <success_criteria>
244
+ - [ ] MILESTONE-AUDIT.md parsed successfully
245
+ - [ ] Gaps classified by fix type
246
+ - [ ] Related gaps grouped by section
247
+ - [ ] Fix plans created for each gap group
248
+ - [ ] Plans follow plan-format.md structure
249
+ - [ ] User knows which plans to execute next
250
+ </success_criteria>
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: wtfp:plan-revision
3
+ description: Create revision plan from review issues
4
+ ---
5
+
6
+ <objective>
7
+ Create targeted revision plan from review issues.
8
+
9
+ Reads ISSUES.md and creates a REVISION.md plan to address identified problems.
10
+
11
+ Prioritizes blockers, then major issues, then minor issues.
12
+ </objective>
13
+
14
+ <execution_context>
15
+ @~/.opencode/write-the-f-paper/workflows/plan-section.md
16
+ @~/.opencode/write-the-f-paper/references/plan-format.md
17
+ </execution_context>
18
+
19
+ <process>
20
+
21
+ <step name="verify">
22
+ **Verify issues exist:**
23
+
24
+ ```bash
25
+ ISSUES_FILE=".planning/sections/[section-dir]/$ARGUMENTS-ISSUES.md"
26
+ [ ! -f "$ISSUES_FILE" ] && echo "ERROR: No issues file found at $ISSUES_FILE" && exit 1
27
+ ```
28
+
29
+ </step>
30
+
31
+ <step name="load">
32
+ **Load context:**
33
+
34
+ - Read the ISSUES.md file
35
+ - Read original PLAN.md for context
36
+ - Read SUMMARY.md for what was written
37
+ - Read the actual section content (paper/[section].md)
38
+ - Read PROJECT.md for requirements reference
39
+ </step>
40
+
41
+ <step name="triage">
42
+ **Triage issues:**
43
+
44
+ Group by severity:
45
+ - **Blockers:** Must fix before submission
46
+ - **Major:** Should fix, impacts quality
47
+ - **Minor:** Nice to fix if time allows
48
+
49
+ Use the question tool:
50
+ - header: "Revision Scope"
51
+ - question: "Which issues should we address?"
52
+ - options:
53
+ - "Blockers only" — Fix critical issues
54
+ - "Blockers + Major" — Fix important issues
55
+ - "All issues" — Comprehensive revision
56
+ - "Let me select" — I'll specify which
57
+
58
+ </step>
59
+
60
+ <step name="create_revision">
61
+ **Create REVISION.md:**
62
+
63
+ ```markdown
64
+ ---
65
+ section: XX-name
66
+ plan: YY-REVISION
67
+ issues_addressed: [list of issue IDs]
68
+ ---
69
+
70
+ <objective>
71
+ Address review issues from [section] verification.
72
+
73
+ Fixes: [N] issues ([blockers] blockers, [major] major, [minor] minor)
74
+ </objective>
75
+
76
+ <execution_context>
77
+ @~/.opencode/write-the-f-paper/workflows/execute-section.md
78
+ </execution_context>
79
+
80
+ <context>
81
+ @.planning/sections/XX-name/XX-YY-ISSUES.md
82
+ @.planning/sections/XX-name/XX-YY-SUMMARY.md
83
+ @paper/[section].md
84
+ </context>
85
+
86
+ <tasks>
87
+
88
+ <task type="auto">
89
+ <name>Fix [ISSUE-ID]: [description]</name>
90
+ <issue>[Full issue description]</issue>
91
+ <location>[Where in document]</location>
92
+ <action>
93
+ [Specific fix instructions]
94
+ </action>
95
+ <verify>
96
+ - [ ] Issue resolved
97
+ - [ ] No new issues introduced
98
+ </verify>
99
+ </task>
100
+
101
+ [... task per issue ...]
102
+
103
+ </tasks>
104
+
105
+ <verification>
106
+ - [ ] All addressed issues resolved
107
+ - [ ] No regression in other checks
108
+ - [ ] Word count still within target
109
+ </verification>
110
+
111
+ <success_criteria>
112
+ - [ ] [N] issues fixed
113
+ - [ ] Section passes re-verification
114
+ </success_criteria>
115
+
116
+ <output>
117
+ - Updated paper/[section].md
118
+ - REVISION-SUMMARY.md
119
+ </output>
120
+ ```
121
+
122
+ </step>
123
+
124
+ <step name="commit">
125
+ ```bash
126
+ git add .planning/sections/XX-name/XX-YY-REVISION.md
127
+ git commit -m "$(cat <<'EOF'
128
+ plan(XX-YY): revision plan
129
+
130
+ Addresses: [N] issues
131
+ Scope: [blockers/major/all]
132
+ EOF
133
+ )"
134
+ ```
135
+
136
+ </step>
137
+
138
+ <step name="done">
139
+ **Present completion:**
140
+
141
+ ```
142
+ Revision plan created:
143
+
144
+ - Plan: .planning/sections/XX-name/XX-YY-REVISION.md
145
+ - Issues addressed: [N]
146
+ - Scope: [blockers/major/all]
147
+
148
+ ## Issues to Fix
149
+ [List of issues]
150
+
151
+ ---
152
+
153
+ ## ▶ Next Up
154
+
155
+ **Execute revision** — apply fixes
156
+
157
+ `/wtfp:write-section .planning/sections/XX-name/XX-YY-REVISION.md`
158
+
159
+ <sub>`/clear` first → fresh context window</sub>
160
+
161
+ ---
162
+ ```
163
+
164
+ </step>
165
+
166
+ </process>
167
+
168
+ <success_criteria>
169
+ - [ ] Issues triaged by severity
170
+ - [ ] User selected scope
171
+ - [ ] REVISION.md created with specific fixes
172
+ - [ ] Each issue has a targeted task
173
+ - [ ] Clear verification criteria
174
+ </success_criteria>
@@ -0,0 +1,214 @@
1
+ ---
2
+ name: wtfp:plan-section
3
+ description: Create detailed writing plan for a section (PLAN.md)
4
+ argument-hint: "[section]"
5
+ ---
6
+
7
+ <execution_context>
8
+ @~/.opencode/write-the-f-paper/references/plan-format.md
9
+ @~/.opencode/write-the-f-paper/references/length-estimation.md
10
+ </execution_context>
11
+
12
+ <objective>
13
+ Create executable writing plan with context injection and task breakdown.
14
+
15
+ **Orchestrator role:** Parse arguments, validate section, load context, resolve model profile, spawn section-planner agent, optionally verify plans with plan-checker, iterate until plans pass, present results.
16
+
17
+ **Why subagents:** Planning and verification burn context fast. Fresh agents get peak quality. User sees flow between agents in main context.
18
+ </objective>
19
+
20
+ <context>
21
+ Section number: $ARGUMENTS (optional - auto-detects next unplanned section if not provided)
22
+ </context>
23
+
24
+ <process>
25
+
26
+ ## 1. Validate Environment and Resolve Model Profile
27
+
28
+ ```bash
29
+ ls .planning/ 2>/dev/null
30
+ ```
31
+
32
+ **If not found:** Error - user should run `/wtfp:new-paper` first.
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-planner | opus | opus | sonnet |
45
+ | plan-checker | sonnet | sonnet | haiku |
46
+
47
+ **Resolve gate flag:**
48
+ ```bash
49
+ # Gate: confirm_plan -- skip confirmation if false
50
+ GATE_CONFIRM_PLAN=$(cat .planning/config.json 2>/dev/null | grep -o '"confirm_plan"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
51
+ ```
52
+
53
+ ## 1b. Git Branch Setup
54
+
55
+ ```bash
56
+ BRANCH_STRATEGY=$(cat .planning/config.json 2>/dev/null | grep -o '"branching_strategy"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "none")
57
+ ```
58
+
59
+ **If branching_strategy = "section":**
60
+
61
+ 1. Read section_branch_template from config (default: `wtfp/section-{section}-{slug}`)
62
+ 2. Replace `{section}` with zero-padded section number (e.g., `01`, `02`)
63
+ 3. Replace `{slug}` with slugified section name (lowercase, hyphens)
64
+ 4. Store current branch as base branch for later merge:
65
+ ```bash
66
+ BASE_BRANCH=$(git branch --show-current 2>/dev/null || echo "main")
67
+ echo "$BASE_BRANCH" > .planning/.section_base_branch
68
+ ```
69
+ 5. Create and checkout section branch:
70
+ ```bash
71
+ SECTION_BRANCH_TEMPLATE=$(cat .planning/config.json 2>/dev/null | grep -o '"section_branch_template"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "wtfp/section-{section}-{slug}")
72
+ BRANCH_NAME=$(echo "$SECTION_BRANCH_TEMPLATE" | sed "s/{section}/${SECTION_NUM}/" | sed "s/{slug}/${SECTION_SLUG}/")
73
+ git checkout -b "$BRANCH_NAME"
74
+ ```
75
+ 6. Log: "Created section branch: $BRANCH_NAME"
76
+
77
+ **If branching_strategy = "none" or "submission":** No branch action in plan-section.
78
+
79
+ ## 2. Parse and Normalize Arguments
80
+
81
+ Extract section number from $ARGUMENTS. If no section number, detect next unplanned section from roadmap.
82
+
83
+ ```bash
84
+ ls .planning/sections/*/ 2>/dev/null | head -10
85
+ ```
86
+
87
+ ## 3. Validate Section
88
+
89
+ ```bash
90
+ grep -A5 "Section" .planning/ROADMAP.md 2>/dev/null
91
+ ```
92
+
93
+ Extract section number, name, description.
94
+
95
+ ## 4. Ensure Section Directory and Load CONTEXT.md
96
+
97
+ ```bash
98
+ SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
99
+ CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
100
+ ```
101
+
102
+ **CRITICAL:** Store CONTEXT_CONTENT now. Pass to ALL downstream agents.
103
+
104
+ ## 5. Read Context Files
105
+
106
+ ```bash
107
+ STATE_CONTENT=$(cat .planning/STATE.md)
108
+ ROADMAP_CONTENT=$(cat .planning/ROADMAP.md)
109
+ PROJECT_CONTENT=$(cat .planning/PROJECT.md)
110
+ ARGMAP_CONTENT=$(cat .planning/structure/argument-map.md 2>/dev/null)
111
+ OUTLINE_CONTENT=$(cat .planning/structure/outline.md 2>/dev/null)
112
+ RESEARCH_CONTENT=$(cat "${SECTION_DIR}"/*-RESEARCH.md 2>/dev/null)
113
+ PRIOR_SUMMARIES=$(cat .planning/sections/*/SUMMARY.md 2>/dev/null | head -200)
114
+ ```
115
+
116
+ If RESEARCH.md missing for a literature-heavy section, suggest `/wtfp:research-gap` first.
117
+
118
+ ## 6. Gate Check: Confirm Before Planning
119
+
120
+ **If GATE_CONFIRM_PLAN is "true" (default):**
121
+ Present section context summary to user via the question tool and wait for confirmation before proceeding.
122
+
123
+ **If GATE_CONFIRM_PLAN is "false":**
124
+ Skip confirmation and proceed directly to planning.
125
+
126
+ ## 7. Spawn wtfp-section-planner Agent
127
+
128
+ ```
129
+ ---
130
+ WTF-P > PLANNING SECTION {X}
131
+ ---
132
+ ```
133
+
134
+ Fill prompt with inlined content and spawn:
135
+
136
+ ```
137
+ Task(
138
+ prompt="First, read ~/.opencode/agents/wtfp/section-planner.md for your role and instructions.\n\n" + filled_planning_prompt,
139
+ subagent_type="general-purpose",
140
+ model="{planner_model}",
141
+ description="Plan Section {X}"
142
+ )
143
+ ```
144
+
145
+ Planning prompt includes: `<planning_context>` with STATE, ROADMAP, PROJECT, argument-map, outline, RESEARCH, prior summaries. `<user_decisions>` with CONTEXT_CONTENT. `<output>` with target directory path.
146
+
147
+ ## 8. Handle Planner Return
148
+
149
+ **`## PLANNING COMPLETE`:** Display plan count, proceed to verification check.
150
+
151
+ **`## CHECKPOINT REACHED`:** Present to user, get response.
152
+
153
+ **`## PLANNING INCONCLUSIVE`:** Show what was attempted, offer options.
154
+
155
+ ## 8. Plan-Check-Revise Loop (if enabled)
156
+
157
+ ```bash
158
+ WORKFLOW_PLAN_CHECK=$(cat .planning/config.json 2>/dev/null | grep -o '"plan_check"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
159
+ ```
160
+
161
+ **If plan_check is true:**
162
+
163
+ Read plans for checker:
164
+ ```bash
165
+ PLANS_CONTENT=$(cat "${SECTION_DIR}"/*-PLAN.md 2>/dev/null)
166
+ ```
167
+
168
+ Spawn `wtfp-plan-checker` with plans + ROADMAP + argument-map + CONTEXT.
169
+
170
+ **If VERIFICATION PASSED:** Proceed to done.
171
+
172
+ **If ISSUES FOUND and iteration < 3:** Spawn planner in revision mode with issues. Re-check. Increment iteration.
173
+
174
+ **If iteration >= 3:** Present remaining issues to user with options: force proceed, provide guidance, abandon.
175
+
176
+ ## 9. Present Final Status
177
+
178
+ </process>
179
+
180
+ <offer_next>
181
+
182
+ ---
183
+ WTF-P > SECTION {X} PLANNED
184
+ ---
185
+
186
+ **Section {X}: {Name}** -- {N} plan(s), {W} words target
187
+
188
+ Verification: {Passed | Passed with override | Skipped}
189
+
190
+ ---
191
+
192
+ ## > Next Up
193
+
194
+ **Execute writing** -- run the plan
195
+
196
+ `/wtfp:write-section .planning/sections/XX-name/XX-YY-PLAN.md`
197
+
198
+ <sub>`/clear` first -> fresh context window</sub>
199
+
200
+ ---
201
+
202
+ </offer_next>
203
+
204
+ <success_criteria>
205
+ - [ ] .planning/ directory validated
206
+ - [ ] Section validated against roadmap
207
+ - [ ] CONTEXT.md loaded early and passed to ALL agents
208
+ - [ ] RESEARCH.md auto-loaded if exists
209
+ - [ ] Section-planner spawned with full context
210
+ - [ ] Plans created (PLANNING COMPLETE or CHECKPOINT handled)
211
+ - [ ] Plan-checker spawned (if workflow.plan_check enabled)
212
+ - [ ] Verification passed OR user override OR max iterations
213
+ - [ ] User knows next steps
214
+ </success_criteria>