@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,388 +0,0 @@
1
- # /sniper-init -- Initialize SNIPER in a New or Existing Project
2
-
3
- You are executing the `/sniper-init` command. Your job is to initialize the SNIPER framework in the current project. Follow every step below precisely.
4
-
5
- ---
6
-
7
- ## Step 0: Pre-Flight Checks
8
-
9
- 1. Check if the directory `.sniper/` already exists in the project root by listing its contents.
10
- 2. If `.sniper/` exists AND contains a `config.yaml` with a non-empty `project.name`:
11
- - **WARN the user:** "SNIPER is already initialized for project '{name}'. Re-running will overwrite configuration and persona files. Artifacts in `docs/` will NOT be deleted."
12
- - Ask the user: "Do you want to re-initialize? (yes/no)"
13
- - If they say no, STOP and print: "Initialization cancelled. Run `/sniper-status` to see current state."
14
- - If they say yes, proceed with overwrite.
15
- 3. If `.sniper/` does not exist, or `config.yaml` is empty/missing, proceed normally.
16
-
17
- ---
18
-
19
- ## Step 1: Gather Project Information
20
-
21
- Ask the user the following questions ONE AT A TIME using conversational prompts. Wait for each answer before asking the next. Provide defaults in brackets.
22
-
23
- **Question 1: Project Name**
24
- > What is the project name? This will be used in config and artifacts.
25
-
26
- **Question 2: Project Type**
27
- > What type of project is this?
28
- > Options: `saas` | `api` | `mobile` | `cli` | `library` | `monorepo`
29
- > [default: saas]
30
-
31
- **Question 3: One-Line Description**
32
- > Give a one-line description of what this project does.
33
-
34
- **Question 4: Tech Stack**
35
- Ask about each stack component. Present all at once and let the user confirm or override:
36
-
37
- > Here is the default tech stack. Confirm or override each:
38
- >
39
- > | Setting | Default |
40
- > |-----------------|----------------|
41
- > | Language | typescript |
42
- > | Frontend | react |
43
- > | Backend | node-express |
44
- > | Database | postgresql |
45
- > | Cache | redis |
46
- > | Infrastructure | aws |
47
- > | Test Runner | vitest |
48
- > | Package Manager | pnpm |
49
- >
50
- > Type your overrides as key=value pairs (e.g., `language=python backend=fastapi database=mongodb frontend=null`), or type `ok` to accept defaults.
51
-
52
- Parse the user's response. For any key not mentioned, keep the default. If the user says `ok` or `confirm` or similar, keep all defaults.
53
-
54
- **Question 5: Domain Pack**
55
- > Do you want to install a domain pack? Domain packs add industry-specific context to personas.
56
- > Available packs are found in `.sniper/domain-packs/`. Enter a pack name, or `none` to skip.
57
- > [default: none]
58
-
59
- If the user specifies a domain pack, verify that the directory `.sniper/domain-packs/{pack-name}/` exists. If it does not exist, warn them and set domain_pack to null.
60
-
61
- **Question 6: Review Gate Configuration**
62
- > Here are the default review gates:
63
- >
64
- > | Gate | Default | Description |
65
- > |-----------------|------------|--------------------------------------------|
66
- > | after_discover | flexible | Auto-advance, human reviews async |
67
- > | after_plan | strict | Full stop, human must approve |
68
- > | after_solve | flexible | Auto-advance, human reviews async |
69
- > | after_sprint | strict | Full stop, human must review code |
70
- >
71
- > Options per gate: `strict` | `flexible` | `auto`
72
- > Type overrides as key=value (e.g., `after_discover=strict`), or `ok` to accept defaults.
73
-
74
- Parse overrides. Keep defaults for any not mentioned.
75
-
76
- ---
77
-
78
- ## Step 2: Create Directory Structure
79
-
80
- Create the following directories if they do not already exist. Use `mkdir -p` to create them all at once:
81
-
82
- ```
83
- .sniper/personas/process
84
- .sniper/personas/technical
85
- .sniper/personas/cognitive
86
- .sniper/personas/domain
87
- .sniper/teams
88
- .sniper/workflows
89
- .sniper/templates
90
- .sniper/checklists
91
- .sniper/spawn-prompts
92
- .sniper/domain-packs
93
- ```
94
-
95
- ---
96
-
97
- ## Step 3: Generate config.yaml
98
-
99
- Write `.sniper/config.yaml` using the gathered information. Use this exact structure:
100
-
101
- ```yaml
102
- # ─────────────────────────────────────────
103
- # SNIPER Framework Configuration
104
- # ─────────────────────────────────────────
105
-
106
- project:
107
- name: "{project_name}"
108
- type: {project_type}
109
- description: "{description}"
110
-
111
- stack:
112
- language: {language}
113
- frontend: {frontend}
114
- backend: {backend}
115
- database: {database}
116
- cache: {cache}
117
- infrastructure: {infrastructure}
118
- test_runner: {test_runner}
119
- package_manager: {package_manager}
120
-
121
- # ─────────────────────────────────────────
122
- # Review Gate Configuration
123
- # ─────────────────────────────────────────
124
- # strict = full stop, human must approve before next phase
125
- # flexible = auto-advance, human reviews async
126
- # auto = no gate (not recommended for architecture/implementation)
127
-
128
- review_gates:
129
- after_discover: {after_discover}
130
- after_plan: {after_plan}
131
- after_solve: {after_solve}
132
- after_sprint: {after_sprint}
133
-
134
- # ─────────────────────────────────────────
135
- # Agent Teams Configuration
136
- # ─────────────────────────────────────────
137
-
138
- agent_teams:
139
- max_teammates: 5
140
- default_model: sonnet
141
- planning_model: opus
142
- delegate_mode: true
143
- plan_approval: true
144
- coordination_timeout: 30
145
-
146
- # ─────────────────────────────────────────
147
- # Domain Pack
148
- # ─────────────────────────────────────────
149
-
150
- domain_pack: {domain_pack_or_null}
151
-
152
- # ─────────────────────────────────────────
153
- # File Ownership Rules
154
- # ─────────────────────────────────────────
155
- # These are injected into spawn prompts to prevent teammates from editing
156
- # each other's files. Customize per project.
157
-
158
- ownership:
159
- backend:
160
- - "src/backend/"
161
- - "src/api/"
162
- - "src/services/"
163
- - "src/db/"
164
- - "src/workers/"
165
- frontend:
166
- - "src/frontend/"
167
- - "src/components/"
168
- - "src/hooks/"
169
- - "src/styles/"
170
- - "src/pages/"
171
- infrastructure:
172
- - "docker/"
173
- - ".github/"
174
- - "infra/"
175
- - "terraform/"
176
- - "scripts/"
177
- tests:
178
- - "tests/"
179
- - "__tests__/"
180
- - "*.test.*"
181
- - "*.spec.*"
182
- docs:
183
- - "docs/"
184
-
185
- # ─────────────────────────────────────────
186
- # Lifecycle State (managed by SNIPER, don't edit manually)
187
- # ─────────────────────────────────────────
188
-
189
- state:
190
- current_phase: null
191
- phase_history: []
192
- current_sprint: 0
193
- artifacts:
194
- brief: null
195
- prd: null
196
- architecture: null
197
- ux_spec: null
198
- security: null
199
- epics: null
200
- stories: null
201
- ```
202
-
203
- Replace all `{placeholders}` with the actual values gathered from the user. For `null` values (e.g., no frontend, no cache), write the literal YAML `null`.
204
-
205
- ---
206
-
207
- ## Step 4: Verify Framework Files Exist
208
-
209
- Check that the following framework files already exist. For each file category, list what is present:
210
-
211
- 1. **Persona layers** in `.sniper/personas/`:
212
- - Process: `analyst.md`, `product-manager.md`, `architect.md`, `ux-designer.md`, `scrum-master.md`, `developer.md`, `qa-engineer.md`
213
- - Technical: `backend.md`, `frontend.md`, `infrastructure.md`, `security.md`, `ai-ml.md`, `database.md`, `api-design.md`
214
- - Cognitive: `systems-thinker.md`, `security-first.md`, `performance-focused.md`, `user-empathetic.md`, `devils-advocate.md`, `mentor-explainer.md`
215
- 2. **Spawn prompt template**: `.sniper/spawn-prompts/_template.md`
216
- 3. **Team definitions**: `.sniper/teams/discover.yaml`, `plan.yaml`, `solve.yaml`, `sprint.yaml`
217
- 4. **Artifact templates**: `.sniper/templates/brief.md`, `risks.md`, `personas.md`, `prd.md`, `architecture.md`, `ux-spec.md`, `security.md`, `epic.md`, `story.md`, `sprint-review.md`
218
- 5. **Review checklists**: `.sniper/checklists/discover-review.md`, `plan-review.md`, `story-review.md`, `sprint-review.md`, `code-review.md`
219
- 6. **Workflows**: `.sniper/workflows/full-lifecycle.md`, `sprint-cycle.md`, `discover-only.md`, `quick-feature.md`
220
-
221
- For any MISSING files, report them to the user as warnings. These are framework files that should have been included with the SNIPER framework repo. Do NOT attempt to generate them from scratch -- just warn.
222
-
223
- ---
224
-
225
- ## Step 5: Install Domain Pack(s) (if specified)
226
-
227
- If the user chose one or more domain packs:
228
-
229
- For each domain pack:
230
-
231
- 1. Check that `.sniper/domain-packs/{pack-name}/` exists
232
- 2. Check for `pack.yaml` manifest in the pack directory
233
- 3. **If `pack.yaml` exists (v2 pack):**
234
- a. Read the manifest to discover all content types
235
- b. Copy knowledge files to `.sniper/packs/{pack-name}/knowledge/`
236
- c. Copy personas to `.sniper/packs/{pack-name}/personas/`
237
- d. Copy checklists to `.sniper/packs/{pack-name}/checklists/`
238
- e. Copy templates to `.sniper/packs/{pack-name}/templates/`
239
- f. Copy workflows to `.sniper/packs/{pack-name}/workflows/` (if any)
240
- g. Apply `config_defaults` from the manifest (warn on conflicts with user choices)
241
- h. Check `conflicts_with` against other loaded packs (warn if conflicts found)
242
- i. Report all installed content with counts
243
- 4. **If `pack.yaml` does not exist (legacy pack):**
244
- a. Check for a `context/` subdirectory with `.md` files
245
- b. If contexts exist, copy/link them into `.sniper/packs/{pack-name}/knowledge/`
246
- c. Report what domain context files were installed
247
-
248
- **Config migration:** If `domain_pack` is a string (legacy format), auto-convert to `domain_packs: [{name: "{value}"}]` array format.
249
-
250
- If no domain pack was chosen, skip this step.
251
-
252
- ---
253
-
254
- ## Step 6: Create docs/ Directory
255
-
256
- Create the `docs/` directory if it does not exist:
257
- ```
258
- docs/
259
- docs/epics/
260
- docs/stories/
261
- ```
262
-
263
- Do NOT create any artifact files -- those are produced by the discovery and planning phases.
264
-
265
- ---
266
-
267
- ## Step 7: Verify CLAUDE.md
268
-
269
- Check that `CLAUDE.md` exists in the project root. If it does, read it and verify it references the SNIPER framework. If it does NOT exist, create one with the standard SNIPER CLAUDE.md content:
270
-
271
- ```markdown
272
- # SNIPER Project
273
-
274
- ## Framework
275
- This project uses SNIPER (Spawn, Navigate, Implement, Parallelize, Evaluate, Release).
276
- See `.sniper/config.yaml` for project settings.
277
-
278
- ## Quick Reference
279
- - Framework workflows: `.sniper/workflows/`
280
- - Persona layers: `.sniper/personas/`
281
- - Team definitions: `.sniper/teams/`
282
- - Artifact templates: `.sniper/templates/`
283
- - Quality gates: `.sniper/checklists/`
284
- - Project artifacts: `docs/`
285
- - Domain context: `.sniper/domain-packs/{pack-name}/`
286
-
287
- ## Commands
288
- - `/sniper-init` -- Initialize SNIPER in a new project
289
- - `/sniper-discover` -- Phase 1: Discovery & Analysis (parallel team)
290
- - `/sniper-plan` -- Phase 2: Planning & Architecture (parallel team)
291
- - `/sniper-solve` -- Phase 3: Epic Sharding & Story Creation (sequential)
292
- - `/sniper-sprint` -- Phase 4: Implementation Sprint (parallel team)
293
- - `/sniper-review` -- Run review gate for current phase
294
- - `/sniper-compose` -- Create a spawn prompt from persona layers
295
- - `/sniper-status` -- Show lifecycle status and artifact state
296
-
297
- ## Agent Teams Rules
298
- When spawning teammates, always:
299
- 1. Read the relevant team YAML from `.sniper/teams/`
300
- 2. Compose spawn prompts using `/sniper-compose` with the layers specified in the YAML
301
- 3. Assign file ownership boundaries from `config.yaml` ownership rules
302
- 4. Create tasks with dependencies from the team YAML
303
- 5. Enter delegate mode (Shift+Tab) -- the lead coordinates, it does not code
304
- 6. Require plan approval for tasks marked `plan_approval: true`
305
- 7. When a phase completes, run `/sniper-review` before advancing
306
-
307
- ## Code Standards
308
- See `.sniper/config.yaml` -> stack section for language/framework specifics.
309
- ```
310
-
311
- ---
312
-
313
- ## Step 8: Verify Slash Commands
314
-
315
- Check that the following slash command files exist in `.claude/commands/`:
316
- - `sniper-init.md` (this file)
317
- - `sniper-compose.md`
318
- - `sniper-discover.md`
319
- - `sniper-plan.md`
320
- - `sniper-solve.md`
321
- - `sniper-sprint.md`
322
- - `sniper-review.md`
323
- - `sniper-status.md`
324
-
325
- Report any missing commands as warnings.
326
-
327
- ---
328
-
329
- ## Step 9: Print Summary and Next Steps
330
-
331
- Print a formatted summary:
332
-
333
- ```
334
- ============================================
335
- SNIPER Initialized Successfully
336
- ============================================
337
-
338
- Project: {project_name}
339
- Type: {project_type}
340
- Description: {description}
341
-
342
- Stack:
343
- Language: {language}
344
- Frontend: {frontend}
345
- Backend: {backend}
346
- Database: {database}
347
- Cache: {cache}
348
- Infrastructure: {infrastructure}
349
- Test Runner: {test_runner}
350
- Package Manager: {package_manager}
351
-
352
- Domain Pack: {domain_pack or "none"}
353
-
354
- Review Gates:
355
- after_discover: {gate}
356
- after_plan: {gate}
357
- after_solve: {gate}
358
- after_sprint: {gate}
359
-
360
- Framework Files:
361
- Personas: {count} layers found
362
- Teams: {count} definitions found
363
- Templates: {count} templates found
364
- Checklists: {count} checklists found
365
- Workflows: {count} workflows found
366
-
367
- {warnings if any}
368
-
369
- ============================================
370
- Next Steps
371
- ============================================
372
-
373
- 1. Review `.sniper/config.yaml` and adjust ownership rules for your project structure
374
- 2. Run `/sniper-discover` to begin Phase 1: Discovery & Analysis
375
- 3. Or run `/sniper-status` to see the current lifecycle state
376
-
377
- Tip: The full lifecycle workflow is documented in `.sniper/workflows/full-lifecycle.md`
378
- ```
379
-
380
- ---
381
-
382
- ## IMPORTANT RULES
383
-
384
- - Do NOT skip the user questions -- every project is different and needs configuration.
385
- - Do NOT generate placeholder artifact files (brief.md, prd.md, etc.) -- those come from the actual phases.
386
- - Do NOT modify any existing artifact files in `docs/`.
387
- - If the user cancels at any point, stop gracefully and report what was done.
388
- - All file paths are relative to the project root.
@@ -1,219 +0,0 @@
1
- # /sniper-memory -- Manage Agent Memory (Conventions, Anti-Patterns, Decisions)
2
-
3
- You are executing the `/sniper-memory` command. Your job is to manage the project's accumulated knowledge — conventions, anti-patterns, and decisions that agents learn over time. Follow every step below precisely.
4
-
5
- The user's arguments are provided in: $ARGUMENTS
6
-
7
- ---
8
-
9
- ## Step 0: Pre-Flight Checks
10
-
11
- 1. Verify `.sniper/config.yaml` exists (SNIPER is initialized)
12
- 2. Check if `.sniper/memory/` directory exists. If not, create it with empty starter files:
13
- - `.sniper/memory/conventions.yaml` with `conventions: []`
14
- - `.sniper/memory/anti-patterns.yaml` with `anti_patterns: []`
15
- - `.sniper/memory/decisions.yaml` with `decisions: []`
16
- - `.sniper/memory/estimates.yaml` with `calibration: { velocity_factor: 1.0, common_underestimates: [], last_updated: null, sprints_analyzed: 0 }`
17
- - `.sniper/memory/retros/` directory
18
-
19
- ---
20
-
21
- ## Step 1: Parse Arguments
22
-
23
- Parse the following flags from `$ARGUMENTS`:
24
-
25
- | Flag | Description | Example |
26
- |------|-------------|---------|
27
- | (none) | Show memory summary | `/sniper-memory` |
28
- | `--conventions` | List all conventions | `/sniper-memory --conventions` |
29
- | `--anti-patterns` | List all anti-patterns | `/sniper-memory --anti-patterns` |
30
- | `--decisions` | List all decisions | `/sniper-memory --decisions` |
31
- | `--add convention "rule"` | Add a new convention | `/sniper-memory --add convention "Use barrel exports"` |
32
- | `--add anti-pattern "desc"` | Add a new anti-pattern | `/sniper-memory --add anti-pattern "Nested ternaries"` |
33
- | `--add decision "title" --rationale "why"` | Add a decision | `/sniper-memory --add decision "Use Zod" --rationale "Type-safe validation"` |
34
- | `--remove {id}` | Remove an entry by ID | `/sniper-memory --remove conv-003` |
35
- | `--promote {id}` | Promote candidate to confirmed | `/sniper-memory --promote ap-002` |
36
- | `--export` | Export memory as portable YAML | `/sniper-memory --export` |
37
- | `--import {file}` | Import memory from file | `/sniper-memory --import memory-pack.yaml` |
38
- | `--retro` | Manually trigger retrospective | `/sniper-memory --retro` |
39
-
40
- If no arguments provided, default to showing the summary.
41
-
42
- If unrecognized flags, show usage guide and STOP.
43
-
44
- ---
45
-
46
- ## Step 2: Read Memory State
47
-
48
- 1. Read `.sniper/memory/conventions.yaml` — parse the `conventions` array
49
- 2. Read `.sniper/memory/anti-patterns.yaml` — parse the `anti_patterns` array
50
- 3. Read `.sniper/memory/decisions.yaml` — parse the `decisions` array
51
- 4. Read `.sniper/memory/estimates.yaml` — parse calibration data
52
- 5. Scan `.sniper/memory/retros/` for retro files — count them, find the latest
53
-
54
- If any file is missing or empty, treat it as an empty array/object.
55
-
56
- ---
57
-
58
- ## Step 3: Execute Operation
59
-
60
- ### 3a: Summary (no flags)
61
-
62
- Display a formatted summary:
63
-
64
- ```
65
- ============================================
66
- SNIPER Memory
67
- ============================================
68
-
69
- Conventions: {N} confirmed, {M} candidates
70
- Anti-Patterns: {N} confirmed, {M} candidates
71
- Decisions: {N} active, {M} superseded
72
-
73
- Estimation:
74
- Velocity Factor: {factor}
75
- Sprints Analyzed: {count}
76
-
77
- Retrospectives:
78
- Total: {count}
79
- Latest: Sprint {N} ({date})
80
-
81
- ============================================
82
- ```
83
-
84
- ### 3b: List Operations (--conventions, --anti-patterns, --decisions)
85
-
86
- For each entry, display in a readable format:
87
-
88
- **Conventions:**
89
- ```
90
- [conv-001] (confirmed) enforcement: both
91
- Rule: All API routes use Zod validation middleware
92
- Applies to: backend-engineer, api-designer
93
- Source: review_gate (sprint-2-review, 2026-02-15)
94
-
95
- [conv-002] (candidate) enforcement: spawn_prompt
96
- Rule: Use named exports for React components
97
- Applies to: frontend-engineer
98
- Source: retro (sprint-3-retro, 2026-02-18)
99
- ```
100
-
101
- Similar format for anti-patterns (include severity) and decisions (include status).
102
-
103
- ### 3c: Add Operations (--add)
104
-
105
- **Add convention:**
106
- 1. Determine the next convention ID: find the highest `conv-XXX` number and increment
107
- 2. Create the entry:
108
- ```yaml
109
- - id: conv-{NNN}
110
- rule: "{provided rule}"
111
- rationale: ""
112
- source:
113
- type: manual
114
- ref: "user-added"
115
- date: "{today ISO 8601}"
116
- applies_to: []
117
- enforcement: both
118
- scope: project
119
- status: confirmed
120
- examples:
121
- positive: ""
122
- negative: ""
123
- ```
124
- 3. Ask the user which roles this applies to (suggest common roles: backend-engineer, frontend-engineer, architect, etc.)
125
- 4. Append to `.sniper/memory/conventions.yaml`
126
- 5. Confirm addition
127
-
128
- **Add anti-pattern:**
129
- Similar flow — next `ap-XXX` ID, ask for severity (high/medium/low), ask for fix_pattern, ask for applies_to roles.
130
-
131
- **Add decision:**
132
- Similar flow — next `dec-XXX` ID, require `--rationale` flag, ask for applies_to roles, set status to active.
133
-
134
- ### 3d: Remove Operation (--remove {id})
135
-
136
- 1. Determine which file the ID belongs to (conv- → conventions, ap- → anti-patterns, dec- → decisions)
137
- 2. Find the entry by ID
138
- 3. If not found, error: `Entry {id} not found in memory.`
139
- 4. Show the entry and ask for confirmation: `Remove this entry? (y/n)`
140
- 5. If confirmed, remove from the YAML array and rewrite the file
141
- 6. Confirm removal
142
-
143
- ### 3e: Promote Operation (--promote {id})
144
-
145
- 1. Find the entry by ID (check all three files)
146
- 2. If not found or already confirmed/active, error with appropriate message
147
- 3. Change `status` from `candidate` to `confirmed` (for conventions/anti-patterns) or to `active` (for decisions)
148
- 4. Rewrite the file
149
- 5. Confirm promotion
150
-
151
- ### 3f: Export Operation (--export)
152
-
153
- 1. Create a combined export YAML:
154
- ```yaml
155
- exported_from: "{project.name}"
156
- exported_at: "{today ISO 8601}"
157
- version: "1.0"
158
-
159
- conventions:
160
- # Strip source.ref and project-specific fields
161
- # Keep: rule, applies_to, enforcement, examples
162
-
163
- anti_patterns:
164
- # Keep: description, fix_pattern, severity, applies_to
165
-
166
- decisions: [] # Decisions excluded by default (project-specific)
167
- ```
168
- 2. Write to `sniper-memory-export.yaml` in the project root
169
- 3. Report: exported {N} conventions, {M} anti-patterns
170
-
171
- ### 3g: Import Operation (--import {file})
172
-
173
- 1. Read the specified file
174
- 2. Validate it has the expected export format
175
- 3. For each entry, check for duplicates by content similarity (exact rule/description match)
176
- 4. Add non-duplicate entries with `source.type: imported`, `status: candidate`
177
- 5. Report: imported {N} conventions, {M} anti-patterns, {K} skipped (duplicates)
178
-
179
- ### 3h: Retro Operation (--retro)
180
-
181
- 1. Read `.sniper/config.yaml` to get the current sprint number
182
- 2. Read `.sniper/teams/retro.yaml` for the team definition
183
- 3. Print instructions for running the retro:
184
- ```
185
- To run a sprint retrospective:
186
-
187
- 1. The retro team will analyze sprint {N} output
188
- 2. Findings will be written to .sniper/memory/retros/sprint-{N}-retro.yaml
189
- 3. High-confidence findings will be auto-added to memory
190
-
191
- Compose the retro-analyst spawn prompt:
192
- /sniper-compose --process retro-analyst --cognitive systems-thinker --name "Retro Analyst"
193
-
194
- Then spawn the retro agent with context from:
195
- - docs/stories/ (completed stories)
196
- - docs/reviews/ (review gate results)
197
- - .sniper/memory/ (existing memory for dedup)
198
- ```
199
-
200
- ---
201
-
202
- ## Step 4: Display Results
203
-
204
- After executing the operation, display a final summary showing:
205
- - What changed (if anything)
206
- - Current memory counts
207
- - Any warnings or suggestions
208
-
209
- ---
210
-
211
- ## IMPORTANT RULES
212
-
213
- - Never delete memory files entirely — always preserve the YAML structure with empty arrays
214
- - When modifying YAML files, preserve comments and formatting where possible
215
- - Convention IDs use `conv-XXX`, anti-pattern IDs use `ap-XXX`, decision IDs use `dec-XXX` (zero-padded to 3 digits)
216
- - Always ask for confirmation before destructive operations (remove)
217
- - The `--retro` flag provides instructions but does not directly spawn agents (that requires team orchestration)
218
- - Memory files use standard YAML format — no managed section markers (those are for markdown templates)
219
- - If workspace memory exists (check config for `workspace.workspace_path`), mention it in the summary but don't modify it from this command