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.
- package/README.md +146 -208
- package/bin/commands/doctor.js +88 -2
- package/bin/commands/install-logic.js +127 -36
- package/bin/commands/status.js +22 -4
- package/bin/commands/update.js +5 -4
- package/bin/install.js +66 -26
- package/bin/lib/analyze-impact.js +105 -0
- package/bin/lib/bib-format.js +161 -0
- package/bin/lib/bib-index.js +104 -0
- package/bin/lib/checkpoint.js +183 -0
- package/bin/lib/citation-fetcher.js +299 -0
- package/bin/lib/citation-ranker.js +133 -0
- package/bin/lib/context-primer.js +214 -0
- package/bin/lib/manifest.js +80 -2
- package/bin/lib/scholar-lookup.js +188 -0
- package/bin/lib/semantic-scholar.js +184 -0
- package/bin/lib/utils.js +22 -1
- package/bin/uninstall.js +270 -111
- package/core/write-the-f-paper/references/agent-model-matrix.md +62 -0
- package/core/write-the-f-paper/references/checkpoints.md +160 -9
- package/core/write-the-f-paper/references/context-fidelity.md +153 -0
- package/core/write-the-f-paper/references/deviation-rules.md +150 -0
- package/core/write-the-f-paper/references/git-integration.md +80 -0
- package/core/write-the-f-paper/references/orchestrator-pattern.md +167 -0
- package/core/write-the-f-paper/references/planning-config.md +135 -0
- package/core/write-the-f-paper/references/ui-brand.md +186 -0
- package/core/write-the-f-paper/templates/UAT.md +80 -0
- package/core/write-the-f-paper/templates/base-prefs.yaml +42 -0
- package/core/write-the-f-paper/templates/config.json +31 -5
- package/core/write-the-f-paper/workflows/create-outline.wcn.md +1 -1
- package/core/write-the-f-paper/workflows/execute-outline.md +163 -0
- package/core/write-the-f-paper/workflows/execute-outline.wcn.md +73 -0
- package/core/write-the-f-paper/workflows/execute-section.wcn.md +141 -169
- package/core/write-the-f-paper/workflows/plan-section.wcn.md +96 -103
- package/core/write-the-f-paper/workflows/research-gap.md +27 -3
- package/core/write-the-f-paper/workflows/research-gap.wcn.md +18 -1
- package/core/write-the-f-paper/workflows/verify-work.md +251 -0
- package/core/write-the-f-paper/workflows/verify-work.wcn.md +74 -0
- package/package.json +19 -7
- package/vendors/claude/.claude-plugin/plugin.json +2 -2
- package/vendors/claude/agents/wtfp/argument-verifier.md +189 -0
- package/vendors/claude/agents/wtfp/citation-expert.md +45 -0
- package/vendors/claude/agents/wtfp/citation-formatter.md +42 -0
- package/vendors/claude/agents/wtfp/coherence-checker.md +167 -0
- package/vendors/claude/agents/wtfp/outliner.md +259 -0
- package/vendors/claude/agents/wtfp/plan-checker.md +249 -0
- package/vendors/claude/agents/wtfp/prose-polisher.md +166 -0
- package/vendors/claude/agents/wtfp/research-synthesizer.md +215 -0
- package/vendors/claude/agents/wtfp/section-planner.md +364 -0
- package/vendors/claude/agents/wtfp/section-reviewer.md +182 -0
- package/vendors/claude/agents/wtfp/section-writer.md +312 -0
- package/vendors/claude/commands/wtfp/add-todo.md +108 -0
- package/vendors/claude/commands/wtfp/analyze-bib.md +60 -249
- package/vendors/claude/commands/wtfp/audit-milestone.md +286 -0
- package/vendors/claude/commands/wtfp/check-refs.md +60 -131
- package/vendors/claude/commands/wtfp/check-todos.md +152 -0
- package/vendors/claude/commands/wtfp/checkpoint.md +105 -0
- package/vendors/claude/commands/wtfp/contribute.md +1 -1
- package/vendors/claude/commands/wtfp/create-outline.md +109 -195
- package/vendors/claude/commands/wtfp/create-poster.md +1 -1
- package/vendors/claude/commands/wtfp/create-slides.md +1 -1
- package/vendors/claude/commands/wtfp/discuss-section.md +1 -1
- package/vendors/claude/commands/wtfp/execute-outline.md +257 -0
- package/vendors/claude/commands/wtfp/export-latex.md +1 -1
- package/vendors/claude/commands/wtfp/help.md +174 -280
- package/vendors/claude/commands/wtfp/insert-section.md +1 -1
- package/vendors/claude/commands/wtfp/list-assumptions.md +1 -1
- package/vendors/claude/commands/wtfp/map-project.md +35 -124
- package/vendors/claude/commands/wtfp/new-paper.md +88 -362
- package/vendors/claude/commands/wtfp/pause-writing.md +1 -1
- package/vendors/claude/commands/wtfp/plan-milestone-gaps.md +255 -0
- package/vendors/claude/commands/wtfp/plan-revision.md +1 -1
- package/vendors/claude/commands/wtfp/plan-section.md +165 -190
- package/vendors/claude/commands/wtfp/polish-prose.md +66 -118
- package/vendors/claude/commands/wtfp/progress.md +82 -254
- package/vendors/claude/commands/wtfp/quick.md +107 -0
- package/vendors/claude/commands/wtfp/remove-section.md +1 -1
- package/vendors/claude/commands/wtfp/report-bug.md +1 -1
- package/vendors/claude/commands/wtfp/request-feature.md +1 -1
- package/vendors/claude/commands/wtfp/research-gap.md +138 -151
- package/vendors/claude/commands/wtfp/resume-writing.md +1 -1
- package/vendors/claude/commands/wtfp/review-section.md +55 -333
- package/vendors/claude/commands/wtfp/settings.md +197 -0
- package/vendors/claude/commands/wtfp/submit-milestone.md +248 -99
- package/vendors/claude/commands/wtfp/update.md +112 -0
- package/vendors/claude/commands/wtfp/verify-work.md +254 -0
- package/vendors/claude/commands/wtfp/write-section.md +144 -180
- package/vendors/claude/mcp/research-server/package.json +13 -0
- package/vendors/claude/mcp/research-server/src/index.js +133 -0
- package/vendors/gemini/agents/wtfp/argument-verifier.md +184 -0
- package/vendors/gemini/agents/wtfp/citation-expert.md +41 -0
- package/vendors/gemini/agents/wtfp/citation-formatter.md +38 -0
- package/vendors/gemini/agents/wtfp/coherence-checker.md +162 -0
- package/vendors/gemini/agents/wtfp/outliner.md +252 -0
- package/vendors/gemini/agents/wtfp/plan-checker.md +244 -0
- package/vendors/gemini/agents/wtfp/prose-polisher.md +158 -0
- package/vendors/gemini/agents/wtfp/research-synthesizer.md +205 -0
- package/vendors/gemini/agents/wtfp/section-planner.md +355 -0
- package/vendors/gemini/agents/wtfp/section-reviewer.md +175 -0
- package/vendors/gemini/agents/wtfp/section-writer.md +304 -0
- package/vendors/gemini/commands/wtfp/add-todo.toml +102 -0
- package/vendors/gemini/commands/wtfp/analyze-bib.toml +126 -0
- package/vendors/gemini/commands/wtfp/audit-milestone.toml +278 -0
- package/vendors/gemini/commands/wtfp/check-refs.toml +123 -0
- package/vendors/gemini/commands/wtfp/check-todos.toml +145 -0
- package/vendors/gemini/commands/wtfp/checkpoint.toml +96 -0
- package/vendors/gemini/commands/wtfp/contribute.toml +269 -0
- package/vendors/gemini/commands/wtfp/create-outline.toml +180 -0
- package/vendors/gemini/commands/wtfp/create-poster.toml +36 -0
- package/vendors/gemini/commands/wtfp/create-slides.toml +35 -0
- package/vendors/gemini/commands/wtfp/discuss-section.toml +62 -0
- package/vendors/gemini/commands/wtfp/execute-outline.toml +247 -0
- package/vendors/gemini/commands/wtfp/export-latex.toml +209 -0
- package/vendors/gemini/commands/wtfp/help.toml +184 -0
- package/vendors/gemini/commands/wtfp/insert-section.toml +123 -0
- package/vendors/gemini/commands/wtfp/list-assumptions.toml +104 -0
- package/vendors/gemini/commands/wtfp/map-project.toml +99 -0
- package/vendors/gemini/commands/wtfp/new-paper.toml +160 -0
- package/vendors/gemini/commands/wtfp/pause-writing.toml +140 -0
- package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +249 -0
- package/vendors/gemini/commands/wtfp/plan-revision.toml +171 -0
- package/vendors/gemini/commands/wtfp/plan-section.toml +212 -0
- package/vendors/gemini/commands/wtfp/polish-prose.toml +114 -0
- package/vendors/gemini/commands/wtfp/progress.toml +145 -0
- package/vendors/gemini/commands/wtfp/quick.toml +96 -0
- package/vendors/gemini/commands/wtfp/remove-section.toml +140 -0
- package/vendors/gemini/commands/wtfp/report-bug.toml +126 -0
- package/vendors/gemini/commands/wtfp/request-feature.toml +155 -0
- package/vendors/gemini/commands/wtfp/research-gap.toml +214 -0
- package/vendors/gemini/commands/wtfp/resume-writing.toml +136 -0
- package/vendors/gemini/commands/wtfp/review-section.toml +121 -0
- package/vendors/gemini/commands/wtfp/settings.toml +191 -0
- package/vendors/gemini/commands/wtfp/submit-milestone.toml +351 -0
- package/vendors/gemini/commands/wtfp/update.toml +107 -0
- package/vendors/gemini/commands/wtfp/verify-work.toml +245 -0
- package/vendors/gemini/commands/wtfp/write-section.toml +228 -0
- package/vendors/opencode/agents/wtfp/argument-verifier.md +184 -0
- package/vendors/opencode/agents/wtfp/citation-expert.md +41 -0
- package/vendors/opencode/agents/wtfp/citation-formatter.md +38 -0
- package/vendors/opencode/agents/wtfp/coherence-checker.md +162 -0
- package/vendors/opencode/agents/wtfp/outliner.md +252 -0
- package/vendors/opencode/agents/wtfp/plan-checker.md +244 -0
- package/vendors/opencode/agents/wtfp/prose-polisher.md +158 -0
- package/vendors/opencode/agents/wtfp/research-synthesizer.md +205 -0
- package/vendors/opencode/agents/wtfp/section-planner.md +355 -0
- package/vendors/opencode/agents/wtfp/section-reviewer.md +175 -0
- package/vendors/opencode/agents/wtfp/section-writer.md +304 -0
- package/vendors/opencode/commands/wtfp/add-todo.md +103 -0
- package/vendors/opencode/commands/wtfp/analyze-bib.md +127 -0
- package/vendors/opencode/commands/wtfp/audit-milestone.md +279 -0
- package/vendors/opencode/commands/wtfp/check-refs.md +124 -0
- package/vendors/opencode/commands/wtfp/check-todos.md +146 -0
- package/vendors/opencode/commands/wtfp/checkpoint.md +97 -0
- package/vendors/opencode/commands/wtfp/contribute.md +266 -0
- package/vendors/opencode/commands/wtfp/create-outline.md +181 -0
- package/vendors/opencode/commands/wtfp/create-poster.md +37 -0
- package/vendors/opencode/commands/wtfp/create-slides.md +36 -0
- package/vendors/opencode/commands/wtfp/discuss-section.md +63 -0
- package/vendors/opencode/commands/wtfp/execute-outline.md +248 -0
- package/vendors/opencode/commands/wtfp/export-latex.md +210 -0
- package/vendors/opencode/commands/wtfp/help.md +185 -0
- package/vendors/opencode/commands/wtfp/insert-section.md +124 -0
- package/vendors/opencode/commands/wtfp/list-assumptions.md +105 -0
- package/vendors/opencode/commands/wtfp/map-project.md +100 -0
- package/vendors/opencode/commands/wtfp/new-paper.md +161 -0
- package/vendors/opencode/commands/wtfp/pause-writing.md +141 -0
- package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +250 -0
- package/vendors/opencode/commands/wtfp/plan-revision.md +174 -0
- package/vendors/opencode/commands/wtfp/plan-section.md +214 -0
- package/vendors/opencode/commands/wtfp/polish-prose.md +115 -0
- package/vendors/opencode/commands/wtfp/progress.md +146 -0
- package/vendors/opencode/commands/wtfp/quick.md +97 -0
- package/vendors/opencode/commands/wtfp/remove-section.md +141 -0
- package/vendors/opencode/commands/wtfp/report-bug.md +127 -0
- package/vendors/opencode/commands/wtfp/request-feature.md +156 -0
- package/vendors/opencode/commands/wtfp/research-gap.md +215 -0
- package/vendors/opencode/commands/wtfp/resume-writing.md +137 -0
- package/vendors/opencode/commands/wtfp/review-section.md +123 -0
- package/vendors/opencode/commands/wtfp/settings.md +192 -0
- package/vendors/opencode/commands/wtfp/submit-milestone.md +352 -0
- package/vendors/opencode/commands/wtfp/update.md +108 -0
- package/vendors/opencode/commands/wtfp/verify-work.md +246 -0
- package/vendors/opencode/commands/wtfp/write-section.md +228 -0
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wtfp:create-outline
|
|
3
|
-
description:
|
|
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
|
-
|
|
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
|
|
33
|
-
[ -f .planning/ROADMAP.md ] && echo "ERROR: Outline
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
49
|
+
**Model lookup table:**
|
|
141
50
|
|
|
142
|
-
|
|
143
|
-
|
|
51
|
+
| Agent | quality | balanced | budget |
|
|
52
|
+
|-------|---------|----------|--------|
|
|
53
|
+
| outliner | opus | sonnet | sonnet |
|
|
144
54
|
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
##
|
|
149
|
-
- Project: .planning/PROJECT.md
|
|
150
|
-
- Roadmap: .planning/ROADMAP.md
|
|
151
|
-
- Config: .planning/config.json
|
|
60
|
+
## 2. Read Context Files
|
|
152
61
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
##
|
|
159
|
-
- Sections: 0/[total] complete
|
|
160
|
-
- Words: 0/[target] ([0]%)
|
|
161
|
-
- Plans executed: 0
|
|
68
|
+
## 3. Ensure Structure Directory
|
|
162
69
|
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
|
|
70
|
+
```bash
|
|
71
|
+
mkdir -p .planning/structure
|
|
72
|
+
mkdir -p .planning/sections
|
|
73
|
+
```
|
|
167
74
|
|
|
168
|
-
##
|
|
169
|
-
| Decision | Rationale | Section |
|
|
170
|
-
|----------|-----------|---------|
|
|
75
|
+
## 4. Gate Check: Confirm Before Outlining
|
|
171
76
|
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
176
|
-
|
|
80
|
+
**If GATE_CONFIRM_OUTLINE is "false":**
|
|
81
|
+
Skip confirmation and proceed directly to outlining.
|
|
177
82
|
|
|
178
|
-
##
|
|
179
|
-
- Last session: [date]
|
|
180
|
-
- Handoff: None
|
|
83
|
+
## 5. Spawn wtfp-outliner Agent
|
|
181
84
|
|
|
182
|
-
|
|
183
|
-
|
|
85
|
+
```
|
|
86
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
87
|
+
WTF-P ► OUTLINING DOCUMENT
|
|
88
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
184
89
|
```
|
|
185
90
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
<step name="directories">
|
|
189
|
-
**Create section directories:**
|
|
91
|
+
Fill prompt with inlined content and spawn:
|
|
190
92
|
|
|
191
|
-
```
|
|
192
|
-
|
|
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
|
-
|
|
102
|
+
Outlining prompt includes: `<project_context>` with PROJECT.md content, config.json settings, any existing structure files.
|
|
196
103
|
|
|
197
|
-
|
|
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
|
-
|
|
106
|
+
**`## OUTLINING COMPLETE`:** Proceed to STATE.md creation and directory setup.
|
|
204
107
|
|
|
205
|
-
|
|
108
|
+
**`## CHECKPOINT REACHED`:** Present to user, get response, re-spawn outliner with decision.
|
|
206
109
|
|
|
207
|
-
|
|
208
|
-
**Commit outline:**
|
|
110
|
+
**`## OUTLINING BLOCKED`:** Show blocker, offer options.
|
|
209
111
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
docs: create document outline
|
|
112
|
+
## 7. Post-Outliner Setup
|
|
113
|
+
|
|
114
|
+
After successful outlining, the orchestrator handles:
|
|
214
115
|
|
|
215
|
-
|
|
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
|
-
|
|
218
|
-
|
|
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
|
-
|
|
128
|
+
## 8. Commit (with commit_docs Guard)
|
|
223
129
|
|
|
224
|
-
|
|
225
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
- [ ]
|
|
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>
|
|
@@ -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>
|