@sniper.ai/core 2.0.0 → 3.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.
Files changed (208) hide show
  1. package/README.md +88 -98
  2. package/agents/analyst.md +30 -0
  3. package/agents/architect.md +36 -0
  4. package/agents/backend-dev.md +43 -0
  5. package/agents/code-reviewer.md +72 -0
  6. package/agents/frontend-dev.md +43 -0
  7. package/agents/fullstack-dev.md +44 -0
  8. package/agents/gate-reviewer.md +62 -0
  9. package/agents/lead-orchestrator.md +51 -0
  10. package/agents/product-manager.md +38 -0
  11. package/agents/qa-engineer.md +37 -0
  12. package/agents/retro-analyst.md +98 -0
  13. package/checklists/discover.yaml +23 -0
  14. package/checklists/implement.yaml +28 -0
  15. package/checklists/ingest-document.yaml +18 -0
  16. package/checklists/ingest-extract.yaml +13 -0
  17. package/checklists/ingest-scan.yaml +18 -0
  18. package/checklists/multi-faceted-review.yaml +56 -0
  19. package/checklists/plan.yaml +36 -0
  20. package/checklists/refactor-analyze.yaml +18 -0
  21. package/checklists/review.yaml +28 -0
  22. package/claude-md.template +42 -0
  23. package/config.template.yaml +156 -0
  24. package/hooks/settings-hooks.json +31 -0
  25. package/hooks/signal-hooks.json +11 -0
  26. package/package.json +23 -5
  27. package/personas/cognitive/devils-advocate.md +24 -0
  28. package/personas/cognitive/performance-focused.md +23 -0
  29. package/personas/cognitive/security-first.md +24 -0
  30. package/protocols/explore.yaml +18 -0
  31. package/protocols/feature.yaml +45 -0
  32. package/protocols/full.yaml +63 -0
  33. package/protocols/hotfix.yaml +19 -0
  34. package/protocols/ingest.yaml +39 -0
  35. package/protocols/patch.yaml +30 -0
  36. package/protocols/refactor.yaml +41 -0
  37. package/schemas/checkpoint.schema.yaml +133 -0
  38. package/schemas/cost.schema.yaml +97 -0
  39. package/schemas/dependency-graph.schema.yaml +37 -0
  40. package/schemas/gate-result.schema.yaml +101 -0
  41. package/schemas/knowledge-manifest.schema.yaml +39 -0
  42. package/schemas/live-status.schema.yaml +122 -0
  43. package/schemas/protocol.schema.yaml +100 -0
  44. package/schemas/retro.schema.yaml +95 -0
  45. package/schemas/revert-plan.schema.yaml +40 -0
  46. package/schemas/signal.schema.yaml +39 -0
  47. package/schemas/velocity.schema.yaml +52 -0
  48. package/schemas/workspace-lock.schema.yaml +34 -0
  49. package/schemas/workspace.schema.yaml +82 -0
  50. package/skills/sniper-flow/SKILL.md +243 -0
  51. package/skills/sniper-flow-headless/SKILL.md +105 -0
  52. package/skills/sniper-init/SKILL.md +103 -0
  53. package/skills/sniper-review/SKILL.md +49 -0
  54. package/skills/sniper-status/SKILL.md +79 -0
  55. package/templates/architecture.md +23 -0
  56. package/templates/checkpoint.yaml +27 -0
  57. package/templates/codebase-overview.md +19 -0
  58. package/templates/cost.yaml +23 -0
  59. package/templates/custom-protocol.yaml +98 -0
  60. package/templates/knowledge-manifest.yaml +32 -0
  61. package/templates/live-status.yaml +26 -0
  62. package/templates/multi-faceted-review-report.md +28 -0
  63. package/templates/review-report.md +25 -0
  64. package/templates/signal-record.yaml +37 -0
  65. package/templates/spec.md +28 -0
  66. package/templates/story.md +19 -0
  67. package/templates/velocity.yaml +9 -0
  68. package/templates/workspace-config.yaml +44 -0
  69. package/framework/checklists/code-review.md +0 -33
  70. package/framework/checklists/debug-review.md +0 -34
  71. package/framework/checklists/discover-review.md +0 -33
  72. package/framework/checklists/doc-review.md +0 -39
  73. package/framework/checklists/feature-review.md +0 -42
  74. package/framework/checklists/ingest-review.md +0 -42
  75. package/framework/checklists/memory-review.md +0 -30
  76. package/framework/checklists/perf-review.md +0 -33
  77. package/framework/checklists/plan-review.md +0 -52
  78. package/framework/checklists/refactor-review.md +0 -33
  79. package/framework/checklists/security-review.md +0 -34
  80. package/framework/checklists/sprint-review.md +0 -41
  81. package/framework/checklists/story-review.md +0 -30
  82. package/framework/checklists/test-review.md +0 -32
  83. package/framework/checklists/workspace-review.md +0 -34
  84. package/framework/claude-md.template +0 -37
  85. package/framework/commands/sniper-audit.md +0 -1549
  86. package/framework/commands/sniper-compose.md +0 -323
  87. package/framework/commands/sniper-debug.md +0 -337
  88. package/framework/commands/sniper-discover.md +0 -423
  89. package/framework/commands/sniper-doc.md +0 -441
  90. package/framework/commands/sniper-feature.md +0 -515
  91. package/framework/commands/sniper-ingest.md +0 -506
  92. package/framework/commands/sniper-init.md +0 -388
  93. package/framework/commands/sniper-memory.md +0 -219
  94. package/framework/commands/sniper-plan.md +0 -630
  95. package/framework/commands/sniper-review.md +0 -369
  96. package/framework/commands/sniper-solve.md +0 -408
  97. package/framework/commands/sniper-sprint.md +0 -716
  98. package/framework/commands/sniper-status.md +0 -481
  99. package/framework/commands/sniper-workspace-feature.md +0 -267
  100. package/framework/commands/sniper-workspace-init.md +0 -252
  101. package/framework/commands/sniper-workspace-status.md +0 -112
  102. package/framework/commands/sniper-workspace-validate.md +0 -138
  103. package/framework/config.template.yaml +0 -196
  104. package/framework/personas/cognitive/devils-advocate.md +0 -30
  105. package/framework/personas/cognitive/mentor-explainer.md +0 -29
  106. package/framework/personas/cognitive/performance-focused.md +0 -30
  107. package/framework/personas/cognitive/security-first.md +0 -29
  108. package/framework/personas/cognitive/systems-thinker.md +0 -29
  109. package/framework/personas/cognitive/user-empathetic.md +0 -29
  110. package/framework/personas/domain/.gitkeep +0 -0
  111. package/framework/personas/process/analyst.md +0 -29
  112. package/framework/personas/process/architect.md +0 -30
  113. package/framework/personas/process/architecture-cartographer.md +0 -25
  114. package/framework/personas/process/code-archaeologist.md +0 -22
  115. package/framework/personas/process/code-investigator.md +0 -29
  116. package/framework/personas/process/code-reviewer.md +0 -26
  117. package/framework/personas/process/contract-designer.md +0 -31
  118. package/framework/personas/process/convention-miner.md +0 -27
  119. package/framework/personas/process/coverage-analyst.md +0 -24
  120. package/framework/personas/process/developer.md +0 -32
  121. package/framework/personas/process/doc-analyst.md +0 -63
  122. package/framework/personas/process/doc-reviewer.md +0 -62
  123. package/framework/personas/process/doc-writer.md +0 -42
  124. package/framework/personas/process/flake-hunter.md +0 -30
  125. package/framework/personas/process/impact-analyst.md +0 -23
  126. package/framework/personas/process/integration-validator.md +0 -29
  127. package/framework/personas/process/log-analyst.md +0 -22
  128. package/framework/personas/process/migration-architect.md +0 -24
  129. package/framework/personas/process/perf-profiler.md +0 -27
  130. package/framework/personas/process/product-manager.md +0 -32
  131. package/framework/personas/process/qa-engineer.md +0 -31
  132. package/framework/personas/process/release-manager.md +0 -23
  133. package/framework/personas/process/retro-analyst.md +0 -30
  134. package/framework/personas/process/scrum-master.md +0 -31
  135. package/framework/personas/process/threat-modeler.md +0 -30
  136. package/framework/personas/process/triage-lead.md +0 -23
  137. package/framework/personas/process/ux-designer.md +0 -31
  138. package/framework/personas/process/vuln-scanner.md +0 -27
  139. package/framework/personas/process/workspace-orchestrator.md +0 -30
  140. package/framework/personas/technical/ai-ml.md +0 -33
  141. package/framework/personas/technical/api-design.md +0 -32
  142. package/framework/personas/technical/backend.md +0 -32
  143. package/framework/personas/technical/database.md +0 -32
  144. package/framework/personas/technical/frontend.md +0 -33
  145. package/framework/personas/technical/infrastructure.md +0 -32
  146. package/framework/personas/technical/security.md +0 -34
  147. package/framework/settings.template.json +0 -6
  148. package/framework/spawn-prompts/_template.md +0 -25
  149. package/framework/teams/debug.yaml +0 -56
  150. package/framework/teams/discover.yaml +0 -57
  151. package/framework/teams/doc.yaml +0 -76
  152. package/framework/teams/feature-plan.yaml +0 -61
  153. package/framework/teams/ingest.yaml +0 -85
  154. package/framework/teams/perf.yaml +0 -33
  155. package/framework/teams/plan.yaml +0 -86
  156. package/framework/teams/refactor.yaml +0 -34
  157. package/framework/teams/retro.yaml +0 -30
  158. package/framework/teams/review-pr.yaml +0 -73
  159. package/framework/teams/review-release.yaml +0 -70
  160. package/framework/teams/security.yaml +0 -59
  161. package/framework/teams/solve.yaml +0 -48
  162. package/framework/teams/sprint.yaml +0 -68
  163. package/framework/teams/test.yaml +0 -59
  164. package/framework/teams/workspace-feature.yaml +0 -69
  165. package/framework/teams/workspace-validation.yaml +0 -27
  166. package/framework/templates/arch-delta.md +0 -74
  167. package/framework/templates/architecture.md +0 -95
  168. package/framework/templates/brief.md +0 -73
  169. package/framework/templates/bug-report.md +0 -55
  170. package/framework/templates/contract-validation-report.md +0 -68
  171. package/framework/templates/contract.yaml +0 -60
  172. package/framework/templates/conventions.md +0 -59
  173. package/framework/templates/coverage-report.md +0 -67
  174. package/framework/templates/doc-api.md +0 -53
  175. package/framework/templates/doc-guide.md +0 -35
  176. package/framework/templates/doc-readme.md +0 -49
  177. package/framework/templates/epic.md +0 -47
  178. package/framework/templates/feature-brief.md +0 -54
  179. package/framework/templates/feature-spec.md +0 -53
  180. package/framework/templates/flaky-report.md +0 -64
  181. package/framework/templates/investigation.md +0 -49
  182. package/framework/templates/memory-anti-pattern.yaml +0 -16
  183. package/framework/templates/memory-convention.yaml +0 -17
  184. package/framework/templates/memory-decision.yaml +0 -16
  185. package/framework/templates/migration-plan.md +0 -47
  186. package/framework/templates/optimization-plan.md +0 -59
  187. package/framework/templates/performance-profile.md +0 -64
  188. package/framework/templates/personas.md +0 -118
  189. package/framework/templates/postmortem.md +0 -69
  190. package/framework/templates/pr-review.md +0 -50
  191. package/framework/templates/prd.md +0 -92
  192. package/framework/templates/refactor-scope.md +0 -52
  193. package/framework/templates/release-readiness.md +0 -66
  194. package/framework/templates/retro.yaml +0 -44
  195. package/framework/templates/risks.md +0 -64
  196. package/framework/templates/security.md +0 -111
  197. package/framework/templates/sprint-review.md +0 -32
  198. package/framework/templates/story.md +0 -53
  199. package/framework/templates/threat-model.md +0 -71
  200. package/framework/templates/ux-spec.md +0 -71
  201. package/framework/templates/vulnerability-report.md +0 -56
  202. package/framework/templates/workspace-brief.md +0 -52
  203. package/framework/templates/workspace-plan.md +0 -50
  204. package/framework/workflows/discover-only.md +0 -39
  205. package/framework/workflows/full-lifecycle.md +0 -56
  206. package/framework/workflows/quick-feature.md +0 -44
  207. package/framework/workflows/sprint-cycle.md +0 -47
  208. package/framework/workflows/workspace-feature.md +0 -71
@@ -1,630 +0,0 @@
1
- # /sniper-plan -- Phase 2: Planning & Architecture (Parallel Team with Coordination)
2
-
3
- You are executing the `/sniper-plan` command. Your job is to spawn a planning team that produces the PRD, system architecture, UX specification, and security requirements. This phase has **task dependencies** and **coordination pairs** -- you must manage the flow. You are the **team lead** -- you coordinate, you do NOT produce artifacts yourself. 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 1 Artifacts Exist
20
-
21
- Check that the following files exist and are non-empty:
22
-
23
- 1. `docs/brief.md` -- **REQUIRED.** If missing, STOP and print: "Phase 1 artifact `docs/brief.md` is missing. Run `/sniper-discover` first."
24
- 2. `docs/risks.md` -- Recommended but not blocking. If missing, print a warning.
25
- 3. `docs/personas.md` -- Recommended but not blocking. If missing, print a warning.
26
-
27
- ### 0c. Config Migration Check
28
-
29
- 1. Read `schema_version` from `.sniper/config.yaml`.
30
- 2. If `schema_version` is absent or less than 2, run the v1→v2 migration as defined in the Config Reader Protocol. Write the updated config before proceeding.
31
-
32
- ### 0d. Verify Phase State
33
-
34
- 1. Determine the current active phase: find the last entry in `state.phase_log` where `completed_at` is null.
35
- 2. **If no active phase:** Good -- proceed. Re-running plan after sprint is normal iteration.
36
- 3. **If active phase is `plan`:** Already in progress.
37
- - Ask the user: "A plan phase is already in progress ({context}). Options: (a) Resume it (b) Start a new plan with a different context"
38
- 4. **If active phase is something else:**
39
- - Ask the user: "You have an active {phase} phase ({context}) that hasn't completed. Options: (a) Pause it and start planning (b) Complete {phase} first"
40
-
41
- ### 0e. Amendment Detection
42
-
43
- 1. Check if the target artifact files already exist and are non-empty:
44
- - `docs/prd.md`
45
- - `docs/architecture.md`
46
- - `docs/ux-spec.md`
47
- - `docs/security.md`
48
- 2. **If ANY exist:** Enter **amendment mode**. Note which files exist and their current version numbers. Agents will be instructed to amend rather than create.
49
- 3. **If NONE exist:** Normal create mode.
50
-
51
- ### 0f. Verify Framework Files
52
-
53
- Check that these files exist:
54
- - `.sniper/teams/plan.yaml`
55
- - `.sniper/spawn-prompts/_template.md`
56
- - `.sniper/checklists/plan-review.md`
57
- - `.sniper/personas/process/product-manager.md`
58
- - `.sniper/personas/process/architect.md`
59
- - `.sniper/personas/process/ux-designer.md`
60
- - `.sniper/personas/technical/api-design.md`
61
- - `.sniper/personas/technical/backend.md`
62
- - `.sniper/personas/technical/frontend.md`
63
- - `.sniper/personas/technical/security.md`
64
- - `.sniper/personas/cognitive/systems-thinker.md`
65
- - `.sniper/personas/cognitive/security-first.md`
66
- - `.sniper/personas/cognitive/user-empathetic.md`
67
- - `.sniper/templates/prd.md`
68
- - `.sniper/templates/architecture.md`
69
- - `.sniper/templates/ux-spec.md`
70
-
71
- Report any missing files as warnings. Continue if the team YAML and key personas exist.
72
-
73
- ---
74
-
75
- ## Step 1: Update Lifecycle State
76
-
77
- Edit `.sniper/config.yaml`:
78
-
79
- 1. Append to `state.phase_log`:
80
- ```yaml
81
- - phase: plan
82
- context: "{from --context argument, or 'initial' for first run, or 'iteration-N' for re-runs}"
83
- started_at: "{current ISO timestamp}"
84
- completed_at: null
85
- approved_by: null
86
- ```
87
-
88
- ---
89
-
90
- ## Step 2: Read Team Definition
91
-
92
- 1. Read `.sniper/teams/plan.yaml` in full.
93
- 2. Parse out:
94
- - `team_name`: `sniper-plan`
95
- - `model_override`: `opus` -- note this for all teammate spawns
96
- - The list of `teammates` with their `name`, `compose` layers, `tasks` (including `reads`, `blocked_by`, `plan_approval`)
97
- - The `coordination` pairs
98
- - The `review_gate` section (should be `strict`)
99
- 3. Map out the dependency graph:
100
- - `product-manager` (prd) -> NO dependencies, starts immediately
101
- - `architect` (architecture) -> blocked_by: [prd]
102
- - `ux-designer` (ux-spec) -> blocked_by: [prd]
103
- - `security-analyst` (security) -> blocked_by: [prd]
104
- 4. Note: `architect` has `plan_approval: true` -- you MUST approve their approach before they execute.
105
-
106
- ---
107
-
108
- ## Step 3: Read Project Context and Phase 1 Artifacts
109
-
110
- 1. Read `.sniper/config.yaml` for project settings, stack, and ownership.
111
- 2. Read the Phase 1 discovery artifacts:
112
- - `docs/brief.md`
113
- - `docs/risks.md` (if exists)
114
- - `docs/personas.md` (if exists)
115
- 3. Read the artifact templates:
116
- - `.sniper/templates/prd.md`
117
- - `.sniper/templates/architecture.md`
118
- - `.sniper/templates/ux-spec.md`
119
- 4. If `domain_pack` is set, read domain context files.
120
-
121
- ---
122
-
123
- ## Step 4: Compose Spawn Prompts
124
-
125
- For each teammate, compose a spawn prompt by reading persona layer files and assembling them into the template from `.sniper/spawn-prompts/_template.md`.
126
-
127
- ### Teammate: product-manager
128
-
129
- 1. Read persona layers:
130
- - Process: `.sniper/personas/process/product-manager.md`
131
- - Technical: `.sniper/personas/technical/api-design.md`
132
- - Cognitive: `.sniper/personas/cognitive/systems-thinker.md`
133
- - Domain: domain pack context if configured, otherwise skip
134
-
135
- 2. Assemble using the spawn template:
136
- - `{name}` = "product-manager"
137
- - `{ownership}` = the `docs` ownership paths from config.yaml
138
-
139
- 3. Append task context:
140
- ```
141
- ## Your Task
142
- **Task ID:** prd
143
- **Task Name:** Product Requirements Document
144
- **Output File:** docs/prd.md
145
- **Template:** .sniper/templates/prd.md
146
-
147
- Write a comprehensive PRD covering: problem statement, user stories, feature requirements
148
- (P0/P1/P2), success metrics, constraints, and out-of-scope items. This is the single
149
- source of truth for what to build.
150
-
151
- ## Required Reading (read these BEFORE writing)
152
- - docs/brief.md
153
- - docs/personas.md (if exists)
154
- - docs/risks.md (if exists)
155
-
156
- ## Project Context
157
- - **Project:** {project.name}
158
- - **Type:** {project.type}
159
- - **Description:** {project.description}
160
- - **Stack:** {summary of stack section}
161
-
162
- ## Instructions (Create Mode — when docs/prd.md does NOT exist)
163
- 1. Read ALL the required reading files listed above.
164
- 2. Read the template at `.sniper/templates/prd.md` for expected output format.
165
- 3. Synthesize the discovery artifacts into a coherent PRD.
166
- 4. Every P0 requirement MUST have testable acceptance criteria.
167
- 5. User stories must reference the personas from `docs/personas.md`.
168
- 6. Write the complete output to `docs/prd.md`.
169
- 7. When complete, message the team lead. Other teammates are waiting on your output.
170
-
171
- ## Instructions (Amendment Mode — when docs/prd.md already exists)
172
- 1. Read the EXISTING `docs/prd.md` first. Note its current version number.
173
- 2. Read ALL the required reading files listed above.
174
- 3. AMEND the existing PRD: add new requirements, update changed sections, mark removed items as deprecated. Preserve content outside managed sections (<!-- sniper:managed --> markers).
175
- 4. Every P0 requirement MUST have testable acceptance criteria.
176
- 5. Increment the version number and add a changelog entry describing what changed.
177
- 6. Set Status back to "Draft".
178
- 7. When complete, message the team lead. Other teammates are waiting on your output.
179
- ```
180
-
181
- ### Teammate: architect
182
-
183
- 1. Read persona layers:
184
- - Process: `.sniper/personas/process/architect.md`
185
- - Technical: `.sniper/personas/technical/backend.md`
186
- - Cognitive: `.sniper/personas/cognitive/security-first.md`
187
- - Domain: domain pack context if configured
188
-
189
- 2. Assemble using the spawn template:
190
- - `{name}` = "architect"
191
- - `{ownership}` = the `docs` ownership paths
192
-
193
- 3. Append task context:
194
- ```
195
- ## Your Task
196
- **Task ID:** architecture
197
- **Task Name:** System Architecture Document
198
- **Output File:** docs/architecture.md
199
- **Template:** .sniper/templates/architecture.md
200
- **IMPORTANT:** This task has `plan_approval: true`. You MUST describe your approach first and wait for the team lead to approve before writing the full document.
201
-
202
- Design the complete system architecture including: component diagram, data models,
203
- API contracts, infrastructure topology, technology choices with rationale, and
204
- non-functional requirements.
205
-
206
- ## Required Reading (read these BEFORE starting)
207
- - docs/prd.md (WAIT for this to be completed first -- you are blocked until it exists)
208
- - docs/brief.md
209
- - docs/risks.md (if exists)
210
-
211
- ## Coordination
212
- - You will coordinate with `security-analyst` -- they will review your security architecture decisions.
213
- - You will coordinate with `ux-designer` -- align frontend component boundaries with your API contracts.
214
- - When you have API contracts drafted, message `ux-designer` to validate component hierarchy.
215
- - When you have security architecture drafted, message `security-analyst` for review.
216
-
217
- ## Project Context
218
- - **Project:** {project.name}
219
- - **Type:** {project.type}
220
- - **Stack:** {full stack details}
221
-
222
- ## Instructions
223
- 1. WAIT until `docs/prd.md` exists (the product-manager must complete it first).
224
- 2. Read all required reading files.
225
- 3. Read the template at `.sniper/templates/architecture.md`.
226
- 4. **PLAN APPROVAL REQUIRED:** Before writing the full architecture, describe your high-level approach to the team lead:
227
- - Proposed component boundaries
228
- - Key technology choices and rationale
229
- - Data flow overview
230
- - Infrastructure topology approach
231
- Wait for the lead to approve or provide feedback before proceeding.
232
- 5. After approval, write the complete architecture document to `docs/architecture.md`.
233
- 6. Message `security-analyst` and `ux-designer` when your document is ready for their review.
234
- 7. Message the team lead when complete.
235
- ```
236
-
237
- ### Teammate: ux-designer
238
-
239
- 1. Read persona layers:
240
- - Process: `.sniper/personas/process/ux-designer.md`
241
- - Technical: `.sniper/personas/technical/frontend.md`
242
- - Cognitive: `.sniper/personas/cognitive/user-empathetic.md`
243
- - Domain: domain pack context if configured
244
-
245
- 2. Assemble using the spawn template:
246
- - `{name}` = "ux-designer"
247
- - `{ownership}` = the `docs` ownership paths
248
-
249
- 3. Append task context:
250
- ```
251
- ## Your Task
252
- **Task ID:** ux-spec
253
- **Task Name:** UX Specification
254
- **Output File:** docs/ux-spec.md
255
- **Template:** .sniper/templates/ux-spec.md
256
-
257
- Create the UX specification: information architecture, screen inventory, key user flows
258
- (with decision trees), component hierarchy, interaction patterns, and responsive breakpoints.
259
-
260
- ## Required Reading (read these BEFORE starting)
261
- - docs/prd.md (WAIT for this to be completed first -- you are blocked until it exists)
262
- - docs/personas.md (if exists)
263
-
264
- ## Coordination
265
- - You will coordinate with `architect` -- validate that your component hierarchy aligns with their API contracts and backend architecture.
266
- - When the architect shares their API contracts, review them and provide feedback on frontend data needs.
267
-
268
- ## Project Context
269
- - **Project:** {project.name}
270
- - **Type:** {project.type}
271
- - **Stack:** {frontend framework, etc.}
272
-
273
- ## Instructions
274
- 1. WAIT until `docs/prd.md` exists.
275
- 2. Read all required reading files.
276
- 3. Read the template at `.sniper/templates/ux-spec.md`.
277
- 4. Write the UX specification to `docs/ux-spec.md`.
278
- 5. When `architect` messages you about API contracts, review and provide feedback.
279
- 6. Message the team lead when complete.
280
- ```
281
-
282
- ### Teammate: security-analyst
283
-
284
- 1. Read persona layers:
285
- - Process: `.sniper/personas/process/architect.md`
286
- - Technical: `.sniper/personas/technical/security.md`
287
- - Cognitive: `.sniper/personas/cognitive/security-first.md`
288
- - Domain: domain pack context if configured
289
-
290
- 2. Assemble using the spawn template:
291
- - `{name}` = "security-analyst"
292
- - `{ownership}` = the `docs` ownership paths
293
-
294
- 3. Append task context:
295
- ```
296
- ## Your Task
297
- **Task ID:** security
298
- **Task Name:** Security & Compliance Requirements
299
- **Output File:** docs/security.md
300
-
301
- Define security architecture: auth model, data encryption strategy, compliance requirements
302
- (with specific regulations), threat model, and security testing requirements.
303
-
304
- ## Required Reading (read these BEFORE starting)
305
- - docs/prd.md (WAIT for this to be completed first)
306
- - docs/risks.md (if exists)
307
-
308
- ## Coordination
309
- - You will coordinate with `architect` -- review their architecture for security concerns.
310
- - When the architect shares their document, review it and provide security feedback via messaging.
311
-
312
- ## Project Context
313
- - **Project:** {project.name}
314
- - **Type:** {project.type}
315
- - **Stack:** {infrastructure, etc.}
316
-
317
- ## Instructions
318
- 1. WAIT until `docs/prd.md` exists.
319
- 2. Read all required reading files.
320
- 3. Write the security requirements to `docs/security.md`.
321
- 4. When `architect` messages you about their architecture, review it for security concerns and provide feedback.
322
- 5. If you find security issues in the architecture, message the architect directly with specific concerns.
323
- 6. Message the team lead when complete.
324
- ```
325
-
326
- ---
327
-
328
- ## Step 5: Create the Agent Team
329
-
330
- Use the TeamCreate tool:
331
-
332
- ```
333
- TeamCreate:
334
- team_name: "sniper-plan"
335
- description: "SNIPER Phase 2: Planning & Architecture for {project.name}. Model override: opus."
336
- ```
337
-
338
- ---
339
-
340
- ## Step 6: Create Tasks with Dependencies
341
-
342
- Create tasks in the shared task list. **Dependencies matter here** -- the architect, UX designer, and security analyst are all blocked by the product manager completing the PRD.
343
-
344
- ### Task 1: PRD (no dependencies -- starts immediately)
345
-
346
- ```
347
- TaskCreate:
348
- subject: "Write the Product Requirements Document"
349
- description: "Synthesize discovery artifacts into a comprehensive PRD. Output: docs/prd.md. Template: .sniper/templates/prd.md. Reads: docs/brief.md, docs/personas.md, docs/risks.md. This task BLOCKS architect, ux-designer, and security-analyst."
350
- activeForm: "Writing the Product Requirements Document"
351
- ```
352
-
353
- ### Task 2: Architecture (blocked by PRD)
354
-
355
- ```
356
- TaskCreate:
357
- subject: "Design the system architecture"
358
- description: "Design complete system architecture with components, data models, API contracts, infrastructure. Output: docs/architecture.md. Template: .sniper/templates/architecture.md. PLAN APPROVAL REQUIRED: must describe approach and get lead approval before executing. Blocked by: PRD task."
359
- activeForm: "Designing system architecture"
360
- ```
361
-
362
- After creating Task 2, set its dependency:
363
- ```
364
- TaskUpdate:
365
- taskId: "{task 2 id}"
366
- addBlockedBy: ["{task 1 id}"]
367
- ```
368
-
369
- ### Task 3: UX Specification (blocked by PRD)
370
-
371
- ```
372
- TaskCreate:
373
- subject: "Create the UX specification"
374
- description: "Define information architecture, screen inventory, user flows, component hierarchy, responsive breakpoints. Output: docs/ux-spec.md. Template: .sniper/templates/ux-spec.md. Blocked by: PRD task."
375
- activeForm: "Creating UX specification"
376
- ```
377
-
378
- After creating Task 3, set its dependency:
379
- ```
380
- TaskUpdate:
381
- taskId: "{task 3 id}"
382
- addBlockedBy: ["{task 1 id}"]
383
- ```
384
-
385
- ### Task 4: Security Requirements (blocked by PRD)
386
-
387
- ```
388
- TaskCreate:
389
- subject: "Define security and compliance requirements"
390
- description: "Define auth model, encryption, compliance, threat model, security testing. Output: docs/security.md. Blocked by: PRD task."
391
- activeForm: "Defining security requirements"
392
- ```
393
-
394
- After creating Task 4, set its dependency:
395
- ```
396
- TaskUpdate:
397
- taskId: "{task 4 id}"
398
- addBlockedBy: ["{task 1 id}"]
399
- ```
400
-
401
- ---
402
-
403
- ## Step 7: Spawn Teammates
404
-
405
- Spawn each teammate using the Task tool with:
406
- - `team_name`: "sniper-plan"
407
- - `name`: the teammate name
408
- - The full composed spawn prompt from Step 4
409
-
410
- **Spawn order matters for efficiency:**
411
- 1. Spawn `product-manager` FIRST -- they have no blockers and others depend on them.
412
- 2. Spawn `architect`, `ux-designer`, and `security-analyst` -- they will wait for the PRD.
413
-
414
- Assign tasks to teammates using TaskUpdate:
415
- - Task 1 (PRD) -> owner: "product-manager", status: "in_progress"
416
- - Task 2 (Architecture) -> owner: "architect" (stays `pending` until PRD completes)
417
- - Task 3 (UX Spec) -> owner: "ux-designer" (stays `pending` until PRD completes)
418
- - Task 4 (Security) -> owner: "security-analyst" (stays `pending` until PRD completes)
419
-
420
- ---
421
-
422
- ## Step 8: Enter Delegate Mode
423
-
424
- **You are the team lead. You coordinate, you do NOT produce artifacts.**
425
-
426
- ### Phase 8a: PRD Completion
427
-
428
- 1. Wait for `product-manager` to complete the PRD.
429
- 2. When they report completion, verify `docs/prd.md` exists and is non-empty.
430
- 3. Mark Task 1 as `completed` via TaskUpdate.
431
- 4. The blocked tasks (2, 3, 4) are now unblocked.
432
- 5. Message `architect`, `ux-designer`, and `security-analyst`:
433
- > "The PRD is complete at `docs/prd.md`. You may now begin your tasks. Read the PRD before starting."
434
- 6. Update tasks 2, 3, 4 to `in_progress`.
435
-
436
- ### Phase 8b: Architect Plan Approval
437
-
438
- 1. The architect has `plan_approval: true`. They MUST describe their approach before executing.
439
- 2. When the architect sends their plan/approach, **carefully review it**:
440
- - Does the component architecture align with the PRD requirements?
441
- - Are the technology choices appropriate for the stack in config.yaml?
442
- - Is the data model sound?
443
- - Are there obvious gaps or risks?
444
- 3. **Decide:**
445
- - If the approach looks solid: Approve by messaging the architect: "Plan approved. Proceed with the full architecture document."
446
- - If it needs changes: Send specific feedback: "Please revise: {specific issues}". Wait for revised plan.
447
- - If you are unsure: Present the architect's plan to the USER and ask for their input before approving.
448
-
449
- ### Phase 8c: Coordination Facilitation
450
-
451
- Monitor for coordination between teammates:
452
-
453
- 1. **architect <-> security-analyst:** When the architect completes or shares their draft, ensure the security analyst reviews it. If the security analyst finds issues, facilitate the conversation.
454
- 2. **architect <-> ux-designer:** When the architect has API contracts, ensure the UX designer validates that component hierarchy aligns. Facilitate alignment if there are conflicts.
455
-
456
- If teammates are not coordinating on their own, prompt them:
457
- - Message architect: "Have you shared your API contracts with ux-designer for validation?"
458
- - Message security-analyst: "The architecture document is ready. Please review it for security concerns."
459
-
460
- ### Phase 8d: Completion Monitoring
461
-
462
- Track progress. As each teammate completes:
463
- 1. Verify their output file exists and is non-empty.
464
- 2. Mark their task as `completed`.
465
- 3. If a teammate has been working for more than 20 minutes without a message, check on them.
466
-
467
- Wait for ALL four tasks to complete before proceeding.
468
-
469
- ---
470
-
471
- ## Step 9: Verify All Artifacts
472
-
473
- Verify these files exist and contain content:
474
- 1. `docs/prd.md` -- **REQUIRED**
475
- 2. `docs/architecture.md` -- **REQUIRED**
476
- 3. `docs/ux-spec.md` -- **REQUIRED**
477
- 4. `docs/security.md` -- Recommended but not strictly required
478
-
479
- If any REQUIRED file is missing, message the responsible teammate and wait for completion. Do NOT proceed without the PRD, architecture, and UX spec.
480
-
481
- ---
482
-
483
- ## Step 10: Run Review Gate (STRICT -- Human Must Approve)
484
-
485
- This is a **STRICT** gate. Human approval is NON-NEGOTIABLE.
486
-
487
- 1. Read the review checklist at `.sniper/checklists/plan-review.md`.
488
- 2. For each checklist section, read the relevant artifact and evaluate:
489
- - **PRD section:** Read `docs/prd.md` and check each item.
490
- - **Architecture section:** Read `docs/architecture.md` and check each item.
491
- - **UX section:** Read `docs/ux-spec.md` and check each item.
492
- - **Security section:** Read `docs/security.md` (if exists) and check each item.
493
- - **Cross-Document Consistency:** Verify alignment across all artifacts.
494
- 3. Compile the review into a structured report:
495
-
496
- ```
497
- ============================================
498
- SNIPER Phase 2: Planning Review
499
- ============================================
500
-
501
- Gate Mode: STRICT (human approval required)
502
-
503
- ## PRD Review (docs/prd.md)
504
- [PASS] / [ATTENTION] / [FAIL] for each checklist item
505
-
506
- ## Architecture Review (docs/architecture.md)
507
- [PASS] / [ATTENTION] / [FAIL] for each checklist item
508
-
509
- ## UX Specification Review (docs/ux-spec.md)
510
- [PASS] / [ATTENTION] / [FAIL] for each checklist item
511
-
512
- ## Security Review (docs/security.md)
513
- [PASS] / [ATTENTION] / [FAIL] for each checklist item
514
-
515
- ## Cross-Document Consistency
516
- [PASS] / [ATTENTION] / [FAIL] for each checklist item
517
-
518
- Summary:
519
- Passed: {count}/{total}
520
- Attention: {count}
521
- Failed: {count}
522
- ============================================
523
- ```
524
-
525
- 4. **ALWAYS present this review to the user and wait for explicit approval.**
526
-
527
- Print to the user:
528
- > "Phase 2 planning review is complete. Please review the artifacts and the checklist results above."
529
- >
530
- > "**Your options:**"
531
- > 1. **Approve** -- advance to Phase 3 (Epic Sharding)
532
- > 2. **Request revisions** -- specify which artifacts need changes, and I will instruct the relevant teammates
533
- > 3. **Reject** -- stop the process for manual review
534
-
535
- 5. **WAIT for the user to respond.** Do not auto-advance. Do not assume approval.
536
-
537
- ### If User Requests Revisions
538
-
539
- 1. Parse their feedback to determine which artifacts need changes.
540
- 2. Message the relevant teammate(s) with specific revision instructions.
541
- 3. Wait for revisions to complete.
542
- 4. Re-run the checklist evaluation.
543
- 5. Present the updated review to the user again.
544
- 6. Repeat until the user approves.
545
-
546
- ### If User Approves
547
-
548
- Proceed to Step 11.
549
-
550
- ### If User Rejects
551
-
552
- Print: "Phase 2 halted. Review artifacts manually in `docs/`. Run `/sniper-plan` again when ready to retry."
553
- Update state with `approved_by: "rejected"` and STOP.
554
-
555
- ---
556
-
557
- ## Step 11: Update State and Shut Down Team
558
-
559
- ### Update Lifecycle State
560
-
561
- Edit `.sniper/config.yaml`:
562
-
563
- 1. Update artifact tracking (increment version if amendment mode):
564
- - Set `state.artifacts.prd.status: draft` and increment `state.artifacts.prd.version`
565
- - Set `state.artifacts.architecture.status: draft` and increment `state.artifacts.architecture.version`
566
- - Set `state.artifacts.ux_spec.status: draft` and increment `state.artifacts.ux_spec.version`
567
- - Set `state.artifacts.security.status: draft` and increment `state.artifacts.security.version` (if produced)
568
- 2. Update the plan entry in `state.phase_log`:
569
- - Set `completed_at: "{current ISO timestamp}"`
570
- - Set `approved_by: "human"` (since this is a strict gate)
571
-
572
- ### Shut Down Teammates
573
-
574
- Send shutdown requests to each teammate:
575
- - Send shutdown_request to "product-manager"
576
- - Send shutdown_request to "architect"
577
- - Send shutdown_request to "ux-designer"
578
- - Send shutdown_request to "security-analyst"
579
-
580
- Wait for all teammates to acknowledge shutdown.
581
-
582
- ---
583
-
584
- ## Step 12: Present Results and Next Steps
585
-
586
- ```
587
- ============================================
588
- SNIPER Phase 2: Planning Complete
589
- ============================================
590
-
591
- Artifacts Produced:
592
- - docs/prd.md [draft, approved]
593
- - docs/architecture.md [draft, approved]
594
- - docs/ux-spec.md [draft, approved]
595
- - docs/security.md [draft, approved]
596
-
597
- Review Gate: STRICT
598
- Status: APPROVED by human
599
- Passed: {count}/{total} checklist items
600
-
601
- Phase Duration: {time elapsed}
602
-
603
- ============================================
604
- Next Steps
605
- ============================================
606
-
607
- 1. Run `/sniper-solve` to begin Phase 3: Epic Sharding & Story Creation
608
- 2. Or run `/sniper-status` to see the full lifecycle state
609
-
610
- Note: Phase 3 runs as a single agent (no team spawned).
611
- It will break the PRD into epics and create implementation stories.
612
-
613
- ============================================
614
- ```
615
-
616
- ---
617
-
618
- ## IMPORTANT RULES
619
-
620
- - You are the LEAD. You coordinate. You do NOT write artifact files.
621
- - The `model_override: opus` from the team YAML should be noted in the team description. If the Task tool supports model selection, use opus for all teammates in this phase.
622
- - The architect's `plan_approval: true` is MANDATORY. Do NOT let the architect skip the plan approval step.
623
- - The review gate is STRICT. Do NOT auto-advance. ALWAYS wait for human approval.
624
- - If `$ARGUMENTS` contains "dry-run", perform Steps 0-4 only (compose prompts) and print them without spawning.
625
- - If `$ARGUMENTS` contains "skip-review", IGNORE IT. The plan gate is strict and cannot be skipped.
626
- - Dependencies: product-manager runs first. Architect, UX designer, and security analyst are blocked until PRD completes.
627
- - Coordination: actively facilitate cross-team communication, especially architect<->security and architect<->UX.
628
- - If a teammate is blocked or unresponsive for more than 10 minutes, check on them and report to the user if needed.
629
- - All file paths are relative to the project root.
630
- - Do NOT proceed to `/sniper-solve` automatically -- always let the user initiate the next phase.