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