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,43 +1,58 @@
1
1
  ---
2
2
  name: wtfp:submit-milestone
3
- description: Archive completed submission round
3
+ description: Archive a completed draft or submission version
4
4
  argument-hint: "[version]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
8
8
  - Write
9
9
  - AskUserQuestion
10
+ - Glob
11
+ - Grep
10
12
  ---
11
13
 
12
14
  <objective>
13
15
  Archive a completed draft or submission round.
14
16
 
17
+ Archives full state to `.planning/milestones/{version}/`.
15
18
  Creates MILESTONES.md entry with stats.
16
- Archives full details to milestones/ directory.
17
- Creates git tag for the version.
18
- Prepares workspace for revision round.
19
+ Evolves PROJECT.md (shipped claims to Validated).
20
+ Creates annotated git tag.
21
+ Resets ROADMAP.md for revision round.
19
22
  </objective>
20
23
 
21
24
  <process>
22
25
 
23
- <step name="verify">
24
- **Verify paper is ready:**
26
+ <step name="validate_environment">
27
+ **Step 1: Validate Environment and Gather Stats**
25
28
 
26
29
  ```bash
27
30
  [ ! -f .planning/STATE.md ] && echo "ERROR: No project state found" && exit 1
31
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No ROADMAP.md found" && exit 1
32
+ [ ! -f .planning/PROJECT.md ] && echo "ERROR: No PROJECT.md found" && exit 1
28
33
  ```
29
34
 
30
- Check completion status:
31
- - Are all planned sections written?
32
- - Any unresolved blockers?
35
+ Read version from argument:
36
+ ```bash
37
+ VERSION=$ARGUMENTS # e.g., "draft-1", "camera-ready", "revision-2"
38
+ [ -z "$VERSION" ] && echo "ERROR: Version required. Usage: /wtfp:submit-milestone draft-1" && exit 1
39
+ ```
40
+
41
+ **Gather statistics from ROADMAP.md and section summaries:**
42
+ - Total sections (count section entries in ROADMAP)
43
+ - Sections complete (count checked `[x]` entries)
44
+ - Read all SUMMARY.md files in `.planning/sections/*/`:
45
+ - Total words (sum from each summary)
46
+ - Citations used
47
+ - Figures
48
+ - Tables
33
49
 
34
- If incomplete:
50
+ If incomplete sections exist:
35
51
  ```
36
52
  WARNING: Not all sections are complete.
37
53
 
38
54
  Sections remaining:
39
55
  - [Section N]: [status]
40
- - [Section M]: [status]
41
56
 
42
57
  Continue anyway?
43
58
  ```
@@ -46,155 +61,287 @@ Use AskUserQuestion:
46
61
  - header: "Proceed?"
47
62
  - question: "Archive milestone with incomplete sections?"
48
63
  - options:
49
- - "Yes, archive anyway" — Create milestone as-is
50
- - "No, finish first" — Return to writing
64
+ - "Yes, archive anyway" -- Create milestone as-is
65
+ - "No, finish first" -- Return to writing
66
+
67
+ </step>
68
+
69
+ <step name="read_git_config">
70
+ **Step 2: Read Git Config**
71
+
72
+ ```bash
73
+ BRANCH_STRATEGY=$(cat .planning/config.json 2>/dev/null | grep -o '"branching_strategy"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "none")
74
+ SQUASH=$(cat .planning/config.json 2>/dev/null | grep -o '"squash_on_merge"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "false")
75
+ COMMIT_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
76
+ SUBMISSION_TEMPLATE=$(cat .planning/config.json 2>/dev/null | grep -o '"submission_branch_template"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "wtfp/{milestone}-{slug}")
77
+ ```
78
+
79
+ Store these for use in subsequent steps.
51
80
 
52
81
  </step>
53
82
 
54
- <step name="gather_stats">
55
- **Gather statistics:**
83
+ <step name="archive">
84
+ **Step 3: Archive to .planning/milestones/ (MLN-01)**
85
+
86
+ ```bash
87
+ ARCHIVE_DIR=".planning/milestones/${VERSION}"
88
+ mkdir -p "$ARCHIVE_DIR"
89
+ ```
90
+
91
+ Archive these files:
92
+ ```bash
93
+ # Core planning files
94
+ cp .planning/ROADMAP.md "$ARCHIVE_DIR/${VERSION}-ROADMAP.md"
95
+ cp .planning/STATE.md "$ARCHIVE_DIR/${VERSION}-STATE.md"
96
+
97
+ # Argument map if exists
98
+ cp .planning/structure/argument-map.md "$ARCHIVE_DIR/${VERSION}-argument-map.md" 2>/dev/null || true
99
+
100
+ # All section summaries
101
+ for summary in .planning/sections/*/*-SUMMARY.md; do
102
+ [ -f "$summary" ] && cp "$summary" "$ARCHIVE_DIR/"
103
+ done
104
+ ```
56
105
 
57
- - Total sections: [N]
58
- - Sections complete: [M]
59
- - Total words: [X]
60
- - Target words: [Y]
61
- - Word variance: [+/- Z%]
62
- - Citations used: [N]
63
- - Figures: [N]
64
- - Tables: [N]
65
- - Issues resolved: [N]
66
- - Issues deferred: [N]
106
+ Verify archive created:
107
+ ```bash
108
+ ls -la "$ARCHIVE_DIR/"
109
+ ```
67
110
 
68
111
  </step>
69
112
 
70
- <step name="milestone_entry">
71
- **Create/update MILESTONES.md:**
113
+ <step name="milestones_entry">
114
+ **Step 4: Create/Update MILESTONES.md (MLN-02)**
115
+
116
+ Read existing MILESTONES.md if present, otherwise create header.
117
+
118
+ Prepend new entry to `.planning/MILESTONES.md`:
72
119
 
73
120
  ```markdown
74
121
  # Milestones
75
122
 
76
- ## [version] - [Name/Description]
77
-
78
- **Date:** [date]
79
- **Status:** [Submitted / Draft / Ready for Review]
123
+ ## {version} - {description}
80
124
 
81
- ### Summary
82
- [Brief description of what this version represents]
125
+ **Date:** {YYYY-MM-DD}
126
+ **Status:** {Submitted / Draft / Ready for Review}
83
127
 
84
128
  ### Stats
85
- - Sections: [M]/[N] complete
86
- - Words: [X] / [Y] target
87
- - Citations: [N]
88
- - Figures: [N]
129
+ - Sections: {M}/{N} complete
130
+ - Words: {X} / {Y} target ({variance}%)
131
+ - Citations: {N}
132
+ - Figures: {N}
133
+ - Tables: {N}
89
134
 
90
135
  ### Sections Included
91
136
  | Section | Words | Status |
92
137
  |---------|-------|--------|
93
- | Introduction | [X] | Complete |
94
- | Methods | [X] | Complete |
138
+ | {name} | {X} | {status} |
95
139
  | ... | | |
96
140
 
97
141
  ### Key Decisions
98
- [Major decisions made in this version]
142
+ {Extract from section SUMMARY.md files - concatenate "Decisions Made" sections}
99
143
 
100
144
  ### Known Issues
101
- [Issues deferred to next version]
145
+ {Any deferred issues from section reviews - extract from SUMMARY.md "Next Steps" sections}
102
146
 
103
147
  ### Git Reference
104
- - Tag: `[version]`
105
- - Commit: [hash]
148
+ - Tag: `{version}`
149
+ - Commit: {hash}
150
+ - Archive: `.planning/milestones/{version}/`
106
151
 
107
152
  ---
108
153
 
109
- [Previous milestones below...]
154
+ {Previous milestones below...}
110
155
  ```
111
156
 
112
157
  </step>
113
158
 
114
- <step name="archive">
115
- **Create milestone archive:**
159
+ <step name="project_evolution">
160
+ **Step 5: Update PROJECT.md (MLN-03)**
161
+
162
+ Read PROJECT.md. Make these updates:
163
+
164
+ **Requirements section:**
165
+ - Identify items marked as complete/shipped in the "Active" or "In Progress" column
166
+ - Move those items to "Validated" status
167
+
168
+ **What This Is section:**
169
+ - Append: "v{version}: {brief milestone description}"
170
+
171
+ **Key Decisions section:**
172
+ - Add entry: "{date} | Milestone {version} archived | {N} sections, {X} words"
116
173
 
174
+ Write updated PROJECT.md.
175
+
176
+ </step>
177
+
178
+ <step name="git_tag">
179
+ **Step 6: Git Operations (MLN-04)**
180
+
181
+ **If BRANCH_STRATEGY = "submission":**
182
+
183
+ 1. Create submission branch:
117
184
  ```bash
118
- mkdir -p .planning/milestones
185
+ # Resolve template variables
186
+ PAPER_SLUG=$(cat .planning/PROJECT.md | grep -m1 "^#" | sed 's/^# //' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd '[:alnum:]-')
187
+ BRANCH_NAME=$(echo "$SUBMISSION_TEMPLATE" | sed "s/{milestone}/${VERSION}/g" | sed "s/{slug}/${PAPER_SLUG}/g")
188
+
189
+ git checkout -b "$BRANCH_NAME"
119
190
  ```
120
191
 
121
- Copy current state to archive:
122
- - `.planning/milestones/[version]-ROADMAP.md`
123
- - `.planning/milestones/[version]-STATE.md`
124
- - Snapshot of all SUMMARY.md files
192
+ 2. Commit archive and MILESTONES.md:
193
+ ```bash
194
+ git add .planning/milestones/
195
+ git add .planning/MILESTONES.md
196
+ git add .planning/PROJECT.md
197
+
198
+ # Respect commit_docs for planning files
199
+ if [ "$COMMIT_DOCS" = "true" ]; then
200
+ git add .planning/STATE.md .planning/ROADMAP.md
201
+ fi
125
202
 
126
- </step>
203
+ git commit -m "$(cat <<'EOF'
204
+ milestone({version}): archive submission
205
+
206
+ Sections: {M}/{N}
207
+ Words: {X}
208
+ Date: {date}
127
209
 
128
- <step name="tag">
129
- **Create git tag:**
210
+ Archive: .planning/milestones/{version}/
211
+ EOF
212
+ )"
213
+ ```
130
214
 
215
+ 3. Create annotated tag:
131
216
  ```bash
132
- git add .planning/MILESTONES.md .planning/milestones/
217
+ git tag -a "${VERSION}" -m "$(cat <<EOF
218
+ Milestone: ${VERSION}
219
+
220
+ Sections completed:
221
+ $(list sections from stats)
222
+
223
+ Words: ${WORD_COUNT}
224
+ Date: ${DATE}
225
+ Archive: .planning/milestones/${VERSION}/
226
+ EOF
227
+ )"
228
+ ```
229
+
230
+ 4. Merge back to base branch:
231
+ ```bash
232
+ BASE_BRANCH=$(git rev-parse --abbrev-ref HEAD@{1} 2>/dev/null || echo "main")
233
+ git checkout "$BASE_BRANCH"
234
+
235
+ if [ "$SQUASH" = "true" ]; then
236
+ git merge --squash "$BRANCH_NAME"
237
+ git commit -m "milestone(${VERSION}): squash merge submission branch"
238
+ else
239
+ git merge --no-ff "$BRANCH_NAME" -m "milestone(${VERSION}): merge submission branch"
240
+ fi
241
+
242
+ git branch -d "$BRANCH_NAME"
243
+ ```
244
+
245
+ **If BRANCH_STRATEGY != "submission":**
246
+
247
+ 1. Commit archive and MILESTONES.md (respect commit_docs):
248
+ ```bash
249
+ git add .planning/milestones/
250
+ git add .planning/MILESTONES.md
251
+ git add .planning/PROJECT.md
252
+
253
+ if [ "$COMMIT_DOCS" = "true" ]; then
254
+ git add .planning/STATE.md .planning/ROADMAP.md
255
+ fi
256
+
133
257
  git commit -m "$(cat <<'EOF'
134
- milestone: [version] - [name]
258
+ milestone({version}): archive submission
259
+
260
+ Sections: {M}/{N}
261
+ Words: {X}
262
+ Date: {date}
135
263
 
136
- Words: [X]
137
- Sections: [M]/[N]
138
- Status: [status]
264
+ Archive: .planning/milestones/{version}/
139
265
  EOF
140
266
  )"
267
+ ```
268
+
269
+ 2. Create annotated tag:
270
+ ```bash
271
+ git tag -a "${VERSION}" -m "$(cat <<EOF
272
+ Milestone: ${VERSION}
141
273
 
142
- git tag -a "[version]" -m "[Milestone description]"
274
+ Sections completed:
275
+ $(list sections from stats)
276
+
277
+ Words: ${WORD_COUNT}
278
+ Date: ${DATE}
279
+ Archive: .planning/milestones/${VERSION}/
280
+ EOF
281
+ )"
143
282
  ```
144
283
 
145
284
  </step>
146
285
 
147
- <step name="prepare_next">
148
- **Prepare for next round:**
286
+ <step name="reset_roadmap">
287
+ **Step 7: Reset ROADMAP.md (MLN-05)**
149
288
 
150
- Use AskUserQuestion:
151
- - header: "Next Steps"
152
- - question: "What's next after this milestone?"
153
- - options:
154
- - "Wait for reviews" — Pause until feedback
155
- - "Start revisions" — Begin revision round
156
- - "Done for now" — Just archive
289
+ After archival, prepare for revision round:
157
290
 
158
- If "Start revisions":
159
- - Reset STATE.md position to first section
160
- - Note that this is revision round
161
- - Suggest `/wtfp:progress` to start
291
+ 1. Add "Previous Milestone" note at top of ROADMAP.md:
292
+ ```markdown
293
+ > **Previous:** {version} archived on {date}
294
+ ```
295
+
296
+ 2. Reset all section checkboxes (change `[x]` to `[ ]`):
297
+ ```bash
298
+ sed -i 's/\[x\]/[ ]/g' .planning/ROADMAP.md
299
+ ```
300
+
301
+ 3. Keep section structure intact for revision round.
302
+
303
+ 4. Update STATE.md:
304
+ - Reset position to "Revision round after {version}"
305
+ - Note milestone archived
306
+ - Clear any in-progress tracking
162
307
 
163
308
  </step>
164
309
 
165
- <step name="done">
166
- **Present completion:**
310
+ <step name="completion_banner">
311
+ **Step 8: Completion Banner**
167
312
 
168
313
  ```
169
- Milestone archived:
314
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
315
+ WTF-P ► MILESTONE ARCHIVED ✓
316
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
170
317
 
171
- - Version: [version]
172
- - Entry: .planning/MILESTONES.md
173
- - Archive: .planning/milestones/[version]-*
174
- - Git tag: [version]
318
+ Version: {version}
319
+ Archive: .planning/milestones/{version}/
320
+ Tag: {version}
175
321
 
176
- ## Summary
177
- - Sections: [M]/[N] complete
178
- - Words: [X] / [Y]
179
- - Status: [status]
322
+ Stats:
323
+ Sections: {M}/{N}
324
+ Words: {X}
325
+ Citations: {N}
180
326
 
181
- ---
327
+ Git:
328
+ Commit: {hash}
329
+ Tag: {version}
182
330
 
183
- ## ▶ Next Up
331
+ ───────────────────────────────────────────
184
332
 
185
- [Based on user's choice:]
333
+ ## Next Up
186
334
 
187
335
  **Wait for reviews:**
188
- When you receive reviewer feedback:
189
- `/wtfp:import-reviews` (coming soon)
336
+ Run `/wtfp:progress` when feedback arrives
190
337
 
191
338
  **Start revisions:**
192
- `/wtfp:progress` — check what needs revision
339
+ Run `/wtfp:progress` to see what needs revision
193
340
 
194
- **Done for now:**
195
- Your work is archived. Run `/wtfp:progress` when ready to continue.
341
+ **Audit before next submission:**
342
+ Run `/wtfp:audit-milestone` to check readiness
196
343
 
197
- ---
344
+ ───────────────────────────────────────────
198
345
  ```
199
346
 
200
347
  </step>
@@ -202,10 +349,12 @@ Your work is archived. Run `/wtfp:progress` when ready to continue.
202
349
  </process>
203
350
 
204
351
  <success_criteria>
205
- - [ ] Completion status verified
206
- - [ ] Statistics gathered
207
- - [ ] MILESTONES.md updated
208
- - [ ] Archive created
209
- - [ ] Git tag created
210
- - [ ] Next steps clear
352
+ - [ ] Archive directory created at `.planning/milestones/{version}/`
353
+ - [ ] Archive contains: ROADMAP, argument-map, STATE, section summaries
354
+ - [ ] MILESTONES.md entry created with version, date, stats table
355
+ - [ ] PROJECT.md updated (shipped items to Validated, What This Is appended)
356
+ - [ ] Git tag created with annotated message listing sections completed
357
+ - [ ] ROADMAP.md reset for revision round (checkboxes unchecked)
358
+ - [ ] Branching strategy respected (submission branch if configured)
359
+ - [ ] commit_docs guard respected for planning file commits
211
360
  </success_criteria>
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: wtfp:update
3
+ description: Check for updates and install newer version
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - AskUserQuestion
8
+ ---
9
+
10
+ <objective>
11
+ Check npm registry for newer version, show what changed, offer to update.
12
+ </objective>
13
+
14
+ <context>
15
+ No arguments. Checks current installed version against npm registry.
16
+ </context>
17
+
18
+ <process>
19
+
20
+ ## 1. Get Current Version
21
+
22
+ Try global install first:
23
+ ```bash
24
+ CURRENT=$(node -e "console.log(require('$(npm root -g)/wtf-p/package.json').version)" 2>/dev/null || echo "")
25
+ ```
26
+
27
+ If empty, try local:
28
+ ```bash
29
+ CURRENT=$(node -e "console.log(require('./package.json').version)" 2>/dev/null || echo "unknown")
30
+ ```
31
+
32
+ If still unknown, notify user:
33
+ ```
34
+ Could not determine current WTF-P version.
35
+ ```
36
+
37
+ ## 2. Check npm Registry
38
+
39
+ ```bash
40
+ LATEST=$(npm view wtf-p version 2>/dev/null || echo "")
41
+ ```
42
+
43
+ If empty:
44
+ ```
45
+ Could not reach npm registry. Check your connection.
46
+ ```
47
+ Exit.
48
+
49
+ ## 3. Compare Versions
50
+
51
+ If CURRENT == LATEST:
52
+ ```
53
+ WTF-P is up to date (v{CURRENT}).
54
+ ```
55
+ Exit.
56
+
57
+ If CURRENT < LATEST, continue to show update available.
58
+
59
+ ## 4. Fetch Changelog
60
+
61
+ Attempt to get changelog information:
62
+ ```bash
63
+ npm view wtf-p readme 2>/dev/null | head -80
64
+ ```
65
+
66
+ Or read from installed path if available:
67
+ ```bash
68
+ cat $(npm root -g)/wtf-p/CHANGELOG.md 2>/dev/null | head -100
69
+ ```
70
+
71
+ Extract relevant changes between current and latest versions.
72
+
73
+ ## 5. Present Update Option
74
+
75
+ Use AskUserQuestion:
76
+ - header: "Update Available"
77
+ - question: "WTF-P v{CURRENT} -> v{LATEST}\n\n{changelog excerpt showing new features/fixes}"
78
+ - options:
79
+ - "Update now"
80
+ - "Skip for now"
81
+ - "Show full changelog"
82
+
83
+ ## 6. Handle Response
84
+
85
+ **"Update now":**
86
+ ```bash
87
+ npm install -g wtf-p@latest
88
+ ```
89
+
90
+ Confirm:
91
+ ```
92
+ Updated to v{LATEST}. Restart your terminal for changes to take effect.
93
+ ```
94
+
95
+ **"Skip for now":**
96
+ ```
97
+ Update skipped. Run /wtfp:update when ready.
98
+ ```
99
+ Exit.
100
+
101
+ **"Show full changelog":**
102
+ Display more changelog content, then ask again (Update now / Skip for now).
103
+
104
+ </process>
105
+
106
+ <success_criteria>
107
+ - [ ] Current and latest version compared
108
+ - [ ] Changelog diff shown when update available
109
+ - [ ] User can update or skip
110
+ - [ ] npm install -g runs on confirm
111
+ - [ ] Restart reminder shown after update
112
+ </success_criteria>