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.
Files changed (175) hide show
  1. package/README.md +146 -226
  2. package/bin/commands/doctor.js +88 -2
  3. package/bin/commands/install-logic.js +121 -26
  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/checkpoint.js +183 -0
  8. package/bin/lib/context-primer.js +214 -0
  9. package/bin/lib/manifest.js +62 -2
  10. package/bin/lib/utils.js +22 -1
  11. package/bin/uninstall.js +270 -111
  12. package/core/write-the-f-paper/references/agent-model-matrix.md +62 -0
  13. package/core/write-the-f-paper/references/checkpoints.md +160 -9
  14. package/core/write-the-f-paper/references/context-fidelity.md +153 -0
  15. package/core/write-the-f-paper/references/deviation-rules.md +150 -0
  16. package/core/write-the-f-paper/references/git-integration.md +80 -0
  17. package/core/write-the-f-paper/references/orchestrator-pattern.md +167 -0
  18. package/core/write-the-f-paper/references/planning-config.md +135 -0
  19. package/core/write-the-f-paper/references/ui-brand.md +186 -0
  20. package/core/write-the-f-paper/templates/UAT.md +80 -0
  21. package/core/write-the-f-paper/templates/base-prefs.yaml +42 -0
  22. package/core/write-the-f-paper/templates/config.json +31 -5
  23. package/core/write-the-f-paper/workflows/create-outline.wcn.md +1 -1
  24. package/core/write-the-f-paper/workflows/execute-outline.md +163 -0
  25. package/core/write-the-f-paper/workflows/execute-outline.wcn.md +73 -0
  26. package/core/write-the-f-paper/workflows/execute-section.wcn.md +141 -169
  27. package/core/write-the-f-paper/workflows/plan-section.wcn.md +96 -103
  28. package/core/write-the-f-paper/workflows/research-gap.md +27 -3
  29. package/core/write-the-f-paper/workflows/research-gap.wcn.md +18 -1
  30. package/core/write-the-f-paper/workflows/verify-work.md +251 -0
  31. package/core/write-the-f-paper/workflows/verify-work.wcn.md +74 -0
  32. package/package.json +19 -7
  33. package/vendors/claude/.claude-plugin/plugin.json +2 -2
  34. package/vendors/claude/agents/wtfp/argument-verifier.md +189 -0
  35. package/vendors/claude/agents/wtfp/citation-expert.md +1 -1
  36. package/vendors/claude/agents/wtfp/citation-formatter.md +1 -1
  37. package/vendors/claude/agents/wtfp/coherence-checker.md +167 -0
  38. package/vendors/claude/agents/wtfp/outliner.md +259 -0
  39. package/vendors/claude/agents/wtfp/plan-checker.md +249 -0
  40. package/vendors/claude/agents/wtfp/prose-polisher.md +166 -0
  41. package/vendors/claude/agents/wtfp/research-synthesizer.md +215 -0
  42. package/vendors/claude/agents/wtfp/section-planner.md +364 -0
  43. package/vendors/claude/agents/wtfp/section-reviewer.md +182 -0
  44. package/vendors/claude/agents/wtfp/section-writer.md +312 -0
  45. package/vendors/claude/commands/wtfp/add-todo.md +108 -0
  46. package/vendors/claude/commands/wtfp/analyze-bib.md +58 -236
  47. package/vendors/claude/commands/wtfp/audit-milestone.md +286 -0
  48. package/vendors/claude/commands/wtfp/check-refs.md +60 -133
  49. package/vendors/claude/commands/wtfp/check-todos.md +152 -0
  50. package/vendors/claude/commands/wtfp/checkpoint.md +105 -0
  51. package/vendors/claude/commands/wtfp/contribute.md +1 -1
  52. package/vendors/claude/commands/wtfp/create-outline.md +109 -195
  53. package/vendors/claude/commands/wtfp/create-poster.md +1 -1
  54. package/vendors/claude/commands/wtfp/create-slides.md +1 -1
  55. package/vendors/claude/commands/wtfp/discuss-section.md +1 -1
  56. package/vendors/claude/commands/wtfp/execute-outline.md +257 -0
  57. package/vendors/claude/commands/wtfp/export-latex.md +1 -1
  58. package/vendors/claude/commands/wtfp/help.md +174 -280
  59. package/vendors/claude/commands/wtfp/insert-section.md +1 -1
  60. package/vendors/claude/commands/wtfp/list-assumptions.md +1 -1
  61. package/vendors/claude/commands/wtfp/map-project.md +35 -124
  62. package/vendors/claude/commands/wtfp/new-paper.md +85 -320
  63. package/vendors/claude/commands/wtfp/pause-writing.md +1 -1
  64. package/vendors/claude/commands/wtfp/plan-milestone-gaps.md +255 -0
  65. package/vendors/claude/commands/wtfp/plan-revision.md +1 -1
  66. package/vendors/claude/commands/wtfp/plan-section.md +165 -190
  67. package/vendors/claude/commands/wtfp/polish-prose.md +66 -118
  68. package/vendors/claude/commands/wtfp/progress.md +82 -254
  69. package/vendors/claude/commands/wtfp/quick.md +107 -0
  70. package/vendors/claude/commands/wtfp/remove-section.md +1 -1
  71. package/vendors/claude/commands/wtfp/report-bug.md +1 -1
  72. package/vendors/claude/commands/wtfp/request-feature.md +1 -1
  73. package/vendors/claude/commands/wtfp/research-gap.md +138 -150
  74. package/vendors/claude/commands/wtfp/resume-writing.md +1 -1
  75. package/vendors/claude/commands/wtfp/review-section.md +55 -333
  76. package/vendors/claude/commands/wtfp/settings.md +197 -0
  77. package/vendors/claude/commands/wtfp/submit-milestone.md +248 -99
  78. package/vendors/claude/commands/wtfp/update.md +112 -0
  79. package/vendors/claude/commands/wtfp/verify-work.md +254 -0
  80. package/vendors/claude/commands/wtfp/write-section.md +144 -180
  81. package/vendors/gemini/agents/wtfp/argument-verifier.md +184 -0
  82. package/vendors/gemini/agents/wtfp/citation-expert.md +41 -0
  83. package/vendors/gemini/agents/wtfp/citation-formatter.md +38 -0
  84. package/vendors/gemini/agents/wtfp/coherence-checker.md +162 -0
  85. package/vendors/gemini/agents/wtfp/outliner.md +252 -0
  86. package/vendors/gemini/agents/wtfp/plan-checker.md +244 -0
  87. package/vendors/gemini/agents/wtfp/prose-polisher.md +158 -0
  88. package/vendors/gemini/agents/wtfp/research-synthesizer.md +205 -0
  89. package/vendors/gemini/agents/wtfp/section-planner.md +355 -0
  90. package/vendors/gemini/agents/wtfp/section-reviewer.md +175 -0
  91. package/vendors/gemini/agents/wtfp/section-writer.md +304 -0
  92. package/vendors/gemini/commands/wtfp/add-todo.toml +102 -0
  93. package/vendors/gemini/commands/wtfp/analyze-bib.toml +126 -0
  94. package/vendors/gemini/commands/wtfp/audit-milestone.toml +278 -0
  95. package/vendors/gemini/commands/wtfp/check-refs.toml +123 -0
  96. package/vendors/gemini/commands/wtfp/check-todos.toml +145 -0
  97. package/vendors/gemini/commands/wtfp/checkpoint.toml +96 -0
  98. package/vendors/gemini/commands/wtfp/contribute.toml +269 -0
  99. package/vendors/gemini/commands/wtfp/create-outline.toml +180 -0
  100. package/vendors/gemini/commands/wtfp/create-poster.toml +36 -0
  101. package/vendors/gemini/commands/wtfp/create-slides.toml +35 -0
  102. package/vendors/gemini/commands/wtfp/discuss-section.toml +62 -0
  103. package/vendors/gemini/commands/wtfp/execute-outline.toml +247 -0
  104. package/vendors/gemini/commands/wtfp/export-latex.toml +209 -0
  105. package/vendors/gemini/commands/wtfp/help.toml +184 -0
  106. package/vendors/gemini/commands/wtfp/insert-section.toml +123 -0
  107. package/vendors/gemini/commands/wtfp/list-assumptions.toml +104 -0
  108. package/vendors/gemini/commands/wtfp/map-project.toml +99 -0
  109. package/vendors/gemini/commands/wtfp/new-paper.toml +160 -0
  110. package/vendors/gemini/commands/wtfp/pause-writing.toml +140 -0
  111. package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +249 -0
  112. package/vendors/gemini/commands/wtfp/plan-revision.toml +171 -0
  113. package/vendors/gemini/commands/wtfp/plan-section.toml +212 -0
  114. package/vendors/gemini/commands/wtfp/polish-prose.toml +114 -0
  115. package/vendors/gemini/commands/wtfp/progress.toml +145 -0
  116. package/vendors/gemini/commands/wtfp/quick.toml +96 -0
  117. package/vendors/gemini/commands/wtfp/remove-section.toml +140 -0
  118. package/vendors/gemini/commands/wtfp/report-bug.toml +126 -0
  119. package/vendors/gemini/commands/wtfp/request-feature.toml +155 -0
  120. package/vendors/gemini/commands/wtfp/research-gap.toml +214 -0
  121. package/vendors/gemini/commands/wtfp/resume-writing.toml +136 -0
  122. package/vendors/gemini/commands/wtfp/review-section.toml +121 -0
  123. package/vendors/gemini/commands/wtfp/settings.toml +191 -0
  124. package/vendors/gemini/commands/wtfp/submit-milestone.toml +351 -0
  125. package/vendors/gemini/commands/wtfp/update.toml +107 -0
  126. package/vendors/gemini/commands/wtfp/verify-work.toml +245 -0
  127. package/vendors/gemini/commands/wtfp/write-section.toml +228 -0
  128. package/vendors/opencode/agents/wtfp/argument-verifier.md +184 -0
  129. package/vendors/opencode/agents/wtfp/citation-expert.md +41 -0
  130. package/vendors/opencode/agents/wtfp/citation-formatter.md +38 -0
  131. package/vendors/opencode/agents/wtfp/coherence-checker.md +162 -0
  132. package/vendors/opencode/agents/wtfp/outliner.md +252 -0
  133. package/vendors/opencode/agents/wtfp/plan-checker.md +244 -0
  134. package/vendors/opencode/agents/wtfp/prose-polisher.md +158 -0
  135. package/vendors/opencode/agents/wtfp/research-synthesizer.md +205 -0
  136. package/vendors/opencode/agents/wtfp/section-planner.md +355 -0
  137. package/vendors/opencode/agents/wtfp/section-reviewer.md +175 -0
  138. package/vendors/opencode/agents/wtfp/section-writer.md +304 -0
  139. package/vendors/opencode/commands/wtfp/add-todo.md +103 -0
  140. package/vendors/opencode/commands/wtfp/analyze-bib.md +127 -0
  141. package/vendors/opencode/commands/wtfp/audit-milestone.md +279 -0
  142. package/vendors/opencode/commands/wtfp/check-refs.md +124 -0
  143. package/vendors/opencode/commands/wtfp/check-todos.md +146 -0
  144. package/vendors/opencode/commands/wtfp/checkpoint.md +97 -0
  145. package/vendors/opencode/commands/wtfp/contribute.md +266 -0
  146. package/vendors/opencode/commands/wtfp/create-outline.md +181 -0
  147. package/vendors/opencode/commands/wtfp/create-poster.md +37 -0
  148. package/vendors/opencode/commands/wtfp/create-slides.md +36 -0
  149. package/vendors/opencode/commands/wtfp/discuss-section.md +63 -0
  150. package/vendors/opencode/commands/wtfp/execute-outline.md +248 -0
  151. package/vendors/opencode/commands/wtfp/export-latex.md +210 -0
  152. package/vendors/opencode/commands/wtfp/help.md +185 -0
  153. package/vendors/opencode/commands/wtfp/insert-section.md +124 -0
  154. package/vendors/opencode/commands/wtfp/list-assumptions.md +105 -0
  155. package/vendors/opencode/commands/wtfp/map-project.md +100 -0
  156. package/vendors/opencode/commands/wtfp/new-paper.md +161 -0
  157. package/vendors/opencode/commands/wtfp/pause-writing.md +141 -0
  158. package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +250 -0
  159. package/vendors/opencode/commands/wtfp/plan-revision.md +174 -0
  160. package/vendors/opencode/commands/wtfp/plan-section.md +214 -0
  161. package/vendors/opencode/commands/wtfp/polish-prose.md +115 -0
  162. package/vendors/opencode/commands/wtfp/progress.md +146 -0
  163. package/vendors/opencode/commands/wtfp/quick.md +97 -0
  164. package/vendors/opencode/commands/wtfp/remove-section.md +141 -0
  165. package/vendors/opencode/commands/wtfp/report-bug.md +127 -0
  166. package/vendors/opencode/commands/wtfp/request-feature.md +156 -0
  167. package/vendors/opencode/commands/wtfp/research-gap.md +215 -0
  168. package/vendors/opencode/commands/wtfp/resume-writing.md +137 -0
  169. package/vendors/opencode/commands/wtfp/review-section.md +123 -0
  170. package/vendors/opencode/commands/wtfp/settings.md +192 -0
  171. package/vendors/opencode/commands/wtfp/submit-milestone.md +352 -0
  172. package/vendors/opencode/commands/wtfp/update.md +108 -0
  173. package/vendors/opencode/commands/wtfp/verify-work.md +246 -0
  174. package/vendors/opencode/commands/wtfp/write-section.md +228 -0
  175. package/vendors/claude/agents/wtfp/citation-retriever.md +0 -31
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: wtfp:request-feature
3
+ description: Request a new feature via GitHub issue
4
+ ---
5
+
6
+ <objective>
7
+ Help the user request a new feature for WTF-P by creating a well-formatted GitHub issue.
8
+ </objective>
9
+
10
+ <context>
11
+ @~/.opencode/write-the-f-paper/references/github-contrib.md
12
+ </context>
13
+
14
+ <process>
15
+
16
+ ## Step 1: Verify GitHub CLI
17
+
18
+ Check if `gh` is authenticated:
19
+
20
+ ```bash
21
+ gh auth status 2>&1
22
+ ```
23
+
24
+ If not authenticated, inform the user:
25
+ > To create GitHub issues, you need to authenticate the GitHub CLI.
26
+ > Run: `gh auth login`
27
+ > Then try this command again.
28
+
29
+ ## Step 2: Understand the Feature Request
30
+
31
+ Use the question tool to understand what the user wants:
32
+
33
+ **Question 1: Feature Category**
34
+ - Header: "Category"
35
+ - Options:
36
+ - "New command" - A new /wtfp:* slash command
37
+ - "Workflow enhancement" - Improve existing writing workflow
38
+ - "Installation/CLI" - Improve npx wtf-p experience
39
+ - "Template/Format" - New venue template or output format
40
+ - "Integration" - Connect with other tools (Zotero, Overleaf, etc.)
41
+
42
+ **Question 2: Complexity**
43
+ - Header: "Scope"
44
+ - Options:
45
+ - "Small tweak" - Minor change to existing behavior
46
+ - "New capability" - Add something that doesn't exist
47
+ - "Major feature" - Significant new functionality
48
+
49
+ ## Step 3: Gather Feature Details
50
+
51
+ Based on category, ask targeted questions:
52
+
53
+ **For new command:**
54
+ - What should `/wtfp:new-command` do?
55
+ - When would you use it in your writing workflow?
56
+ - What inputs does it need? What outputs?
57
+
58
+ **For workflow enhancement:**
59
+ - Which workflow needs improvement?
60
+ - What's missing or frustrating?
61
+ - How should it work differently?
62
+
63
+ **For templates/formats:**
64
+ - Which venue or format?
65
+ - Do you have example requirements?
66
+
67
+ ## Step 4: Explore Use Case
68
+
69
+ Ask user:
70
+ - What problem does this solve for you?
71
+ - How often would you use this?
72
+ - Have you tried any workarounds?
73
+
74
+ ## Step 5: Check for Duplicates
75
+
76
+ Search existing issues:
77
+ ```bash
78
+ gh issue list --repo akougkas/wtf-p --search "[KEYWORDS]" --limit 5
79
+ ```
80
+
81
+ If similar issues exist, show them to the user and ask:
82
+ - "These similar issues exist. Should we add to one of these, or create a new issue?"
83
+
84
+ ## Step 6: Draft the Feature Request
85
+
86
+ Create a draft:
87
+
88
+ ```markdown
89
+ ## Feature Description
90
+ [Clear description of the feature]
91
+
92
+ ## Use Case
93
+ [Why this is needed, what problem it solves]
94
+
95
+ ## Proposed Solution
96
+ [How it should work, with examples]
97
+
98
+ ### Example Usage
99
+ ```
100
+ /wtfp:new-command
101
+ > [Expected interaction]
102
+ ```
103
+
104
+ ## Alternatives Considered
105
+ [Other approaches, if discussed]
106
+
107
+ ## Additional Context
108
+ [Related features, prior art, mockups]
109
+ ```
110
+
111
+ ## Step 7: Offer Implementation Path
112
+
113
+ Ask user:
114
+ - Header: "Next Step"
115
+ - Options:
116
+ - "Create issue only" - Submit as feature request for maintainers
117
+ - "I'll implement it" - Create issue + guide through PR process
118
+ - "Help me implement" - Assistant assists with implementation
119
+
120
+ If user wants to implement, transition to `/wtfp:contribute` workflow.
121
+
122
+ ## Step 8: Create the Issue
123
+
124
+ If confirmed:
125
+
126
+ ```bash
127
+ gh issue create \
128
+ --repo akougkas/wtf-p \
129
+ --title "feat: [SHORT_TITLE]" \
130
+ --body "$(cat <<'EOF'
131
+ [FULL_BODY_HERE]
132
+ EOF
133
+ )" \
134
+ --label "enhancement"
135
+ ```
136
+
137
+ ## Step 9: Report Success
138
+
139
+ Show the user:
140
+ - Issue URL
141
+ - Issue number
142
+ - Encourage voting/commenting to show interest
143
+ - If they want to implement: next steps
144
+
145
+ </process>
146
+
147
+ <tips>
148
+
149
+ **Good feature requests include:**
150
+ - Specific use case (not just "it would be nice")
151
+ - Example of how it would work
152
+ - Explanation of why existing features don't solve this
153
+
154
+ **Signal boost:** Encourage users to share the issue link with others who might want the feature. More reactions = higher priority.
155
+
156
+ </tips>
@@ -0,0 +1,215 @@
1
+ ---
2
+ name: wtfp:research-gap
3
+ description: Research literature and domain knowledge for a section
4
+ ---
5
+
6
+ <execution_context>
7
+ @~/.opencode/write-the-f-paper/references/research-pitfalls.md
8
+ </execution_context>
9
+
10
+ <objective>
11
+ Perform comprehensive literature/domain research for a specific section.
12
+
13
+ **Orchestrator role:** Validate project, scope research with user, resolve model profile, spawn research-synthesizer agent, present results.
14
+
15
+ Creates RESEARCH.md with "how experts write this" knowledge, key citations, gaps, and positioning.
16
+ </objective>
17
+
18
+ <context>
19
+ Section: $ARGUMENTS (section number or name)
20
+ </context>
21
+
22
+ <process>
23
+
24
+ ## 1. Validate Environment and Resolve Model Profile
25
+
26
+ ```bash
27
+ [ ! -f .planning/PROJECT.md ] && echo "ERROR: No project. Run /wtfp:new-paper" && exit 1
28
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No roadmap. Run /wtfp:create-outline" && exit 1
29
+ ```
30
+
31
+ ```bash
32
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
33
+ ```
34
+
35
+ | Agent | quality | balanced | budget |
36
+ |-------|---------|----------|--------|
37
+ | research-synthesizer | opus | sonnet | haiku |
38
+
39
+ ## 1b. Parse Depth Flag
40
+
41
+ Parse --depth from $ARGUMENTS:
42
+
43
+ ```bash
44
+ # Extract depth from arguments (--depth=quick, --depth=standard, or --depth=deep)
45
+ DEPTH_ARG=$(echo "$ARGUMENTS" | grep -oE '\-\-depth=(quick|standard|deep)' | cut -d= -f2)
46
+
47
+ # If no --depth flag, read default from config
48
+ if [ -z "$DEPTH_ARG" ]; then
49
+ DEPTH=$(cat .planning/config.json 2>/dev/null | grep -o '"depth"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "standard")
50
+ else
51
+ DEPTH="$DEPTH_ARG"
52
+ fi
53
+ ```
54
+
55
+ **Depth mapping:**
56
+
57
+ | Depth | Behavior |
58
+ |-------|----------|
59
+ | quick | Quick verbal summary - no RESEARCH.md created, no git commit |
60
+ | standard | Standard research (current behavior) - 10-20 sources, RESEARCH.md created |
61
+ | deep | Exhaustive literature review - 20-50 papers, all categories mandatory |
62
+
63
+ ## 2. Define Research Scope
64
+
65
+ Use the question tool:
66
+ - header: "Research Focus"
67
+ - question: "What specifically do you need to understand for this section?"
68
+ - options:
69
+ - "Key citations" — Who are the must-cite authors/papers?
70
+ - "Methodology" — How do others approach this method?
71
+ - "State of field" — What's the current consensus/debate?
72
+ - "Positioning" — How to differentiate from existing work?
73
+
74
+ ## 3. Read Context Files
75
+
76
+ ```bash
77
+ PROJECT_CONTENT=$(cat .planning/PROJECT.md)
78
+ ROADMAP_CONTENT=$(cat .planning/ROADMAP.md)
79
+ ARGMAP_CONTENT=$(cat .planning/structure/argument-map.md 2>/dev/null)
80
+ LITERATURE_CONTENT=$(cat .planning/sources/literature.md 2>/dev/null)
81
+ BIB_INDEX=$(node ~/.opencode/bin/bib-index.js index references.bib 2>/dev/null || echo "No references.bib")
82
+
83
+ SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
84
+ CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
85
+ ```
86
+
87
+ ## 3b. Quick Depth: Verbal Summary Only
88
+
89
+ **If DEPTH is "quick":**
90
+
91
+ Skip agent spawn entirely. Orchestrator provides direct verbal synthesis.
92
+
93
+ Read available context (PROJECT.md, argument-map, existing literature, CONTEXT_CONTENT) and synthesize a verbal summary directly to user:
94
+
95
+ ```
96
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
97
+ WTF-P ► QUICK RESEARCH SYNTHESIS
98
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99
+
100
+ Based on available context for Section {X}:
101
+
102
+ [Synthesize key points from PROJECT, argument-map, and any existing literature.md]
103
+
104
+ Key areas:
105
+ - [Area 1]: [Brief synthesis]
106
+ - [Area 2]: [Brief synthesis]
107
+
108
+ Suggested citations to consider:
109
+ - [If any mentioned in existing sources]
110
+
111
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
112
+
113
+ **Note:** Quick research -- no RESEARCH.md written. Run with `--depth=standard` for persistent research.
114
+ ```
115
+
116
+ No RESEARCH.md created. No git commit. Present summary and offer next steps, then exit workflow.
117
+
118
+ **If DEPTH is "standard" or "deep":** Continue to Step 4.
119
+
120
+ ## 4. Spawn wtfp-research-synthesizer Agent (standard/deep)
121
+
122
+ ```
123
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
124
+ WTF-P ► RESEARCHING SECTION {X} (depth: {DEPTH})
125
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
126
+ ```
127
+
128
+ ```
129
+ Task(
130
+ prompt="First, read ~/.opencode/agents/wtfp/research-synthesizer.md for your role and instructions.\n\n" + filled_research_prompt,
131
+ subagent_type="general-purpose",
132
+ model="{researcher_model}",
133
+ description="Research Section {X}"
134
+ )
135
+ ```
136
+
137
+ 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.
138
+
139
+ **Depth-specific instructions in prompt:**
140
+
141
+ **If DEPTH is "standard":**
142
+ Add `<depth_instruction>Target 10-20 relevant sources across categories. Focus on most impactful papers for each category.</depth_instruction>`
143
+
144
+ **If DEPTH is "deep":**
145
+ 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>`
146
+
147
+ **Source priority hierarchy (all depths):**
148
+ Add `<source_priority>Source priority: Context7 MCP first (if available), official sources/databases second (Google Scholar, PubMed, IEEE, ACL, arXiv), WebSearch last.</source_priority>`
149
+
150
+ ## 5. Handle Researcher Return
151
+
152
+ **`## RESEARCH COMPLETE`:** Present findings summary.
153
+
154
+ **`## RESEARCH BLOCKED`:** Show blocker, offer alternatives.
155
+
156
+ ## 6. Present Results
157
+
158
+ </process>
159
+
160
+ <offer_next>
161
+
162
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
163
+ WTF-P ► RESEARCH COMPLETE ✓
164
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
165
+
166
+ Depth: {DEPTH}
167
+ Citations found: {N}
168
+ Confidence: {level}
169
+
170
+ ───────────────────────────────────────────
171
+
172
+ ## ▶ Next Up
173
+
174
+ **Plan section** — create writing plan with research context
175
+
176
+ `/wtfp:plan-section {section}`
177
+
178
+ <sub>`/clear` first → fresh context window</sub>
179
+
180
+ ───────────────────────────────────────────
181
+
182
+ </offer_next>
183
+
184
+ <offer_next_quick>
185
+
186
+ **For quick depth only (no RESEARCH.md written):**
187
+
188
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
189
+ WTF-P ► QUICK RESEARCH COMPLETE
190
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
191
+
192
+ Quick research -- no RESEARCH.md written. Run with `--depth=standard` for persistent research.
193
+
194
+ ───────────────────────────────────────────
195
+
196
+ ## ▶ Next Up
197
+
198
+ **Plan section** — proceed without literature doc
199
+
200
+ `/wtfp:plan-section {section}`
201
+
202
+ **Or deepen research:**
203
+
204
+ `/wtfp:research-gap {section} --depth=standard`
205
+
206
+ ───────────────────────────────────────────
207
+
208
+ </offer_next_quick>
209
+
210
+ <success_criteria>
211
+ - [ ] Research scope defined with user
212
+ - [ ] Research-synthesizer spawned with full context
213
+ - [ ] RESEARCH.md created with key citations and gaps
214
+ - [ ] User knows next steps
215
+ </success_criteria>
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: wtfp:resume-writing
3
+ description: Resume writing from a previous session
4
+ ---
5
+
6
+ <objective>
7
+ Resume work from a previous session with full context restoration.
8
+
9
+ Reads STATE.md and any .continue-here.md files to restore context.
10
+
11
+ Shows current position, recent progress, and offers appropriate next actions.
12
+ </objective>
13
+
14
+ <process>
15
+
16
+ <step name="verify">
17
+ **Verify project exists:**
18
+
19
+ ```bash
20
+ [ ! -f .planning/STATE.md ] && echo "ERROR: No project state found. Run /wtfp:new-paper first" && exit 1
21
+ ```
22
+
23
+ </step>
24
+
25
+ <step name="load">
26
+ **Load project context:**
27
+
28
+ - Read STATE.md for current position and session info
29
+ - Read PROJECT.md for paper vision
30
+ - Read ROADMAP.md for section structure
31
+ - Check for .continue-here.md files in section directories
32
+ </step>
33
+
34
+ <step name="check_handoff">
35
+ **Check for handoff file:**
36
+
37
+ ```bash
38
+ find .planning/sections -name ".continue-here.md" 2>/dev/null | head -1
39
+ ```
40
+
41
+ If handoff file exists:
42
+ - Read it for detailed resumption context
43
+ - Extract: current task, remaining work, next action, blockers
44
+ </step>
45
+
46
+ <step name="present">
47
+ **Present resumption context:**
48
+
49
+ **If handoff file exists:**
50
+
51
+ ```
52
+ # Resuming: [Paper Title]
53
+
54
+ ## Where You Left Off
55
+ Section [N]: [Name]
56
+ Task [X] of [Y]: [task description]
57
+ Status: [in_progress/blocked]
58
+
59
+ ## Completed in Last Session
60
+ - [Task 1]: [done]
61
+ - [Task 2]: [done]
62
+
63
+ ## Remaining Work
64
+ - [Current task]: [in progress]
65
+ - [Next tasks]: [pending]
66
+
67
+ ## Context Notes
68
+ [Notes from .continue-here.md]
69
+
70
+ ## Blockers (if any)
71
+ [Any blockers noted]
72
+
73
+ ---
74
+
75
+ ## ▶ Next Action
76
+
77
+ [From .continue-here.md next_action]
78
+
79
+ `/wtfp:[appropriate-command]`
80
+
81
+ <sub>`/clear` first if context window is full</sub>
82
+
83
+ ---
84
+ ```
85
+
86
+ **If no handoff file:**
87
+
88
+ ```
89
+ # Resuming: [Paper Title]
90
+
91
+ ## Current Position
92
+ Section [N] of [total]: [Name]
93
+ Plan [X] of [section-total]: [status]
94
+ Words: [current] / [target]
95
+
96
+ ## Recent Progress
97
+ [From STATE.md or recent SUMMARY files]
98
+
99
+ ---
100
+
101
+ ## ▶ Next Up
102
+
103
+ [Based on STATE.md current position]
104
+
105
+ `/wtfp:[appropriate-command]`
106
+
107
+ ---
108
+
109
+ For full status: `/wtfp:progress`
110
+
111
+ ---
112
+ ```
113
+
114
+ </step>
115
+
116
+ <step name="cleanup">
117
+ **Clean up handoff file after resume:**
118
+
119
+ If user proceeds with next action, the handoff file should be removed:
120
+
121
+ ```bash
122
+ rm .planning/sections/XX-name/.continue-here.md
123
+ git add .planning/sections/XX-name/
124
+ git commit -m "docs: resume [section name] from handoff"
125
+ ```
126
+
127
+ </step>
128
+
129
+ </process>
130
+
131
+ <success_criteria>
132
+ - [ ] STATE.md read for current position
133
+ - [ ] Handoff file detected if exists
134
+ - [ ] Full context presented
135
+ - [ ] Clear next action provided
136
+ - [ ] Routes to appropriate command
137
+ </success_criteria>
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: wtfp:review-section
3
+ description: Run 3-layer verification on written sections
4
+ argument-hint: "[section]"
5
+ ---
6
+
7
+ <execution_context>
8
+ @~/.opencode/write-the-f-paper/workflows/review-section.md
9
+ </execution_context>
10
+
11
+ <objective>
12
+ User acceptance testing of written sections with configurable reviewer personas.
13
+
14
+ **Orchestrator role:** Validate section exists, select persona, resolve model profile, spawn section-reviewer agent, present results.
15
+
16
+ Runs 3-layer verification:
17
+ 1. Citation Check (Mechanical)
18
+ 2. Argument Coherence (Logical)
19
+ 3. Rubric Check (Requirements)
20
+ </objective>
21
+
22
+ <context>
23
+ Section: $ARGUMENTS (section number or path)
24
+ </context>
25
+
26
+ <process>
27
+
28
+ ## 1. Validate Environment and Resolve Model Profile
29
+
30
+ ```bash
31
+ ls paper/*.md 2>/dev/null || echo "No content in paper/ directory"
32
+ ls .planning/ 2>/dev/null
33
+ ```
34
+
35
+ **Resolve model profile:**
36
+ ```bash
37
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
38
+ ```
39
+
40
+ | Agent | quality | balanced | budget |
41
+ |-------|---------|----------|--------|
42
+ | section-reviewer | opus | sonnet | haiku |
43
+
44
+ ## 2. Select Reviewer Persona
45
+
46
+ Use the question tool:
47
+ - header: "Reviewer"
48
+ - question: "What type of review do you want?"
49
+ - options:
50
+ - "Friendly Mentor" -- Balanced, constructive, actionable (Recommended)
51
+ - "Reviewer #2 (Hostile)" -- Nitpicky, assumes worst, finds every flaw
52
+ - "Area Chair (Big Picture)" -- Strategic focus on contribution and impact
53
+ - "Camera-Ready Editor" -- Formatting, style, polish, consistency
54
+
55
+ ## 3. Read Context Files
56
+
57
+ ```bash
58
+ SECTION_CONTENT=$(cat paper/*.md 2>/dev/null)
59
+ PROJECT_CONTENT=$(cat .planning/PROJECT.md)
60
+ ARGMAP_CONTENT=$(cat .planning/structure/argument-map.md 2>/dev/null)
61
+ OUTLINE_CONTENT=$(cat .planning/structure/outline.md 2>/dev/null)
62
+ SUMMARY_CONTENT=$(cat .planning/sections/*/SUMMARY.md 2>/dev/null | head -200)
63
+
64
+ SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
65
+ CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
66
+ ```
67
+
68
+ ## 4. Spawn wtfp-section-reviewer Agent
69
+
70
+ ```
71
+ ---
72
+ WTF-P > REVIEWING SECTION
73
+ ---
74
+ ```
75
+
76
+ ```
77
+ Task(
78
+ prompt="First, read ~/.opencode/agents/wtfp/section-reviewer.md for your role and instructions.\n\n" + filled_review_prompt,
79
+ subagent_type="general-purpose",
80
+ model="{reviewer_model}",
81
+ description="Review Section {X}"
82
+ )
83
+ ```
84
+
85
+ Review prompt includes: `<section_content>` with written text, `<review_persona>` with selected persona, `<project_context>` with PROJECT + argument-map + outline, `<user_decisions>` with CONTEXT_CONTENT.
86
+
87
+ ## 5. Handle Reviewer Return
88
+
89
+ **`## REVIEW COMPLETE`:** Present results, route to next action.
90
+
91
+ ## 6. Present Results
92
+
93
+ </process>
94
+
95
+ <offer_next>
96
+
97
+ ---
98
+ WTF-P > REVIEW COMPLETE
99
+ ---
100
+
101
+ [If issues found:]
102
+ **Plan revisions** -- address identified issues
103
+
104
+ `/wtfp:plan-revision XX-YY`
105
+
106
+ [If no issues:]
107
+ **Continue** -- move to next section
108
+
109
+ `/wtfp:plan-section [next]`
110
+
111
+ <sub>`/clear` first -> fresh context window</sub>
112
+
113
+ ---
114
+
115
+ </offer_next>
116
+
117
+ <success_criteria>
118
+ - [ ] Reviewer persona selected
119
+ - [ ] Section-reviewer spawned with full context
120
+ - [ ] All 3 verification layers executed
121
+ - [ ] Issues documented in ISSUES.md
122
+ - [ ] Clear next steps provided
123
+ </success_criteria>