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