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,114 @@
1
+ description = "Improve clarity, flow, and academic voice in written prose"
2
+
3
+ prompt = '''
4
+ <execution_context>
5
+ @~/.config/gemini/write-the-f-paper/references/principles.md
6
+ </execution_context>
7
+
8
+ <objective>
9
+ Polish prose to eliminate robotic AI-sounding text and improve academic voice.
10
+
11
+ **Orchestrator role:** Identify target files, gather voice preference, resolve model profile, spawn prose-polisher agent, present results.
12
+ </objective>
13
+
14
+ <context>
15
+ Target: {{args}} (section number, file path, or "all" for full manuscript)
16
+
17
+ **Load project state:**
18
+ @.planning/STATE.md
19
+ </context>
20
+
21
+ <process>
22
+
23
+ ## 1. Validate Environment and Resolve Model Profile
24
+
25
+ ```bash
26
+ ls paper/*.md 2>/dev/null || echo "No content in paper/ directory"
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
+ | prose-polisher | opus | sonnet | haiku |
36
+
37
+ ## 2. Identify Target and Gather Preferences
38
+
39
+ Parse {{args}} to find target file(s).
40
+
41
+ Use interactive prompting:
42
+ - header: "Voice"
43
+ - question: "What tone should dominate this section?"
44
+ - options:
45
+ - "Authoritative" — Confident, direct claims
46
+ - "Measured" — Careful hedging, academic caution
47
+ - "Accessible" — Clear to non-specialists
48
+ - "Technical" — Dense, specialist terminology OK
49
+
50
+ ## 3. Read Context Files
51
+
52
+ ```bash
53
+ TARGET_CONTENT=$(cat paper/[target].md 2>/dev/null)
54
+ STYLE_CONTENT=$(cat .planning/sources/style-guide.md 2>/dev/null)
55
+
56
+ SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
57
+ CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
58
+ ```
59
+
60
+ ## 4. Spawn wtfp-prose-polisher Agent
61
+
62
+ ```
63
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
64
+ WTF-P ► POLISHING PROSE
65
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
66
+ ```
67
+
68
+ ```
69
+ Task(
70
+ prompt="First, read ~/.config/gemini/agents/wtfp/prose-polisher.md for your role and instructions.\n\n" + filled_polish_prompt,
71
+ subagent_type="general-purpose",
72
+ model="{polisher_model}",
73
+ description="Polish prose"
74
+ )
75
+ ```
76
+
77
+ Polish prompt includes: `<target_content>` with section text, `<voice_preference>` with user selection, `<style_guide>` with style context, `<user_decisions>` with CONTEXT_CONTENT.
78
+
79
+ ## 5. Handle Polisher Return
80
+
81
+ **`## POLISH COMPLETE`:** Present before/after summary.
82
+
83
+ **`## POLISH BLOCKED`:** Present blocker, ask user how to proceed.
84
+
85
+ ## 6. Present Results
86
+
87
+ </process>
88
+
89
+ <offer_next>
90
+
91
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
92
+ WTF-P ► PROSE POLISHED ✓
93
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
94
+
95
+ ───────────────────────────────────────────
96
+
97
+ ## Next Up
98
+
99
+ - `/wtfp:review-section {N}` — Get reviewer feedback
100
+ - `/wtfp:check-refs` — Verify citations
101
+ - `/wtfp:export-latex` — Generate LaTeX
102
+
103
+ ───────────────────────────────────────────
104
+
105
+ </offer_next>
106
+
107
+ <success_criteria>
108
+ - [ ] Target file(s) identified
109
+ - [ ] Voice preference gathered
110
+ - [ ] Prose-polisher spawned with full context
111
+ - [ ] Changes applied to paper/ files
112
+ - [ ] User knows next steps
113
+ </success_criteria>
114
+ '''
@@ -0,0 +1,145 @@
1
+ description = "Show writing progress and suggest next step"
2
+
3
+ prompt = '''
4
+ <objective>
5
+ Check writing progress, summarize recent work, and intelligently route to the next action.
6
+
7
+ **Orchestrator role:** Load state files, calculate progress metrics, present rich status report, determine and offer the next logical command.
8
+ </objective>
9
+
10
+ <context>
11
+ No arguments. Reads project state from .planning/.
12
+ </context>
13
+
14
+ <process>
15
+
16
+ ## 1. Validate Environment
17
+
18
+ ```bash
19
+ ls .planning/STATE.md .planning/ROADMAP.md .planning/PROJECT.md 2>/dev/null
20
+ ```
21
+
22
+ If missing `.planning/` → suggest `/wtfp:new-paper`.
23
+ If missing STATE.md or ROADMAP.md → suggest what's needed.
24
+
25
+ ## 2. Load Project Context
26
+
27
+ Read: STATE.md, ROADMAP.md, PROJECT.md, config.json (for model_profile).
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
+ ## 3. Gather Recent Work
34
+
35
+ Find 2-3 most recent SUMMARY.md files. Extract: what was written, key decisions, issues.
36
+
37
+ ## 4. Parse Current Position
38
+
39
+ From STATE.md: current section, plan number, status, word count.
40
+ Calculate: total plans, completed, remaining. Total words vs target.
41
+ Check for CONTEXT.md in current section directory.
42
+
43
+ ## 4b. Build Statusline
44
+
45
+ Build the statusline string:
46
+ ```
47
+ WTF-P ► {section progress} ◆ {word count} ► {model_profile}
48
+ ```
49
+
50
+ **Section progress:** `{completed}/{total} sections` (count SUMMARY.md files vs total sections)
51
+
52
+ **Word count:** `{current_words}/{target_words}w` (from STATE.md and PROJECT.md)
53
+
54
+ **Model profile:** from config.json (quality/balanced/budget)
55
+
56
+ **Update indicator:** Check for newer version quietly:
57
+ ```bash
58
+ CURRENT=$(node -e "console.log(require('$(npm root -g)/wtf-p/package.json').version)" 2>/dev/null || echo "")
59
+ LATEST=$(npm view wtf-p version 2>/dev/null || echo "")
60
+ ```
61
+
62
+ If LATEST exists and CURRENT < LATEST, append ` ▲ update` to statusline.
63
+
64
+ **Pending todos:** Count files:
65
+ ```bash
66
+ PENDING_TODOS=$(ls -1 .planning/todos/pending/*.md 2>/dev/null | wc -l | tr -d ' ')
67
+ ```
68
+
69
+ ## 5. Present Status Report
70
+
71
+ **Display statusline FIRST** (before all other output):
72
+ ```
73
+ WTF-P ► 3/6 sections ◆ 4200/8000w ► balanced ▲ update
74
+ ```
75
+
76
+ Then the detailed status report:
77
+
78
+ ```
79
+ # [Paper Title]
80
+
81
+ **Progress:** [████████░░] 8/10 sections drafted
82
+ **Words:** [current] / [target] ([percentage]%)
83
+ **Profile:** [quality/balanced/budget]
84
+
85
+ ## Recent Work
86
+ - [Section X]: [1-line summary]
87
+
88
+ ## Current Position
89
+ Section [N] of [total]: [name] — [status]
90
+ CONTEXT: [✓ | -]
91
+
92
+ ## Key Decisions
93
+ - [from STATE.md]
94
+
95
+ ## Open Issues
96
+ - [deferred items]
97
+
98
+ ## Pending Todos
99
+ {PENDING_TODOS} pending (run /wtfp:check-todos to review)
100
+ ```
101
+
102
+ ## 6. Route to Next Action
103
+
104
+ **Count files in current section:**
105
+ ```bash
106
+ ls -1 .planning/sections/[dir]/*-PLAN.md 2>/dev/null | wc -l
107
+ ls -1 .planning/sections/[dir]/*-SUMMARY.md 2>/dev/null | wc -l
108
+ ls -1 .planning/sections/[dir]/*-ISSUES.md 2>/dev/null | wc -l
109
+ ```
110
+
111
+ **Route A — Unexecuted plan exists** (summaries < plans):
112
+ Find first PLAN.md without SUMMARY.md. Offer `/wtfp:write-section [path]`.
113
+
114
+ **Route B — Section needs planning** (plans = 0):
115
+ If CONTEXT.md exists → offer `/wtfp:plan-section {N}`.
116
+ If not → offer `/wtfp:discuss-section {N}` or `/wtfp:plan-section {N}`.
117
+
118
+ **Route C — Section complete, more remain** (summaries = plans, not last section):
119
+ Offer `/wtfp:plan-section {N+1}`. Also: `/wtfp:review-section {N}`.
120
+
121
+ **Route D — Draft complete** (all sections done):
122
+ Offer `/wtfp:review-section` and `/wtfp:export-latex`.
123
+
124
+ **Route E — Review issues need revision** (ISSUES.md without REVISION.md):
125
+ Offer `/wtfp:plan-revision {plan}`.
126
+
127
+ </process>
128
+
129
+ <offer_next>
130
+
131
+ Show the routed next action with clear command and `/clear` suggestion.
132
+
133
+ </offer_next>
134
+
135
+ <success_criteria>
136
+ - [ ] Statusline displayed first: WTF-P ► {sections} ◆ {words} ► {profile} [▲ update]
137
+ - [ ] Update indicator shown when newer version available
138
+ - [ ] Pending todo count shown
139
+ - [ ] Rich context provided (recent work, word counts, decisions)
140
+ - [ ] Current position clear with visual progress
141
+ - [ ] Model profile shown
142
+ - [ ] Smart routing to next command
143
+ - [ ] User confirms before any action
144
+ </success_criteria>
145
+ '''
@@ -0,0 +1,96 @@
1
+ description = "Run a small writing fix without full planning overhead"
2
+
3
+ prompt = '''
4
+ <objective>
5
+ Execute a quick writing task with atomic commits and state tracking but skip optional agents (plan-checker, argument-verifier).
6
+
7
+ **Orchestrator role:** Parse task, load minimal context, execute directly or spawn writer agent, commit result.
8
+
9
+ Use for small targeted tasks: fix a paragraph, add a citation, tweak wording, expand a point.
10
+ </objective>
11
+
12
+ <context>
13
+ Task: {{args}} (natural language description of what to do)
14
+
15
+ **Load project state:**
16
+ @.planning/STATE.md
17
+ @.planning/config.json
18
+ </context>
19
+
20
+ <process>
21
+
22
+ ## 1. Validate Environment
23
+
24
+ ```bash
25
+ ls .planning/ 2>/dev/null || echo "No project — will work on files directly"
26
+ ls paper/*.md 2>/dev/null
27
+ ```
28
+
29
+ ## 2. Parse Task Intent
30
+
31
+ Classify {{args}} into task type:
32
+ - **fix** — Correct an error, fix citation, resolve contradiction
33
+ - **add** — Add a paragraph, citation, transition, figure reference
34
+ - **revise** — Rewrite a paragraph, strengthen argument, tighten prose
35
+ - **cite** — Add or fix specific citations
36
+
37
+ ## 3. Load Minimal Context
38
+
39
+ ```bash
40
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
41
+ STATE_CONTENT=$(cat .planning/STATE.md 2>/dev/null)
42
+ ```
43
+
44
+ Only load files directly relevant to the task. No full context dump.
45
+
46
+ ## 4. Execute Task
47
+
48
+ **For simple tasks (fix, cite):** Execute directly in orchestrator — read target file, make edit, verify.
49
+
50
+ **For complex tasks (add, revise):** Spawn section-writer agent with focused prompt.
51
+
52
+ | Agent | quality | balanced | budget |
53
+ |-------|---------|----------|--------|
54
+ | section-writer | opus | sonnet | sonnet |
55
+
56
+ ```
57
+ Task(
58
+ prompt="First, read ~/.config/gemini/agents/wtfp/section-writer.md for your role.\n\n" + focused_prompt,
59
+ subagent_type="general-purpose",
60
+ model="{writer_model}",
61
+ description="Quick: [task summary]"
62
+ )
63
+ ```
64
+
65
+ **Skip:** plan-checker, argument-verifier (quick mode = no verification loop).
66
+
67
+ ## 5. Commit and Update State
68
+
69
+ ```bash
70
+ git add paper/
71
+ git commit -m "[type](quick): [task description]"
72
+ ```
73
+
74
+ Update STATE.md word count if changed.
75
+
76
+ </process>
77
+
78
+ <offer_next>
79
+
80
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
81
+ WTF-P ► QUICK TASK DONE ✓
82
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
83
+
84
+ [task summary] — [words changed]
85
+
86
+ ───────────────────────────────────────────
87
+
88
+ </offer_next>
89
+
90
+ <success_criteria>
91
+ - [ ] Task executed with minimal context loading
92
+ - [ ] Changes committed atomically
93
+ - [ ] STATE.md word count updated
94
+ - [ ] No unnecessary agent spawning
95
+ </success_criteria>
96
+ '''
@@ -0,0 +1,140 @@
1
+ description = "Remove an unwritten section and renumber the rest"
2
+
3
+ prompt = '''
4
+ <objective>
5
+ Remove a future (unwritten) section and renumber subsequent sections.
6
+
7
+ Only works on sections that haven't been started yet.
8
+
9
+ Git commit preserves historical record of what was removed.
10
+ </objective>
11
+
12
+ <process>
13
+
14
+ <step name="verify">
15
+ **Verify project and section:**
16
+
17
+ ```bash
18
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No roadmap found" && exit 1
19
+ ```
20
+
21
+ Check section exists and hasn't been started:
22
+ - No PLAN.md files in section directory
23
+ - No SUMMARY.md files in section directory
24
+ - Status is "Not started" in ROADMAP.md
25
+
26
+ If section has work:
27
+ ```
28
+ ERROR: Section [N] has already been started.
29
+
30
+ To remove a section with existing work:
31
+ 1. Manually delete the content
32
+ 2. Update ROADMAP.md
33
+ 3. Commit the changes
34
+
35
+ This command only removes future/unstarted sections.
36
+ ```
37
+ </step>
38
+
39
+ <step name="confirm">
40
+ **Confirm removal:**
41
+
42
+ Show what will be removed:
43
+
44
+ ```
45
+ ## Section to Remove
46
+
47
+ Section [N]: [Name]
48
+ - Goal: [goal]
49
+ - Word target: [X]
50
+ - Status: Not started
51
+
52
+ ## Impact
53
+
54
+ Sections to renumber:
55
+ - Section [N+1] → Section [N]
56
+ - Section [N+2] → Section [N+1]
57
+ - ...
58
+
59
+ Files to delete:
60
+ - .planning/sections/[NN]-[name]/
61
+ ```
62
+
63
+ Use interactive prompting:
64
+ - header: "Remove Section"
65
+ - question: "Remove Section [N]: [name] and renumber subsequent sections?"
66
+ - options:
67
+ - "Yes, remove it" — Delete and renumber
68
+ - "Cancel" — Keep the section
69
+
70
+ </step>
71
+
72
+ <step name="remove">
73
+ **Remove section:**
74
+
75
+ 1. Delete section directory:
76
+ ```bash
77
+ rm -rf ".planning/sections/[NN]-[name]/"
78
+ ```
79
+
80
+ 2. Update ROADMAP.md:
81
+ - Remove section entry
82
+ - Renumber all subsequent sections
83
+
84
+ 3. Rename subsequent section directories:
85
+ ```bash
86
+ mv ".planning/sections/[N+1]-[name]/" ".planning/sections/[N]-[name]/"
87
+ # ... for all subsequent sections
88
+ ```
89
+
90
+ 4. Update any references in STATE.md
91
+
92
+ </step>
93
+
94
+ <step name="commit">
95
+ ```bash
96
+ git add .planning/
97
+ git commit -m "$(cat <<'EOF'
98
+ docs: remove Section [N] - [name]
99
+
100
+ Removed unstarted section.
101
+ Renumbered sections [N+1]-[total] to [N]-[total-1].
102
+ EOF
103
+ )"
104
+ ```
105
+
106
+ </step>
107
+
108
+ <step name="done">
109
+ **Present completion:**
110
+
111
+ ```
112
+ Section removed:
113
+
114
+ - Removed: Section [N] - [Name]
115
+ - Renumbered: Sections [N+1]-[total] → [N]-[total-1]
116
+ - Total sections: [new total]
117
+
118
+ ---
119
+
120
+ ## ▶ Next Up
121
+
122
+ `/wtfp:progress` — check updated status
123
+
124
+ ---
125
+ ```
126
+
127
+ </step>
128
+
129
+ </process>
130
+
131
+ <success_criteria>
132
+ - [ ] Section verified as unstarted
133
+ - [ ] User confirmed removal
134
+ - [ ] Section directory deleted
135
+ - [ ] ROADMAP.md updated
136
+ - [ ] Subsequent sections renumbered
137
+ - [ ] All references updated
138
+ - [ ] Committed to git with clear history
139
+ </success_criteria>
140
+ '''
@@ -0,0 +1,126 @@
1
+ description = "Report a bug via GitHub issue"
2
+
3
+ prompt = '''
4
+ <objective>
5
+ Help the user report a bug in 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: Gather Bug Information
28
+
29
+ Use interactive prompting to collect bug details:
30
+
31
+ **Question 1: Bug Category**
32
+ - Header: "Bug Type"
33
+ - Options:
34
+ - "Command fails" - A /wtfp:* command doesn't work as expected
35
+ - "Installation issue" - Problems with npx wtf-p install/uninstall
36
+ - "Workflow error" - Writing workflow produces wrong output
37
+ - "Documentation gap" - Docs are missing or incorrect
38
+
39
+ **Question 2: Bug Description**
40
+ - Header: "Description"
41
+ - Options:
42
+ - "Let me describe it" - User provides description
43
+ - "Help me articulate" - Claude helps user describe the bug
44
+
45
+ If user needs help articulating, ask follow-up questions:
46
+ - What were you trying to do?
47
+ - What happened instead?
48
+ - What did you expect to happen?
49
+
50
+ ## Step 3: Gather Environment Info
51
+
52
+ Automatically collect:
53
+ ```bash
54
+ npx wtf-p --version 2>/dev/null || echo "Not installed via npx"
55
+ node --version
56
+ uname -s 2>/dev/null || echo "Unknown OS"
57
+ ```
58
+
59
+ ## Step 4: Collect Reproduction Steps
60
+
61
+ Ask user:
62
+ - What command or action triggered the bug?
63
+ - Can you reproduce it consistently?
64
+ - Any error messages? (ask to paste them)
65
+
66
+ ## Step 5: Draft the Issue
67
+
68
+ Create a draft and show it to the user:
69
+
70
+ ```markdown
71
+ ## Bug Description
72
+ [From user input]
73
+
74
+ ## Steps to Reproduce
75
+ 1. [Step 1]
76
+ 2. [Step 2]
77
+ 3. [What happened vs expected]
78
+
79
+ ## Environment
80
+ - WTF-P version: [collected]
81
+ - Node.js version: [collected]
82
+ - OS: [collected]
83
+
84
+ ## Additional Context
85
+ [Error messages, logs, screenshots mentioned]
86
+ ```
87
+
88
+ ## Step 6: Confirm and Create
89
+
90
+ Ask user to confirm:
91
+ - "Create this issue?" with options: Yes / Edit first / Cancel
92
+
93
+ If confirmed, create the issue:
94
+
95
+ ```bash
96
+ gh issue create \
97
+ --repo akougkas/wtf-p \
98
+ --title "bug: [SHORT_TITLE]" \
99
+ --body "$(cat <<'EOF'
100
+ [FULL_BODY_HERE]
101
+ EOF
102
+ )" \
103
+ --label "bug"
104
+ ```
105
+
106
+ ## Step 7: Report Success
107
+
108
+ Show the user:
109
+ - Issue URL (from gh output)
110
+ - Issue number
111
+ - What happens next (maintainer will review)
112
+
113
+ </process>
114
+
115
+ <error-handling>
116
+
117
+ **gh not installed**: Direct user to https://cli.github.com/
118
+
119
+ **gh not authenticated**: Guide through `gh auth login`
120
+
121
+ **Network error**: Save draft locally, retry later
122
+
123
+ **Permission denied**: User may need to fork first for external contributors
124
+
125
+ </error-handling>
126
+ '''