@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,408 +0,0 @@
1
- # /sniper-solve -- Phase 3: Epic Sharding & Story Creation (Single Agent)
2
-
3
- You are executing the `/sniper-solve` command. Your job is to break the PRD into implementable epics and self-contained stories. This phase runs as a **single agent** -- you do the work directly, no team is spawned. Follow every step below precisely.
4
-
5
- **Arguments:** $ARGUMENTS
6
-
7
- ---
8
-
9
- ## Step 0: Pre-Flight Checks
10
-
11
- Perform ALL checks before proceeding. If any critical check fails, STOP.
12
-
13
- ### 0a. Verify SNIPER Is Initialized
14
-
15
- 1. Read `.sniper/config.yaml`.
16
- 2. If the file does not exist or `project.name` is empty:
17
- - **STOP.** Print: "SNIPER is not initialized. Run `/sniper-init` first."
18
-
19
- ### 0b. Verify Phase 2 Artifacts Exist
20
-
21
- Check that the following files exist and are non-empty. Read each file to verify it has substantive content (not just a template with empty sections).
22
-
23
- 1. `docs/prd.md` -- **REQUIRED.** If missing or empty, STOP and print: "Phase 2 artifact `docs/prd.md` is missing. Run `/sniper-plan` first."
24
- 2. `docs/architecture.md` -- **REQUIRED.** If missing or empty, STOP and print: "Phase 2 artifact `docs/architecture.md` is missing. Run `/sniper-plan` first."
25
- 3. `docs/ux-spec.md` -- **REQUIRED.** If missing or empty, STOP and print: "Phase 2 artifact `docs/ux-spec.md` is missing. Run `/sniper-plan` first."
26
- 4. `docs/security.md` -- Recommended. If missing, print a warning but continue.
27
-
28
- ### 0c. Verify Phase 2 Was Approved
29
-
30
- 1. Read `state.phase_history` from config.yaml.
31
- 2. Find the entry with `phase: plan`.
32
- 3. Check that `approved_by` is not null and not "rejected".
33
- 4. **If plan was not approved:** Print a warning:
34
- > "WARNING: Phase 2 (plan) has not been formally approved. The planning review gate is strict -- artifacts should be reviewed and approved before sharding into stories. Continue anyway? (yes/no)"
35
- - If no, STOP.
36
- - If yes, proceed with a note in the output.
37
-
38
- ### 0d. Config Migration Check
39
-
40
- 1. Read `schema_version` from `.sniper/config.yaml`.
41
- 2. If `schema_version` is absent or less than 2, run the v1→v2 migration. Write the updated config before proceeding.
42
-
43
- ### 0e. Verify Phase State
44
-
45
- 1. Determine the current active phase from `state.phase_log`.
46
- 2. **If no active phase:** Good -- proceed.
47
- 3. **If active phase is `solve`:** Already in progress.
48
- - Ask the user: "A solve phase is already in progress ({context}). Options: (a) Resume it (b) Start a new solve with a different context"
49
- 4. **If active phase is something else:**
50
- - Ask the user: "You have an active {phase} phase ({context}). Options: (a) Pause it and start solving (b) Complete {phase} first"
51
-
52
- ### 0f. Amendment Detection for Stories
53
-
54
- 1. Check if `docs/epics/` and `docs/stories/` directories exist and contain files.
55
- 2. **If story files exist:**
56
- - Scan each story file for a `> **Status:** Complete (Sprint {N})` marker.
57
- - **Completed stories** are NEVER overwritten. They are preserved as-is.
58
- - **Draft stories** (no completion marker) can be amended: updated acceptance criteria, refreshed embedded context.
59
- - **New requirements** (from amended PRD) generate new stories with the next available story number.
60
- - **Removed requirements** — stories for removed PRD items are marked `> **Status:** Deprecated` rather than deleted.
61
- 3. **If no story files exist:** Normal create mode.
62
-
63
- ---
64
-
65
- ## Step 1: Update Lifecycle State
66
-
67
- Edit `.sniper/config.yaml`:
68
-
69
- 1. Append to `state.phase_log`:
70
- ```yaml
71
- - phase: solve
72
- context: "{from --context argument, or 'initial' for first run, or 'iteration-N' for re-runs}"
73
- started_at: "{current ISO timestamp}"
74
- completed_at: null
75
- approved_by: null
76
- ```
77
-
78
- ---
79
-
80
- ## Step 2: Load Persona and Context
81
-
82
- This phase does NOT spawn a team. Instead, adopt the scrum-master persona yourself.
83
-
84
- 1. Read `.sniper/personas/process/scrum-master.md` -- internalize this role. You ARE the scrum master for this step.
85
- 2. Read `.sniper/personas/cognitive/systems-thinker.md` -- apply this thinking pattern to your sharding decisions.
86
- 3. If `domain_pack` is set in config.yaml, read domain context files from `.sniper/domain-packs/{domain_pack}/context/`.
87
-
88
- ---
89
-
90
- ## Step 3: Read All Phase 2 Artifacts
91
-
92
- Read each artifact fully. You will need deep understanding of all of these to shard properly.
93
-
94
- 1. **Read `docs/prd.md`** -- This is your primary input. Pay close attention to:
95
- - P0 requirements (must-have for v1)
96
- - P1 requirements (should-have)
97
- - P2 requirements (nice-to-have, likely deferred)
98
- - User stories and acceptance criteria
99
- - Non-functional requirements
100
- - Out-of-scope items
101
-
102
- 2. **Read `docs/architecture.md`** -- Pay close attention to:
103
- - Component boundaries (these inform epic boundaries)
104
- - Data models (stories need embedded schema context)
105
- - API contracts (stories need embedded endpoint specs)
106
- - Infrastructure requirements
107
- - Cross-cutting concerns (auth, logging, etc.)
108
-
109
- 3. **Read `docs/ux-spec.md`** -- Pay close attention to:
110
- - Screen inventory (each screen may map to one or more stories)
111
- - User flows (flows cross multiple components)
112
- - Component hierarchy (informs frontend story scope)
113
- - Responsive breakpoints and states
114
-
115
- 4. **Read `docs/security.md`** (if exists) -- Pay close attention to:
116
- - Auth model (will be its own epic or stories)
117
- - Encryption requirements
118
- - Compliance requirements
119
-
120
- ---
121
-
122
- ## Step 4: Read Templates
123
-
124
- 1. Read `.sniper/templates/epic.md` -- Every epic MUST follow this template structure.
125
- 2. Read `.sniper/templates/story.md` -- Every story MUST follow this template structure.
126
-
127
- ---
128
-
129
- ## Step 5: Create Output Directories
130
-
131
- Create the following directories if they do not exist:
132
- - `docs/epics/`
133
- - `docs/stories/`
134
-
135
- If the directories already exist and contain files from a previous run, note this. The files will be overwritten.
136
-
137
- ---
138
-
139
- ## Step 6: Shard PRD into Epics
140
-
141
- Break the PRD into **6-12 epics**. Follow these rules strictly:
142
-
143
- ### Sharding Rules
144
-
145
- 1. **No overlap:** Every requirement from the PRD belongs to exactly ONE epic. No requirement should appear in two epics.
146
- 2. **Clear boundaries:** Each epic has explicit "In Scope" and "Out of Scope" sections.
147
- 3. **Architecture alignment:** Epic boundaries should align with architecture component boundaries where possible.
148
- 4. **Dependency DAG:** Epic dependencies must form a Directed Acyclic Graph -- no circular dependencies.
149
- 5. **Sizing:** Each epic should be roughly similar in size (not one massive epic and five tiny ones).
150
- 6. **Embedded context:** Each epic must EMBED the relevant architecture sections, not just reference them.
151
-
152
- ### Suggested Epic Structure
153
-
154
- Consider organizing epics along these axes (adapt to the specific project):
155
- - **E01: Foundation** -- Project setup, configuration, infrastructure scaffolding
156
- - **E02: Authentication & Authorization** -- Auth flows, RBAC, session management
157
- - **E03: Core Data Layer** -- Database models, migrations, seed data, repositories
158
- - **E04-E08: Feature Epics** -- One epic per major feature area from the PRD
159
- - **E09: API Layer** -- API contracts, middleware, validation, error handling
160
- - **E10: Frontend Shell** -- Layout, navigation, routing, shared components
161
- - **E11-E12: Integration** -- Third-party integrations, background jobs, notifications
162
-
163
- Adapt this structure to fit the actual project. Do NOT force-fit the project into this template if it does not make sense.
164
-
165
- ### Writing Each Epic
166
-
167
- For each epic, create a file at `docs/epics/E{NN}-{slug}.md` where:
168
- - `{NN}` is a zero-padded two-digit number (E01, E02, etc.)
169
- - `{slug}` is a kebab-case short name (e.g., `auth-system`, `core-data`, `dashboard-ui`)
170
-
171
- Follow the template at `.sniper/templates/epic.md` exactly. Fill in:
172
- - **Status:** Draft
173
- - **Priority:** P0, P1, or P2 (based on the requirements it covers)
174
- - **Estimated Points:** Total story points for all stories in this epic
175
- - **Dependencies:** List other epics this depends on (e.g., "E01-foundation" if it needs project setup)
176
- - **Scope:** Clear in/out boundaries
177
- - **Architecture Context:** COPY the relevant sections from `docs/architecture.md` -- data models, API contracts, component descriptions. Do NOT just write "see architecture doc."
178
- - **Stories table:** List the stories that will be created in Step 7 (you can fill this in after Step 7)
179
- - **Acceptance Criteria:** Epic-level criteria -- what must be true when ALL stories in this epic are done
180
- - **Technical Notes:** Implementation-specific guidance
181
-
182
- ---
183
-
184
- ## Step 7: Create Stories for Each Epic
185
-
186
- For each epic, create **3-8 stories**. Follow these rules strictly:
187
-
188
- ### Story Rules
189
-
190
- 1. **Self-contained:** A developer reading ONLY the story file must have ALL context needed to implement it. No "see PRD" or "see architecture doc" -- embed the context.
191
- 2. **Given/When/Then:** All acceptance criteria MUST use Given/When/Then format.
192
- 3. **File ownership:** Each story must declare which directories it touches (from the ownership rules in config.yaml).
193
- 4. **Complexity:** Estimate S/M/L/XL. If any story is XL, split it into smaller stories.
194
- 5. **Dependencies:** Declare inter-story dependencies. Must form a DAG.
195
- 6. **Test requirements:** Specify what tests are needed (unit, integration, e2e).
196
-
197
- ### Writing Each Story
198
-
199
- For each story, create a file at `docs/stories/S{NN}-{slug}.md` where:
200
- - `{NN}` is a zero-padded two-digit number, globally sequential across all epics (S01, S02, ..., S42, etc.)
201
- - `{slug}` is a kebab-case short name
202
-
203
- Follow the template at `.sniper/templates/story.md` exactly. Fill in:
204
-
205
- - **Epic reference:** Which epic this belongs to
206
- - **Complexity:** S, M, L (never XL -- split if needed)
207
- - **Priority:** P0, P1, or P2
208
- - **File Ownership:** Which directories from config.yaml this story touches (e.g., "backend, tests" or "frontend, tests")
209
- - **Dependencies:** Other story IDs that must complete first
210
-
211
- #### Embedded Context (CRITICAL)
212
-
213
- For the "Embedded Context" section, COPY the relevant content from the source documents:
214
-
215
- - **From PRD:** Copy the specific requirements and user stories this story implements. Include exact acceptance criteria text.
216
- - **From Architecture:** Copy relevant data models (with field types), API endpoint specs (with request/response shapes), and architectural patterns to follow.
217
- - **From UX Spec:** For frontend stories, copy the screen descriptions, component specs (with all states), user flow segments, and responsive requirements.
218
-
219
- Do NOT summarize or paraphrase. COPY the exact sections. A developer should not need to open any other document.
220
-
221
- #### Acceptance Criteria
222
-
223
- Write testable assertions in Given/When/Then format:
224
-
225
- ```
226
- 1. **Given** a user is not authenticated
227
- **When** they access the dashboard endpoint
228
- **Then** they receive a 401 Unauthorized response with a redirect URL to the login page
229
-
230
- 2. **Given** a user is authenticated with role "admin"
231
- **When** they request the user list endpoint with pagination params page=2, limit=20
232
- **Then** they receive a 200 response with exactly 20 user objects and correct pagination metadata
233
- ```
234
-
235
- Be specific. Include status codes, field names, exact behaviors.
236
-
237
- #### Test Requirements
238
-
239
- Specify what tests are needed:
240
- ```
241
- - [ ] Unit tests: {specific functions/methods to test}
242
- - [ ] Integration tests: {specific API endpoints or flows to test}
243
- - [ ] E2E tests (if applicable): {specific user scenarios}
244
- ```
245
-
246
- ---
247
-
248
- ## Step 8: Backfill Epic Story Tables
249
-
250
- After creating all stories, go back to each epic file and update the **Stories** table with the actual story IDs, names, complexity, dependencies, and file ownership.
251
-
252
- ---
253
-
254
- ## Step 9: Self-Review Against Checklist
255
-
256
- Read `.sniper/checklists/story-review.md` and evaluate your work against every item.
257
-
258
- ### Epic Structure Review
259
-
260
- Go through each epic checklist item:
261
- - [ ] Epics number between 6-12
262
- - [ ] No overlap between epics
263
- - [ ] Epic dependencies form a DAG
264
- - [ ] Each epic has clear scope boundaries
265
- - [ ] Architecture context is EMBEDDED
266
- - [ ] Complexity estimates are realistic
267
-
268
- ### Story Quality Review
269
-
270
- For EACH story, verify:
271
- - [ ] Story is self-contained (a developer can implement from the story alone)
272
- - [ ] PRD context is EMBEDDED (not just referenced)
273
- - [ ] Architecture context is EMBEDDED
274
- - [ ] UX context is EMBEDDED for frontend stories
275
- - [ ] Acceptance criteria use Given/When/Then format
276
- - [ ] Every criterion is testable
277
- - [ ] Test requirements are specified
278
- - [ ] File ownership is assigned
279
- - [ ] Dependencies are declared
280
- - [ ] Complexity is S/M/L (not XL)
281
-
282
- ### Coverage Review
283
-
284
- - [ ] All P0 requirements have implementing stories
285
- - [ ] All P1 requirements have implementing stories
286
- - [ ] All architecture components have at least one story
287
- - [ ] Story dependency chains allow reasonable sprint planning
288
-
289
- ---
290
-
291
- ## Step 10: Fix Issues Found in Self-Review
292
-
293
- If the self-review identified any issues:
294
-
295
- 1. Fix each issue directly by editing the relevant epic or story file.
296
- 2. Common fixes:
297
- - **Missing embedded context:** Go back to the source doc, copy the relevant section into the story.
298
- - **Vague acceptance criteria:** Rewrite with specific Given/When/Then and concrete values.
299
- - **XL story:** Split into two or more smaller stories with clear boundaries.
300
- - **Missing test requirements:** Add specific test types and what to test.
301
- - **Circular dependencies:** Restructure the dependency graph to break the cycle.
302
- 3. After fixing, re-verify the specific items that failed.
303
-
304
- ---
305
-
306
- ## Step 11: Update Lifecycle State
307
-
308
- Edit `.sniper/config.yaml`:
309
-
310
- 1. Update artifact tracking:
311
- - Set `state.artifacts.epics.status: draft` and increment `state.artifacts.epics.version`
312
- - Set `state.artifacts.stories.status: draft` and increment `state.artifacts.stories.version`
313
- 2. Update the solve entry in `state.phase_log`:
314
- - Set `completed_at: "{current ISO timestamp}"`
315
- - Set `approved_by: "auto-flexible"` (this is a flexible gate)
316
-
317
- ---
318
-
319
- ## Step 12: Present Results and Next Steps
320
-
321
- Print a formatted summary:
322
-
323
- ```
324
- ============================================
325
- SNIPER Phase 3: Epic Sharding Complete
326
- ============================================
327
-
328
- Epics Created: {count}
329
- Stories Created: {count}
330
-
331
- Epic Summary:
332
- E01-{slug} | P{x} | {story count} stories | {total points} pts
333
- E02-{slug} | P{x} | {story count} stories | {total points} pts
334
- ...
335
-
336
- Story Breakdown by Complexity:
337
- Small (S): {count}
338
- Medium (M): {count}
339
- Large (L): {count}
340
-
341
- Story Breakdown by File Ownership:
342
- Backend: {count} stories
343
- Frontend: {count} stories
344
- Infrastructure: {count} stories
345
- Full-stack: {count} stories
346
-
347
- Self-Review Results:
348
- Passed: {count}/{total} checklist items
349
- Fixed: {count} issues auto-corrected
350
- Attention: {count} items for async review
351
-
352
- Review Gate: FLEXIBLE (auto-advanced)
353
-
354
- ============================================
355
- Next Steps
356
- ============================================
357
-
358
- 1. Review epics in `docs/epics/` and stories in `docs/stories/`
359
- 2. When ready, run `/sniper-sprint` to begin Phase 4: Implementation Sprint
360
- 3. `/sniper-sprint` will ask you to select which stories to include in the sprint
361
- 4. Or run `/sniper-status` to see the full lifecycle state
362
-
363
- Recommended first sprint: Start with foundation stories (E01)
364
- and any stories with no dependencies.
365
-
366
- ============================================
367
-
368
- Files:
369
- Epics: docs/epics/E01-*.md through docs/epics/E{NN}-*.md
370
- Stories: docs/stories/S01-*.md through docs/stories/S{NN}-*.md
371
-
372
- ============================================
373
- ```
374
-
375
- ---
376
-
377
- ## Feature-Scoped Mode
378
-
379
- If `$ARGUMENTS` contains `--feature SNPR-{XXXX}`:
380
-
381
- 1. **Skip Steps 0b and 0c** (no need to check for main PRD or plan approval).
382
- 2. **Step 3:** Instead of reading main PRD/architecture/UX-spec, read:
383
- - `docs/features/SNPR-{XXXX}/spec.md` (replaces PRD as primary input)
384
- - `docs/features/SNPR-{XXXX}/arch-delta.md` (replaces architecture for feature scope)
385
- - `docs/architecture.md` (for broader system context)
386
- - `docs/conventions.md` (if exists, for coding patterns)
387
- 3. **Step 5:** Create stories in `docs/features/SNPR-{XXXX}/stories/` instead of `docs/stories/`.
388
- 4. **Step 6:** Skip epic creation. Feature stories don't need epics (the feature IS the epic).
389
- 5. **Step 7:** Number stories as S01, S02, etc. within the feature directory. Target 3-8 stories.
390
- 6. **Step 7 context embedding:** Embed context from the feature spec and arch-delta, NOT the main PRD.
391
- 7. **Step 11:** Update `state.features[].stories_total` with the count.
392
-
393
- ---
394
-
395
- ## IMPORTANT RULES
396
-
397
- - This phase runs as a SINGLE AGENT. Do NOT create a team or spawn teammates.
398
- - You ARE the scrum master. You do the work directly.
399
- - Stories MUST be self-contained. This is the most critical quality requirement. A developer reading only the story file must have all context to implement it.
400
- - EMBED context from PRD, architecture, and UX spec. Do NOT just reference them.
401
- - Acceptance criteria MUST be Given/When/Then format with specific, testable assertions.
402
- - No story should be XL complexity. Split large stories.
403
- - Epic and story dependencies MUST form a DAG. No circular dependencies.
404
- - If `$ARGUMENTS` contains "dry-run", perform Steps 0-4 only (read all artifacts and plan the sharding) and present the proposed epic structure without creating files. Let the user approve before proceeding.
405
- - If `$ARGUMENTS` contains a specific epic count (e.g., "8 epics"), use that as a target instead of the 6-12 range.
406
- - All file paths are relative to the project root.
407
- - Do NOT start implementation. Do NOT write code. This phase produces planning artifacts only.
408
- - Do NOT proceed to `/sniper-sprint` automatically -- let the user initiate it.