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.
- package/README.md +146 -226
- package/bin/commands/doctor.js +88 -2
- package/bin/commands/install-logic.js +121 -26
- package/bin/commands/status.js +22 -4
- package/bin/commands/update.js +5 -4
- package/bin/install.js +66 -26
- package/bin/lib/checkpoint.js +183 -0
- package/bin/lib/context-primer.js +214 -0
- package/bin/lib/manifest.js +62 -2
- 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 +1 -1
- package/vendors/claude/agents/wtfp/citation-formatter.md +1 -1
- 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 +58 -236
- package/vendors/claude/commands/wtfp/audit-milestone.md +286 -0
- package/vendors/claude/commands/wtfp/check-refs.md +60 -133
- 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 +85 -320
- 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 -150
- 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/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
- package/vendors/claude/agents/wtfp/citation-retriever.md +0 -31
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wtfp:verify-work
|
|
3
|
+
description: Test a written section against its plan, one check at a time
|
|
4
|
+
argument-hint: "[section-number]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Bash
|
|
8
|
+
- Write
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- AskUserQuestion
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<execution_context>
|
|
15
|
+
@~/.claude/write-the-f-paper/workflows/verify-work.md
|
|
16
|
+
@~/.claude/write-the-f-paper/references/ui-brand.md
|
|
17
|
+
</execution_context>
|
|
18
|
+
|
|
19
|
+
<objective>
|
|
20
|
+
Conversational verification of a written section. Presents one test at a time.
|
|
21
|
+
Persists state in UAT.md that survives /clear.
|
|
22
|
+
|
|
23
|
+
**Orchestrator role:** Load UAT.md (or create from PLAN.md + argument-map),
|
|
24
|
+
present next pending test, record result, update UAT.md, route on completion.
|
|
25
|
+
|
|
26
|
+
**Why no subagent:** Verification is a conversation loop, not a creative task.
|
|
27
|
+
The orchestrator reads artifacts, extracts tests, and guides the user through
|
|
28
|
+
each one. State persists via UAT.md file reads/writes.
|
|
29
|
+
</objective>
|
|
30
|
+
|
|
31
|
+
<context>
|
|
32
|
+
Section: $ARGUMENTS (section number or name)
|
|
33
|
+
</context>
|
|
34
|
+
|
|
35
|
+
<process>
|
|
36
|
+
|
|
37
|
+
## 1. Validate Environment
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
[ ! -f ".planning/PROJECT.md" ] && echo "ERROR: No project initialized. Run /wtfp:new-paper first." && exit 1
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Resolve section from $ARGUMENTS:
|
|
44
|
+
- If numeric (e.g., "3"): find `.planning/sections/03-*`
|
|
45
|
+
- If name (e.g., "methods"): find `.planning/sections/*-methods*`
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
|
|
49
|
+
[ -z "$SECTION_DIR" ] && echo "ERROR: Section '$ARGUMENTS' not found in .planning/sections/" && exit 1
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Verify section was written (SUMMARY.md exists):
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
ls "$SECTION_DIR"/*-SUMMARY.md 2>/dev/null
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If no SUMMARY.md:
|
|
59
|
+
```
|
|
60
|
+
Section has not been written yet. Cannot verify unwritten content.
|
|
61
|
+
|
|
62
|
+
Write it first: /wtfp:write-section [plan-path]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 2. Load or Resume UAT
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
UAT_PATH="$SECTION_DIR/UAT.md"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**If UAT.md exists (resuming):**
|
|
72
|
+
|
|
73
|
+
Read UAT.md. Count tests by status:
|
|
74
|
+
- Total tests
|
|
75
|
+
- Passed (result: pass)
|
|
76
|
+
- Skipped (result: skip)
|
|
77
|
+
- Issues (result: issue)
|
|
78
|
+
- Pending (result: pending)
|
|
79
|
+
|
|
80
|
+
Report:
|
|
81
|
+
```
|
|
82
|
+
Resuming verification for Section [X]: [Name]
|
|
83
|
+
[completed]/[total] tests evaluated ([pending] remaining)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Find the first test with `result: pending` and proceed to step 3.
|
|
87
|
+
|
|
88
|
+
**If UAT.md does not exist (starting fresh):**
|
|
89
|
+
|
|
90
|
+
Derive tests from two sources:
|
|
91
|
+
|
|
92
|
+
**Source 1: PLAN.md success criteria**
|
|
93
|
+
```bash
|
|
94
|
+
cat "$SECTION_DIR"/*-PLAN.md
|
|
95
|
+
```
|
|
96
|
+
Extract each `- [ ]` item from `<success_criteria>`. Each becomes a test tagged `[plan]`.
|
|
97
|
+
|
|
98
|
+
**Source 2: Argument-map claims**
|
|
99
|
+
```bash
|
|
100
|
+
cat .planning/structure/argument-map.md 2>/dev/null
|
|
101
|
+
```
|
|
102
|
+
Find claims assigned to this section. Each becomes a test tagged `[argument-map]`.
|
|
103
|
+
|
|
104
|
+
Write UAT.md:
|
|
105
|
+
|
|
106
|
+
```yaml
|
|
107
|
+
---
|
|
108
|
+
status: testing
|
|
109
|
+
section: [section-dir-name]
|
|
110
|
+
started: [ISO timestamp]
|
|
111
|
+
last_test: 0
|
|
112
|
+
---
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Followed by `## Tests` with all derived tests (numbered, pending), `## Summary` with initial counts, empty `## Gaps`.
|
|
116
|
+
|
|
117
|
+
Report:
|
|
118
|
+
```
|
|
119
|
+
Starting verification for Section [X]: [Name]
|
|
120
|
+
[total] tests derived ([plan-count] from plan, [map-count] from argument-map)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 3. Present Next Test
|
|
124
|
+
|
|
125
|
+
Find the next test with `result: pending`.
|
|
126
|
+
|
|
127
|
+
Display using branded checkpoint box:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
════════════════════════════════════════
|
|
131
|
+
VERIFICATION: Test {N} of {total}
|
|
132
|
+
════════════════════════════════════════
|
|
133
|
+
|
|
134
|
+
Source: {[plan] or [argument-map]}
|
|
135
|
+
|
|
136
|
+
{The criterion or claim being verified}
|
|
137
|
+
|
|
138
|
+
Check: Does this section satisfy the above?
|
|
139
|
+
════════════════════════════════════════
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use AskUserQuestion:
|
|
143
|
+
- header: "Verification"
|
|
144
|
+
- question: "[The criterion or claim text]"
|
|
145
|
+
- options:
|
|
146
|
+
- "Pass - meets criteria"
|
|
147
|
+
- "Skip - not applicable"
|
|
148
|
+
- "Issue - describe the problem"
|
|
149
|
+
|
|
150
|
+
## 4. Record and Continue
|
|
151
|
+
|
|
152
|
+
Update UAT.md with the result:
|
|
153
|
+
- Set `result:` to pass, skip, or issue
|
|
154
|
+
- Set `reason:` to user explanation (empty for pass/skip unless user elaborated)
|
|
155
|
+
- Update `last_test` in frontmatter
|
|
156
|
+
|
|
157
|
+
**If "Issue" selected:**
|
|
158
|
+
|
|
159
|
+
Ask for the problem description (user already selected "Issue" so get details):
|
|
160
|
+
|
|
161
|
+
Then ask for severity:
|
|
162
|
+
|
|
163
|
+
Use AskUserQuestion:
|
|
164
|
+
- header: "Severity"
|
|
165
|
+
- question: "How severe is this issue?"
|
|
166
|
+
- options:
|
|
167
|
+
- "Major - undermines argument, must fix"
|
|
168
|
+
- "Minor - weakens but doesn't invalidate"
|
|
169
|
+
- "Cosmetic - polish issue, fix during final pass"
|
|
170
|
+
|
|
171
|
+
Add to `## Gaps` section:
|
|
172
|
+
```markdown
|
|
173
|
+
- claim: "[criterion or claim text]"
|
|
174
|
+
status: issue
|
|
175
|
+
reason: "[user's description]"
|
|
176
|
+
severity: [major|minor|cosmetic]
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Write UAT.md to disk** after each result (persistence).
|
|
180
|
+
|
|
181
|
+
**If more pending tests:** Return to step 3.
|
|
182
|
+
|
|
183
|
+
**If all tests evaluated:** Proceed to step 5.
|
|
184
|
+
|
|
185
|
+
## 5. Route on Completion
|
|
186
|
+
|
|
187
|
+
Set `status: complete` in UAT.md frontmatter. Calculate final counts.
|
|
188
|
+
|
|
189
|
+
**If no issues (all pass/skip):**
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
193
|
+
WTF-P ► VERIFICATION PASSED
|
|
194
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
195
|
+
|
|
196
|
+
Section [X]: [Name]
|
|
197
|
+
Tests: [passed] passed, [skipped] skipped, 0 issues
|
|
198
|
+
|
|
199
|
+
───────────────────────────────────────────
|
|
200
|
+
|
|
201
|
+
## ▶ Next Up
|
|
202
|
+
|
|
203
|
+
**Check progress** — see overall paper status
|
|
204
|
+
|
|
205
|
+
`/wtfp:progress`
|
|
206
|
+
|
|
207
|
+
<sub>`/clear` first → fresh context window</sub>
|
|
208
|
+
|
|
209
|
+
───────────────────────────────────────────
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**If issues found:**
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
216
|
+
WTF-P ► VERIFICATION: ISSUES FOUND
|
|
217
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
218
|
+
|
|
219
|
+
Section [X]: [Name]
|
|
220
|
+
Tests: [passed] passed, [issues] issues, [skipped] skipped
|
|
221
|
+
|
|
222
|
+
## Gap Summary
|
|
223
|
+
|
|
224
|
+
| # | Claim/Criterion | Severity | Reason |
|
|
225
|
+
|---|-----------------|----------|--------|
|
|
226
|
+
| 1 | [text] | major | [reason] |
|
|
227
|
+
| 2 | [text] | minor | [reason] |
|
|
228
|
+
|
|
229
|
+
───────────────────────────────────────────
|
|
230
|
+
|
|
231
|
+
## ▶ Next Up
|
|
232
|
+
|
|
233
|
+
**Plan revision** — create fix plan for identified issues
|
|
234
|
+
|
|
235
|
+
`/wtfp:plan-revision [section]`
|
|
236
|
+
|
|
237
|
+
<sub>`/clear` first → fresh context window</sub>
|
|
238
|
+
|
|
239
|
+
───────────────────────────────────────────
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
</process>
|
|
243
|
+
|
|
244
|
+
<success_criteria>
|
|
245
|
+
- [ ] Section resolved from arguments
|
|
246
|
+
- [ ] SUMMARY.md validated (section was written)
|
|
247
|
+
- [ ] Tests derived from PLAN.md success_criteria AND argument-map.md claims
|
|
248
|
+
- [ ] UAT.md created or resumed
|
|
249
|
+
- [ ] Each test presented one at a time
|
|
250
|
+
- [ ] Results recorded with persistence (survives /clear)
|
|
251
|
+
- [ ] Issues classified by severity
|
|
252
|
+
- [ ] Routes to plan-revision when issues found
|
|
253
|
+
- [ ] Routes to progress when verification passes
|
|
254
|
+
</success_criteria>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wtfp:write-section
|
|
3
|
-
description:
|
|
3
|
+
description: Write a section by executing its plan
|
|
4
4
|
argument-hint: "[path-to-PLAN.md]"
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- Read
|
|
@@ -9,265 +9,229 @@ allowed-tools:
|
|
|
9
9
|
- Edit
|
|
10
10
|
- Glob
|
|
11
11
|
- Grep
|
|
12
|
-
- AskUserQuestion
|
|
13
12
|
- Task
|
|
13
|
+
- AskUserQuestion
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
+
<execution_context>
|
|
17
|
+
@~/.claude/write-the-f-paper/workflows/execute-section.md
|
|
18
|
+
@~/.claude/write-the-f-paper/references/git-integration.md
|
|
19
|
+
</execution_context>
|
|
20
|
+
|
|
16
21
|
<objective>
|
|
17
22
|
Execute a PLAN.md file to write section content.
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
**Orchestrator role:** Validate plan, resolve model profile, read context files, spawn section-writer agent, optionally run argument-verifier post-write, route based on verification, present results.
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
**Why subagents:** Writing burns context fast. Fresh agent gets peak prose quality. Verification in fresh context catches what writer missed.
|
|
22
27
|
</objective>
|
|
23
28
|
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@~/.claude/write-the-f-paper/references/git-integration.md
|
|
28
|
-
</execution_context>
|
|
29
|
+
<context>
|
|
30
|
+
Plan path: $ARGUMENTS (path to a PLAN.md file)
|
|
31
|
+
</context>
|
|
29
32
|
|
|
30
33
|
<process>
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
**Verify plan exists:**
|
|
35
|
+
## 1. Validate Environment and Resolve Model Profile
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
38
|
[ ! -f "$ARGUMENTS" ] && echo "ERROR: Plan not found at $ARGUMENTS" && exit 1
|
|
39
|
+
ls .planning/ 2>/dev/null
|
|
37
40
|
```
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
**Resolve model profile:**
|
|
40
43
|
```bash
|
|
41
|
-
|
|
42
|
-
[ -f "$SUMMARY_PATH" ] && echo "WARNING: This plan already has a SUMMARY.md. Re-executing will overwrite."
|
|
44
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
**Model lookup table:**
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
| Agent | quality | balanced | budget |
|
|
50
|
+
|-------|---------|----------|--------|
|
|
51
|
+
| section-writer | opus | sonnet | sonnet |
|
|
52
|
+
| argument-verifier | sonnet | sonnet | haiku |
|
|
49
53
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
5. Read argument-map.md for relevant claims
|
|
55
|
-
6. Read any prior section content for continuity
|
|
56
|
-
</step>
|
|
57
|
-
|
|
58
|
-
<step name="mode_setup">
|
|
59
|
-
**Configure for writing mode:**
|
|
60
|
-
|
|
61
|
-
Based on `mode` from plan frontmatter:
|
|
54
|
+
**Resolve gate and safety flags:**
|
|
55
|
+
```bash
|
|
56
|
+
# Gate: confirm_write — skip confirmation if false
|
|
57
|
+
GATE_CONFIRM_WRITE=$(cat .planning/config.json 2>/dev/null | grep -o '"confirm_write"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
- Output: Full draft text
|
|
59
|
+
# Safety: always_confirm_destructive — force confirmation for destructive ops
|
|
60
|
+
SAFETY_DESTRUCTIVE=$(cat .planning/config.json 2>/dev/null | grep -o '"always_confirm_destructive"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
61
|
+
```
|
|
67
62
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
-
|
|
63
|
+
Check for existing SUMMARY.md:
|
|
64
|
+
```bash
|
|
65
|
+
SUMMARY_PATH="${ARGUMENTS/PLAN.md/SUMMARY.md}"
|
|
66
|
+
[ -f "$SUMMARY_PATH" ] && echo "WARNING: SUMMARY.md exists. Re-executing will overwrite."
|
|
67
|
+
```
|
|
72
68
|
|
|
73
|
-
|
|
74
|
-
- Prompt user to write section
|
|
75
|
-
- Claude provides feedback after each chunk
|
|
76
|
-
- Output: User's text + Claude's comments
|
|
69
|
+
## 2. Read Context Files
|
|
77
70
|
|
|
78
|
-
|
|
71
|
+
```bash
|
|
72
|
+
PLAN_CONTENT=$(cat "$ARGUMENTS")
|
|
73
|
+
STATE_CONTENT=$(cat .planning/STATE.md)
|
|
74
|
+
PROJECT_CONTENT=$(cat .planning/PROJECT.md)
|
|
75
|
+
ARGMAP_CONTENT=$(cat .planning/structure/argument-map.md 2>/dev/null)
|
|
76
|
+
|
|
77
|
+
# Derive section dir from plan path
|
|
78
|
+
SECTION_DIR=$(dirname "$ARGUMENTS")
|
|
79
|
+
CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
|
|
80
|
+
PRIOR_CONTENT=$(cat paper/*.md 2>/dev/null | head -500)
|
|
81
|
+
```
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
**Execute each task in the plan:**
|
|
83
|
+
## 3. Gate Check: Confirm Before Writing
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
**If GATE_CONFIRM_WRITE is "true" (default) OR SAFETY_DESTRUCTIVE is "true" and SUMMARY.md exists (re-execution is destructive):**
|
|
86
|
+
Present plan summary to user via AskUserQuestion and wait for confirmation before proceeding.
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- **Co-Author:** Write the draft content
|
|
88
|
-
- **Scaffold:** Create detailed outline
|
|
89
|
-
- **Reviewer:** Prompt user to write, then critique
|
|
90
|
-
3. Verify the output meets task criteria
|
|
91
|
-
4. Track word count
|
|
92
|
-
5. Commit after each task (if substantive)
|
|
88
|
+
**If GATE_CONFIRM_WRITE is "false" AND (SAFETY_DESTRUCTIVE is "false" OR no existing SUMMARY.md):**
|
|
89
|
+
Skip confirmation and proceed directly to writing.
|
|
93
90
|
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
git add paper/[section].md # or wherever content lives
|
|
97
|
-
git commit -m "$(cat <<'EOF'
|
|
98
|
-
write(XX-YY): [task description]
|
|
91
|
+
## 4. Spawn wtfp-section-writer Agent
|
|
99
92
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
```
|
|
94
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
95
|
+
WTF-P ► WRITING SECTION
|
|
96
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
103
97
|
```
|
|
104
98
|
|
|
105
|
-
|
|
99
|
+
Fill prompt with inlined content and spawn:
|
|
106
100
|
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
```
|
|
102
|
+
Task(
|
|
103
|
+
prompt="First, read ~/.claude/agents/wtfp/section-writer.md for your role and instructions.\n\n" + filled_writing_prompt,
|
|
104
|
+
subagent_type="general-purpose",
|
|
105
|
+
model="{writer_model}",
|
|
106
|
+
description="Write Section {X}"
|
|
107
|
+
)
|
|
108
|
+
```
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|------|--------|
|
|
112
|
-
| Citation needed but not in sources | Flag, continue, note in SUMMARY |
|
|
113
|
-
| Argument weak | Note in SUMMARY for revision |
|
|
114
|
-
| Word count significantly off | Note in SUMMARY, suggest adjustment |
|
|
115
|
-
| Logical gap discovered | Note in SUMMARY, may need ISSUES.md |
|
|
116
|
-
| Better structure found | Implement if minor, note if major |
|
|
110
|
+
Writing prompt includes: `<plan>` with full PLAN.md content, `<project_context>` with PROJECT + STATE + argument-map, `<user_decisions>` with CONTEXT_CONTENT, `<prior_content>` with existing paper content for continuity.
|
|
117
111
|
|
|
118
|
-
|
|
119
|
-
- Minor prose improvements
|
|
120
|
-
- Citation format fixes
|
|
121
|
-
- Paragraph flow improvements
|
|
112
|
+
## 5. Handle Writer Return
|
|
122
113
|
|
|
123
|
-
|
|
124
|
-
- Missing citations (add to sources/literature.md gap list)
|
|
125
|
-
- Argument weaknesses (ISSUES.md)
|
|
126
|
-
- Structure suggestions beyond plan scope
|
|
127
|
-
</step>
|
|
114
|
+
**`## WRITING COMPLETE`:** Proceed to verification check.
|
|
128
115
|
|
|
129
|
-
|
|
130
|
-
**Write output content:**
|
|
116
|
+
**`## CHECKPOINT REACHED`:** Present to user, get response.
|
|
131
117
|
|
|
132
|
-
|
|
133
|
-
- `paper/[section-name].md` - Markdown section content
|
|
134
|
-
- Or appended to `paper/paper.md` if single-file format
|
|
118
|
+
**`## WRITING BLOCKED`:** Show blocker, offer options.
|
|
135
119
|
|
|
136
|
-
|
|
137
|
-
```markdown
|
|
138
|
-
## [Section Title]
|
|
120
|
+
## 6. Goal-Backward Verification (if enabled)
|
|
139
121
|
|
|
140
|
-
|
|
122
|
+
```bash
|
|
123
|
+
WORKFLOW_VERIFIER=$(cat .planning/config.json 2>/dev/null | grep -o '"verifier"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
124
|
+
```
|
|
141
125
|
|
|
142
|
-
|
|
126
|
+
**If verifier is true:**
|
|
143
127
|
|
|
144
|
-
|
|
128
|
+
```bash
|
|
129
|
+
WRITTEN_CONTENT=$(cat paper/*.md 2>/dev/null)
|
|
145
130
|
```
|
|
146
131
|
|
|
147
|
-
|
|
148
|
-
</step>
|
|
132
|
+
Spawn `wtfp-argument-verifier` with written content + PLAN goals + argument-map.
|
|
149
133
|
|
|
150
|
-
|
|
151
|
-
**Create SUMMARY.md:**
|
|
134
|
+
**If VERIFIED:** Proceed to done.
|
|
152
135
|
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
section: XX-name
|
|
156
|
-
plan: YY
|
|
157
|
-
mode: [co-author/scaffold/reviewer]
|
|
158
|
-
word_count: [actual]
|
|
159
|
-
word_target: [target]
|
|
160
|
-
---
|
|
136
|
+
**If GAPS_FOUND:** Present gaps to user. Options: fix now, accept, plan revision.
|
|
161
137
|
|
|
162
|
-
|
|
138
|
+
**If HUMAN_NEEDED:** Present what needs human review.
|
|
163
139
|
|
|
164
|
-
##
|
|
165
|
-
- [Task 1]: [what was accomplished]
|
|
166
|
-
- [Task 2]: [what was accomplished]
|
|
167
|
-
- [...]
|
|
140
|
+
## 6b. Commit with commit_docs Guard
|
|
168
141
|
|
|
169
|
-
|
|
170
|
-
- Target: [X] words
|
|
171
|
-
- Actual: [Y] words
|
|
172
|
-
- Variance: [+/- Z]%
|
|
142
|
+
Before any git commit, check commit_docs setting:
|
|
173
143
|
|
|
174
|
-
|
|
175
|
-
-
|
|
144
|
+
```bash
|
|
145
|
+
COMMIT_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
146
|
+
```
|
|
176
147
|
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
148
|
+
**If commit_docs = "false":**
|
|
149
|
+
- Skip `git add` for any `.planning/` paths
|
|
150
|
+
- Only commit paper content files (e.g., `paper/*.md`)
|
|
151
|
+
- Log: "Skipping planning docs commit (commit_docs: false)"
|
|
181
152
|
|
|
182
|
-
|
|
183
|
-
-
|
|
184
|
-
- [...]
|
|
153
|
+
**If commit_docs = "true" (default):**
|
|
154
|
+
- Include `.planning/` files in commits as normal
|
|
185
155
|
|
|
186
|
-
##
|
|
187
|
-
| Decision | Rationale |
|
|
188
|
-
|----------|-----------|
|
|
189
|
-
| [choice] | [why] |
|
|
156
|
+
## 7. Git Branch Merge (if section branch strategy)
|
|
190
157
|
|
|
191
|
-
|
|
192
|
-
- [
|
|
193
|
-
|
|
158
|
+
```bash
|
|
159
|
+
BRANCH_STRATEGY=$(cat .planning/config.json 2>/dev/null | grep -o '"branching_strategy"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "none")
|
|
160
|
+
CURRENT_BRANCH=$(git branch --show-current 2>/dev/null)
|
|
161
|
+
```
|
|
194
162
|
|
|
195
|
-
|
|
196
|
-
- [What should happen next]
|
|
163
|
+
**If branching_strategy = "section" AND current branch matches `wtfp/section-*`:**
|
|
197
164
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
165
|
+
1. Read squash_on_merge setting:
|
|
166
|
+
```bash
|
|
167
|
+
SQUASH=$(cat .planning/config.json 2>/dev/null | grep -o '"squash_on_merge"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "false")
|
|
168
|
+
```
|
|
201
169
|
|
|
202
|
-
|
|
170
|
+
2. Read base branch stored during plan-section:
|
|
171
|
+
```bash
|
|
172
|
+
BASE_BRANCH=$(cat .planning/.section_base_branch 2>/dev/null || echo "main")
|
|
173
|
+
```
|
|
203
174
|
|
|
204
|
-
|
|
205
|
-
**Update STATE.md:**
|
|
175
|
+
3. Perform merge based on squash setting:
|
|
206
176
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
|
|
177
|
+
**If squash=true:**
|
|
178
|
+
```bash
|
|
179
|
+
git checkout "$BASE_BRANCH"
|
|
180
|
+
git merge --squash "$CURRENT_BRANCH"
|
|
181
|
+
git commit -m "write(${SECTION}): complete ${SECTION_NAME}"
|
|
182
|
+
```
|
|
213
183
|
|
|
214
|
-
|
|
215
|
-
|
|
184
|
+
**If squash=false:**
|
|
185
|
+
```bash
|
|
186
|
+
git checkout "$BASE_BRANCH"
|
|
187
|
+
git merge "$CURRENT_BRANCH" --no-ff -m "merge: section ${SECTION} complete"
|
|
188
|
+
```
|
|
216
189
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
git
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
[Word count] words written
|
|
223
|
-
Mode: [mode]
|
|
224
|
-
EOF
|
|
225
|
-
)"
|
|
226
|
-
```
|
|
190
|
+
4. Delete section branch:
|
|
191
|
+
```bash
|
|
192
|
+
git branch -d "$CURRENT_BRANCH"
|
|
193
|
+
rm -f .planning/.section_base_branch
|
|
194
|
+
```
|
|
227
195
|
|
|
228
|
-
|
|
196
|
+
5. Log: "Merged section branch: $CURRENT_BRANCH -> $BASE_BRANCH"
|
|
229
197
|
|
|
230
|
-
|
|
231
|
-
**Present completion:**
|
|
198
|
+
**If branching_strategy = "none" or "submission":** No merge action.
|
|
232
199
|
|
|
233
|
-
|
|
234
|
-
Section written:
|
|
200
|
+
## 8. Present Final Status
|
|
235
201
|
|
|
236
|
-
|
|
237
|
-
- Summary: .planning/sections/XX-name/XX-YY-SUMMARY.md
|
|
238
|
-
- Progress: [current]/[total] words ([%]%)
|
|
202
|
+
</process>
|
|
239
203
|
|
|
240
|
-
|
|
204
|
+
<offer_next>
|
|
241
205
|
|
|
242
|
-
|
|
206
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
207
|
+
WTF-P ► SECTION WRITTEN ✓
|
|
208
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
243
209
|
|
|
244
|
-
|
|
210
|
+
**{Section Name}** — {W} words, mode: {mode}
|
|
245
211
|
|
|
246
|
-
|
|
212
|
+
Verification: {Verified | Gaps found | Skipped}
|
|
247
213
|
|
|
248
|
-
|
|
214
|
+
───────────────────────────────────────────
|
|
249
215
|
|
|
250
216
|
## ▶ Next Up
|
|
251
217
|
|
|
252
|
-
|
|
218
|
+
**Review section** — run verification
|
|
253
219
|
|
|
254
|
-
`/wtfp:
|
|
220
|
+
`/wtfp:review-section {section}`
|
|
255
221
|
|
|
256
222
|
<sub>`/clear` first → fresh context window</sub>
|
|
257
223
|
|
|
258
|
-
|
|
259
|
-
```
|
|
224
|
+
───────────────────────────────────────────
|
|
260
225
|
|
|
261
|
-
</
|
|
262
|
-
|
|
263
|
-
</process>
|
|
226
|
+
</offer_next>
|
|
264
227
|
|
|
265
228
|
<success_criteria>
|
|
266
|
-
- [ ]
|
|
229
|
+
- [ ] Plan validated and loaded
|
|
230
|
+
- [ ] Section-writer spawned with full context
|
|
267
231
|
- [ ] Content written to paper/ directory
|
|
268
|
-
- [ ]
|
|
269
|
-
- [ ]
|
|
270
|
-
- [ ]
|
|
271
|
-
- [ ]
|
|
272
|
-
- [ ]
|
|
232
|
+
- [ ] SUMMARY.md created
|
|
233
|
+
- [ ] STATE.md updated
|
|
234
|
+
- [ ] Argument-verifier spawned (if workflow.verifier enabled)
|
|
235
|
+
- [ ] Verification result handled
|
|
236
|
+
- [ ] User knows next steps
|
|
273
237
|
</success_criteria>
|