@sniper.ai/core 2.0.0 → 3.1.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 (210) hide show
  1. package/README.md +87 -98
  2. package/agents/analyst.md +29 -0
  3. package/agents/architect.md +38 -0
  4. package/agents/backend-dev.md +43 -0
  5. package/agents/code-reviewer.md +72 -0
  6. package/agents/doc-writer.md +60 -0
  7. package/agents/frontend-dev.md +43 -0
  8. package/agents/fullstack-dev.md +44 -0
  9. package/agents/gate-reviewer.md +72 -0
  10. package/agents/lead-orchestrator.md +51 -0
  11. package/agents/product-manager.md +40 -0
  12. package/agents/qa-engineer.md +37 -0
  13. package/agents/retro-analyst.md +104 -0
  14. package/checklists/discover.yaml +23 -0
  15. package/checklists/implement.yaml +28 -0
  16. package/checklists/ingest-document.yaml +18 -0
  17. package/checklists/ingest-extract.yaml +13 -0
  18. package/checklists/ingest-scan.yaml +18 -0
  19. package/checklists/multi-faceted-review.yaml +57 -0
  20. package/checklists/plan.yaml +36 -0
  21. package/checklists/refactor-analyze.yaml +19 -0
  22. package/checklists/review.yaml +29 -0
  23. package/claude-md.template +42 -0
  24. package/config.template.yaml +156 -0
  25. package/hooks/settings-hooks.json +40 -0
  26. package/hooks/signal-hooks.json +16 -0
  27. package/package.json +23 -5
  28. package/personas/cognitive/devils-advocate.md +24 -0
  29. package/personas/cognitive/performance-focused.md +23 -0
  30. package/personas/cognitive/security-first.md +24 -0
  31. package/protocols/explore.yaml +21 -0
  32. package/protocols/feature.yaml +47 -0
  33. package/protocols/full.yaml +65 -0
  34. package/protocols/hotfix.yaml +19 -0
  35. package/protocols/ingest.yaml +42 -0
  36. package/protocols/patch.yaml +30 -0
  37. package/protocols/refactor.yaml +43 -0
  38. package/schemas/checkpoint.schema.yaml +133 -0
  39. package/schemas/cost.schema.yaml +97 -0
  40. package/schemas/dependency-graph.schema.yaml +37 -0
  41. package/schemas/gate-result.schema.yaml +101 -0
  42. package/schemas/knowledge-manifest.schema.yaml +39 -0
  43. package/schemas/live-status.schema.yaml +122 -0
  44. package/schemas/protocol-meta.schema.yaml +58 -0
  45. package/schemas/protocol.schema.yaml +100 -0
  46. package/schemas/retro.schema.yaml +95 -0
  47. package/schemas/revert-plan.schema.yaml +40 -0
  48. package/schemas/signal.schema.yaml +39 -0
  49. package/schemas/velocity.schema.yaml +52 -0
  50. package/schemas/workspace-lock.schema.yaml +34 -0
  51. package/schemas/workspace.schema.yaml +82 -0
  52. package/skills/sniper-flow/SKILL.md +196 -0
  53. package/skills/sniper-init/SKILL.md +102 -0
  54. package/skills/sniper-review/SKILL.md +49 -0
  55. package/skills/sniper-status/SKILL.md +79 -0
  56. package/templates/architecture.md +23 -0
  57. package/templates/checkpoint.yaml +27 -0
  58. package/templates/codebase-overview.md +19 -0
  59. package/templates/cost.yaml +23 -0
  60. package/templates/custom-protocol.yaml +98 -0
  61. package/templates/knowledge-manifest.yaml +32 -0
  62. package/templates/live-status.yaml +26 -0
  63. package/templates/multi-faceted-review-report.md +28 -0
  64. package/templates/registry.md +4 -0
  65. package/templates/review-report.md +25 -0
  66. package/templates/signal-record.yaml +37 -0
  67. package/templates/spec.md +28 -0
  68. package/templates/story.md +19 -0
  69. package/templates/velocity.yaml +9 -0
  70. package/templates/workspace-config.yaml +44 -0
  71. package/framework/checklists/code-review.md +0 -33
  72. package/framework/checklists/debug-review.md +0 -34
  73. package/framework/checklists/discover-review.md +0 -33
  74. package/framework/checklists/doc-review.md +0 -39
  75. package/framework/checklists/feature-review.md +0 -42
  76. package/framework/checklists/ingest-review.md +0 -42
  77. package/framework/checklists/memory-review.md +0 -30
  78. package/framework/checklists/perf-review.md +0 -33
  79. package/framework/checklists/plan-review.md +0 -52
  80. package/framework/checklists/refactor-review.md +0 -33
  81. package/framework/checklists/security-review.md +0 -34
  82. package/framework/checklists/sprint-review.md +0 -41
  83. package/framework/checklists/story-review.md +0 -30
  84. package/framework/checklists/test-review.md +0 -32
  85. package/framework/checklists/workspace-review.md +0 -34
  86. package/framework/claude-md.template +0 -37
  87. package/framework/commands/sniper-audit.md +0 -1549
  88. package/framework/commands/sniper-compose.md +0 -323
  89. package/framework/commands/sniper-debug.md +0 -337
  90. package/framework/commands/sniper-discover.md +0 -423
  91. package/framework/commands/sniper-doc.md +0 -441
  92. package/framework/commands/sniper-feature.md +0 -515
  93. package/framework/commands/sniper-ingest.md +0 -506
  94. package/framework/commands/sniper-init.md +0 -388
  95. package/framework/commands/sniper-memory.md +0 -219
  96. package/framework/commands/sniper-plan.md +0 -630
  97. package/framework/commands/sniper-review.md +0 -369
  98. package/framework/commands/sniper-solve.md +0 -408
  99. package/framework/commands/sniper-sprint.md +0 -716
  100. package/framework/commands/sniper-status.md +0 -481
  101. package/framework/commands/sniper-workspace-feature.md +0 -267
  102. package/framework/commands/sniper-workspace-init.md +0 -252
  103. package/framework/commands/sniper-workspace-status.md +0 -112
  104. package/framework/commands/sniper-workspace-validate.md +0 -138
  105. package/framework/config.template.yaml +0 -196
  106. package/framework/personas/cognitive/devils-advocate.md +0 -30
  107. package/framework/personas/cognitive/mentor-explainer.md +0 -29
  108. package/framework/personas/cognitive/performance-focused.md +0 -30
  109. package/framework/personas/cognitive/security-first.md +0 -29
  110. package/framework/personas/cognitive/systems-thinker.md +0 -29
  111. package/framework/personas/cognitive/user-empathetic.md +0 -29
  112. package/framework/personas/domain/.gitkeep +0 -0
  113. package/framework/personas/process/analyst.md +0 -29
  114. package/framework/personas/process/architect.md +0 -30
  115. package/framework/personas/process/architecture-cartographer.md +0 -25
  116. package/framework/personas/process/code-archaeologist.md +0 -22
  117. package/framework/personas/process/code-investigator.md +0 -29
  118. package/framework/personas/process/code-reviewer.md +0 -26
  119. package/framework/personas/process/contract-designer.md +0 -31
  120. package/framework/personas/process/convention-miner.md +0 -27
  121. package/framework/personas/process/coverage-analyst.md +0 -24
  122. package/framework/personas/process/developer.md +0 -32
  123. package/framework/personas/process/doc-analyst.md +0 -63
  124. package/framework/personas/process/doc-reviewer.md +0 -62
  125. package/framework/personas/process/doc-writer.md +0 -42
  126. package/framework/personas/process/flake-hunter.md +0 -30
  127. package/framework/personas/process/impact-analyst.md +0 -23
  128. package/framework/personas/process/integration-validator.md +0 -29
  129. package/framework/personas/process/log-analyst.md +0 -22
  130. package/framework/personas/process/migration-architect.md +0 -24
  131. package/framework/personas/process/perf-profiler.md +0 -27
  132. package/framework/personas/process/product-manager.md +0 -32
  133. package/framework/personas/process/qa-engineer.md +0 -31
  134. package/framework/personas/process/release-manager.md +0 -23
  135. package/framework/personas/process/retro-analyst.md +0 -30
  136. package/framework/personas/process/scrum-master.md +0 -31
  137. package/framework/personas/process/threat-modeler.md +0 -30
  138. package/framework/personas/process/triage-lead.md +0 -23
  139. package/framework/personas/process/ux-designer.md +0 -31
  140. package/framework/personas/process/vuln-scanner.md +0 -27
  141. package/framework/personas/process/workspace-orchestrator.md +0 -30
  142. package/framework/personas/technical/ai-ml.md +0 -33
  143. package/framework/personas/technical/api-design.md +0 -32
  144. package/framework/personas/technical/backend.md +0 -32
  145. package/framework/personas/technical/database.md +0 -32
  146. package/framework/personas/technical/frontend.md +0 -33
  147. package/framework/personas/technical/infrastructure.md +0 -32
  148. package/framework/personas/technical/security.md +0 -34
  149. package/framework/settings.template.json +0 -6
  150. package/framework/spawn-prompts/_template.md +0 -25
  151. package/framework/teams/debug.yaml +0 -56
  152. package/framework/teams/discover.yaml +0 -57
  153. package/framework/teams/doc.yaml +0 -76
  154. package/framework/teams/feature-plan.yaml +0 -61
  155. package/framework/teams/ingest.yaml +0 -85
  156. package/framework/teams/perf.yaml +0 -33
  157. package/framework/teams/plan.yaml +0 -86
  158. package/framework/teams/refactor.yaml +0 -34
  159. package/framework/teams/retro.yaml +0 -30
  160. package/framework/teams/review-pr.yaml +0 -73
  161. package/framework/teams/review-release.yaml +0 -70
  162. package/framework/teams/security.yaml +0 -59
  163. package/framework/teams/solve.yaml +0 -48
  164. package/framework/teams/sprint.yaml +0 -68
  165. package/framework/teams/test.yaml +0 -59
  166. package/framework/teams/workspace-feature.yaml +0 -69
  167. package/framework/teams/workspace-validation.yaml +0 -27
  168. package/framework/templates/arch-delta.md +0 -74
  169. package/framework/templates/architecture.md +0 -95
  170. package/framework/templates/brief.md +0 -73
  171. package/framework/templates/bug-report.md +0 -55
  172. package/framework/templates/contract-validation-report.md +0 -68
  173. package/framework/templates/contract.yaml +0 -60
  174. package/framework/templates/conventions.md +0 -59
  175. package/framework/templates/coverage-report.md +0 -67
  176. package/framework/templates/doc-api.md +0 -53
  177. package/framework/templates/doc-guide.md +0 -35
  178. package/framework/templates/doc-readme.md +0 -49
  179. package/framework/templates/epic.md +0 -47
  180. package/framework/templates/feature-brief.md +0 -54
  181. package/framework/templates/feature-spec.md +0 -53
  182. package/framework/templates/flaky-report.md +0 -64
  183. package/framework/templates/investigation.md +0 -49
  184. package/framework/templates/memory-anti-pattern.yaml +0 -16
  185. package/framework/templates/memory-convention.yaml +0 -17
  186. package/framework/templates/memory-decision.yaml +0 -16
  187. package/framework/templates/migration-plan.md +0 -47
  188. package/framework/templates/optimization-plan.md +0 -59
  189. package/framework/templates/performance-profile.md +0 -64
  190. package/framework/templates/personas.md +0 -118
  191. package/framework/templates/postmortem.md +0 -69
  192. package/framework/templates/pr-review.md +0 -50
  193. package/framework/templates/prd.md +0 -92
  194. package/framework/templates/refactor-scope.md +0 -52
  195. package/framework/templates/release-readiness.md +0 -66
  196. package/framework/templates/retro.yaml +0 -44
  197. package/framework/templates/risks.md +0 -64
  198. package/framework/templates/security.md +0 -111
  199. package/framework/templates/sprint-review.md +0 -32
  200. package/framework/templates/story.md +0 -53
  201. package/framework/templates/threat-model.md +0 -71
  202. package/framework/templates/ux-spec.md +0 -71
  203. package/framework/templates/vulnerability-report.md +0 -56
  204. package/framework/templates/workspace-brief.md +0 -52
  205. package/framework/templates/workspace-plan.md +0 -50
  206. package/framework/workflows/discover-only.md +0 -39
  207. package/framework/workflows/full-lifecycle.md +0 -56
  208. package/framework/workflows/quick-feature.md +0 -44
  209. package/framework/workflows/sprint-cycle.md +0 -47
  210. package/framework/workflows/workspace-feature.md +0 -71
@@ -1,515 +0,0 @@
1
- # /sniper-feature -- Incremental Feature Lifecycle
2
-
3
- You are executing the `/sniper-feature` command. Your job is to orchestrate a scoped mini-lifecycle for adding a single feature to an existing project. You run the full flow: scoping, planning, story generation, sprint, and merge-back — with user checkpoints between phases. Follow every step below precisely.
4
-
5
- **Arguments:** $ARGUMENTS
6
-
7
- ---
8
-
9
- ## Step 0: Pre-Flight Checks
10
-
11
- ### 0a. Verify SNIPER Is Initialized
12
-
13
- 1. Read `.sniper/config.yaml`.
14
- 2. If the file does not exist or `project.name` is empty:
15
- - **STOP.** Print: "SNIPER is not initialized. Run `/sniper-init` first."
16
-
17
- ### 0b. Config Migration Check
18
-
19
- 1. Read `schema_version` from `.sniper/config.yaml`.
20
- 2. If `schema_version` is absent or less than 2, run the v1→v2 migration. Write the updated config before proceeding.
21
-
22
- ### 0c. Parse Arguments
23
-
24
- 1. **Feature description** (positional): The feature title/description (e.g., "Add webhook support for real-time event delivery").
25
- 2. **`--list`:** List all active and completed features with their status. Print the list and STOP.
26
- 3. **`--resume SNPR-{XXXX}`:** Resume a paused feature. Find the feature in `state.features[]`, determine its current phase, and jump to the appropriate step.
27
- 4. **`--skip-to {phase}`:** Skip directly to a specific phase (planning, solving, sprint). Only valid with `--resume`.
28
-
29
- ### 0d. Handle `--list`
30
-
31
- If `--list` was passed:
32
-
33
- ```
34
- ============================================
35
- SNIPER Features
36
- ============================================
37
-
38
- Active Features:
39
- SNPR-{XXXX} {title} {phase} ({progress})
40
- ...
41
-
42
- Completed Features:
43
- SNPR-{XXXX} {title} completed {date} ({story_count} stories)
44
- ...
45
-
46
- Total: {active} active, {completed} completed
47
-
48
- ============================================
49
- ```
50
-
51
- Then STOP.
52
-
53
- ### 0e. Handle `--resume`
54
-
55
- If `--resume SNPR-{XXXX}` was passed:
56
-
57
- 1. Find the feature in `state.features[]` by ID.
58
- 2. If not found, STOP: "Feature SNPR-{XXXX} not found."
59
- 3. Read the feature's current phase.
60
- 4. Jump to the corresponding step:
61
- - `scoping` → Step 2 (re-run scoping or continue)
62
- - `planning` → Step 4 (run planning)
63
- - `solving` → Step 6 (run story generation)
64
- - `sprint` → Step 8 (run sprint)
65
-
66
- ### 0f. Verify Feature Description
67
-
68
- If no `--list` or `--resume` flag, a feature description is required:
69
-
70
- 1. If `$ARGUMENTS` does not contain a feature description, ask the user: "What feature would you like to add? Describe it in one sentence."
71
- 2. Store the feature description for Step 1.
72
-
73
- ### 0g. Check Architecture Doc Exists
74
-
75
- 1. Check if `docs/architecture.md` exists.
76
- 2. If it does NOT exist:
77
- - Print: "No architecture doc found. The feature lifecycle works best with an existing architecture doc. Options: (a) Run `/sniper-ingest` first to reverse-engineer the architecture (b) Continue without architecture context"
78
- - If (a), STOP.
79
- - If (b), note that the architecture delta phase will be skipped.
80
-
81
- ---
82
-
83
- ## Step 1: Assign Feature ID and Create Directory
84
-
85
- ### 1a. Assign SNPR ID
86
-
87
- 1. Read `state.feature_counter` from config (default: 1).
88
- 2. Assign the feature ID: `SNPR-{XXXX}` where XXXX is zero-padded (e.g., SNPR-0001).
89
- 3. Generate a slug from the feature description (e.g., "Add webhook support" → "webhook-support").
90
- 4. Increment `feature_counter` and write back to config.
91
-
92
- ### 1b. Record Feature in State
93
-
94
- Add to `state.features[]`:
95
-
96
- ```yaml
97
- - id: "SNPR-{XXXX}"
98
- slug: "{slug}"
99
- title: "{feature description}"
100
- phase: scoping
101
- created_at: "{current ISO timestamp}"
102
- completed_at: null
103
- arch_base_version: {current version of docs/architecture.md, or 0 if it doesn't exist}
104
- stories_total: 0
105
- stories_complete: 0
106
- ```
107
-
108
- ### 1c. Create Feature Directory
109
-
110
- ```
111
- docs/features/SNPR-{XXXX}/
112
- ```
113
-
114
- Print:
115
-
116
- ```
117
- ============================================
118
- Feature Created: SNPR-{XXXX}
119
- ============================================
120
-
121
- Title: {feature description}
122
- Slug: {slug}
123
- Dir: docs/features/SNPR-{XXXX}/
124
-
125
- Starting scoping phase...
126
- ============================================
127
- ```
128
-
129
- ---
130
-
131
- ## Step 2: Phase 1 — Scoping (Single Agent)
132
-
133
- **You run scoping directly — no team is spawned.** This is lightweight.
134
-
135
- ### 2a. Gather Context
136
-
137
- Read the following files to understand the current system:
138
-
139
- 1. `docs/architecture.md` (if exists) — understand the system structure
140
- 2. `docs/conventions.md` (if exists) — understand coding patterns
141
- 3. `.sniper/config.yaml` — get ownership paths and stack info
142
- 4. Source code files relevant to the feature — search for keywords from the feature description in the codebase
143
-
144
- ### 2b. Read Template
145
-
146
- Read `.sniper/templates/feature-brief.md`
147
-
148
- ### 2c. Produce Feature Brief
149
-
150
- Write `docs/features/SNPR-{XXXX}/brief.md` following the template. Fill in:
151
-
152
- - **Feature Description** — what this feature does, in user-facing terms
153
- - **Motivation** — why this feature is needed
154
- - **Affected Areas** — which components/files will be impacted (use architecture doc and codebase search)
155
- - **Scope** — clear in/out boundaries
156
- - **Risks & Open Questions** — unknowns that need resolution
157
- - **Dependencies** — external services, libraries, or other features needed
158
-
159
- ### 2d. Update Feature State
160
-
161
- Update `state.features[]` for this feature: `phase: scoping` (already set).
162
-
163
- ### 2e. Present to User
164
-
165
- Print:
166
-
167
- ```
168
- ============================================
169
- Feature Brief: SNPR-{XXXX}
170
- ============================================
171
-
172
- {Summary of the brief — affected components, scope, key risks}
173
-
174
- Full brief: docs/features/SNPR-{XXXX}/brief.md
175
-
176
- Options:
177
- yes — Continue to planning phase
178
- edit — Make manual edits, then say "continue"
179
- cancel — Pause this feature (resume later with --resume)
180
-
181
- ============================================
182
- ```
183
-
184
- Wait for user response.
185
-
186
- - **yes** → proceed to Step 3
187
- - **edit** → wait for user to say "continue", then proceed to Step 3
188
- - **cancel** → STOP. Feature remains in `scoping` phase.
189
-
190
- ---
191
-
192
- ## Step 3: Transition to Planning
193
-
194
- Update `state.features[]` for this feature: `phase: planning`
195
-
196
- ---
197
-
198
- ## Step 4: Phase 2 — Planning (2-Agent Team)
199
-
200
- ### 4a. Read Team Definition
201
-
202
- Read `.sniper/teams/feature-plan.yaml`. Replace `{feature_id}` with the actual ID and `{feature_title}` with the title.
203
-
204
- ### 4b. Read Context
205
-
206
- 1. Read `docs/features/SNPR-{XXXX}/brief.md` (just produced)
207
- 2. Read `docs/architecture.md` (if exists)
208
- 3. Read `docs/conventions.md` (if exists)
209
- 4. Read templates: `.sniper/templates/feature-spec.md` and `.sniper/templates/arch-delta.md`
210
-
211
- ### 4c. Compose Spawn Prompts
212
-
213
- For each teammate in the feature-plan team YAML:
214
-
215
- **feature-pm:**
216
- 1. Read persona layers: process/product-manager.md, cognitive/systems-thinker.md
217
- 2. Compose spawn prompt with:
218
- - Feature context (brief, architecture, description)
219
- - Task: produce `docs/features/SNPR-{XXXX}/spec.md`
220
- - Instructions to follow the feature-spec template
221
- - Remind agent to read the brief first
222
-
223
- **feature-architect:**
224
- 1. Read persona layers: process/architect.md, technical/backend.md, cognitive/systems-thinker.md
225
- 2. Compose spawn prompt with:
226
- - Feature context (brief, spec once produced, architecture, conventions)
227
- - Task: produce `docs/features/SNPR-{XXXX}/arch-delta.md`
228
- - Instructions to follow the arch-delta template
229
- - Note the base architecture version for merge-back tracking
230
- - Blocked by: feature-spec (must wait for PM to complete)
231
- - `plan_approval: true` — the architect must present a plan for approval before writing
232
-
233
- ### 4d. Create Team and Tasks
234
-
235
- ```
236
- TeamCreate:
237
- team_name: "sniper-feature-plan-{feature_id}"
238
- description: "Feature planning for SNPR-{XXXX}: {title}"
239
- ```
240
-
241
- Create two tasks:
242
- 1. "Feature Requirements Spec" — assigned to feature-pm
243
- 2. "Architecture Delta" — assigned to feature-architect, blocked by task 1
244
-
245
- ### 4e. Spawn Teammates and Delegate
246
-
247
- Spawn both teammates. Enter delegate mode — coordinate, don't produce artifacts.
248
-
249
- - The PM works first (produces spec.md)
250
- - When PM completes, the architect's task unblocks
251
- - The architect reads the spec + architecture and produces arch-delta.md
252
- - The architect's task requires plan approval — review their proposed approach before they write
253
-
254
- ### 4f. Verify Artifacts
255
-
256
- Once both complete, verify:
257
- - `docs/features/SNPR-{XXXX}/spec.md` exists and has content
258
- - `docs/features/SNPR-{XXXX}/arch-delta.md` exists and has content
259
-
260
- ### 4g. Shut Down Planning Team
261
-
262
- Send shutdown requests to both teammates.
263
-
264
- ### 4h. Run Feature Review
265
-
266
- Read `.sniper/checklists/feature-review.md`. Evaluate the spec and arch-delta sections.
267
-
268
- ### 4i. Present to User
269
-
270
- Print:
271
-
272
- ```
273
- ============================================
274
- Feature Planning Complete: SNPR-{XXXX}
275
- ============================================
276
-
277
- Spec: docs/features/SNPR-{XXXX}/spec.md
278
- Arch Delta: docs/features/SNPR-{XXXX}/arch-delta.md
279
-
280
- {Summary: requirement count, component changes, data model changes}
281
-
282
- Review: {pass_count}/{total} checklist items passed
283
-
284
- Options:
285
- yes — Continue to story generation
286
- edit — Make manual edits, then say "continue"
287
- cancel — Pause this feature
288
-
289
- ============================================
290
- ```
291
-
292
- Wait for user response.
293
-
294
- ---
295
-
296
- ## Step 5: Transition to Solving
297
-
298
- Update `state.features[]` for this feature: `phase: solving`
299
-
300
- ---
301
-
302
- ## Step 6: Phase 3 — Story Generation (Scoped Solve)
303
-
304
- **You run this directly as a single agent (same as `/sniper-solve`), but scoped to the feature.**
305
-
306
- ### 6a. Read Feature Artifacts
307
-
308
- 1. Read `docs/features/SNPR-{XXXX}/spec.md`
309
- 2. Read `docs/features/SNPR-{XXXX}/arch-delta.md`
310
- 3. Read `docs/architecture.md` (for broader context)
311
- 4. Read `docs/conventions.md` (if exists, for coding patterns)
312
- 5. Read story template: `.sniper/templates/story.md`
313
-
314
- ### 6b. Create Stories Directory
315
-
316
- ```
317
- docs/features/SNPR-{XXXX}/stories/
318
- ```
319
-
320
- ### 6c. Generate Stories
321
-
322
- Create **3-8 stories** scoped to this feature. Follow the same rules as `/sniper-solve` Step 7:
323
-
324
- - Self-contained: embed all context from the feature spec and arch-delta
325
- - Given/When/Then acceptance criteria
326
- - File ownership from config.yaml
327
- - Complexity: S/M/L (split XL)
328
- - Dependencies form a DAG
329
-
330
- **Numbering:** Stories are numbered sequentially within the feature: `S01-{slug}.md`, `S02-{slug}.md`, etc.
331
-
332
- **Context embedding:** Stories reference the feature spec and arch-delta, NOT the main PRD. Embed:
333
- - Relevant requirements from `spec.md`
334
- - Relevant architecture changes from `arch-delta.md`
335
- - Patterns from `conventions.md`
336
-
337
- ### 6d. Update Feature State
338
-
339
- ```yaml
340
- stories_total: {count of stories created}
341
- ```
342
-
343
- ### 6e. Present to User
344
-
345
- ```
346
- ============================================
347
- Stories Created: SNPR-{XXXX}
348
- ============================================
349
-
350
- {count} stories in docs/features/SNPR-{XXXX}/stories/
351
-
352
- | # | Story | Size | Priority | Ownership | Deps |
353
- |---|-------|------|----------|-----------|------|
354
- | S01 | {title} | M | P0 | backend | None |
355
- | S02 | {title} | S | P0 | backend | S01 |
356
- | ... | ... | ... | ... | ... | ... |
357
-
358
- Options:
359
- yes — Start implementation sprint
360
- edit — Make manual edits, then say "continue"
361
- cancel — Pause this feature
362
-
363
- ============================================
364
- ```
365
-
366
- Wait for user response.
367
-
368
- ---
369
-
370
- ## Step 7: Transition to Sprint
371
-
372
- Update `state.features[]` for this feature: `phase: sprint`
373
-
374
- ---
375
-
376
- ## Step 8: Phase 4 — Sprint (Scoped to Feature)
377
-
378
- **This runs the sprint logic from `/sniper-sprint`, but scoped to the feature.**
379
-
380
- ### Key Differences from Standard Sprint
381
-
382
- 1. **Story source:** Read stories from `docs/features/SNPR-{XXXX}/stories/` instead of `docs/stories/`.
383
-
384
- 2. **Architecture context:** Include both `docs/architecture.md` AND `docs/features/SNPR-{XXXX}/arch-delta.md` in teammate spawn prompts. The arch-delta takes precedence for this feature's scope.
385
-
386
- 3. **State tracking:** Does NOT increment `state.current_sprint`. The feature's sprint is tracked in `state.features[].phase: sprint` and `state.features[].stories_complete`.
387
-
388
- 4. **Team naming:** Use `sniper-feature-sprint-{feature_id}` to avoid collision with main lifecycle sprint teams.
389
-
390
- 5. **Story completion:** Update `state.features[].stories_complete` count as stories complete.
391
-
392
- 6. **Conventions context:** Include `docs/conventions.md` (if exists) in spawn prompts so agents follow established patterns.
393
-
394
- ### Sprint Execution
395
-
396
- Follow the same process as `/sniper-sprint` Steps 1-14, with the adjustments above:
397
-
398
- - Step 0: Pre-flight (already done in feature pre-flight)
399
- - Step 1: Do NOT increment `state.current_sprint`. Append a phase_log entry with `context: "feature-sprint-SNPR-{XXXX}"`.
400
- - Step 2: Read team definition from `.sniper/teams/sprint.yaml`
401
- - Step 3: Present feature stories (from feature dir) for selection. Default: select ALL feature stories.
402
- - Steps 4-6: Same (determine teammates, assign stories, compose prompts — add arch-delta to context)
403
- - Steps 7-14: Same execution, delegate, verify, review, state update
404
-
405
- ### After Sprint Completes
406
-
407
- If all feature stories are complete, proceed automatically to Step 9 (merge-back).
408
-
409
- If not all stories are complete, present:
410
- ```
411
- Feature SNPR-{XXXX}: {completed}/{total} stories complete.
412
- Run another sprint? (yes/no)
413
- ```
414
-
415
- ---
416
-
417
- ## Step 9: Phase 5 — Merge-Back
418
-
419
- After all feature stories are complete and the sprint is approved:
420
-
421
- ### 9a. Conflict Detection
422
-
423
- 1. Read `arch_base_version` from `state.features[]` for this feature.
424
- 2. Read the current version from `docs/architecture.md` header.
425
- 3. **If current version > base version:** The architecture doc was modified since this feature started.
426
- - Print: "The architecture doc has been updated since this feature started (was v{base}, now v{current}). Please review the merge-back manually."
427
- - Show the arch-delta changes and ask for user approval before merging.
428
- - Wait for confirmation.
429
- 4. **If current version == base version:** Proceed with automatic merge.
430
-
431
- ### 9b. Merge Architecture Delta
432
-
433
- 1. Read `docs/features/SNPR-{XXXX}/arch-delta.md`
434
- 2. Read `docs/architecture.md`
435
- 3. For each section in the delta:
436
- - **New Components** → Add to the architecture doc's component section (within managed markers if present)
437
- - **Modified Components** → Update the relevant section in the architecture doc
438
- - **New Data Models** → Add to the Data Models section
439
- - **New/Modified API Endpoints** → Add to the API Contracts section
440
- - **Infrastructure Changes** → Add to the Infrastructure section
441
- 4. Increment the architecture doc's version number
442
- 5. Add a changelog entry: `v{N} ({date}): Merged SNPR-{XXXX} — {feature title}`
443
- 6. Set architecture doc status back to "Draft"
444
-
445
- ### 9c. Update Feature Log
446
-
447
- Append to `docs/features/log.md` (create if it doesn't exist):
448
-
449
- ```markdown
450
- | SNPR-{XXXX} | {title} | {start_date} | {completion_date} | {story_count} | {summary of architecture changes} |
451
- ```
452
-
453
- ### 9d. Update Feature State
454
-
455
- ```yaml
456
- phase: complete
457
- completed_at: "{current ISO timestamp}"
458
- ```
459
-
460
- Update `state.artifacts.architecture.version` (incremented by merge-back).
461
-
462
- ---
463
-
464
- ## Step 10: Present Final Results
465
-
466
- ```
467
- ============================================
468
- Feature Complete: SNPR-{XXXX}
469
- ============================================
470
-
471
- {title}
472
-
473
- Stories Completed: {count}/{total}
474
- Architecture Updated: v{old} → v{new}
475
-
476
- Artifacts:
477
- Brief: docs/features/SNPR-{XXXX}/brief.md
478
- Spec: docs/features/SNPR-{XXXX}/spec.md
479
- Arch Delta: docs/features/SNPR-{XXXX}/arch-delta.md
480
- Stories: docs/features/SNPR-{XXXX}/stories/
481
-
482
- Architecture Merge-Back:
483
- {summary of components/models/APIs added or modified}
484
-
485
- Feature logged in: docs/features/log.md
486
-
487
- ============================================
488
- Next Steps
489
- ============================================
490
-
491
- 1. Review the merged architecture doc at docs/architecture.md
492
- 2. Run /sniper-feature "next feature" to add another feature
493
- 3. Run /sniper-status to see overall project state
494
- 4. Run /sniper-audit --target security to audit the new code
495
-
496
- ============================================
497
- ```
498
-
499
- ---
500
-
501
- ## IMPORTANT RULES
502
-
503
- - The feature lifecycle runs as a single orchestrated session with user checkpoints between phases.
504
- - Phase 1 (scoping) runs as a single agent — no team spawned. Keep it lightweight (2-3 minutes).
505
- - Phase 2 (planning) spawns a 2-agent team. The architect is blocked by the PM.
506
- - Phase 3 (story generation) runs as a single agent scoped to the feature.
507
- - Phase 4 (sprint) spawns the standard sprint team but scoped to feature stories.
508
- - Phase 5 (merge-back) runs as a single agent and merges the arch-delta into the main architecture doc.
509
- - Features are tracked in `state.features[]`, NOT in `state.phase_log` (except for sprint entries).
510
- - The `arch_base_version` is recorded at scoping time for merge-back conflict detection.
511
- - Feature stories live in `docs/features/SNPR-{XXXX}/stories/`, not in `docs/stories/`.
512
- - Feature sprints do NOT increment `state.current_sprint`.
513
- - At every user checkpoint, the user can pause the feature with "cancel" and resume later with `--resume`.
514
- - If `$ARGUMENTS` contains "dry-run", perform Steps 0-2 only (scope the feature) and present the brief without proceeding further.
515
- - All file paths are relative to the project root.