wtf-p 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +146 -208
  2. package/bin/commands/doctor.js +88 -2
  3. package/bin/commands/install-logic.js +127 -36
  4. package/bin/commands/status.js +22 -4
  5. package/bin/commands/update.js +5 -4
  6. package/bin/install.js +66 -26
  7. package/bin/lib/analyze-impact.js +105 -0
  8. package/bin/lib/bib-format.js +161 -0
  9. package/bin/lib/bib-index.js +104 -0
  10. package/bin/lib/checkpoint.js +183 -0
  11. package/bin/lib/citation-fetcher.js +299 -0
  12. package/bin/lib/citation-ranker.js +133 -0
  13. package/bin/lib/context-primer.js +214 -0
  14. package/bin/lib/manifest.js +80 -2
  15. package/bin/lib/scholar-lookup.js +188 -0
  16. package/bin/lib/semantic-scholar.js +184 -0
  17. package/bin/lib/utils.js +22 -1
  18. package/bin/uninstall.js +270 -111
  19. package/core/write-the-f-paper/references/agent-model-matrix.md +62 -0
  20. package/core/write-the-f-paper/references/checkpoints.md +160 -9
  21. package/core/write-the-f-paper/references/context-fidelity.md +153 -0
  22. package/core/write-the-f-paper/references/deviation-rules.md +150 -0
  23. package/core/write-the-f-paper/references/git-integration.md +80 -0
  24. package/core/write-the-f-paper/references/orchestrator-pattern.md +167 -0
  25. package/core/write-the-f-paper/references/planning-config.md +135 -0
  26. package/core/write-the-f-paper/references/ui-brand.md +186 -0
  27. package/core/write-the-f-paper/templates/UAT.md +80 -0
  28. package/core/write-the-f-paper/templates/base-prefs.yaml +42 -0
  29. package/core/write-the-f-paper/templates/config.json +31 -5
  30. package/core/write-the-f-paper/workflows/create-outline.wcn.md +1 -1
  31. package/core/write-the-f-paper/workflows/execute-outline.md +163 -0
  32. package/core/write-the-f-paper/workflows/execute-outline.wcn.md +73 -0
  33. package/core/write-the-f-paper/workflows/execute-section.wcn.md +141 -169
  34. package/core/write-the-f-paper/workflows/plan-section.wcn.md +96 -103
  35. package/core/write-the-f-paper/workflows/research-gap.md +27 -3
  36. package/core/write-the-f-paper/workflows/research-gap.wcn.md +18 -1
  37. package/core/write-the-f-paper/workflows/verify-work.md +251 -0
  38. package/core/write-the-f-paper/workflows/verify-work.wcn.md +74 -0
  39. package/package.json +19 -7
  40. package/vendors/claude/.claude-plugin/plugin.json +2 -2
  41. package/vendors/claude/agents/wtfp/argument-verifier.md +189 -0
  42. package/vendors/claude/agents/wtfp/citation-expert.md +45 -0
  43. package/vendors/claude/agents/wtfp/citation-formatter.md +42 -0
  44. package/vendors/claude/agents/wtfp/coherence-checker.md +167 -0
  45. package/vendors/claude/agents/wtfp/outliner.md +259 -0
  46. package/vendors/claude/agents/wtfp/plan-checker.md +249 -0
  47. package/vendors/claude/agents/wtfp/prose-polisher.md +166 -0
  48. package/vendors/claude/agents/wtfp/research-synthesizer.md +215 -0
  49. package/vendors/claude/agents/wtfp/section-planner.md +364 -0
  50. package/vendors/claude/agents/wtfp/section-reviewer.md +182 -0
  51. package/vendors/claude/agents/wtfp/section-writer.md +312 -0
  52. package/vendors/claude/commands/wtfp/add-todo.md +108 -0
  53. package/vendors/claude/commands/wtfp/analyze-bib.md +60 -249
  54. package/vendors/claude/commands/wtfp/audit-milestone.md +286 -0
  55. package/vendors/claude/commands/wtfp/check-refs.md +60 -131
  56. package/vendors/claude/commands/wtfp/check-todos.md +152 -0
  57. package/vendors/claude/commands/wtfp/checkpoint.md +105 -0
  58. package/vendors/claude/commands/wtfp/contribute.md +1 -1
  59. package/vendors/claude/commands/wtfp/create-outline.md +109 -195
  60. package/vendors/claude/commands/wtfp/create-poster.md +1 -1
  61. package/vendors/claude/commands/wtfp/create-slides.md +1 -1
  62. package/vendors/claude/commands/wtfp/discuss-section.md +1 -1
  63. package/vendors/claude/commands/wtfp/execute-outline.md +257 -0
  64. package/vendors/claude/commands/wtfp/export-latex.md +1 -1
  65. package/vendors/claude/commands/wtfp/help.md +174 -280
  66. package/vendors/claude/commands/wtfp/insert-section.md +1 -1
  67. package/vendors/claude/commands/wtfp/list-assumptions.md +1 -1
  68. package/vendors/claude/commands/wtfp/map-project.md +35 -124
  69. package/vendors/claude/commands/wtfp/new-paper.md +88 -362
  70. package/vendors/claude/commands/wtfp/pause-writing.md +1 -1
  71. package/vendors/claude/commands/wtfp/plan-milestone-gaps.md +255 -0
  72. package/vendors/claude/commands/wtfp/plan-revision.md +1 -1
  73. package/vendors/claude/commands/wtfp/plan-section.md +165 -190
  74. package/vendors/claude/commands/wtfp/polish-prose.md +66 -118
  75. package/vendors/claude/commands/wtfp/progress.md +82 -254
  76. package/vendors/claude/commands/wtfp/quick.md +107 -0
  77. package/vendors/claude/commands/wtfp/remove-section.md +1 -1
  78. package/vendors/claude/commands/wtfp/report-bug.md +1 -1
  79. package/vendors/claude/commands/wtfp/request-feature.md +1 -1
  80. package/vendors/claude/commands/wtfp/research-gap.md +138 -151
  81. package/vendors/claude/commands/wtfp/resume-writing.md +1 -1
  82. package/vendors/claude/commands/wtfp/review-section.md +55 -333
  83. package/vendors/claude/commands/wtfp/settings.md +197 -0
  84. package/vendors/claude/commands/wtfp/submit-milestone.md +248 -99
  85. package/vendors/claude/commands/wtfp/update.md +112 -0
  86. package/vendors/claude/commands/wtfp/verify-work.md +254 -0
  87. package/vendors/claude/commands/wtfp/write-section.md +144 -180
  88. package/vendors/claude/mcp/research-server/package.json +13 -0
  89. package/vendors/claude/mcp/research-server/src/index.js +133 -0
  90. package/vendors/gemini/agents/wtfp/argument-verifier.md +184 -0
  91. package/vendors/gemini/agents/wtfp/citation-expert.md +41 -0
  92. package/vendors/gemini/agents/wtfp/citation-formatter.md +38 -0
  93. package/vendors/gemini/agents/wtfp/coherence-checker.md +162 -0
  94. package/vendors/gemini/agents/wtfp/outliner.md +252 -0
  95. package/vendors/gemini/agents/wtfp/plan-checker.md +244 -0
  96. package/vendors/gemini/agents/wtfp/prose-polisher.md +158 -0
  97. package/vendors/gemini/agents/wtfp/research-synthesizer.md +205 -0
  98. package/vendors/gemini/agents/wtfp/section-planner.md +355 -0
  99. package/vendors/gemini/agents/wtfp/section-reviewer.md +175 -0
  100. package/vendors/gemini/agents/wtfp/section-writer.md +304 -0
  101. package/vendors/gemini/commands/wtfp/add-todo.toml +102 -0
  102. package/vendors/gemini/commands/wtfp/analyze-bib.toml +126 -0
  103. package/vendors/gemini/commands/wtfp/audit-milestone.toml +278 -0
  104. package/vendors/gemini/commands/wtfp/check-refs.toml +123 -0
  105. package/vendors/gemini/commands/wtfp/check-todos.toml +145 -0
  106. package/vendors/gemini/commands/wtfp/checkpoint.toml +96 -0
  107. package/vendors/gemini/commands/wtfp/contribute.toml +269 -0
  108. package/vendors/gemini/commands/wtfp/create-outline.toml +180 -0
  109. package/vendors/gemini/commands/wtfp/create-poster.toml +36 -0
  110. package/vendors/gemini/commands/wtfp/create-slides.toml +35 -0
  111. package/vendors/gemini/commands/wtfp/discuss-section.toml +62 -0
  112. package/vendors/gemini/commands/wtfp/execute-outline.toml +247 -0
  113. package/vendors/gemini/commands/wtfp/export-latex.toml +209 -0
  114. package/vendors/gemini/commands/wtfp/help.toml +184 -0
  115. package/vendors/gemini/commands/wtfp/insert-section.toml +123 -0
  116. package/vendors/gemini/commands/wtfp/list-assumptions.toml +104 -0
  117. package/vendors/gemini/commands/wtfp/map-project.toml +99 -0
  118. package/vendors/gemini/commands/wtfp/new-paper.toml +160 -0
  119. package/vendors/gemini/commands/wtfp/pause-writing.toml +140 -0
  120. package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +249 -0
  121. package/vendors/gemini/commands/wtfp/plan-revision.toml +171 -0
  122. package/vendors/gemini/commands/wtfp/plan-section.toml +212 -0
  123. package/vendors/gemini/commands/wtfp/polish-prose.toml +114 -0
  124. package/vendors/gemini/commands/wtfp/progress.toml +145 -0
  125. package/vendors/gemini/commands/wtfp/quick.toml +96 -0
  126. package/vendors/gemini/commands/wtfp/remove-section.toml +140 -0
  127. package/vendors/gemini/commands/wtfp/report-bug.toml +126 -0
  128. package/vendors/gemini/commands/wtfp/request-feature.toml +155 -0
  129. package/vendors/gemini/commands/wtfp/research-gap.toml +214 -0
  130. package/vendors/gemini/commands/wtfp/resume-writing.toml +136 -0
  131. package/vendors/gemini/commands/wtfp/review-section.toml +121 -0
  132. package/vendors/gemini/commands/wtfp/settings.toml +191 -0
  133. package/vendors/gemini/commands/wtfp/submit-milestone.toml +351 -0
  134. package/vendors/gemini/commands/wtfp/update.toml +107 -0
  135. package/vendors/gemini/commands/wtfp/verify-work.toml +245 -0
  136. package/vendors/gemini/commands/wtfp/write-section.toml +228 -0
  137. package/vendors/opencode/agents/wtfp/argument-verifier.md +184 -0
  138. package/vendors/opencode/agents/wtfp/citation-expert.md +41 -0
  139. package/vendors/opencode/agents/wtfp/citation-formatter.md +38 -0
  140. package/vendors/opencode/agents/wtfp/coherence-checker.md +162 -0
  141. package/vendors/opencode/agents/wtfp/outliner.md +252 -0
  142. package/vendors/opencode/agents/wtfp/plan-checker.md +244 -0
  143. package/vendors/opencode/agents/wtfp/prose-polisher.md +158 -0
  144. package/vendors/opencode/agents/wtfp/research-synthesizer.md +205 -0
  145. package/vendors/opencode/agents/wtfp/section-planner.md +355 -0
  146. package/vendors/opencode/agents/wtfp/section-reviewer.md +175 -0
  147. package/vendors/opencode/agents/wtfp/section-writer.md +304 -0
  148. package/vendors/opencode/commands/wtfp/add-todo.md +103 -0
  149. package/vendors/opencode/commands/wtfp/analyze-bib.md +127 -0
  150. package/vendors/opencode/commands/wtfp/audit-milestone.md +279 -0
  151. package/vendors/opencode/commands/wtfp/check-refs.md +124 -0
  152. package/vendors/opencode/commands/wtfp/check-todos.md +146 -0
  153. package/vendors/opencode/commands/wtfp/checkpoint.md +97 -0
  154. package/vendors/opencode/commands/wtfp/contribute.md +266 -0
  155. package/vendors/opencode/commands/wtfp/create-outline.md +181 -0
  156. package/vendors/opencode/commands/wtfp/create-poster.md +37 -0
  157. package/vendors/opencode/commands/wtfp/create-slides.md +36 -0
  158. package/vendors/opencode/commands/wtfp/discuss-section.md +63 -0
  159. package/vendors/opencode/commands/wtfp/execute-outline.md +248 -0
  160. package/vendors/opencode/commands/wtfp/export-latex.md +210 -0
  161. package/vendors/opencode/commands/wtfp/help.md +185 -0
  162. package/vendors/opencode/commands/wtfp/insert-section.md +124 -0
  163. package/vendors/opencode/commands/wtfp/list-assumptions.md +105 -0
  164. package/vendors/opencode/commands/wtfp/map-project.md +100 -0
  165. package/vendors/opencode/commands/wtfp/new-paper.md +161 -0
  166. package/vendors/opencode/commands/wtfp/pause-writing.md +141 -0
  167. package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +250 -0
  168. package/vendors/opencode/commands/wtfp/plan-revision.md +174 -0
  169. package/vendors/opencode/commands/wtfp/plan-section.md +214 -0
  170. package/vendors/opencode/commands/wtfp/polish-prose.md +115 -0
  171. package/vendors/opencode/commands/wtfp/progress.md +146 -0
  172. package/vendors/opencode/commands/wtfp/quick.md +97 -0
  173. package/vendors/opencode/commands/wtfp/remove-section.md +141 -0
  174. package/vendors/opencode/commands/wtfp/report-bug.md +127 -0
  175. package/vendors/opencode/commands/wtfp/request-feature.md +156 -0
  176. package/vendors/opencode/commands/wtfp/research-gap.md +215 -0
  177. package/vendors/opencode/commands/wtfp/resume-writing.md +137 -0
  178. package/vendors/opencode/commands/wtfp/review-section.md +123 -0
  179. package/vendors/opencode/commands/wtfp/settings.md +192 -0
  180. package/vendors/opencode/commands/wtfp/submit-milestone.md +352 -0
  181. package/vendors/opencode/commands/wtfp/update.md +108 -0
  182. package/vendors/opencode/commands/wtfp/verify-work.md +246 -0
  183. package/vendors/opencode/commands/wtfp/write-section.md +228 -0
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: wtfp:quick
3
+ description: Run a small writing fix without full planning overhead
4
+ argument-hint: "[task description]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Edit
10
+ - Glob
11
+ - Grep
12
+ - Task
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <objective>
17
+ Execute a quick writing task with atomic commits and state tracking but skip optional agents (plan-checker, argument-verifier).
18
+
19
+ **Orchestrator role:** Parse task, load minimal context, execute directly or spawn writer agent, commit result.
20
+
21
+ Use for small targeted tasks: fix a paragraph, add a citation, tweak wording, expand a point.
22
+ </objective>
23
+
24
+ <context>
25
+ Task: $ARGUMENTS (natural language description of what to do)
26
+
27
+ **Load project state:**
28
+ @.planning/STATE.md
29
+ @.planning/config.json
30
+ </context>
31
+
32
+ <process>
33
+
34
+ ## 1. Validate Environment
35
+
36
+ ```bash
37
+ ls .planning/ 2>/dev/null || echo "No project — will work on files directly"
38
+ ls paper/*.md 2>/dev/null
39
+ ```
40
+
41
+ ## 2. Parse Task Intent
42
+
43
+ Classify $ARGUMENTS into task type:
44
+ - **fix** — Correct an error, fix citation, resolve contradiction
45
+ - **add** — Add a paragraph, citation, transition, figure reference
46
+ - **revise** — Rewrite a paragraph, strengthen argument, tighten prose
47
+ - **cite** — Add or fix specific citations
48
+
49
+ ## 3. Load Minimal Context
50
+
51
+ ```bash
52
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
53
+ STATE_CONTENT=$(cat .planning/STATE.md 2>/dev/null)
54
+ ```
55
+
56
+ Only load files directly relevant to the task. No full context dump.
57
+
58
+ ## 4. Execute Task
59
+
60
+ **For simple tasks (fix, cite):** Execute directly in orchestrator — read target file, make edit, verify.
61
+
62
+ **For complex tasks (add, revise):** Spawn section-writer agent with focused prompt.
63
+
64
+ | Agent | quality | balanced | budget |
65
+ |-------|---------|----------|--------|
66
+ | section-writer | opus | sonnet | sonnet |
67
+
68
+ ```
69
+ Task(
70
+ prompt="First, read ~/.claude/agents/wtfp/section-writer.md for your role.\n\n" + focused_prompt,
71
+ subagent_type="general-purpose",
72
+ model="{writer_model}",
73
+ description="Quick: [task summary]"
74
+ )
75
+ ```
76
+
77
+ **Skip:** plan-checker, argument-verifier (quick mode = no verification loop).
78
+
79
+ ## 5. Commit and Update State
80
+
81
+ ```bash
82
+ git add paper/
83
+ git commit -m "[type](quick): [task description]"
84
+ ```
85
+
86
+ Update STATE.md word count if changed.
87
+
88
+ </process>
89
+
90
+ <offer_next>
91
+
92
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
93
+ WTF-P ► QUICK TASK DONE ✓
94
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
+
96
+ [task summary] — [words changed]
97
+
98
+ ───────────────────────────────────────────
99
+
100
+ </offer_next>
101
+
102
+ <success_criteria>
103
+ - [ ] Task executed with minimal context loading
104
+ - [ ] Changes committed atomically
105
+ - [ ] STATE.md word count updated
106
+ - [ ] No unnecessary agent spawning
107
+ </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:remove-section
3
- description: Remove a future section and renumber subsequent sections
3
+ description: Remove an unwritten section and renumber the rest
4
4
  argument-hint: "[section]"
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:report-bug
3
- description: Report a bug in WTF-P via GitHub issue
3
+ description: Report a bug via GitHub issue
4
4
  allowed-tools:
5
5
  - Bash
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:request-feature
3
- description: Request a new feature for WTF-P via GitHub issue
3
+ description: Request a new feature via GitHub issue
4
4
  allowed-tools:
5
5
  - Bash
6
6
  - Read
@@ -1,235 +1,222 @@
1
1
  ---
2
2
  name: wtfp:research-gap
3
- description: Comprehensive literature/domain research for a section
4
- argument-hint: "[section]"
3
+ description: Research literature and domain knowledge for a section
4
+ argument-hint: "[section] [--depth=quick|standard|deep]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
8
8
  - Write
9
- - WebFetch
10
- - WebSearch
11
- - mcp__context7__*
9
+ - Task
12
10
  - AskUserQuestion
13
11
  ---
14
12
 
13
+ <execution_context>
14
+ @~/.claude/write-the-f-paper/references/research-pitfalls.md
15
+ </execution_context>
16
+
15
17
  <objective>
16
18
  Perform comprehensive literature/domain research for a specific section.
17
19
 
18
- Discovers:
19
- - Key citations needed
20
- - Standard approaches in the literature
21
- - Gaps in current research
22
- - How experts write about this topic
23
-
24
- Creates RESEARCH.md with "how experts write this" knowledge.
20
+ **Orchestrator role:** Validate project, scope research with user, resolve model profile, spawn research-synthesizer agent, present results.
25
21
 
26
- Use for literature reviews, methodology justification, positioning your contribution.
22
+ Creates RESEARCH.md with "how experts write this" knowledge, key citations, gaps, and positioning.
27
23
  </objective>
28
24
 
29
- <execution_context>
30
- @~/.claude/write-the-f-paper/workflows/research-gap.md
31
- @~/.claude/write-the-f-paper/references/research-pitfalls.md
32
- </execution_context>
25
+ <context>
26
+ Section: $ARGUMENTS (section number or name)
27
+ </context>
33
28
 
34
29
  <process>
35
30
 
36
- <step name="verify">
37
- **Verify project exists:**
31
+ ## 1. Validate Environment and Resolve Model Profile
38
32
 
39
33
  ```bash
40
- [ ! -f .planning/PROJECT.md ] && echo "ERROR: No project found. Run /wtfp:new-paper first" && exit 1
41
- [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No outline found. Run /wtfp:create-outline first" && exit 1
34
+ [ ! -f .planning/PROJECT.md ] && echo "ERROR: No project. Run /wtfp:new-paper" && exit 1
35
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No roadmap. Run /wtfp:create-outline" && exit 1
42
36
  ```
43
37
 
44
- </step>
38
+ ```bash
39
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
40
+ ```
45
41
 
46
- <step name="load">
47
- **Load context:**
42
+ | Agent | quality | balanced | budget |
43
+ |-------|---------|----------|--------|
44
+ | research-synthesizer | opus | sonnet | haiku |
48
45
 
49
- - Read PROJECT.md for core argument and field
50
- - Read ROADMAP.md for section goal
51
- - Read argument-map.md for claims to support
52
- - Read sources/literature.md for existing citations
53
- </step>
46
+ ## 1b. Parse Depth Flag
54
47
 
55
- <step name="scope">
56
- **Define research scope:**
48
+ Parse --depth from $ARGUMENTS:
49
+
50
+ ```bash
51
+ # Extract depth from arguments (--depth=quick, --depth=standard, or --depth=deep)
52
+ DEPTH_ARG=$(echo "$ARGUMENTS" | grep -oE '\-\-depth=(quick|standard|deep)' | cut -d= -f2)
53
+
54
+ # If no --depth flag, read default from config
55
+ if [ -z "$DEPTH_ARG" ]; then
56
+ DEPTH=$(cat .planning/config.json 2>/dev/null | grep -o '"depth"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "standard")
57
+ else
58
+ DEPTH="$DEPTH_ARG"
59
+ fi
60
+ ```
61
+
62
+ **Depth mapping:**
63
+
64
+ | Depth | Behavior |
65
+ |-------|----------|
66
+ | quick | Quick verbal summary - no RESEARCH.md created, no git commit |
67
+ | standard | Standard research (current behavior) - 10-20 sources, RESEARCH.md created |
68
+ | deep | Exhaustive literature review - 20-50 papers, all categories mandatory |
69
+
70
+ ## 2. Define Research Scope
57
71
 
58
72
  Use AskUserQuestion:
59
73
  - header: "Research Focus"
60
- - question: "What specifically do you need to understand for [section]?"
74
+ - question: "What specifically do you need to understand for this section?"
61
75
  - options:
62
76
  - "Key citations" — Who are the must-cite authors/papers?
63
77
  - "Methodology" — How do others approach this method?
64
78
  - "State of field" — What's the current consensus/debate?
65
79
  - "Positioning" — How to differentiate from existing work?
66
- - "All of the above" — Comprehensive research
67
80
 
68
- </step>
81
+ ## 3. Read Context Files
69
82
 
70
- <step name="research">
71
- **Conduct research:**
83
+ ```bash
84
+ PROJECT_CONTENT=$(cat .planning/PROJECT.md)
85
+ ROADMAP_CONTENT=$(cat .planning/ROADMAP.md)
86
+ ARGMAP_CONTENT=$(cat .planning/structure/argument-map.md 2>/dev/null)
87
+ LITERATURE_CONTENT=$(cat .planning/sources/literature.md 2>/dev/null)
88
+ BIB_INDEX=$(node ~/.claude/bin/bib-index.js index references.bib 2>/dev/null || echo "No references.bib")
89
+
90
+ SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
91
+ CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
92
+ ```
72
93
 
73
- Based on scope, investigate:
94
+ ## 3b. Quick Depth: Verbal Summary Only
74
95
 
75
- **Key Citations:**
76
- - Identify foundational papers
77
- - Find recent high-impact work
78
- - Note methodological papers
79
- - Track disagreements/debates
96
+ **If DEPTH is "quick":**
80
97
 
81
- **Standard Approaches:**
82
- - How do others structure similar sections?
83
- - What's the typical argument flow?
84
- - What evidence is typically presented?
98
+ Skip agent spawn entirely. Orchestrator provides direct verbal synthesis.
85
99
 
86
- **Gaps:**
87
- - What's missing in current literature?
88
- - Where does your work fit?
89
- - What questions remain unanswered?
100
+ Read available context (PROJECT.md, argument-map, existing literature, CONTEXT_CONTENT) and synthesize a verbal summary directly to user:
90
101
 
91
- **Expert Writing Patterns:**
92
- - How do top papers in this area write about this?
93
- - What terminology is standard?
94
- - What level of detail is expected?
102
+ ```
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
+ WTF-P ► QUICK RESEARCH SYNTHESIS
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
106
 
96
- </step>
107
+ Based on available context for Section {X}:
97
108
 
98
- <step name="create_research">
99
- **Create RESEARCH.md:**
109
+ [Synthesize key points from PROJECT, argument-map, and any existing literature.md]
100
110
 
101
- ```markdown
102
- ---
103
- section: XX-name
104
- scope: [research scope]
105
- confidence: [high/medium/low]
106
- ---
111
+ Key areas:
112
+ - [Area 1]: [Brief synthesis]
113
+ - [Area 2]: [Brief synthesis]
107
114
 
108
- # Research: [Section Name]
115
+ Suggested citations to consider:
116
+ - [If any mentioned in existing sources]
109
117
 
110
- ## Summary
111
- [2-3 sentence overview of findings]
118
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
112
119
 
113
- ## Key Citations
120
+ **Note:** Quick research -- no RESEARCH.md written. Run with `--depth=standard` for persistent research.
121
+ ```
114
122
 
115
- ### Foundational
116
- | Citation | Contribution | Relevance |
117
- |----------|--------------|-----------|
118
- | [Author (Year)] | [What they established] | [Why cite] |
123
+ No RESEARCH.md created. No git commit. Present summary and offer next steps, then exit workflow.
119
124
 
120
- ### Recent/High-Impact
121
- | Citation | Contribution | Relevance |
122
- |----------|--------------|-----------|
125
+ **If DEPTH is "standard" or "deep":** Continue to Step 4.
123
126
 
124
- ### Methodology
125
- | Citation | Approach | Relevance |
126
- |----------|----------|-----------|
127
+ ## 4. Spawn wtfp-research-synthesizer Agent (standard/deep)
127
128
 
128
- ## Standard Approaches
129
- [How others write about this topic]
129
+ ```
130
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
131
+ WTF-P ► RESEARCHING SECTION {X} (depth: {DEPTH})
132
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
133
+ ```
130
134
 
131
- - Typical structure: [...]
132
- - Common arguments: [...]
133
- - Expected evidence: [...]
135
+ ```
136
+ Task(
137
+ prompt="First, read ~/.claude/agents/wtfp/research-synthesizer.md for your role and instructions.\n\n" + filled_research_prompt,
138
+ subagent_type="general-purpose",
139
+ model="{researcher_model}",
140
+ description="Research Section {X}"
141
+ )
142
+ ```
134
143
 
135
- ## Field Consensus
136
- [What's generally agreed upon]
144
+ Research prompt includes: `<research_scope>` with user-selected scope, `<project_context>` with PROJECT + ROADMAP + argument-map, `<existing_literature>` with bib index and literature.md, `<user_decisions>` with CONTEXT_CONTENT, `<output>` with target RESEARCH.md path, `<depth>` with current depth setting.
137
145
 
138
- ## Active Debates
139
- [Where experts disagree]
146
+ **Depth-specific instructions in prompt:**
140
147
 
141
- ## Gaps in Literature
142
- - [Gap 1]: [your opportunity]
143
- - [Gap 2]: [your opportunity]
148
+ **If DEPTH is "standard":**
149
+ Add `<depth_instruction>Target 10-20 relevant sources across categories. Focus on most impactful papers for each category.</depth_instruction>`
144
150
 
145
- ## Your Positioning
146
- [How your work relates to existing literature]
151
+ **If DEPTH is "deep":**
152
+ Add `<depth_instruction>Perform exhaustive literature review. Target 20-50 papers across all categories. Include systematic field mapping: major research groups, funding bodies, key venues, citation networks. Map the intellectual lineage of the field. Identify ALL competing approaches, not just the main ones. Document methodology variations comprehensively. All 5 categories (foundational, recent, competing, gap, methods) are REQUIRED, not optional.</depth_instruction>`
147
153
 
148
- ## Writing Recommendations
149
- - Terminology to use: [...]
150
- - Level of detail expected: [...]
151
- - Citations to definitely include: [...]
152
- - Arguments to make: [...]
154
+ **Source priority hierarchy (all depths):**
155
+ Add `<source_priority>Source priority: Context7 MCP first (if available), official sources/databases second (Google Scholar, PubMed, IEEE, ACL, arXiv), WebSearch last.</source_priority>`
153
156
 
154
- ## Sources Consulted
155
- - [Source 1]
156
- - [Source 2]
157
+ ## 5. Handle Researcher Return
157
158
 
158
- ## Confidence Assessment
159
- - Key citations: [high/medium/low]
160
- - Field understanding: [high/medium/low]
161
- - Gap identification: [high/medium/low]
159
+ **`## RESEARCH COMPLETE`:** Present findings summary.
162
160
 
163
- ## Open Questions
164
- - [Questions that need user input]
161
+ **`## RESEARCH BLOCKED`:** Show blocker, offer alternatives.
165
162
 
166
- ---
167
- *Researched: [date]*
168
- ```
163
+ ## 6. Present Results
169
164
 
170
- </step>
165
+ </process>
171
166
 
172
- <step name="update_literature">
173
- **Update literature index:**
167
+ <offer_next>
174
168
 
175
- Add any new citations discovered to `.planning/sources/literature.md`.
169
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
170
+ WTF-P ► RESEARCH COMPLETE ✓
171
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
176
172
 
177
- </step>
173
+ Depth: {DEPTH}
174
+ Citations found: {N}
175
+ Confidence: {level}
178
176
 
179
- <step name="commit">
180
- ```bash
181
- git add .planning/sections/XX-name/XX-RESEARCH.md .planning/sources/literature.md
182
- git commit -m "$(cat <<'EOF'
183
- research(XX): [section name] literature review
184
-
185
- Scope: [scope]
186
- Citations found: [N]
187
- Confidence: [level]
188
- EOF
189
- )"
190
- ```
177
+ ───────────────────────────────────────────
191
178
 
192
- </step>
179
+ ## ▶ Next Up
193
180
 
194
- <step name="done">
195
- **Present completion:**
181
+ **Plan section** — create writing plan with research context
196
182
 
197
- ```
198
- Research complete:
183
+ `/wtfp:plan-section {section}`
199
184
 
200
- - Research: .planning/sections/XX-name/XX-RESEARCH.md
201
- - Citations added: [N] new references
202
- - Confidence: [level]
185
+ <sub>`/clear` first → fresh context window</sub>
203
186
 
204
- ## Key Findings
205
- [2-3 bullet summary]
187
+ ───────────────────────────────────────────
206
188
 
207
- ## Recommended Next Steps
208
- [Based on research]
189
+ </offer_next>
209
190
 
210
- ---
191
+ <offer_next_quick>
192
+
193
+ **For quick depth only (no RESEARCH.md written):**
194
+
195
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
196
+ WTF-P ► QUICK RESEARCH COMPLETE
197
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
198
+
199
+ Quick research -- no RESEARCH.md written. Run with `--depth=standard` for persistent research.
200
+
201
+ ───────────────────────────────────────────
211
202
 
212
203
  ## ▶ Next Up
213
204
 
214
- **Plan section** — create writing plan with research context
205
+ **Plan section** — proceed without literature doc
215
206
 
216
- `/wtfp:plan-section [section]`
207
+ `/wtfp:plan-section {section}`
217
208
 
218
- <sub>`/clear` first → fresh context window</sub>
209
+ **Or deepen research:**
219
210
 
220
- ---
221
- ```
211
+ `/wtfp:research-gap {section} --depth=standard`
222
212
 
223
- </step>
213
+ ───────────────────────────────────────────
224
214
 
225
- </process>
215
+ </offer_next_quick>
226
216
 
227
217
  <success_criteria>
228
218
  - [ ] Research scope defined with user
229
- - [ ] Key citations identified
230
- - [ ] Standard approaches documented
231
- - [ ] Gaps identified
232
- - [ ] Writing recommendations provided
233
- - [ ] literature.md updated
234
- - [ ] All committed to git
219
+ - [ ] Research-synthesizer spawned with full context
220
+ - [ ] RESEARCH.md created with key citations and gaps
221
+ - [ ] User knows next steps
235
222
  </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:resume-writing
3
- description: Resume work from previous session with full context restoration
3
+ description: Resume writing from a previous session
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash