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