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
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:polish-prose
3
- description: De-robotize and refine prose for clarity, flow, and academic voice
3
+ description: Improve clarity, flow, and academic voice in written prose
4
4
  argument-hint: "[section-number or file]"
5
5
  allowed-tools:
6
6
  - Read
@@ -9,66 +9,47 @@ allowed-tools:
9
9
  - Edit
10
10
  - Glob
11
11
  - Grep
12
+ - Task
12
13
  - AskUserQuestion
13
14
  ---
14
15
 
16
+ <execution_context>
17
+ @~/.claude/write-the-f-paper/references/principles.md
18
+ </execution_context>
19
+
15
20
  <objective>
16
21
  Polish prose to eliminate robotic AI-sounding text and improve academic voice.
17
22
 
18
- Purpose: Transform draft prose into publication-ready writing that sounds human, flows naturally, and maintains academic rigor.
19
- Output: Refined section text with improved clarity, varied sentence structure, and natural transitions.
23
+ **Orchestrator role:** Identify target files, gather voice preference, resolve model profile, spawn prose-polisher agent, present results.
20
24
  </objective>
21
25
 
22
- <execution_context>
23
- @~/.claude/write-the-f-paper/references/prose-quality.md
24
- @~/.claude/write-the-f-paper/references/academic-voice.md
25
- </execution_context>
26
-
27
26
  <context>
28
27
  Target: $ARGUMENTS (section number, file path, or "all" for full manuscript)
29
28
 
30
29
  **Load project state:**
31
30
  @.planning/STATE.md
32
-
33
- **Load style context if exists:**
34
- @.planning/sources/style-guide.md
35
31
  </context>
36
32
 
37
33
  <process>
38
34
 
39
- <step name="identify_target">
40
- 1. Parse $ARGUMENTS to determine scope:
41
- - Section number → find section draft in .planning/sections/XX-name/
42
- - File path → use directly
43
- - "all" or empty → process all draft sections
44
- 2. Read target content
45
- 3. Identify prose issues
46
- </step>
47
-
48
- <step name="analyze_prose">
49
- **Identify common AI-writing patterns to fix:**
50
-
51
- | Pattern | Fix |
52
- |---------|-----|
53
- | "It is important to note that..." | Delete or integrate naturally |
54
- | "This study aims to..." | Active voice: "We investigate..." |
55
- | "In conclusion, it can be said..." | Direct statement |
56
- | Excessive hedging | Confident assertions where warranted |
57
- | Repetitive sentence starts | Vary structure |
58
- | Overuse of "Furthermore", "Moreover" | Natural transitions |
59
- | Passive voice overload | Active where appropriate |
60
- | Nominalization | Verbs over noun forms |
61
- | Word padding | Tighten |
62
-
63
- **Check for:**
64
- - Sentence length variety (mix short punchy with longer complex)
65
- - Paragraph flow and transitions
66
- - Topic sentences that preview content
67
- - Concluding sentences that land
68
- - Jargon density appropriate for venue
69
- </step>
70
-
71
- <step name="gather_preferences">
35
+ ## 1. Validate Environment and Resolve Model Profile
36
+
37
+ ```bash
38
+ ls paper/*.md 2>/dev/null || echo "No content in paper/ directory"
39
+ ```
40
+
41
+ ```bash
42
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
43
+ ```
44
+
45
+ | Agent | quality | balanced | budget |
46
+ |-------|---------|----------|--------|
47
+ | prose-polisher | opus | sonnet | haiku |
48
+
49
+ ## 2. Identify Target and Gather Preferences
50
+
51
+ Parse $ARGUMENTS to find target file(s).
52
+
72
53
  Use AskUserQuestion:
73
54
  - header: "Voice"
74
55
  - question: "What tone should dominate this section?"
@@ -77,101 +58,68 @@ Use AskUserQuestion:
77
58
  - "Measured" — Careful hedging, academic caution
78
59
  - "Accessible" — Clear to non-specialists
79
60
  - "Technical" — Dense, specialist terminology OK
80
- </step>
81
-
82
- <step name="polish">
83
- **Apply transformations:**
84
61
 
85
- 1. **Sentence-level:**
86
- - Eliminate filler phrases
87
- - Convert passive to active where natural
88
- - Vary sentence openings
89
- - Tighten word count (cut 10-15%)
62
+ ## 3. Read Context Files
90
63
 
91
- 2. **Paragraph-level:**
92
- - Ensure clear topic sentences
93
- - Check logical flow between sentences
94
- - Verify transitions connect ideas
95
-
96
- 3. **Section-level:**
97
- - Opening hook engages
98
- - Closing paragraph lands the point
99
- - Section advances the argument
64
+ ```bash
65
+ TARGET_CONTENT=$(cat paper/[target].md 2>/dev/null)
66
+ STYLE_CONTENT=$(cat .planning/sources/style-guide.md 2>/dev/null)
100
67
 
101
- **Preserve:**
102
- - Technical accuracy
103
- - Citation placement
104
- - Author's core arguments
105
- - Discipline-specific terminology
106
- </step>
68
+ SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
69
+ CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
70
+ ```
107
71
 
108
- <step name="present_changes">
109
- Show before/after for significant changes:
72
+ ## 4. Spawn wtfp-prose-polisher Agent
110
73
 
111
74
  ```
112
- Before: "It is important to note that the results demonstrate..."
113
- After: "The results demonstrate..."
75
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
76
+ WTF-P ► POLISHING PROSE
77
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
78
+ ```
114
79
 
115
- Before: "This methodology was utilized in order to..."
116
- After: "We used this methodology to..."
80
+ ```
81
+ Task(
82
+ prompt="First, read ~/.claude/agents/wtfp/prose-polisher.md for your role and instructions.\n\n" + filled_polish_prompt,
83
+ subagent_type="general-purpose",
84
+ model="{polisher_model}",
85
+ description="Polish prose"
86
+ )
117
87
  ```
118
88
 
119
- Use AskUserQuestion:
120
- - header: "Review"
121
- - question: "Apply these prose refinements?"
122
- - options:
123
- - "Apply all" — Looks good, update the file
124
- - "Show more" — I want to see more examples
125
- - "Selective" — Let me choose which changes
126
- </step>
89
+ Polish prompt includes: `<target_content>` with section text, `<voice_preference>` with user selection, `<style_guide>` with style context, `<user_decisions>` with CONTEXT_CONTENT.
127
90
 
128
- <step name="apply">
129
- Apply approved changes to the target file(s).
130
- </step>
91
+ ## 5. Handle Polisher Return
131
92
 
132
- <step name="commit">
133
- ```bash
134
- git add [modified files]
135
- git commit -m "$(cat <<'EOF'
136
- style(XX): polish prose for clarity and flow
137
-
138
- - Eliminated AI-sounding phrases
139
- - Varied sentence structure
140
- - Tightened word count
141
- - Improved transitions
142
- EOF
143
- )"
144
- ```
145
- </step>
93
+ **`## POLISH COMPLETE`:** Present before/after summary.
146
94
 
147
- <step name="done">
148
- ```
149
- Prose polished:
95
+ **`## POLISH BLOCKED`:** Present blocker, ask user how to proceed.
150
96
 
151
- - File(s): [list]
152
- - Word count: [before] → [after] ([X]% reduction)
153
- - Patterns fixed: [count]
97
+ ## 6. Present Results
154
98
 
155
- ---
99
+ </process>
100
+
101
+ <offer_next>
102
+
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
+ WTF-P ► PROSE POLISHED ✓
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+
107
+ ───────────────────────────────────────────
156
108
 
157
109
  ## Next Up
158
110
 
159
- Review the changes, then continue:
160
- - `/wtfp:review-section [N]` — Get reviewer feedback
111
+ - `/wtfp:review-section {N}` — Get reviewer feedback
161
112
  - `/wtfp:check-refs` — Verify citations
162
113
  - `/wtfp:export-latex` — Generate LaTeX
163
114
 
164
- ---
165
- ```
166
- </step>
115
+ ───────────────────────────────────────────
167
116
 
168
- </process>
117
+ </offer_next>
169
118
 
170
119
  <success_criteria>
171
- - AI-sounding patterns eliminated
172
- - Sentence variety improved
173
- - Transitions flow naturally
174
- - Word count tightened without losing meaning
175
- - Academic voice maintained
176
- - Changes committed to git
120
+ - [ ] Target file(s) identified
121
+ - [ ] Voice preference gathered
122
+ - [ ] Prose-polisher spawned with full context
123
+ - [ ] Changes applied to paper/ files
124
+ - [ ] User knows next steps
177
125
  </success_criteria>
@@ -1,325 +1,153 @@
1
1
  ---
2
2
  name: wtfp:progress
3
- description: Check writing progress, show context, and route to next action
3
+ description: Show writing progress and suggest next step
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Bash
7
- - Grep
8
7
  - Glob
9
- - SlashCommand
8
+ - Grep
9
+ - Task
10
+ - AskUserQuestion
10
11
  ---
11
12
 
12
13
  <objective>
13
- Check writing progress, summarize recent work and what's ahead, then intelligently route to the next action - either executing an existing plan or creating the next one.
14
+ Check writing progress, summarize recent work, and intelligently route to the next action.
14
15
 
15
- Provides situational awareness before continuing writing.
16
+ **Orchestrator role:** Load state files, calculate progress metrics, present rich status report, determine and offer the next logical command.
16
17
  </objective>
17
18
 
19
+ <context>
20
+ No arguments. Reads project state from .planning/.
21
+ </context>
18
22
 
19
23
  <process>
20
24
 
21
- <step name="verify">
22
- **Verify planning structure exists:**
23
-
24
- If no `.planning/` directory:
25
-
26
- ```
27
- No planning structure found.
28
-
29
- Run /wtfp:new-paper to start a new paper.
30
- ```
31
-
32
- Exit.
33
-
34
- If missing STATE.md or ROADMAP.md: inform what's missing, suggest running `/wtfp:new-paper`.
35
- </step>
36
-
37
- <step name="load">
38
- **Load full project context:**
39
-
40
- - Read `.planning/STATE.md` for living memory (position, word counts, decisions)
41
- - Read `.planning/ROADMAP.md` for section structure and objectives
42
- - Read `.planning/PROJECT.md` for paper vision (Core Argument, Requirements)
43
- </step>
44
-
45
- <step name="recent">
46
- **Gather recent work context:**
47
-
48
- - Find the 2-3 most recent SUMMARY.md files
49
- - Extract from each: what was written, key decisions, any issues logged
50
- - This shows "what we've been working on"
51
- </step>
52
-
53
- <step name="position">
54
- **Parse current position:**
55
-
56
- - From STATE.md: current section, plan number, status, word count
57
- - Calculate: total plans, completed plans, remaining plans
58
- - Calculate: total words written vs target word count
59
- - Note any gaps, concerns, or deferred issues
60
- - Check for CONTEXT.md: For sections without PLAN.md files, check if `{section}-CONTEXT.md` exists
61
- </step>
62
-
63
- <step name="report">
64
- **Present rich status report:**
65
-
66
- ```
67
- # [Paper Title]
68
-
69
- **Progress:** [████████░░] 8/10 sections drafted
70
- **Words:** [current] / [target] ([percentage]%)
71
-
72
- ## Recent Work
73
- - [Section X, Plan Y]: [what was written - 1 line]
74
- - [Section X, Plan Z]: [what was written - 1 line]
75
-
76
- ## Current Position
77
- Section [N] of [total]: [section-name]
78
- Plan [M] of [section-total]: [status]
79
- CONTEXT: [✓ if CONTEXT.md exists | - if not]
80
-
81
- ## Argument Strength
82
- - Core claim: [from STATE.md]
83
- - Evidence gaps: [list]
84
-
85
- ## Key Decisions Made
86
- - [decision 1 from STATE.md]
87
- - [decision 2]
88
-
89
- ## Open Issues
90
- - [any deferred issues or gaps]
25
+ ## 1. Validate Environment
91
26
 
92
- ## What's Next
93
- [Next section/plan objective from ROADMAP]
27
+ ```bash
28
+ ls .planning/STATE.md .planning/ROADMAP.md .planning/PROJECT.md 2>/dev/null
94
29
  ```
95
30
 
96
- </step>
97
-
98
- <step name="route">
99
- **Determine next action based on verified counts.**
31
+ If missing `.planning/` → suggest `/wtfp:new-paper`.
32
+ If missing STATE.md or ROADMAP.md → suggest what's needed.
100
33
 
101
- **Step 1: Count plans, summaries, and issues in current section**
34
+ ## 2. Load Project Context
102
35
 
103
- List files in the current section directory:
36
+ Read: STATE.md, ROADMAP.md, PROJECT.md, config.json (for model_profile).
104
37
 
105
38
  ```bash
106
- ls -1 .planning/sections/[current-section-dir]/*-PLAN.md 2>/dev/null | wc -l
107
- ls -1 .planning/sections/[current-section-dir]/*-SUMMARY.md 2>/dev/null | wc -l
108
- ls -1 .planning/sections/[current-section-dir]/*-ISSUES.md 2>/dev/null | wc -l
109
- ls -1 .planning/sections/[current-section-dir]/*-REVISION.md 2>/dev/null | wc -l
39
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
110
40
  ```
111
41
 
112
- State: "This section has {X} plans, {Y} summaries, {Z} issues files."
113
-
114
- **Step 1.5: Check for unaddressed review issues**
115
-
116
- For each *-ISSUES.md file, check if matching *-REVISION.md exists.
117
- For each *-REVISION.md file, check if matching *-REVISION-SUMMARY.md exists.
42
+ ## 3. Gather Recent Work
118
43
 
119
- Track:
120
- - `issues_without_revision`: ISSUES.md files without REVISION.md
121
- - `revisions_without_summary`: REVISION.md files without REVISION-SUMMARY.md
44
+ Find 2-3 most recent SUMMARY.md files. Extract: what was written, key decisions, issues.
122
45
 
123
- **Step 2: Route based on counts**
46
+ ## 4. Parse Current Position
124
47
 
125
- | Condition | Meaning | Action |
126
- |-----------|---------|--------|
127
- | revisions_without_summary > 0 | Unexecuted revision plans exist | Go to **Route A** (with REVISION.md) |
128
- | issues_without_revision > 0 | Review issues need revision plans | Go to **Route E** |
129
- | summaries < plans | Unexecuted plans exist | Go to **Route A** |
130
- | summaries = plans AND plans > 0 | Section complete | Go to Step 3 |
131
- | plans = 0 | Section not yet planned | Go to **Route B** |
48
+ From STATE.md: current section, plan number, status, word count.
49
+ Calculate: total plans, completed, remaining. Total words vs target.
50
+ Check for CONTEXT.md in current section directory.
132
51
 
133
- ---
134
-
135
- **Route A: Unexecuted plan exists**
136
-
137
- Find the first PLAN.md without matching SUMMARY.md.
138
- Read its `<objective>` section.
52
+ ## 4b. Build Statusline
139
53
 
54
+ Build the statusline string:
140
55
  ```
141
- ---
142
-
143
- ## ▶ Next Up
144
-
145
- **{section}-{plan}: [Plan Name]** — [objective summary from PLAN.md]
146
-
147
- `/wtfp:write-section [full-path-to-PLAN.md]`
148
-
149
- <sub>`/clear` first → fresh context window</sub>
150
-
151
- ---
56
+ WTF-P ► {section progress} ◆ {word count} ► {model_profile}
152
57
  ```
153
58
 
154
- ---
59
+ **Section progress:** `{completed}/{total} sections` (count SUMMARY.md files vs total sections)
155
60
 
156
- **Route B: Section needs planning**
61
+ **Word count:** `{current_words}/{target_words}w` (from STATE.md and PROJECT.md)
157
62
 
158
- Check if `{section}-CONTEXT.md` exists in section directory.
159
-
160
- **If CONTEXT.md exists:**
161
-
162
- ```
163
- ---
164
-
165
- ## ▶ Next Up
166
-
167
- **Section {N}: {Name}** — {Goal from ROADMAP.md}
168
- <sub>✓ Context gathered, ready to plan</sub>
169
-
170
- `/wtfp:plan-section {section-number}`
171
-
172
- <sub>`/clear` first → fresh context window</sub>
173
-
174
- ---
175
- ```
176
-
177
- **If CONTEXT.md does NOT exist:**
63
+ **Model profile:** from config.json (quality/balanced/budget)
178
64
 
65
+ **Update indicator:** Check for newer version quietly:
66
+ ```bash
67
+ CURRENT=$(node -e "console.log(require('$(npm root -g)/wtf-p/package.json').version)" 2>/dev/null || echo "")
68
+ LATEST=$(npm view wtf-p version 2>/dev/null || echo "")
179
69
  ```
180
- ---
181
70
 
182
- ## ▶ Next Up
71
+ If LATEST exists and CURRENT < LATEST, append ` ▲ update` to statusline.
183
72
 
184
- **Section {N}: {Name}** — {Goal from ROADMAP.md}
185
-
186
- `/wtfp:plan-section {section}`
187
-
188
- <sub>`/clear` first → fresh context window</sub>
189
-
190
- ---
191
-
192
- **Also available:**
193
- - `/wtfp:discuss-section {section}` — gather context first
194
- - `/wtfp:research-gap {section}` — investigate literature
195
- - `/wtfp:list-assumptions {section}` — see Claude's assumptions
196
-
197
- ---
73
+ **Pending todos:** Count files:
74
+ ```bash
75
+ PENDING_TODOS=$(ls -1 .planning/todos/pending/*.md 2>/dev/null | wc -l | tr -d ' ')
198
76
  ```
199
77
 
200
- ---
201
-
202
- **Route E: Review issues need revision plans**
203
-
204
- ISSUES.md exists without matching REVISION.md. User needs to plan revisions.
78
+ ## 5. Present Status Report
205
79
 
80
+ **Display statusline FIRST** (before all other output):
206
81
  ```
207
- ---
208
-
209
- ## ⚠ Review Issues Found
210
-
211
- **{plan}-ISSUES.md** has {N} issues without a revision plan.
212
-
213
- `/wtfp:plan-revision {plan}`
214
-
215
- <sub>`/clear` first → fresh context window</sub>
216
-
217
- ---
218
-
219
- **Also available:**
220
- - `/wtfp:write-section [path]` — continue with other work first
221
- - `/wtfp:review-section {section}` — run more verification
222
-
223
- ---
82
+ WTF-P ► 3/6 sections ◆ 4200/8000w ► balanced ▲ update
224
83
  ```
225
84
 
226
- ---
227
-
228
- **Step 3: Check paper status (only when section complete)**
229
-
230
- Read ROADMAP.md and identify:
231
- 1. Current section number
232
- 2. All section numbers in the document structure
233
-
234
- Count total sections and identify the highest section number.
235
-
236
- State: "Current section is {X}. Paper has {N} sections (highest: {Y})."
237
-
238
- **Route based on paper status:**
239
-
240
- | Condition | Meaning | Action |
241
- |-----------|---------|--------|
242
- | current section < highest section | More sections remain | Go to **Route C** |
243
- | current section = highest section | Paper draft complete | Go to **Route D** |
244
-
245
- ---
246
-
247
- **Route C: Section complete, more sections remain**
248
-
249
- Read ROADMAP.md to get the next section's name and goal.
85
+ Then the detailed status report:
250
86
 
251
87
  ```
252
- ---
253
-
254
- ## ✓ Section {Z} Complete
255
-
256
- ## ▶ Next Up
88
+ # [Paper Title]
257
89
 
258
- **Section {Z+1}: {Name}** — {Goal from ROADMAP.md}
90
+ **Progress:** [████████░░] 8/10 sections drafted
91
+ **Words:** [current] / [target] ([percentage]%)
92
+ **Profile:** [quality/balanced/budget]
259
93
 
260
- `/wtfp:plan-section {Z+1}`
94
+ ## Recent Work
95
+ - [Section X]: [1-line summary]
261
96
 
262
- <sub>`/clear` first → fresh context window</sub>
97
+ ## Current Position
98
+ Section [N] of [total]: [name] — [status]
99
+ CONTEXT: [✓ | -]
263
100
 
264
- ---
101
+ ## Key Decisions
102
+ - [from STATE.md]
265
103
 
266
- **Also available:**
267
- - `/wtfp:review-section {Z}` — verify before continuing
268
- - `/wtfp:discuss-section {Z+1}` — gather context first
269
- - `/wtfp:research-gap {Z+1}` — investigate literature
104
+ ## Open Issues
105
+ - [deferred items]
270
106
 
271
- ---
107
+ ## Pending Todos
108
+ {PENDING_TODOS} pending (run /wtfp:check-todos to review)
272
109
  ```
273
110
 
274
- ---
275
-
276
- **Route D: Paper draft complete**
111
+ ## 6. Route to Next Action
277
112
 
113
+ **Count files in current section:**
114
+ ```bash
115
+ ls -1 .planning/sections/[dir]/*-PLAN.md 2>/dev/null | wc -l
116
+ ls -1 .planning/sections/[dir]/*-SUMMARY.md 2>/dev/null | wc -l
117
+ ls -1 .planning/sections/[dir]/*-ISSUES.md 2>/dev/null | wc -l
278
118
  ```
279
- ---
280
-
281
- ## 🎉 Draft Complete
282
-
283
- All {N} sections written!
284
-
285
- **Words:** [current] / [target]
286
-
287
- ## ▶ Next Up
288
119
 
289
- **Review & Polish** — verify and prepare for submission
120
+ **Route A — Unexecuted plan exists** (summaries < plans):
121
+ Find first PLAN.md without SUMMARY.md. Offer `/wtfp:write-section [path]`.
290
122
 
291
- `/wtfp:review-section` — run full verification
292
- `/wtfp:export-latex` — generate LaTeX output
123
+ **Route B — Section needs planning** (plans = 0):
124
+ If CONTEXT.md exists → offer `/wtfp:plan-section {N}`.
125
+ If not → offer `/wtfp:discuss-section {N}` or `/wtfp:plan-section {N}`.
293
126
 
294
- <sub>`/clear` first → fresh context window</sub>
127
+ **Route C — Section complete, more remain** (summaries = plans, not last section):
128
+ Offer `/wtfp:plan-section {N+1}`. Also: `/wtfp:review-section {N}`.
295
129
 
296
- ---
297
-
298
- **Also available:**
299
- - `/wtfp:submit-milestone "draft-1"` — archive this draft
130
+ **Route D — Draft complete** (all sections done):
131
+ Offer `/wtfp:review-section` and `/wtfp:export-latex`.
300
132
 
301
- ---
302
- ```
133
+ **Route E — Review issues need revision** (ISSUES.md without REVISION.md):
134
+ Offer `/wtfp:plan-revision {plan}`.
303
135
 
304
- </step>
136
+ </process>
305
137
 
306
- <step name="edge_cases">
307
- **Handle edge cases:**
138
+ <offer_next>
308
139
 
309
- - Section complete but next section not planned → offer `/wtfp:plan-section [next]`
310
- - All work complete → offer review and export
311
- - Gaps present → highlight before offering to continue
312
- - Handoff file exists → mention it, offer `/wtfp:resume-writing`
313
- </step>
140
+ Show the routed next action with clear command and `/clear` suggestion.
314
141
 
315
- </process>
142
+ </offer_next>
316
143
 
317
144
  <success_criteria>
318
-
145
+ - [ ] Statusline displayed first: WTF-P ► {sections} ◆ {words} ► {profile} [▲ update]
146
+ - [ ] Update indicator shown when newer version available
147
+ - [ ] Pending todo count shown
319
148
  - [ ] Rich context provided (recent work, word counts, decisions)
320
149
  - [ ] Current position clear with visual progress
321
- - [ ] What's next clearly explained
322
- - [ ] Smart routing: /wtfp:write-section if plan exists, /wtfp:plan-section if not
150
+ - [ ] Model profile shown
151
+ - [ ] Smart routing to next command
323
152
  - [ ] User confirms before any action
324
- - [ ] Seamless handoff to appropriate wtfp command
325
153
  </success_criteria>