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