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
@@ -1,21 +1,16 @@
1
1
  ---
2
2
  name: wtfp:create-outline
3
- description: Create document outline, section roadmap, and state tracking
3
+ description: Build section outline, argument map, and word budgets
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash
7
7
  - Write
8
+ - Glob
9
+ - Grep
10
+ - Task
8
11
  - AskUserQuestion
9
12
  ---
10
13
 
11
- <objective>
12
- Create the document outline and section roadmap for an initialized paper.
13
-
14
- Creates ROADMAP.md (section breakdown), STATE.md (writing memory), and section directories.
15
-
16
- This establishes the structure before section-by-section planning begins.
17
- </objective>
18
-
19
14
  <execution_context>
20
15
  @~/.claude/write-the-f-paper/workflows/create-outline.md
21
16
  @~/.claude/write-the-f-paper/templates/roadmap.md
@@ -23,221 +18,148 @@ This establishes the structure before section-by-section planning begins.
23
18
  @~/.claude/write-the-f-paper/references/imrad-structure.md
24
19
  </execution_context>
25
20
 
21
+ <objective>
22
+ Create the document outline and section roadmap for an initialized paper.
23
+
24
+ **Orchestrator role:** Validate environment, load project context, resolve model profile, spawn outliner agent to produce structure artifacts, create STATE.md, create section directories, commit, present results.
25
+
26
+ **Why subagent:** Outlining requires significant reasoning about document structure, argument decomposition, and wave assignment. A fresh outliner agent gets peak quality for these creative decisions.
27
+ </objective>
28
+
29
+ <context>
30
+ No arguments. Requires `.planning/PROJECT.md` to exist.
31
+ </context>
32
+
26
33
  <process>
27
34
 
28
- <step name="verify">
29
- **Verify project exists:**
35
+ ## 1. Validate Environment and Resolve Model Profile
30
36
 
31
37
  ```bash
32
- [ ! -f .planning/PROJECT.md ] && echo "ERROR: No project found. Run /wtfp:new-paper first" && exit 1
33
- [ -f .planning/ROADMAP.md ] && echo "ERROR: Outline already exists. Use /wtfp:progress" && exit 1
38
+ [ ! -f .planning/PROJECT.md ] && echo "ERROR: No project. Run /wtfp:new-paper" && exit 1
39
+ [ -f .planning/ROADMAP.md ] && echo "ERROR: Outline exists. Use /wtfp:progress" && exit 1
40
+ ls .planning/ 2>/dev/null
34
41
  ```
35
42
 
36
- </step>
37
-
38
- <step name="load">
39
- **Load project context:**
40
-
41
- - Read `.planning/PROJECT.md` for paper vision, core argument, requirements
42
- - Read `.planning/config.json` for document type and workflow mode
43
- - Read `.planning/structure/outline.md` for initial structure sketch
44
- - Read `.planning/structure/argument-map.md` for logical structure
45
- </step>
46
-
47
- <step name="structure">
48
- **Determine document structure:**
49
-
50
- Based on document type from config.json:
51
-
52
- **Research Paper (IMRaD):**
53
- - Abstract
54
- - Introduction
55
- - Methods (or Materials and Methods)
56
- - Results
57
- - Discussion
58
- - Conclusion (sometimes combined with Discussion)
59
- - References
60
-
61
- **Grant Proposal (NSF-style):**
62
- - Specific Aims
63
- - Background and Significance
64
- - Preliminary Data
65
- - Research Design and Methods
66
- - Timeline
67
- - Budget Justification
68
-
69
- **Grant Proposal (NIH-style):**
70
- - Specific Aims
71
- - Significance
72
- - Innovation
73
- - Approach
74
- - Timeline and Milestones
75
-
76
- **Thesis Chapter:**
77
- - Introduction
78
- - Literature Review
79
- - Methodology
80
- - Results/Findings
81
- - Discussion
82
- - Conclusion
83
-
84
- Use AskUserQuestion if structure needs customization:
85
- - header: "Structure"
86
- - question: "The standard structure for [type] is [list]. Any modifications?"
87
- - options:
88
- - "Use standard structure" — Apply typical [type] structure
89
- - "Customize sections" — I have specific sections in mind
90
- - "Show me options" — What alternatives exist?
91
-
92
- </step>
93
-
94
- <step name="roadmap">
95
- **Create ROADMAP.md:**
96
-
97
- ```markdown
98
- # Document Roadmap
99
-
100
- ## Document: [Paper Title]
101
- ## Type: [Paper Type]
102
- ## Target: [Venue if known]
103
-
104
- ## Sections
105
-
106
- ### 1. [Section Name]
107
- - **Goal:** [What this section accomplishes]
108
- - **Word Target:** [X words]
109
- - **Status:** Not started
110
- - **Dependencies:** [Any prerequisites]
111
-
112
- ### 2. [Section Name]
113
- - **Goal:** [What this section accomplishes]
114
- - **Word Target:** [X words]
115
- - **Status:** Not started
116
- - **Dependencies:** [Section 1 must establish X]
117
-
118
- [... continue for all sections ...]
119
-
120
- ## Progress
121
-
122
- | # | Section | Goal | Words | Status |
123
- |---|---------|------|-------|--------|
124
- | 1 | [Name] | [1-liner] | 0/[target] | - |
125
- | 2 | [Name] | [1-liner] | 0/[target] | - |
126
- | ... | | | | |
127
-
128
- ## Word Budget
129
-
130
- | Section | Target | Current | % |
131
- |---------|--------|---------|---|
132
- | [Name] | [X] | 0 | 0% |
133
- | ... | | | |
134
- | **Total** | **[X]** | **0** | **0%** |
43
+ **Resolve model profile:**
135
44
 
136
- ---
137
- *Last updated: [date] after outline creation*
45
+ ```bash
46
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
138
47
  ```
139
48
 
140
- </step>
49
+ **Model lookup table:**
141
50
 
142
- <step name="state">
143
- **Create STATE.md:**
51
+ | Agent | quality | balanced | budget |
52
+ |-------|---------|----------|--------|
53
+ | outliner | opus | sonnet | sonnet |
144
54
 
145
- ```markdown
146
- # Writing State
55
+ **Resolve gate flag:**
56
+ ```bash
57
+ GATE_CONFIRM_OUTLINE=$(cat .planning/config.json 2>/dev/null | grep -o '"confirm_outline"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
58
+ ```
147
59
 
148
- ## Project Reference
149
- - Project: .planning/PROJECT.md
150
- - Roadmap: .planning/ROADMAP.md
151
- - Config: .planning/config.json
60
+ ## 2. Read Context Files
152
61
 
153
- ## Current Position
154
- - Section: 1 of [total]
155
- - Plan: 0 (not yet planned)
156
- - Status: Ready to plan first section
62
+ ```bash
63
+ PROJECT_CONTENT=$(cat .planning/PROJECT.md)
64
+ CONFIG_CONTENT=$(cat .planning/config.json 2>/dev/null)
65
+ EXISTING_STRUCTURE=$(cat .planning/structure/*.md 2>/dev/null)
66
+ ```
157
67
 
158
- ## Progress
159
- - Sections: 0/[total] complete
160
- - Words: 0/[target] ([0]%)
161
- - Plans executed: 0
68
+ ## 3. Ensure Structure Directory
162
69
 
163
- ## Argument Strength
164
- - Core claim: [from PROJECT.md]
165
- - Supporting claims: [from argument-map.md]
166
- - Evidence status: Not yet written
70
+ ```bash
71
+ mkdir -p .planning/structure
72
+ mkdir -p .planning/sections
73
+ ```
167
74
 
168
- ## Key Decisions
169
- | Decision | Rationale | Section |
170
- |----------|-----------|---------|
75
+ ## 4. Gate Check: Confirm Before Outlining
171
76
 
172
- ## Open Questions
173
- - [Questions from PROJECT.md that need resolution]
77
+ **If GATE_CONFIRM_OUTLINE is "true" (default):**
78
+ Present project summary to user via AskUserQuestion and wait for confirmation before proceeding.
174
79
 
175
- ## Deferred
176
- - [Nothing yet]
80
+ **If GATE_CONFIRM_OUTLINE is "false":**
81
+ Skip confirmation and proceed directly to outlining.
177
82
 
178
- ## Session Continuity
179
- - Last session: [date]
180
- - Handoff: None
83
+ ## 5. Spawn wtfp-outliner Agent
181
84
 
182
- ---
183
- *Living document — updated after each writing session*
85
+ ```
86
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
87
+ WTF-P ► OUTLINING DOCUMENT
88
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
184
89
  ```
185
90
 
186
- </step>
187
-
188
- <step name="directories">
189
- **Create section directories:**
91
+ Fill prompt with inlined content and spawn:
190
92
 
191
- ```bash
192
- mkdir -p .planning/sections
93
+ ```
94
+ Task(
95
+ prompt="First, read ~/.claude/agents/wtfp/outliner.md for your role and instructions.\n\n" + filled_outlining_prompt,
96
+ subagent_type="general-purpose",
97
+ model="{outliner_model}",
98
+ description="Create Document Outline"
99
+ )
193
100
  ```
194
101
 
195
- For each section in ROADMAP.md, create directory:
102
+ Outlining prompt includes: `<project_context>` with PROJECT.md content, config.json settings, any existing structure files.
196
103
 
197
- ```bash
198
- mkdir -p .planning/sections/01-[section-name-slug]
199
- mkdir -p .planning/sections/02-[section-name-slug]
200
- # ... for all sections
201
- ```
104
+ ## 6. Handle Outliner Return
202
105
 
203
- Use lowercase, hyphenated names (e.g., `01-introduction`, `02-methods`, `03-results`).
106
+ **`## OUTLINING COMPLETE`:** Proceed to STATE.md creation and directory setup.
204
107
 
205
- </step>
108
+ **`## CHECKPOINT REACHED`:** Present to user, get response, re-spawn outliner with decision.
206
109
 
207
- <step name="commit">
208
- **Commit outline:**
110
+ **`## OUTLINING BLOCKED`:** Show blocker, offer options.
209
111
 
210
- ```bash
211
- git add .planning/ROADMAP.md .planning/STATE.md .planning/sections/
212
- git commit -m "$(cat <<'EOF'
213
- docs: create document outline
112
+ ## 7. Post-Outliner Setup
113
+
114
+ After successful outlining, the orchestrator handles:
214
115
 
215
- [N] sections, [X] word target
116
+ **Create STATE.md** using template from `~/.claude/write-the-f-paper/templates/state.md`:
117
+ - Initialize position (section 1 of N), word count (0)
118
+ - Set argument strength from outliner's argument-map
119
+ - Set open questions from PROJECT.md
216
120
 
217
- Sections: [list section names]
218
- EOF
219
- )"
121
+ **Create section directories** from ROADMAP.md sections:
122
+ ```bash
123
+ mkdir -p .planning/sections/01-[section-slug]
124
+ mkdir -p .planning/sections/02-[section-slug]
125
+ # ... for all sections listed in ROADMAP.md
220
126
  ```
221
127
 
222
- </step>
128
+ ## 8. Commit (with commit_docs Guard)
223
129
 
224
- <step name="done">
225
- **Present completion:**
130
+ ```bash
131
+ COMMIT_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
132
+ ```
226
133
 
134
+ **If commit_docs = "true" (default):**
135
+ ```bash
136
+ git add .planning/ROADMAP.md .planning/STATE.md .planning/sections/ .planning/structure/
137
+ git commit -m "docs: create document outline -- [N] sections, [X] words target"
227
138
  ```
228
- Outline created:
229
139
 
230
- - Roadmap: .planning/ROADMAP.md ([N] sections, [X] words target)
140
+ **If commit_docs = "false":**
141
+ Skip git add and commit for planning docs. Log: "Skipping planning docs commit (commit_docs: false)"
142
+
143
+ ## 9. Present Final Status
144
+
145
+ </process>
146
+
147
+ <offer_next>
148
+
149
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
150
+ WTF-P ► OUTLINE CREATED ✓
151
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
152
+
153
+ - Roadmap: .planning/ROADMAP.md ([N] sections, [X] words)
231
154
  - State: .planning/STATE.md
155
+ - Structure: .planning/structure/ (outline, argument-map, narrative-arc)
232
156
  - Sections: .planning/sections/ ([N] directories)
233
157
 
234
- ## Section Structure
235
-
236
- | # | Section | Words |
237
- |---|---------|-------|
158
+ | # | Section | Words | Wave |
159
+ |---|---------|-------|------|
238
160
  [table from ROADMAP.md]
239
161
 
240
- ---
162
+ ───────────────────────────────────────────
241
163
 
242
164
  ## ▶ Next Up
243
165
 
@@ -247,29 +169,21 @@ Outline created:
247
169
 
248
170
  <sub>`/clear` first → fresh context window</sub>
249
171
 
250
- ---
172
+ ───────────────────────────────────────────
251
173
 
252
174
  **Also available:**
253
175
  - `/wtfp:discuss-section 1` — gather context first
254
176
  - `/wtfp:research-gap 1` — investigate literature needs
177
+ - `/wtfp:execute-outline` — write all sections in wave-based parallel execution
255
178
 
256
- ---
257
- ```
258
-
259
- </step>
260
-
261
- </process>
262
-
263
- <output>
264
- - `.planning/ROADMAP.md`
265
- - `.planning/STATE.md`
266
- - `.planning/sections/XX-name/` directories
267
- </output>
179
+ </offer_next>
268
180
 
269
181
  <success_criteria>
270
- - [ ] ROADMAP.md has all sections with goals and word targets
182
+ - [ ] Outliner agent spawned with full project context
183
+ - [ ] 4 artifacts created (outline.md, argument-map.md, narrative-arc.md, ROADMAP.md)
271
184
  - [ ] STATE.md initialized with correct position
272
185
  - [ ] Section directories created
273
186
  - [ ] Word budget totals match target
274
187
  - [ ] All committed to git
188
+ - [ ] User knows next steps
275
189
  </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:create-poster
3
- description: Full workflow for creating an academic poster from project content
3
+ description: Generate academic poster from paper content
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Write
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:create-slides
3
- description: Full workflow for creating presentation slides from project content
3
+ description: Generate presentation slides from paper content
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Write
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:discuss-section
3
- description: Gather section context through adaptive questioning before planning
3
+ description: Discuss your vision for a section before planning it
4
4
  argument-hint: "[section-number]"
5
5
  allowed-tools:
6
6
  - Read
@@ -0,0 +1,257 @@
1
+ ---
2
+ name: wtfp:execute-outline
3
+ description: Write all sections in parallel, then check coherence
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Write
8
+ - Edit
9
+ - Glob
10
+ - Grep
11
+ - Task
12
+ - AskUserQuestion
13
+ ---
14
+
15
+ <execution_context>
16
+ @~/.claude/write-the-f-paper/workflows/execute-outline.md
17
+ @~/.claude/write-the-f-paper/references/checkpoints.md
18
+ @~/.claude/write-the-f-paper/references/ui-brand.md
19
+ </execution_context>
20
+
21
+ <objective>
22
+ Execute all sections of a paper in wave-based parallel execution, then verify cross-section coherence.
23
+
24
+ **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.
25
+
26
+ **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.
27
+ </objective>
28
+
29
+ <context>
30
+ No arguments. Requires `.planning/ROADMAP.md` and PLAN.md files to exist.
31
+ </context>
32
+
33
+ <process>
34
+
35
+ ## 1. Validate Environment and Resolve Model Profile
36
+
37
+ ```bash
38
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No outline. Run /wtfp:create-outline" && exit 1
39
+ ls .planning/sections/*/ 2>/dev/null
40
+ ls .planning/sections/*/*-PLAN.md 2>/dev/null
41
+ ```
42
+
43
+ **Resolve model profile:**
44
+
45
+ ```bash
46
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
47
+ ```
48
+
49
+ **Model lookup table:**
50
+
51
+ | Agent | quality | balanced | budget |
52
+ |-------|---------|----------|--------|
53
+ | section-writer | opus | sonnet | sonnet |
54
+ | coherence-checker | sonnet | sonnet | haiku |
55
+
56
+ **Resolve config flags:**
57
+ ```bash
58
+ WORKFLOW_VERIFIER=$(cat .planning/config.json 2>/dev/null | grep -o '"verifier"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
59
+ ```
60
+
61
+ ## 2. Read Context Files
62
+
63
+ ```bash
64
+ ROADMAP_CONTENT=$(cat .planning/ROADMAP.md)
65
+ STATE_CONTENT=$(cat .planning/STATE.md)
66
+ PROJECT_CONTENT=$(cat .planning/PROJECT.md)
67
+ ARGMAP_CONTENT=$(cat .planning/structure/argument-map.md 2>/dev/null)
68
+ OUTLINE_CONTENT=$(cat .planning/structure/outline.md 2>/dev/null)
69
+ NARRATIVE_CONTENT=$(cat .planning/structure/narrative-arc.md 2>/dev/null)
70
+ ```
71
+
72
+ ## 3. Build Wave Execution Plan
73
+
74
+ Parse ROADMAP.md and all PLAN.md files to build wave groups:
75
+
76
+ ```bash
77
+ # Find all plans and their wave assignments
78
+ for plan in .planning/sections/*/*-PLAN.md; do
79
+ section=$(basename $(dirname "$plan"))
80
+ wave=$(grep -o 'wave:.*' "$plan" | head -1)
81
+ echo "$wave $section $plan"
82
+ done | sort
83
+ ```
84
+
85
+ Group sections by wave number:
86
+ - Wave 1: [sections with wave: 1] (independent, no dependencies)
87
+ - Wave 2: [sections with wave: 2] (depend on wave 1)
88
+ - ...
89
+ - Wave N: [final sections] (depend on all previous)
90
+
91
+ Present execution plan:
92
+
93
+ ```
94
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
+ WTF-P ► EXECUTING OUTLINE
96
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
97
+
98
+ Execution plan:
99
+ Wave 1: [sections] (parallel)
100
+ Wave 2: [sections] (after wave 1)
101
+ Wave 3: [sections] (after wave 2)
102
+ ...
103
+
104
+ Total: [N] sections, [W] words target
105
+ ```
106
+
107
+ ## 4. Wave Execution Loop
108
+
109
+ For each wave (1 to max_wave):
110
+
111
+ **4a. Display wave banner:**
112
+ ```
113
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
114
+ WTF-P ► WRITING WAVE {N}
115
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
116
+ ```
117
+
118
+ **4b. Spawn parallel writers:**
119
+
120
+ For each section in the current wave, for each PLAN.md in that section:
121
+
122
+ ```
123
+ Task(
124
+ prompt="First, read ~/.claude/agents/wtfp/section-writer.md for your role and instructions.\n\n" + filled_writing_prompt,
125
+ subagent_type="general-purpose",
126
+ model="{writer_model}",
127
+ description="Write Section {X}: {Name}"
128
+ )
129
+ ```
130
+
131
+ Sections within the same wave are spawned in parallel (multiple Task() calls).
132
+
133
+ **4c. Collect all returns:**
134
+
135
+ For each completed writer, check return:
136
+ - `## WRITING COMPLETE` -- Record success, update STATE.md
137
+ - `## CHECKPOINT REACHED` -- Queue for user presentation
138
+ - `## WRITING BLOCKED` -- Queue for user presentation
139
+
140
+ **4d. Handle checkpoints between waves:**
141
+
142
+ If any CHECKPOINT returns from this wave:
143
+ - Present each checkpoint to user sequentially
144
+ - Get user response for each
145
+ - If checkpoint was blocking and user provides direction, note for re-execution
146
+
147
+ If any BLOCKED returns:
148
+ - Present blocker to user
149
+ - Options: retry section, skip section (continue to next wave without it), abort execution
150
+
151
+ **4e. Update progress:**
152
+
153
+ ```bash
154
+ # Update STATE.md with wave completion
155
+ # Update ROADMAP.md section statuses
156
+ ```
157
+
158
+ **4f. Continue to next wave** (only if all sections in current wave are COMPLETE or user chose to skip blocked ones).
159
+
160
+ ## 5. Post-Execution Summary
161
+
162
+ After all waves complete:
163
+
164
+ ```
165
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
166
+ WTF-P ► ALL WAVES COMPLETE
167
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
168
+
169
+ Sections written: [N]/[total]
170
+ Words written: [W]
171
+ Skipped: [list if any]
172
+ ```
173
+
174
+ ## 6. Spawn wtfp-coherence-checker
175
+
176
+ After the final wave, spawn coherence-checker with explicit inline context:
177
+
178
+ ```
179
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
180
+ WTF-P ► VERIFYING COHERENCE
181
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
182
+ ```
183
+
184
+ Read all written content:
185
+ ```bash
186
+ ALL_PAPER_CONTENT=$(cat paper/*.md 2>/dev/null)
187
+ ```
188
+
189
+ Spawn with inline context (NOT file references -- provide actual content):
190
+
191
+ ```
192
+ Task(
193
+ prompt="First, read ~/.claude/agents/wtfp/coherence-checker.md for your role and instructions.\n\n" +
194
+ "<paper_content>\n" + ALL_PAPER_CONTENT + "\n</paper_content>\n" +
195
+ "<argument_map>\n" + ARGMAP_CONTENT + "\n</argument_map>\n" +
196
+ "<narrative_arc>\n" + NARRATIVE_CONTENT + "\n</narrative_arc>\n" +
197
+ "<outline>\n" + OUTLINE_CONTENT + "\n</outline>\n" +
198
+ "Run all 5 verification passes and return structured results.",
199
+ subagent_type="general-purpose",
200
+ model="{checker_model}",
201
+ description="Verify Cross-Section Coherence"
202
+ )
203
+ ```
204
+
205
+ ## 7. Handle Coherence Check Return
206
+
207
+ **`## COHERENT`:** All sections pass. Present success summary.
208
+
209
+ **`## GAPS FOUND`:** Present gaps to user with options:
210
+ - Fix now: Re-spawn writers for affected sections with gap context
211
+ - Accept: Note gaps, proceed to review
212
+ - Plan revision: Create revision plans for affected sections
213
+
214
+ ## 8. Present Final Status
215
+
216
+ </process>
217
+
218
+ <offer_next>
219
+
220
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
221
+ WTF-P ► OUTLINE EXECUTED ✓
222
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
223
+
224
+ **Document: {Title}** — {N} sections, {W} words
225
+
226
+ Coherence: {Verified | Gaps found | Skipped}
227
+
228
+ ───────────────────────────────────────────
229
+
230
+ ## ▶ Next Up
231
+
232
+ **Verify sections** — acceptance testing
233
+
234
+ `/wtfp:verify-work [section]`
235
+
236
+ <sub>`/clear` first → fresh context window</sub>
237
+
238
+ ───────────────────────────────────────────
239
+
240
+ **Also available:**
241
+ - `/wtfp:review-section [N]` — detailed section review
242
+ - `/wtfp:polish-prose [N]` — improve prose quality
243
+ - `/wtfp:submit-draft` — prepare for submission
244
+
245
+ </offer_next>
246
+
247
+ <success_criteria>
248
+ - [ ] Roadmap and plans validated
249
+ - [ ] Wave execution plan built from section dependencies
250
+ - [ ] Parallel writers spawned per wave
251
+ - [ ] All waves executed in order
252
+ - [ ] Checkpoints handled between waves
253
+ - [ ] Coherence-checker spawned after final wave with inline content
254
+ - [ ] Coherence result handled (COHERENT or GAPS FOUND)
255
+ - [ ] STATE.md and ROADMAP.md updated
256
+ - [ ] User knows next steps
257
+ </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:export-latex
3
- description: Export paper to LaTeX format
3
+ description: Export paper to LaTeX with bibliography and formatting
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash