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
|
@@ -9,15 +9,25 @@ Validation: X exists+complete, X+1 exists, X.Y doesn't exist, Y >= 1
|
|
|
9
9
|
READ: ~/.claude/write-the-f-paper/templates/section-prompt.md
|
|
10
10
|
READ: ~/.claude/write-the-f-paper/references/plan-format.md
|
|
11
11
|
READ: ~/.claude/write-the-f-paper/references/verification-layers.md
|
|
12
|
+
READ: ~/.claude/write-the-f-paper/references/orchestrator-pattern.md
|
|
13
|
+
READ: ~/.claude/write-the-f-paper/references/context-fidelity.md
|
|
14
|
+
READ: ~/.claude/write-the-f-paper/references/agent-model-matrix.md
|
|
12
15
|
READ: .planning/ROADMAP.md
|
|
13
16
|
READ: .planning/PROJECT.md
|
|
14
17
|
LOAD: .planning/structure/argument-map.md, outline.md, narrative-arc.md
|
|
15
18
|
</required_reading>
|
|
16
19
|
|
|
17
20
|
<purpose>
|
|
18
|
-
Create executable section prompt (PLAN.md). PLAN.md IS the prompt Claude executes - not a doc that gets transformed.
|
|
21
|
+
Create executable section prompt (PLAN.md) via thin orchestrator pattern. Orchestrator validates, loads context, resolves model profile, spawns section-planner agent, then runs plan-checker for quality verification. PLAN.md IS the prompt Claude executes - not a doc that gets transformed.
|
|
19
22
|
</purpose>
|
|
20
23
|
|
|
24
|
+
<architecture>
|
|
25
|
+
ORCHESTRATOR: /wtfp:plan-section (this command)
|
|
26
|
+
AGENTS: section-planner (creates PLAN.md), plan-checker (validates PLAN.md)
|
|
27
|
+
PATTERN: Orchestrator loads context → spawns planner → spawns checker → revise loop if needed
|
|
28
|
+
WHY_SUBAGENTS: Fresh context windows for peak quality. Planner gets full project context without orchestrator overhead. Checker validates independently.
|
|
29
|
+
</architecture>
|
|
30
|
+
|
|
21
31
|
<planning_principles>
|
|
22
32
|
Argument-first: Every paragraph serves core argument. Plan prose that advances thesis, not filler.
|
|
23
33
|
Evidence-grounded: Plan where citations go before writing. Claims need sources identified.
|
|
@@ -26,7 +36,18 @@ Reader-aware: Plan for target audience. Technical depth, assumed knowledge, expl
|
|
|
26
36
|
|
|
27
37
|
<process>
|
|
28
38
|
|
|
29
|
-
[step:
|
|
39
|
+
[step:validate_and_resolve_model p=1]
|
|
40
|
+
RUN: ls .planning/ 2>/dev/null
|
|
41
|
+
RUN: MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
42
|
+
|
|
43
|
+
MODEL_LOOKUP{agent,quality,balanced,budget}:
|
|
44
|
+
section-planner | opus | opus | sonnet
|
|
45
|
+
plan-checker | sonnet | sonnet | haiku
|
|
46
|
+
|
|
47
|
+
RESOLVE: planner_model, checker_model from MODEL_PROFILE
|
|
48
|
+
[/step]
|
|
49
|
+
|
|
50
|
+
[step:load_project_state]
|
|
30
51
|
READ: .planning/STATE.md
|
|
31
52
|
PARSE: current_position, accumulated_decisions, open_questions, argument_strength
|
|
32
53
|
IF missing+.planning_exists → OFFER reconstruct|continue
|
|
@@ -56,14 +77,27 @@ IF decimal → validate: X complete, X+1 exists, X.Y doesn't exist, Y >= 1
|
|
|
56
77
|
READ: existing PLAN.md or RESEARCH.md in section dir
|
|
57
78
|
[/step]
|
|
58
79
|
|
|
80
|
+
[step:load_context_md]
|
|
81
|
+
CRITICAL: Load CONTEXT.md early, pass to ALL agents.
|
|
82
|
+
|
|
83
|
+
RUN: SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
|
|
84
|
+
RUN: CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
|
|
85
|
+
|
|
86
|
+
IF CONTEXT.md exists → store for injection into planner prompt as <user_decisions>
|
|
87
|
+
HONOR: locked decisions, boundaries, vision
|
|
88
|
+
EXCLUDE: deferred ideas
|
|
89
|
+
ALLOW: discretion areas
|
|
90
|
+
IF missing → SUGGEST: /wtfp:discuss-section (simpler) or proceed without
|
|
91
|
+
[/step]
|
|
92
|
+
|
|
59
93
|
[step:mandatory_literature_check]
|
|
60
94
|
MANDATORY for sections flagged Research: Likely
|
|
61
95
|
|
|
62
96
|
LIT_LEVEL{level,desc,action}:
|
|
63
97
|
0-skip | internal content only, no external evidence | skip
|
|
64
|
-
1-quick | single source verify
|
|
65
|
-
2-standard | multiple sources, positioning
|
|
66
|
-
3-deep | core lit review, theoretical framework
|
|
98
|
+
1-quick | single source verify | quick check, no RESEARCH.md
|
|
99
|
+
2-standard | multiple sources, positioning | /wtfp:research-gap → RESEARCH.md
|
|
100
|
+
3-deep | core lit review, theoretical framework | /wtfp:research-gap depth=deep → full RESEARCH.md
|
|
67
101
|
|
|
68
102
|
IF roadmap=Research:Likely → Level 0 not available
|
|
69
103
|
[/step]
|
|
@@ -72,112 +106,70 @@ IF roadmap=Research:Likely → Level 0 not available
|
|
|
72
106
|
RUN: for f in .planning/sections/*/*-SUMMARY.md; do sed -n '1,/^---$/p' "$f" | head -30; done
|
|
73
107
|
PARSE: section, subsection, key-claims, evidence-used, decisions
|
|
74
108
|
|
|
75
|
-
BUILD context:
|
|
76
|
-
- Check logical flow (what claims does this section build on?)
|
|
77
|
-
- Check evidence used (what sources already cited?)
|
|
78
|
-
- Check decisions (stylistic/structural constraints?)
|
|
79
|
-
|
|
80
109
|
AUTO-SELECT sections matching:
|
|
81
110
|
- Immediate prior section
|
|
82
111
|
- Same argumentative thread
|
|
83
112
|
- Mentioned in STATE.md as affecting current
|
|
84
113
|
|
|
85
|
-
EXTRACT
|
|
86
|
-
- Claims established
|
|
87
|
-
- Evidence cited (avoid over-citation)
|
|
88
|
-
- Patterns established (style, terminology)
|
|
89
|
-
- Decisions
|
|
90
|
-
|
|
91
|
-
ANSWER before proceeding:
|
|
92
|
-
Q1: What claims from previous sections does this build on?
|
|
93
|
-
Q2: What sources already cited might be relevant?
|
|
94
|
-
Q3: What writing patterns to maintain?
|
|
95
|
-
Q4: Does roadmap goal still make sense given context?
|
|
114
|
+
EXTRACT: claims established, evidence cited, patterns, decisions
|
|
96
115
|
[/step]
|
|
97
116
|
|
|
98
|
-
[step:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
TASKS_BY_SECTION{section → typical_tasks}:
|
|
123
|
-
abstract | draft complete, verify elements
|
|
124
|
-
intro | hook, context, gap, thesis, roadmap
|
|
125
|
-
methods | protocol, measures, analysis approach
|
|
126
|
-
results | finding narratives, supporting analyses
|
|
127
|
-
discussion | summary, interpretation, limitations, future work, conclusion
|
|
128
|
-
related_work | theme syntheses, positioning statement
|
|
129
|
-
|
|
130
|
-
MODE_SELECT:
|
|
131
|
-
- Procedural content (methods, data) → co-author
|
|
132
|
-
- Argument-heavy (discussion, intro) → scaffold | reviewer
|
|
133
|
-
- Personal voice (abstract conclusion, thesis) → scaffold + user writing
|
|
134
|
-
|
|
135
|
-
CHECKPOINTS: visual/prose verify → human-verify. Voice/framing choices → decision.
|
|
117
|
+
[step:spawn_section_planner]
|
|
118
|
+
EMIT:
|
|
119
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
120
|
+
WTF-P ► PLANNING SECTION {X}
|
|
121
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
122
|
+
|
|
123
|
+
BUILD planner_prompt with inlined content:
|
|
124
|
+
- <planning_context> STATE, ROADMAP, PROJECT, argument-map, outline, RESEARCH, prior summaries
|
|
125
|
+
- <user_decisions> CONTEXT_CONTENT (from CONTEXT.md)
|
|
126
|
+
- <output> target directory path
|
|
127
|
+
|
|
128
|
+
SPAWN:
|
|
129
|
+
Task(
|
|
130
|
+
prompt="First, read ~/.claude/agents/wtfp/section-planner.md for your role and instructions.\n\n" + planner_prompt,
|
|
131
|
+
subagent_type="general-purpose",
|
|
132
|
+
model="{planner_model}",
|
|
133
|
+
description="Plan Section {X}"
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
HANDLE returns:
|
|
137
|
+
"## PLANNING COMPLETE" → proceed to plan-checker
|
|
138
|
+
"## CHECKPOINT REACHED" → present to user, wait
|
|
139
|
+
"## PLANNING BLOCKED" → present blocker, ask user
|
|
136
140
|
[/step]
|
|
137
141
|
|
|
138
|
-
[step:
|
|
139
|
-
|
|
142
|
+
[step:spawn_plan_checker]
|
|
143
|
+
IF config.workflow.plan_check=false → SKIP to git_commit
|
|
140
144
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
SPAWN:
|
|
146
|
+
Task(
|
|
147
|
+
prompt="First, read ~/.claude/agents/wtfp/plan-checker.md for your role and instructions.\n\n" + checker_prompt_with_PLAN_content,
|
|
148
|
+
subagent_type="general-purpose",
|
|
149
|
+
model="{checker_model}",
|
|
150
|
+
description="Check Plan {section}-01"
|
|
151
|
+
)
|
|
145
152
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
ALWAYS_SPLIT if: >3 tasks, multiple threads, complex lit integration
|
|
151
|
-
EACH_PLAN must be: 2-3 tasks max, focused on one aspect, independently verifiable
|
|
152
|
-
[/step]
|
|
153
|
-
|
|
154
|
-
[step:confirm_breakdown]
|
|
155
|
-
IF mode=yolo → auto-approve, proceed
|
|
156
|
-
IF mode=interactive → present breakdown:
|
|
157
|
-
"Section [X] breakdown:
|
|
158
|
-
### Tasks ({section}-01-PLAN.md)
|
|
159
|
-
1. [Task] - [brief] [type] [mode]
|
|
160
|
-
2. [Task] - [brief] [type] [mode]
|
|
161
|
-
Does this look right? (yes/adjust/start over)"
|
|
162
|
-
|
|
163
|
-
IF adjust → revise
|
|
164
|
-
IF start_over → return to gather_section_context
|
|
153
|
+
HANDLE returns:
|
|
154
|
+
"## CHECK PASSED" → proceed to git_commit
|
|
155
|
+
"## ISSUES FOUND" → enter revise loop
|
|
165
156
|
[/step]
|
|
166
157
|
|
|
167
|
-
[step:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
158
|
+
[step:plan_check_revise_loop]
|
|
159
|
+
IF checker returns ISSUES:
|
|
160
|
+
MAX_REVISIONS: 2
|
|
161
|
+
|
|
162
|
+
LOOP:
|
|
163
|
+
1. Present issues to user (or auto-fix if minor)
|
|
164
|
+
2. Re-spawn section-planner with issues as feedback
|
|
165
|
+
3. Re-spawn plan-checker on revised plan
|
|
166
|
+
4. IF passed → proceed
|
|
167
|
+
5. IF max_revisions reached → present remaining issues, ask user
|
|
168
|
+
|
|
169
|
+
ISSUE_CATEGORIES:
|
|
170
|
+
auto-fix | missing citation placeholder, word budget off | planner revises
|
|
171
|
+
user-decision | structural concern, scope question | present to user
|
|
172
|
+
acceptable | style preference, minor suggestion | log and proceed
|
|
181
173
|
[/step]
|
|
182
174
|
|
|
183
175
|
[step:git_commit]
|
|
@@ -190,7 +182,7 @@ EMIT: "Committed: docs(${SECTION}): create section plan"
|
|
|
190
182
|
[step:offer_next]
|
|
191
183
|
EMIT:
|
|
192
184
|
Section plan created: .planning/sections/XX-name/{section}-01-PLAN.md
|
|
193
|
-
[X] tasks defined.
|
|
185
|
+
[X] tasks defined. Plan check: [PASSED/SKIPPED]
|
|
194
186
|
|
|
195
187
|
Next: {section}-01: [Plan Name] - [objective]
|
|
196
188
|
→ /wtfp:write-section .planning/sections/XX-name/{section}-01-PLAN.md
|
|
@@ -221,16 +213,17 @@ Tasks = instructions for Claude writing, not editorial board requirements.
|
|
|
221
213
|
</anti_patterns>
|
|
222
214
|
|
|
223
215
|
<success_criteria>
|
|
216
|
+
- [ ] Model profile resolved, agent models determined
|
|
224
217
|
- [ ] STATE.md read, project context absorbed
|
|
218
|
+
- [ ] CONTEXT.md loaded early and passed to ALL agents
|
|
225
219
|
- [ ] Mandatory literature check completed (Level 0-3)
|
|
226
220
|
- [ ] Prior sections, sources, structure synthesized
|
|
221
|
+
- [ ] Section-planner agent spawned with full context
|
|
227
222
|
- [ ] PLAN file(s) exist with XML structure
|
|
228
|
-
- [ ]
|
|
229
|
-
- [ ]
|
|
223
|
+
- [ ] Plan-checker agent validated plan (or skipped per config)
|
|
224
|
+
- [ ] Plan-check-revise loop completed if issues found
|
|
230
225
|
- [ ] Each plan: 2-3 tasks (~focused scope)
|
|
231
226
|
- [ ] Each task: Type, Mode, Paragraphs (if applicable), Action, Verify, Done
|
|
232
|
-
- [ ] Checkpoints properly structured
|
|
233
|
-
- [ ] If RESEARCH.md exists: sources cited in plan, positioning clear
|
|
234
227
|
- [ ] PLAN file(s) committed to git
|
|
235
228
|
- [ ] User knows next steps
|
|
236
229
|
</success_criteria>
|
|
@@ -188,17 +188,21 @@ Execute research systematically.
|
|
|
188
188
|
|
|
189
189
|
**CRITICAL: Source hierarchy**
|
|
190
190
|
|
|
191
|
-
1. **
|
|
191
|
+
1. **Context7 MCP first (if available):**
|
|
192
|
+
- Query Context7 for relevant documentation and sources
|
|
193
|
+
- Highest quality, most relevant results
|
|
194
|
+
|
|
195
|
+
2. **User's own sources second:**
|
|
192
196
|
- Check .planning/sources/literature.md
|
|
193
197
|
- Check .planning/sources/prior-drafts.md for cited works
|
|
194
198
|
- User may have PDFs or notes to reference
|
|
195
199
|
|
|
196
|
-
|
|
200
|
+
3. **Official sources/databases third:**
|
|
197
201
|
- Google Scholar for academic sources
|
|
198
202
|
- Field-specific databases (PubMed, IEEE, ACL, etc.)
|
|
199
203
|
- Preprint servers (arXiv, SSRN, bioRxiv)
|
|
200
204
|
|
|
201
|
-
|
|
205
|
+
4. **WebSearch last (for recent/emerging work):**
|
|
202
206
|
```
|
|
203
207
|
"[topic] research [current_year]"
|
|
204
208
|
"[topic] systematic review"
|
|
@@ -206,6 +210,19 @@ Execute research systematically.
|
|
|
206
210
|
"[author name] [topic]" for known experts
|
|
207
211
|
```
|
|
208
212
|
|
|
213
|
+
**Depth-conditional instructions:**
|
|
214
|
+
|
|
215
|
+
**If depth is "standard":**
|
|
216
|
+
- Target 10-20 relevant sources across categories
|
|
217
|
+
- Focus on most impactful papers for each category
|
|
218
|
+
- Categories are recommended but not all mandatory
|
|
219
|
+
|
|
220
|
+
**If depth is "deep":**
|
|
221
|
+
- Target 20-50 sources
|
|
222
|
+
- Systematically map the field: research groups, venues, citation networks, methodology variants
|
|
223
|
+
- Every category (foundational, recent, competing, gap, methods) is MANDATORY
|
|
224
|
+
- Include intellectual lineage and funding landscape
|
|
225
|
+
|
|
209
226
|
<research_protocol>
|
|
210
227
|
|
|
211
228
|
**For each research category:**
|
|
@@ -290,6 +307,13 @@ Create it: `.planning/sections/${SECTION}-${SLUG}/`
|
|
|
290
307
|
**Structure:**
|
|
291
308
|
|
|
292
309
|
```markdown
|
|
310
|
+
---
|
|
311
|
+
depth: {quick|standard|deep}
|
|
312
|
+
confidence: {HIGH|MEDIUM|LOW}
|
|
313
|
+
sources_count: {N}
|
|
314
|
+
researched: {YYYY-MM-DD}
|
|
315
|
+
---
|
|
316
|
+
|
|
293
317
|
# Literature Research: [Topic/Section]
|
|
294
318
|
|
|
295
319
|
## Research Summary
|
|
@@ -62,13 +62,30 @@ RUN: cat .planning/sections/${SECTION}-*/${SECTION}-CONTEXT.md 2>/dev/null
|
|
|
62
62
|
[/step]
|
|
63
63
|
|
|
64
64
|
[step:execute_research]
|
|
65
|
+
**CRITICAL: Source hierarchy**
|
|
66
|
+
1. Context7 MCP first (if available) → highest quality, most relevant
|
|
67
|
+
2. User's own sources → .planning/sources/literature.md, prior-drafts.md, PDFs
|
|
68
|
+
3. Official sources/databases → Google Scholar, PubMed, IEEE, ACL, arXiv, SSRN
|
|
69
|
+
4. WebSearch last → "[topic] research [year]", "[topic] systematic review"
|
|
70
|
+
|
|
71
|
+
MODE{depth}:
|
|
72
|
+
| standard | 10-20 sources, focus most impactful, categories recommended not mandatory |
|
|
73
|
+
| deep | 20-50 sources, map field systematically, ALL categories MANDATORY, include lineage+funding |
|
|
74
|
+
|
|
75
|
+
Per category: identify 3-5 foundational + 5-10 recent + 2-3 competing + gap evidence.
|
|
76
|
+
Per source: full citation, key findings, relation to work, where to cite.
|
|
77
|
+
Synthesize: group by argument, consensus vs controversy, methodological trends, gap.
|
|
78
|
+
Cross-verify: legitimate academic work, citation counts, recency, confidence level.
|
|
65
79
|
[/step]
|
|
66
80
|
|
|
67
81
|
[step:quality_check]
|
|
68
82
|
[/step]
|
|
69
83
|
|
|
70
84
|
[step:write_research]
|
|
71
|
-
IF section_directory_doesnt_exist → Create it: `.planning/sections/${SECTION}-${
|
|
85
|
+
IF section_directory_doesnt_exist → Create it: `.planning/sections/${SECTION}-${SLUG}/`
|
|
86
|
+
Output: `.planning/sections/${SECTION}-${SLUG}/${SECTION}-RESEARCH.md`
|
|
87
|
+
Frontmatter: depth, confidence (HIGH/MEDIUM/LOW), sources_count, researched (YYYY-MM-DD)
|
|
88
|
+
Sections: Research Summary, Key Findings (Foundational/Recent/Competing/Gap/Methods), Synthesis for Writing (Intro/Related Work/Discussion), Full Bibliography, Confidence Assessment.
|
|
72
89
|
[/step]
|
|
73
90
|
|
|
74
91
|
[step:update_literature_index]
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Conversational section acceptance testing. Present tests one at a time derived from
|
|
3
|
+
PLAN.md success criteria and argument-map.md claims. Persist state in UAT.md that
|
|
4
|
+
survives /clear. Route to plan-revision when issues are found.
|
|
5
|
+
|
|
6
|
+
The USER evaluates each test — Claude presents, records, and routes.
|
|
7
|
+
</purpose>
|
|
8
|
+
|
|
9
|
+
<process>
|
|
10
|
+
|
|
11
|
+
<step name="load_state">
|
|
12
|
+
**Load project state and config:**
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
cat .planning/STATE.md 2>/dev/null
|
|
16
|
+
cat .planning/config.json 2>/dev/null
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Parse current position, accumulated decisions. Load planning config for commit_docs flag.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
COMMIT_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
23
|
+
```
|
|
24
|
+
</step>
|
|
25
|
+
|
|
26
|
+
<step name="find_section">
|
|
27
|
+
**Resolve section from arguments:**
|
|
28
|
+
|
|
29
|
+
Parse $ARGUMENTS as section number (e.g., "3") or section name (e.g., "methods").
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Find section directory
|
|
33
|
+
SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
|
|
34
|
+
[ -z "$SECTION_DIR" ] && echo "ERROR: Section not found" && exit 1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Validate section was written:**
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
ls "$SECTION_DIR"/*-SUMMARY.md 2>/dev/null
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If no SUMMARY.md exists, the section has not been written yet. Cannot verify unwritten content.
|
|
44
|
+
|
|
45
|
+
Present error:
|
|
46
|
+
```
|
|
47
|
+
Section [X] has not been written yet.
|
|
48
|
+
|
|
49
|
+
Write it first: /wtfp:write-section [plan-path]
|
|
50
|
+
```
|
|
51
|
+
</step>
|
|
52
|
+
|
|
53
|
+
<step name="load_or_create_uat">
|
|
54
|
+
**Check for existing UAT.md:**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
UAT_PATH="$SECTION_DIR/UAT.md"
|
|
58
|
+
[ -f "$UAT_PATH" ] && echo "EXISTING" || echo "NEW"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**If UAT.md exists (resuming):**
|
|
62
|
+
- Read UAT.md
|
|
63
|
+
- Count total tests, completed tests, pending tests
|
|
64
|
+
- Find next test with `result: pending`
|
|
65
|
+
- Report: "Resuming verification (N/M tests complete)"
|
|
66
|
+
|
|
67
|
+
**If UAT.md does not exist (new verification):**
|
|
68
|
+
|
|
69
|
+
Derive tests from two sources:
|
|
70
|
+
|
|
71
|
+
1. **PLAN.md success criteria:**
|
|
72
|
+
```bash
|
|
73
|
+
cat "$SECTION_DIR"/*-PLAN.md
|
|
74
|
+
```
|
|
75
|
+
Extract each item from `<success_criteria>` section. Each `- [ ]` item becomes a test.
|
|
76
|
+
|
|
77
|
+
2. **Argument-map claims for this section:**
|
|
78
|
+
```bash
|
|
79
|
+
cat .planning/structure/argument-map.md 2>/dev/null
|
|
80
|
+
```
|
|
81
|
+
Find claims mapped to this section number. Each claim becomes a test.
|
|
82
|
+
|
|
83
|
+
**Generate test list:** Combine both sources. Each test gets:
|
|
84
|
+
- Sequential number
|
|
85
|
+
- Source label: `[plan]` or `[argument-map]`
|
|
86
|
+
- The criterion or claim text
|
|
87
|
+
- `result: pending`
|
|
88
|
+
- `reason: ""`
|
|
89
|
+
|
|
90
|
+
**Write UAT.md** using template format:
|
|
91
|
+
```yaml
|
|
92
|
+
---
|
|
93
|
+
status: testing
|
|
94
|
+
section: XX-name
|
|
95
|
+
started: [ISO timestamp]
|
|
96
|
+
last_test: 0
|
|
97
|
+
---
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Followed by `## Tests` section with all derived tests, `## Summary` with initial counts, empty `## Gaps` section.
|
|
101
|
+
|
|
102
|
+
Report: "Starting verification (M tests)"
|
|
103
|
+
</step>
|
|
104
|
+
|
|
105
|
+
<step name="present_test">
|
|
106
|
+
**Display current test:**
|
|
107
|
+
|
|
108
|
+
Find next test with `result: pending`.
|
|
109
|
+
|
|
110
|
+
Present using branded checkpoint box:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
════════════════════════════════════════
|
|
114
|
+
VERIFICATION: Test {N} of {total}
|
|
115
|
+
════════════════════════════════════════
|
|
116
|
+
|
|
117
|
+
Source: {[plan] or [argument-map]}
|
|
118
|
+
|
|
119
|
+
{The criterion or claim being verified}
|
|
120
|
+
|
|
121
|
+
Check: Does this section satisfy the above?
|
|
122
|
+
════════════════════════════════════════
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Use AskUserQuestion:
|
|
126
|
+
- header: "Verification"
|
|
127
|
+
- question: The criterion or claim text
|
|
128
|
+
- options:
|
|
129
|
+
- "Pass - meets criteria"
|
|
130
|
+
- "Skip - not applicable"
|
|
131
|
+
- "Issue - describe the problem"
|
|
132
|
+
</step>
|
|
133
|
+
|
|
134
|
+
<step name="record_result">
|
|
135
|
+
**Write result back to UAT.md:**
|
|
136
|
+
|
|
137
|
+
Update the test entry:
|
|
138
|
+
- Set `result:` to pass, skip, or issue
|
|
139
|
+
- Set `reason:` to user's explanation (if provided)
|
|
140
|
+
- Increment `last_test` in frontmatter
|
|
141
|
+
|
|
142
|
+
**If result is "issue":**
|
|
143
|
+
|
|
144
|
+
Ask follow-up for severity classification:
|
|
145
|
+
|
|
146
|
+
Use AskUserQuestion:
|
|
147
|
+
- header: "Severity"
|
|
148
|
+
- question: "How severe is this issue?"
|
|
149
|
+
- options:
|
|
150
|
+
- "Major - undermines argument, must fix"
|
|
151
|
+
- "Minor - weakens but doesn't invalidate"
|
|
152
|
+
- "Cosmetic - polish issue, fix during final pass"
|
|
153
|
+
|
|
154
|
+
Add entry to `## Gaps` section:
|
|
155
|
+
```markdown
|
|
156
|
+
- claim: "[criterion or claim text]"
|
|
157
|
+
status: issue
|
|
158
|
+
reason: "[user's description]"
|
|
159
|
+
severity: [major|minor|cosmetic]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Update UAT.md on disk after each result.
|
|
163
|
+
</step>
|
|
164
|
+
|
|
165
|
+
<step name="check_completion">
|
|
166
|
+
**Check if more tests remain:**
|
|
167
|
+
|
|
168
|
+
Count tests with `result: pending`.
|
|
169
|
+
|
|
170
|
+
**If pending > 0:** Loop back to `present_test` step.
|
|
171
|
+
|
|
172
|
+
**If pending == 0:** All tests evaluated.
|
|
173
|
+
- Set `status: complete` in frontmatter
|
|
174
|
+
- Calculate summary counts:
|
|
175
|
+
- total: [count of all tests]
|
|
176
|
+
- passed: [count with result: pass]
|
|
177
|
+
- issues: [count with result: issue]
|
|
178
|
+
- skipped: [count with result: skip]
|
|
179
|
+
- Update `## Summary` section in UAT.md
|
|
180
|
+
</step>
|
|
181
|
+
|
|
182
|
+
<step name="route_on_completion">
|
|
183
|
+
**Route based on results:**
|
|
184
|
+
|
|
185
|
+
**If no issues found (all pass or skip):**
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
189
|
+
WTF-P ► VERIFICATION PASSED
|
|
190
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
191
|
+
|
|
192
|
+
Section [X]: [Name]
|
|
193
|
+
Tests: [passed] passed, [skipped] skipped, 0 issues
|
|
194
|
+
|
|
195
|
+
───────────────────────────────────────────
|
|
196
|
+
|
|
197
|
+
## ▶ Next Up
|
|
198
|
+
|
|
199
|
+
**Check progress** — see overall paper status
|
|
200
|
+
|
|
201
|
+
`/wtfp:progress`
|
|
202
|
+
|
|
203
|
+
<sub>`/clear` first → fresh context window</sub>
|
|
204
|
+
|
|
205
|
+
───────────────────────────────────────────
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**If issues found:**
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
212
|
+
WTF-P ► VERIFICATION: ISSUES FOUND
|
|
213
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
214
|
+
|
|
215
|
+
Section [X]: [Name]
|
|
216
|
+
Tests: [passed] passed, [issues] issues, [skipped] skipped
|
|
217
|
+
|
|
218
|
+
## Gap Summary
|
|
219
|
+
|
|
220
|
+
| # | Claim/Criterion | Severity | Reason |
|
|
221
|
+
|---|-----------------|----------|--------|
|
|
222
|
+
| 1 | [text] | major | [reason] |
|
|
223
|
+
| 2 | [text] | minor | [reason] |
|
|
224
|
+
|
|
225
|
+
───────────────────────────────────────────
|
|
226
|
+
|
|
227
|
+
## ▶ Next Up
|
|
228
|
+
|
|
229
|
+
**Plan revision** — create fix plan for identified issues
|
|
230
|
+
|
|
231
|
+
`/wtfp:plan-revision [section]`
|
|
232
|
+
|
|
233
|
+
<sub>`/clear` first → fresh context window</sub>
|
|
234
|
+
|
|
235
|
+
───────────────────────────────────────────
|
|
236
|
+
```
|
|
237
|
+
</step>
|
|
238
|
+
|
|
239
|
+
</process>
|
|
240
|
+
|
|
241
|
+
<success_criteria>
|
|
242
|
+
- [ ] Section resolved from arguments
|
|
243
|
+
- [ ] SUMMARY.md existence validated (section was written)
|
|
244
|
+
- [ ] Tests derived from BOTH PLAN.md success_criteria AND argument-map.md claims
|
|
245
|
+
- [ ] UAT.md created or resumed with correct state
|
|
246
|
+
- [ ] Each test presented one at a time with branded checkpoint box
|
|
247
|
+
- [ ] User response recorded (pass/skip/issue) with persistence
|
|
248
|
+
- [ ] Issues get severity classification and are added to Gaps
|
|
249
|
+
- [ ] UAT.md updated on disk after each result (survives /clear)
|
|
250
|
+
- [ ] Completion routes to progress (clean) or plan-revision (issues found)
|
|
251
|
+
</success_criteria>
|