@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,397 @@
1
+ # /sniper-discover -- Phase 1: Discovery & Analysis (Parallel Team)
2
+
3
+ You are executing the `/sniper-discover` command. Your job is to spawn a parallel discovery team that researches the project's market landscape, risks, and user needs. 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 of the following checks before proceeding. If any check fails, STOP and report the issue.
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
+ - Do not proceed further.
19
+
20
+ ### 0b. Verify Phase State
21
+
22
+ 1. Read the `state.current_phase` value from `.sniper/config.yaml`.
23
+ 2. **If `current_phase` is `null`:** Good -- this is a fresh project. Proceed.
24
+ 3. **If `current_phase` is `discover`:** The discover phase is already in progress or was interrupted.
25
+ - Ask the user: "The discover phase appears to be in progress or was previously started. Do you want to restart it? This will overwrite any existing discovery artifacts. (yes/no)"
26
+ - If no, STOP.
27
+ 4. **If `current_phase` is anything else** (plan, solve, sprint):
28
+ - Ask the user: "The project is currently in the '{current_phase}' phase. Running discover again will reset progress. Are you sure? (yes/no)"
29
+ - If no, STOP.
30
+
31
+ ### 0c. Verify Framework Files
32
+
33
+ Check that these files exist (they are needed by the team):
34
+ - `.sniper/teams/discover.yaml`
35
+ - `.sniper/spawn-prompts/_template.md`
36
+ - `.sniper/checklists/discover-review.md`
37
+ - `.sniper/personas/process/analyst.md`
38
+ - `.sniper/personas/cognitive/systems-thinker.md`
39
+ - `.sniper/personas/cognitive/devils-advocate.md`
40
+ - `.sniper/personas/cognitive/user-empathetic.md`
41
+
42
+ If any are missing, print a warning listing the missing files but continue if at least the team YAML exists.
43
+
44
+ ---
45
+
46
+ ## Step 1: Update Lifecycle State
47
+
48
+ Edit `.sniper/config.yaml` to update the state section:
49
+
50
+ 1. Set `state.current_phase: discover`
51
+ 2. Append to `state.phase_history`:
52
+ ```yaml
53
+ - phase: discover
54
+ started_at: "{current ISO timestamp}"
55
+ completed_at: null
56
+ approved_by: null
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Step 2: Read Team Definition
62
+
63
+ 1. Read `.sniper/teams/discover.yaml` in full.
64
+ 2. Parse out:
65
+ - `team_name` (should be `sniper-discover`)
66
+ - The list of `teammates` with their `name`, `compose` layers, and `tasks`
67
+ - The `coordination` rules (should be empty for discover -- independent research)
68
+ - The `review_gate` section (checklist path and mode)
69
+ 3. Store these values for subsequent steps.
70
+
71
+ ---
72
+
73
+ ## Step 3: Read Project Context
74
+
75
+ Gather the context that teammates will need:
76
+
77
+ 1. Read `.sniper/config.yaml` fully -- extract `project.name`, `project.description`, `project.type`, `stack`, `domain_pack`, and `ownership` sections.
78
+ 2. If `domain_pack` is not null, check if `.sniper/domain-packs/{domain_pack}/` exists and read any context files within it.
79
+ 3. Read the artifact template `.sniper/templates/brief.md` -- teammates will need to follow this template.
80
+
81
+ ---
82
+
83
+ ## Step 4: Compose Spawn Prompts
84
+
85
+ For each teammate in the team YAML, compose a spawn prompt by assembling persona layers. Do this by reading the actual persona files and assembling them into the template.
86
+
87
+ ### Teammate: analyst
88
+
89
+ 1. Read these persona layer files:
90
+ - Process: `.sniper/personas/process/analyst.md`
91
+ - Technical: SKIP (null in team YAML)
92
+ - Cognitive: `.sniper/personas/cognitive/systems-thinker.md`
93
+ - Domain: If `domain_pack` is set, read `.sniper/domain-packs/{domain_pack}/context/*.md`. Otherwise skip.
94
+
95
+ 2. Read the spawn prompt template: `.sniper/spawn-prompts/_template.md`
96
+
97
+ 3. Assemble the spawn prompt by filling the template:
98
+ - `{name}` = "analyst"
99
+ - `{process_layer}` = contents of the process persona file
100
+ - `{technical_layer}` = "No specific technical lens for this role."
101
+ - `{cognitive_layer}` = contents of the cognitive persona file
102
+ - `{domain_layer}` = domain pack context if available, otherwise "No domain pack configured."
103
+ - `{ownership}` = the `docs` ownership paths from `config.yaml`
104
+
105
+ 4. Append to the spawn prompt:
106
+ ```
107
+ ## Your Task
108
+ **Task ID:** market-research
109
+ **Task Name:** Market Research & Competitive Analysis
110
+ **Output File:** docs/brief.md
111
+ **Template:** .sniper/templates/brief.md
112
+
113
+ {task description from the team YAML}
114
+
115
+ ## Project Context
116
+ - **Project:** {project.name}
117
+ - **Type:** {project.type}
118
+ - **Description:** {project.description}
119
+ - **Stack:** {summary of stack section}
120
+
121
+ ## Instructions
122
+ 1. Read the template at `.sniper/templates/brief.md` to understand the expected output format.
123
+ 2. If a domain pack is configured, read the domain context files for industry knowledge.
124
+ 3. Research and produce the artifact at `docs/brief.md` following the template exactly.
125
+ 4. Every section in the template MUST be filled -- no empty sections.
126
+ 5. When complete, message the team lead that your task is done.
127
+ ```
128
+
129
+ 5. Save this composed prompt as a variable for spawning.
130
+
131
+ ### Teammate: risk-researcher
132
+
133
+ 1. Read these persona layer files:
134
+ - Process: `.sniper/personas/process/analyst.md`
135
+ - Technical: `.sniper/personas/technical/infrastructure.md`
136
+ - Cognitive: `.sniper/personas/cognitive/devils-advocate.md`
137
+ - Domain: Same as above.
138
+
139
+ 2. Assemble using the same template pattern:
140
+ - `{name}` = "risk-researcher"
141
+ - `{technical_layer}` = contents of the infrastructure technical persona
142
+ - `{ownership}` = the `docs` ownership paths
143
+
144
+ 3. Append task context:
145
+ ```
146
+ ## Your Task
147
+ **Task ID:** risk-assessment
148
+ **Task Name:** Technical Feasibility & Risk Assessment
149
+ **Output File:** docs/risks.md
150
+ **Template:** .sniper/templates/risks.md
151
+
152
+ {task description from the team YAML}
153
+
154
+ ## Project Context
155
+ {same project context as above}
156
+
157
+ ## Instructions
158
+ 1. Read the template at `.sniper/templates/risks.md` to understand the expected output format.
159
+ 2. Assess technical feasibility, integration risks, compliance hurdles, and scalability challenges.
160
+ 3. Challenge optimistic assumptions -- be the devil's advocate.
161
+ 4. For each risk, provide a specific mitigation strategy.
162
+ 5. Write the output to `docs/risks.md` following the template exactly.
163
+ 6. When complete, message the team lead that your task is done.
164
+ ```
165
+
166
+ ### Teammate: user-researcher
167
+
168
+ 1. Read these persona layer files:
169
+ - Process: `.sniper/personas/process/analyst.md`
170
+ - Technical: SKIP (null)
171
+ - Cognitive: `.sniper/personas/cognitive/user-empathetic.md`
172
+ - Domain: Same as above.
173
+
174
+ 2. Assemble using the same template pattern:
175
+ - `{name}` = "user-researcher"
176
+ - `{technical_layer}` = "No specific technical lens for this role."
177
+ - `{ownership}` = the `docs` ownership paths
178
+
179
+ 3. Append task context:
180
+ ```
181
+ ## Your Task
182
+ **Task ID:** user-personas
183
+ **Task Name:** User Persona & Journey Mapping
184
+ **Output File:** docs/personas.md
185
+ **Template:** .sniper/templates/personas.md
186
+
187
+ {task description from the team YAML}
188
+
189
+ ## Project Context
190
+ {same project context as above}
191
+
192
+ ## Instructions
193
+ 1. Read the template at `.sniper/templates/personas.md` to understand the expected output format.
194
+ 2. Define 2-4 distinct user personas with goals, pain points, and workflows.
195
+ 3. Map the primary user journey for each persona.
196
+ 4. Identify key friction points and moments of delight.
197
+ 5. Write the output to `docs/personas.md` following the template exactly.
198
+ 6. When complete, message the team lead that your task is done.
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Step 5: Create the Agent Team
204
+
205
+ Use the TeamCreate tool to create the team:
206
+
207
+ ```
208
+ TeamCreate:
209
+ team_name: "sniper-discover"
210
+ description: "SNIPER Phase 1: Discovery & Analysis for {project.name}"
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Step 6: Create Tasks in the Shared Task List
216
+
217
+ Create one task per teammate using TaskCreate. Since coordination is empty (all tasks are independent), there are NO dependencies between tasks.
218
+
219
+ ### Task 1: Market Research
220
+
221
+ ```
222
+ TaskCreate:
223
+ subject: "Market Research & Competitive Analysis"
224
+ description: "Research the market landscape. Identify competitors, features, pricing, and positioning. Define the project's unique value proposition. Output: docs/brief.md. Follow template at .sniper/templates/brief.md."
225
+ activeForm: "Researching market landscape and competitors"
226
+ ```
227
+
228
+ ### Task 2: Risk Assessment
229
+
230
+ ```
231
+ TaskCreate:
232
+ subject: "Technical Feasibility & Risk Assessment"
233
+ description: "Assess technical feasibility, integration risks, compliance hurdles, and scalability challenges. Challenge optimistic assumptions. Output: docs/risks.md."
234
+ activeForm: "Assessing risks and technical feasibility"
235
+ ```
236
+
237
+ ### Task 3: User Personas
238
+
239
+ ```
240
+ TaskCreate:
241
+ subject: "User Persona & Journey Mapping"
242
+ description: "Define 2-4 user personas with goals, pain points, and workflows. Map primary user journeys. Output: docs/personas.md."
243
+ activeForm: "Defining user personas and journeys"
244
+ ```
245
+
246
+ No dependencies between tasks -- all three run in parallel.
247
+
248
+ ---
249
+
250
+ ## Step 7: Spawn Teammates
251
+
252
+ Spawn each teammate using the Task tool. Use the composed spawn prompts from Step 4.
253
+
254
+ For each teammate, spawn using:
255
+ - `team_name`: "sniper-discover"
256
+ - `name`: the teammate name from the YAML (analyst, risk-researcher, user-researcher)
257
+ - The full composed spawn prompt as the instruction
258
+
259
+ Spawn all three teammates. They will work in parallel on their independent tasks.
260
+
261
+ After spawning, assign each task to its corresponding teammate using TaskUpdate with the `owner` field:
262
+ - Task 1 (Market Research) -> owner: "analyst"
263
+ - Task 2 (Risk Assessment) -> owner: "risk-researcher"
264
+ - Task 3 (User Personas) -> owner: "user-researcher"
265
+
266
+ Mark each task as `in_progress` via TaskUpdate.
267
+
268
+ ---
269
+
270
+ ## Step 8: Enter Delegate Mode
271
+
272
+ **You are now the team lead. You do NOT produce artifacts.**
273
+
274
+ Your responsibilities during execution:
275
+ 1. Monitor task progress via TaskList
276
+ 2. Respond to teammate messages (questions, blockers, completion notifications)
277
+ 3. If a teammate is stuck or asks a question about the project, provide guidance from the project context
278
+ 4. If a teammate finishes early, acknowledge their completion and update their task status to `completed`
279
+ 5. Track which teammates have completed their work
280
+
281
+ **Do NOT:**
282
+ - Write to `docs/brief.md`, `docs/risks.md`, or `docs/personas.md` yourself
283
+ - Modify teammate artifacts
284
+ - Do research yourself
285
+
286
+ Wait for all three teammates to report completion.
287
+
288
+ ---
289
+
290
+ ## Step 9: Verify Artifacts Exist
291
+
292
+ Once all three teammates report completion:
293
+
294
+ 1. Verify these files exist and are non-empty:
295
+ - `docs/brief.md`
296
+ - `docs/risks.md`
297
+ - `docs/personas.md`
298
+
299
+ 2. If any file is missing or empty, message the responsible teammate and ask them to complete it.
300
+
301
+ 3. Do NOT proceed to Step 10 until all three files exist and contain content.
302
+
303
+ ---
304
+
305
+ ## Step 10: Run Review Gate
306
+
307
+ Read the review gate configuration from the team YAML: `review_gate.mode` and `review_gate.checklist`.
308
+
309
+ 1. Read the review checklist at `.sniper/checklists/discover-review.md`.
310
+ 2. For each checklist item, perform a quick evaluation by reading the relevant artifact and checking if the item is addressed.
311
+ 3. Compile a review summary with:
312
+ - Total checklist items
313
+ - Items that PASS
314
+ - Items that NEED ATTENTION (not fully met but not blocking)
315
+ - Items that FAIL (critical gaps)
316
+
317
+ ### Gate Decision
318
+
319
+ The discover gate mode is **flexible**:
320
+
321
+ - **If there are no FAIL items:** Auto-advance. Print the review summary and note any NEED ATTENTION items for async review.
322
+ - **If there are FAIL items:** Present the failures to the user and ask:
323
+ > "The discovery review found {N} critical issues. Would you like to:
324
+ > 1. Have the team fix the issues (I will message the relevant teammates)
325
+ > 2. Override and advance anyway
326
+ > 3. Stop and review manually"
327
+
328
+ If option 1: Message the relevant teammates with specific feedback, wait for fixes, then re-run the checklist.
329
+ If option 2: Proceed with a note that issues were overridden.
330
+ If option 3: STOP and let the user handle it.
331
+
332
+ ---
333
+
334
+ ## Step 11: Update State and Shut Down Team
335
+
336
+ ### Update Lifecycle State
337
+
338
+ Edit `.sniper/config.yaml`:
339
+
340
+ 1. Set `state.artifacts.brief: draft`
341
+ 2. Update the discover entry in `state.phase_history` to add `completed_at: "{current ISO timestamp}"`
342
+ 3. If auto-advanced (flexible gate passed), set `approved_by: "auto-flexible"`
343
+
344
+ ### Shut Down Teammates
345
+
346
+ Send a shutdown request to each teammate:
347
+ - Send shutdown_request to "analyst"
348
+ - Send shutdown_request to "risk-researcher"
349
+ - Send shutdown_request to "user-researcher"
350
+
351
+ Wait for all teammates to acknowledge shutdown.
352
+
353
+ ---
354
+
355
+ ## Step 12: Present Results and Next Steps
356
+
357
+ Print a formatted summary:
358
+
359
+ ```
360
+ ============================================
361
+ SNIPER Phase 1: Discovery Complete
362
+ ============================================
363
+
364
+ Artifacts Produced:
365
+ - docs/brief.md [draft]
366
+ - docs/risks.md [draft]
367
+ - docs/personas.md [draft]
368
+
369
+ Review Gate: FLEXIBLE
370
+ Passed: {count}/{total} checklist items
371
+ Attention: {count} items flagged for async review
372
+ Failed: {count} critical issues
373
+
374
+ Phase Duration: {time elapsed}
375
+
376
+ ============================================
377
+ Next Steps
378
+ ============================================
379
+
380
+ 1. Review the discovery artifacts in `docs/`
381
+ 2. When ready, run `/sniper-plan` to begin Phase 2: Planning & Architecture
382
+ 3. Or run `/sniper-status` to see the full lifecycle state
383
+
384
+ ============================================
385
+ ```
386
+
387
+ ---
388
+
389
+ ## IMPORTANT RULES
390
+
391
+ - You are the LEAD. You coordinate. You do NOT write artifact files.
392
+ - All three teammates work in PARALLEL -- do not serialize their work.
393
+ - If `$ARGUMENTS` contains "dry-run", perform Steps 0-4 only (compose prompts) and print them without spawning. This lets the user review prompts before execution.
394
+ - If `$ARGUMENTS` contains "skip-review", skip Step 10 and go straight to Step 11.
395
+ - If a teammate crashes or becomes unresponsive after 10 minutes of no messages, report the issue to the user and offer to respawn that specific teammate.
396
+ - All file paths are relative to the project root.
397
+ - Do NOT proceed to `/sniper-plan` automatically -- always let the user initiate the next phase.