wtf-p 0.4.0 → 0.5.0

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