@sniper.ai/core 1.0.1 → 2.0.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.
- package/README.md +122 -32
- package/framework/checklists/debug-review.md +34 -0
- package/framework/checklists/feature-review.md +42 -0
- package/framework/checklists/ingest-review.md +42 -0
- package/framework/checklists/memory-review.md +30 -0
- package/framework/checklists/perf-review.md +33 -0
- package/framework/checklists/refactor-review.md +33 -0
- package/framework/checklists/security-review.md +34 -0
- package/framework/checklists/test-review.md +32 -0
- package/framework/checklists/workspace-review.md +34 -0
- package/framework/commands/sniper-audit.md +1549 -0
- package/framework/commands/sniper-compose.md +88 -2
- package/framework/commands/sniper-debug.md +337 -0
- package/framework/commands/sniper-discover.md +41 -15
- package/framework/commands/sniper-feature.md +515 -0
- package/framework/commands/sniper-ingest.md +506 -0
- package/framework/commands/sniper-init.md +21 -5
- package/framework/commands/sniper-memory.md +219 -0
- package/framework/commands/sniper-plan.md +41 -19
- package/framework/commands/sniper-review.md +106 -42
- package/framework/commands/sniper-solve.md +47 -14
- package/framework/commands/sniper-sprint.md +132 -17
- package/framework/commands/sniper-status.md +240 -35
- package/framework/commands/sniper-workspace-feature.md +267 -0
- package/framework/commands/sniper-workspace-init.md +252 -0
- package/framework/commands/sniper-workspace-status.md +112 -0
- package/framework/commands/sniper-workspace-validate.md +138 -0
- package/framework/config.template.yaml +88 -9
- package/framework/personas/process/architecture-cartographer.md +25 -0
- package/framework/personas/process/code-archaeologist.md +22 -0
- package/framework/personas/process/code-investigator.md +29 -0
- package/framework/personas/process/code-reviewer.md +26 -0
- package/framework/personas/process/contract-designer.md +31 -0
- package/framework/personas/process/convention-miner.md +27 -0
- package/framework/personas/process/coverage-analyst.md +24 -0
- package/framework/personas/process/flake-hunter.md +30 -0
- package/framework/personas/process/impact-analyst.md +23 -0
- package/framework/personas/process/integration-validator.md +29 -0
- package/framework/personas/process/log-analyst.md +22 -0
- package/framework/personas/process/migration-architect.md +24 -0
- package/framework/personas/process/perf-profiler.md +27 -0
- package/framework/personas/process/release-manager.md +23 -0
- package/framework/personas/process/retro-analyst.md +30 -0
- package/framework/personas/process/threat-modeler.md +30 -0
- package/framework/personas/process/triage-lead.md +23 -0
- package/framework/personas/process/vuln-scanner.md +27 -0
- package/framework/personas/process/workspace-orchestrator.md +30 -0
- package/framework/spawn-prompts/_template.md +3 -0
- package/framework/teams/debug.yaml +56 -0
- package/framework/teams/feature-plan.yaml +61 -0
- package/framework/teams/ingest.yaml +85 -0
- package/framework/teams/perf.yaml +33 -0
- package/framework/teams/refactor.yaml +34 -0
- package/framework/teams/retro.yaml +30 -0
- package/framework/teams/review-pr.yaml +73 -0
- package/framework/teams/review-release.yaml +70 -0
- package/framework/teams/security.yaml +59 -0
- package/framework/teams/test.yaml +59 -0
- package/framework/teams/workspace-feature.yaml +69 -0
- package/framework/teams/workspace-validation.yaml +27 -0
- package/framework/templates/arch-delta.md +74 -0
- package/framework/templates/architecture.md +24 -1
- package/framework/templates/brief.md +22 -1
- package/framework/templates/bug-report.md +55 -0
- package/framework/templates/contract-validation-report.md +68 -0
- package/framework/templates/contract.yaml +60 -0
- package/framework/templates/conventions.md +59 -0
- package/framework/templates/coverage-report.md +67 -0
- package/framework/templates/epic.md +14 -0
- package/framework/templates/feature-brief.md +54 -0
- package/framework/templates/feature-spec.md +53 -0
- package/framework/templates/flaky-report.md +64 -0
- package/framework/templates/investigation.md +49 -0
- package/framework/templates/memory-anti-pattern.yaml +16 -0
- package/framework/templates/memory-convention.yaml +17 -0
- package/framework/templates/memory-decision.yaml +16 -0
- package/framework/templates/migration-plan.md +47 -0
- package/framework/templates/optimization-plan.md +59 -0
- package/framework/templates/performance-profile.md +64 -0
- package/framework/templates/postmortem.md +69 -0
- package/framework/templates/pr-review.md +50 -0
- package/framework/templates/prd.md +24 -1
- package/framework/templates/refactor-scope.md +52 -0
- package/framework/templates/release-readiness.md +66 -0
- package/framework/templates/retro.yaml +44 -0
- package/framework/templates/security.md +22 -1
- package/framework/templates/story.md +16 -0
- package/framework/templates/threat-model.md +71 -0
- package/framework/templates/ux-spec.md +18 -1
- package/framework/templates/vulnerability-report.md +56 -0
- package/framework/templates/workspace-brief.md +52 -0
- package/framework/templates/workspace-plan.md +50 -0
- package/framework/workflows/workspace-feature.md +71 -0
- package/package.json +1 -1
|
@@ -0,0 +1,515 @@
|
|
|
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.
|