@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,506 +0,0 @@
1
- # /sniper-ingest -- Codebase Ingestion (Parallel Team)
2
-
3
- You are executing the `/sniper-ingest` command. Your job is to spawn a parallel team that reverse-engineers planning artifacts from an existing codebase. 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. Config Migration Check
21
-
22
- 1. Read `schema_version` from `.sniper/config.yaml`.
23
- 2. If `schema_version` is absent or less than 2, run the v1→v2 migration as defined in the Config Reader Protocol (see `plans/features/phase-a-config-schema.md`). Write the updated config before proceeding.
24
-
25
- ### 0c. Parse Arguments
26
-
27
- 1. **`--scope`:** If provided (e.g., `--scope "src/api/ src/models/"`), validate that each listed directory exists. If any directory does not exist, print a warning but continue with the directories that do exist. Store the scope list for Step 4.
28
- 2. **`--update`:** If provided, force amendment mode regardless of whether artifacts already exist.
29
-
30
- ### 0d. Verify Phase State
31
-
32
- 1. Determine the current active phase: find the last entry in `state.phase_log` where `completed_at` is null.
33
- 2. **If no active phase (all completed or empty log):** Good -- proceed.
34
- 3. **If active phase is `ingest`:** The ingest phase is already in progress.
35
- - Ask the user: "An ingest phase is already in progress ({context}). Options: (a) Resume it (b) Start a new ingestion"
36
- - If resume, STOP (they should continue in the existing session).
37
- 4. **If active phase is something else** (discover, plan, solve, sprint):
38
- - Ask the user: "You have an active {phase} phase ({context}) that hasn't completed. Options: (a) Pause it and start ingest (b) Complete {phase} first"
39
- - If (b), STOP.
40
-
41
- ### 0e. Amendment Detection
42
-
43
- 1. Check if the target artifact files already exist and are non-empty:
44
- - `docs/brief.md`
45
- - `docs/architecture.md`
46
- - `docs/conventions.md`
47
- 2. **If ANY exist AND `--update` was NOT passed:**
48
- - Ask the user: "The following artifacts already exist: {list}. Options: (a) Amend existing artifacts (b) Overwrite from scratch (c) Cancel"
49
- - If (a): Enter amendment mode. Note which files exist and their current version numbers.
50
- - If (b): Normal create mode. Agents will overwrite.
51
- - If (c): STOP.
52
- 3. **If `--update` was passed:** Enter amendment mode for any artifacts that exist.
53
- 4. **If NONE exist:** Normal create mode.
54
-
55
- ### 0f. Verify Framework Files
56
-
57
- Check that these files exist (they are needed by the team):
58
- - `.sniper/teams/ingest.yaml`
59
- - `.sniper/spawn-prompts/_template.md`
60
- - `.sniper/checklists/ingest-review.md`
61
- - `.sniper/personas/process/code-archaeologist.md`
62
- - `.sniper/personas/process/architecture-cartographer.md`
63
- - `.sniper/personas/process/convention-miner.md`
64
- - `.sniper/personas/cognitive/systems-thinker.md`
65
- - `.sniper/templates/brief.md`
66
- - `.sniper/templates/architecture.md`
67
- - `.sniper/templates/conventions.md`
68
-
69
- If any are missing, print a warning listing the missing files but continue if at least the team YAML exists.
70
-
71
- ---
72
-
73
- ## Step 1: Update Lifecycle State
74
-
75
- Edit `.sniper/config.yaml` to update the state section:
76
-
77
- 1. Append to `state.phase_log`:
78
- ```yaml
79
- - phase: ingest
80
- context: "{scope if --scope provided, otherwise 'full-codebase'}{' (update)' if amendment mode}"
81
- started_at: "{current ISO timestamp}"
82
- completed_at: null
83
- approved_by: null
84
- ```
85
-
86
- ---
87
-
88
- ## Step 2: Read Team Definition
89
-
90
- 1. Read `.sniper/teams/ingest.yaml` in full.
91
- 2. Parse out:
92
- - `team_name` (should be `sniper-ingest`)
93
- - The list of `teammates` with their `name`, `compose` layers, and `tasks`
94
- - The `coordination` rules (should be empty -- all tasks are independent)
95
- - The `review_gate` section (checklist path and mode)
96
- 3. Store these values for subsequent steps.
97
-
98
- ---
99
-
100
- ## Step 3: Read Project Context
101
-
102
- Gather the context that teammates will need:
103
-
104
- 1. Read `.sniper/config.yaml` fully -- extract `project.name`, `project.description`, `project.type`, `stack`, and `ownership` sections.
105
- 2. Get the project's directory tree by listing top-level directories and key files. If `--scope` was provided, focus the tree listing on those directories.
106
- 3. Read `package.json` / `pyproject.toml` / `Cargo.toml` (whichever exists) -- this gives agents dependency context.
107
- 4. If `README.md` exists, note its location for agents to read.
108
-
109
- ---
110
-
111
- ## Step 4: Compose Spawn Prompts
112
-
113
- 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.
114
-
115
- ### Teammate: code-archaeologist
116
-
117
- 1. Read these persona layer files:
118
- - Process: `.sniper/personas/process/code-archaeologist.md`
119
- - Technical: SKIP (null in team YAML)
120
- - Cognitive: `.sniper/personas/cognitive/systems-thinker.md`
121
-
122
- 2. Read the spawn prompt template: `.sniper/spawn-prompts/_template.md`
123
-
124
- 3. Assemble the spawn prompt by filling the template:
125
- - `{name}` = "code-archaeologist"
126
- - `{process_layer}` = contents of the process persona file
127
- - `{technical_layer}` = "No specific technical lens for this role."
128
- - `{cognitive_layer}` = contents of the cognitive persona file
129
- - `{domain_layer}` = "No domain pack configured."
130
- - `{ownership}` = the `docs` ownership paths from `config.yaml`
131
-
132
- 4. Append to the spawn prompt:
133
- ```
134
- ## Your Task
135
- **Task ID:** project-brief
136
- **Task Name:** Reverse-engineer Project Brief
137
- **Output File:** docs/brief.md
138
- **Template:** .sniper/templates/brief.md
139
-
140
- {task description from the team YAML}
141
-
142
- ## Project Context
143
- - **Project:** {project.name}
144
- - **Type:** {project.type}
145
- - **Description:** {project.description}
146
- - **Stack:** {summary of stack section}
147
- {if --scope: "- **Scope:** Only analyze these directories: {scope list}"}
148
-
149
- ## Key Files to Read
150
- - `package.json` / `pyproject.toml` / `Cargo.toml` (project metadata, dependencies)
151
- - `README.md` (if exists)
152
- - Top-level directory structure
153
- - Key entry points (`src/index.ts`, `src/main.py`, `app/`, etc.)
154
- - CI/CD configs (`.github/workflows/`, `Dockerfile`, etc.)
155
- - Environment files (`.env.example`, NOT `.env`)
156
-
157
- ## Instructions (Create Mode -- when docs/brief.md does NOT exist)
158
- 1. Read the template at `.sniper/templates/brief.md` to understand the expected output format.
159
- 2. Read the codebase to understand what this project does, what problem it solves, and who uses it.
160
- 3. Produce the artifact at `docs/brief.md` following the template exactly.
161
- 4. This is a REVERSE-ENGINEERING exercise: describe what IS, not what SHOULD BE.
162
- 5. For sections you cannot infer from code, write "Unable to determine from codebase analysis."
163
- 6. Every section in the template MUST be filled -- no empty sections.
164
- 7. When complete, message the team lead that your task is done.
165
-
166
- ## Instructions (Amendment Mode -- when docs/brief.md already exists)
167
- 1. Read the EXISTING artifact at `docs/brief.md` first. Note its current version number.
168
- 2. Read the template at `.sniper/templates/brief.md` to understand the expected format.
169
- 3. AMEND the existing brief: update sections that need changes, add new information, preserve content outside managed sections (<!-- sniper:managed --> markers).
170
- 4. Increment the version number in the header (e.g., v1 -> v2).
171
- 5. Add a changelog entry describing what changed.
172
- 6. Set Status back to "Draft" (even if it was previously "Approved").
173
- 7. When complete, message the team lead that your task is done.
174
- ```
175
-
176
- 5. Save this composed prompt as a variable for spawning.
177
-
178
- ### Teammate: architecture-cartographer
179
-
180
- 1. Read these persona layer files:
181
- - Process: `.sniper/personas/process/architecture-cartographer.md`
182
- - Technical: `.sniper/personas/technical/backend.md`
183
- - Cognitive: `.sniper/personas/cognitive/systems-thinker.md`
184
-
185
- 2. Assemble using the same template pattern:
186
- - `{name}` = "architecture-cartographer"
187
- - `{technical_layer}` = contents of the backend technical persona
188
- - `{ownership}` = the `docs` ownership paths
189
-
190
- 3. Append task context:
191
- ```
192
- ## Your Task
193
- **Task ID:** system-architecture
194
- **Task Name:** Reverse-engineer System Architecture
195
- **Output File:** docs/architecture.md
196
- **Template:** .sniper/templates/architecture.md
197
-
198
- {task description from the team YAML}
199
-
200
- ## Project Context
201
- - **Project:** {project.name}
202
- - **Type:** {project.type}
203
- - **Description:** {project.description}
204
- - **Stack:** {summary of stack section}
205
- {if --scope: "- **Scope:** Only analyze these directories: {scope list}"}
206
-
207
- ## Key Files to Read
208
- - Full directory tree (to map component boundaries)
209
- - Database schemas / migrations / ORM models
210
- - API route definitions (Express routes, FastAPI endpoints, etc.)
211
- - Configuration files (database connections, cache, queue configs)
212
- - Infrastructure files (Docker, Terraform, K8s manifests)
213
- - Key service files (to understand component responsibilities)
214
- - Dependency graph (imports between modules)
215
-
216
- ## Instructions (Create Mode)
217
- 1. Read the template at `.sniper/templates/architecture.md` to understand the expected output format.
218
- 2. Map the complete technical architecture from the source code.
219
- 3. Produce a component diagram (ASCII or Mermaid) of the system AS BUILT.
220
- 4. Document data models with actual field names, types, and relationships.
221
- 5. Document API contracts with actual endpoint paths, methods, and request/response shapes.
222
- 6. Note technical debt and inconsistencies: "Pattern inconsistency found: {detail}".
223
- 7. Do NOT hallucinate components -- only document what you can trace to actual code.
224
- 8. Write the output to `docs/architecture.md` following the template exactly.
225
- 9. When complete, message the team lead that your task is done.
226
-
227
- ## Instructions (Amendment Mode)
228
- 1. Read the EXISTING artifact at `docs/architecture.md` first. Note its current version number.
229
- 2. Read the template at `.sniper/templates/architecture.md` to understand the expected format.
230
- 3. AMEND the existing architecture: update components, data models, APIs that have changed. Preserve content outside managed sections.
231
- 4. Increment the version number in the header.
232
- 5. Add a changelog entry describing what changed.
233
- 6. Set Status back to "Draft".
234
- 7. When complete, message the team lead that your task is done.
235
- ```
236
-
237
- ### Teammate: convention-miner
238
-
239
- 1. Read these persona layer files:
240
- - Process: `.sniper/personas/process/convention-miner.md`
241
- - Technical: SKIP (null)
242
- - Cognitive: `.sniper/personas/cognitive/systems-thinker.md`
243
-
244
- 2. Assemble using the same template pattern:
245
- - `{name}` = "convention-miner"
246
- - `{technical_layer}` = "No specific technical lens for this role."
247
- - `{ownership}` = ALL ownership paths (this agent updates them)
248
-
249
- 3. Append task context:
250
- ```
251
- ## Your Task
252
- **Task ID:** conventions
253
- **Task Name:** Extract Coding Conventions
254
- **Output File:** docs/conventions.md AND updates to .sniper/config.yaml (ownership section)
255
- **Template:** .sniper/templates/conventions.md
256
-
257
- {task description from the team YAML}
258
-
259
- ## Project Context
260
- - **Project:** {project.name}
261
- - **Type:** {project.type}
262
- - **Description:** {project.description}
263
- - **Stack:** {summary of stack section}
264
- {if --scope: "- **Scope:** Only analyze these directories: {scope list}"}
265
-
266
- ## Key Files to Read
267
- - Linter/formatter configs: `.eslintrc*`, `.prettierrc*`, `tsconfig*`, `ruff.toml`, `pyproject.toml`
268
- - At least 5-10 representative source files from different parts of the codebase
269
- - Test files (to understand test patterns)
270
- - The full directory tree (to update ownership paths)
271
-
272
- ## Instructions (Create Mode)
273
- 1. Read the template at `.sniper/templates/conventions.md` to understand the expected output format.
274
- 2. Sample multiple files (at least 5-10) from different directories.
275
- 3. For each convention category, identify the dominant pattern (appears in 80%+ of relevant files).
276
- 4. Every convention MUST cite a real code example with file path and code snippet.
277
- 5. If patterns are inconsistent, document BOTH patterns and note the inconsistency.
278
- 6. Write the output to `docs/conventions.md` following the template exactly.
279
- 7. ALSO update `.sniper/config.yaml` ownership section:
280
- - Read the actual project directory structure.
281
- - Replace the template default ownership paths with paths that match the real project layout.
282
- - Categorize directories into: backend, frontend, shared, infrastructure, tests, docs.
283
- - Only include directories that actually exist.
284
- 8. When complete, message the team lead that your task is done.
285
-
286
- ## Instructions (Amendment Mode)
287
- 1. Read the EXISTING artifact at `docs/conventions.md` first. Note its current version number.
288
- 2. Read the template at `.sniper/templates/conventions.md` to understand the expected format.
289
- 3. AMEND the existing conventions: update patterns that have changed, add newly discovered conventions, preserve content outside managed sections.
290
- 4. Re-check the `.sniper/config.yaml` ownership paths and update if the directory structure has changed.
291
- 5. Increment the version number in the header.
292
- 6. Add a changelog entry describing what changed.
293
- 7. Set Status back to "Draft".
294
- 8. When complete, message the team lead that your task is done.
295
- ```
296
-
297
- ---
298
-
299
- ## Step 5: Create the Agent Team
300
-
301
- Use the TeamCreate tool to create the team:
302
-
303
- ```
304
- TeamCreate:
305
- team_name: "sniper-ingest"
306
- description: "SNIPER Codebase Ingestion for {project.name}"
307
- ```
308
-
309
- ---
310
-
311
- ## Step 6: Create Tasks in the Shared Task List
312
-
313
- Create one task per teammate using TaskCreate. All tasks are independent -- no dependencies.
314
-
315
- ### Task 1: Project Brief
316
-
317
- ```
318
- TaskCreate:
319
- subject: "Reverse-engineer Project Brief"
320
- description: "Read the codebase and produce docs/brief.md capturing what this project does, what problem it solves, who uses it, and its current scope. Focus on what IS, not what SHOULD BE. Follow template at .sniper/templates/brief.md."
321
- activeForm: "Reverse-engineering project brief from codebase"
322
- ```
323
-
324
- ### Task 2: System Architecture
325
-
326
- ```
327
- TaskCreate:
328
- subject: "Reverse-engineer System Architecture"
329
- description: "Map the complete technical architecture from source code. Produce docs/architecture.md with component diagrams, data models, API contracts, infrastructure topology, and cross-cutting concerns. Document the system AS BUILT. Follow template at .sniper/templates/architecture.md."
330
- activeForm: "Mapping system architecture from source code"
331
- ```
332
-
333
- ### Task 3: Coding Conventions
334
-
335
- ```
336
- TaskCreate:
337
- subject: "Extract Coding Conventions"
338
- description: "Analyze the codebase to extract coding conventions with real code examples. Produce docs/conventions.md AND update .sniper/config.yaml ownership paths to match actual project structure. Follow template at .sniper/templates/conventions.md."
339
- activeForm: "Extracting coding conventions and patterns"
340
- ```
341
-
342
- No dependencies between tasks -- all three run in parallel.
343
-
344
- ---
345
-
346
- ## Step 7: Spawn Teammates
347
-
348
- Spawn each teammate using the Task tool. Use the composed spawn prompts from Step 4.
349
-
350
- For each teammate, spawn using:
351
- - `team_name`: "sniper-ingest"
352
- - `name`: the teammate name from the YAML (code-archaeologist, architecture-cartographer, convention-miner)
353
- - The full composed spawn prompt as the instruction
354
-
355
- Spawn all three teammates. They will work in parallel on their independent tasks.
356
-
357
- After spawning, assign each task to its corresponding teammate using TaskUpdate with the `owner` field:
358
- - Task 1 (Project Brief) -> owner: "code-archaeologist"
359
- - Task 2 (System Architecture) -> owner: "architecture-cartographer"
360
- - Task 3 (Coding Conventions) -> owner: "convention-miner"
361
-
362
- Mark each task as `in_progress` via TaskUpdate.
363
-
364
- ---
365
-
366
- ## Step 8: Enter Delegate Mode
367
-
368
- **You are now the team lead. You do NOT produce artifacts.**
369
-
370
- Your responsibilities during execution:
371
- 1. Monitor task progress via TaskList
372
- 2. Respond to teammate messages (questions, blockers, completion notifications)
373
- 3. If a teammate asks about project structure or where to find files, provide guidance from the project context
374
- 4. If a teammate finishes early, acknowledge their completion and update their task status to `completed`
375
- 5. Track which teammates have completed their work
376
-
377
- **Do NOT:**
378
- - Write to `docs/brief.md`, `docs/architecture.md`, or `docs/conventions.md` yourself
379
- - Modify teammate artifacts
380
- - Analyze the codebase yourself
381
-
382
- Wait for all three teammates to report completion.
383
-
384
- ---
385
-
386
- ## Step 9: Verify Artifacts Exist
387
-
388
- Once all three teammates report completion:
389
-
390
- 1. Verify these files exist and are non-empty:
391
- - `docs/brief.md`
392
- - `docs/architecture.md`
393
- - `docs/conventions.md`
394
-
395
- 2. Verify the ownership section in `.sniper/config.yaml` has been updated (paths should not match the template defaults unless the project happens to use the default structure).
396
-
397
- 3. If any file is missing or empty, message the responsible teammate and ask them to complete it.
398
-
399
- 4. Do NOT proceed to Step 10 until all three files exist and contain content.
400
-
401
- ---
402
-
403
- ## Step 10: Run Review Gate
404
-
405
- Read the review gate configuration from the team YAML: `review_gate.mode` and `review_gate.checklist`.
406
-
407
- 1. Read the review checklist at `.sniper/checklists/ingest-review.md`.
408
- 2. For each checklist item, perform a quick evaluation by reading the relevant artifact and checking if the item is addressed.
409
- 3. Compile a review summary with:
410
- - Total checklist items
411
- - Items that PASS
412
- - Items that NEED ATTENTION (not fully met but not blocking)
413
- - Items that FAIL (critical gaps)
414
-
415
- ### Gate Decision
416
-
417
- The ingest gate mode is **flexible**:
418
-
419
- - **If there are no FAIL items:** Auto-advance. Print the review summary and note any NEED ATTENTION items for async review.
420
- - **If there are FAIL items:** Present the failures to the user and ask:
421
- > "The ingestion review found {N} critical issues. Would you like to:
422
- > 1. Have the team fix the issues (I will message the relevant teammates)
423
- > 2. Override and advance anyway
424
- > 3. Stop and review manually"
425
-
426
- If option 1: Message the relevant teammates with specific feedback, wait for fixes, then re-run the checklist.
427
- If option 2: Proceed with a note that issues were overridden.
428
- If option 3: STOP and let the user handle it.
429
-
430
- ---
431
-
432
- ## Step 11: Update State and Shut Down Team
433
-
434
- ### Update Lifecycle State
435
-
436
- Edit `.sniper/config.yaml`:
437
-
438
- 1. Update artifact tracking (increment version if amendment mode):
439
- - Set `state.artifacts.brief.status: draft` and increment `state.artifacts.brief.version`
440
- - Set `state.artifacts.architecture.status: draft` and increment `state.artifacts.architecture.version`
441
- - Set `state.artifacts.conventions.status: draft` and increment `state.artifacts.conventions.version`
442
- 2. Update the ingest entry in `state.phase_log` to add `completed_at: "{current ISO timestamp}"`
443
- 3. If auto-advanced (flexible gate passed), set `approved_by: "auto-flexible"`
444
-
445
- ### Shut Down Teammates
446
-
447
- Send a shutdown request to each teammate:
448
- - Send shutdown_request to "code-archaeologist"
449
- - Send shutdown_request to "architecture-cartographer"
450
- - Send shutdown_request to "convention-miner"
451
-
452
- Wait for all teammates to acknowledge shutdown.
453
-
454
- ---
455
-
456
- ## Step 12: Present Results and Next Steps
457
-
458
- Print a formatted summary:
459
-
460
- ```
461
- ============================================
462
- SNIPER Codebase Ingestion Complete
463
- ============================================
464
-
465
- Artifacts Produced:
466
- - docs/brief.md [draft] {v1 or vN}
467
- - docs/architecture.md [draft] {v1 or vN}
468
- - docs/conventions.md [draft] {v1 or vN}
469
-
470
- Config Updated:
471
- - ownership paths updated to match project structure
472
-
473
- Review Gate: FLEXIBLE
474
- Passed: {count}/{total} checklist items
475
- Attention: {count} items flagged for async review
476
- Failed: {count} critical issues
477
-
478
- Phase Duration: {time elapsed}
479
-
480
- ============================================
481
- Next Steps
482
- ============================================
483
-
484
- 1. Review the ingested artifacts in `docs/`
485
- 2. These artifacts provide the foundation for:
486
- - /sniper-feature -- add incremental features using the architecture as reference
487
- - /sniper-discover -- run discovery if you want market/risk/persona analysis
488
- - /sniper-plan -- run planning if you want a PRD and UX spec
489
- - /sniper-audit -- audit the codebase using the architecture as baseline
490
- 3. Run /sniper-status to see the full lifecycle state
491
-
492
- ============================================
493
- ```
494
-
495
- ---
496
-
497
- ## IMPORTANT RULES
498
-
499
- - You are the LEAD. You coordinate. You do NOT write artifact files.
500
- - All three teammates work in PARALLEL -- do not serialize their work.
501
- - 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.
502
- - If `$ARGUMENTS` contains "skip-review", skip Step 10 and go straight to Step 11.
503
- - 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.
504
- - All file paths are relative to the project root.
505
- - Do NOT proceed to other phases automatically -- always let the user initiate the next command.
506
- - The convention-miner modifies `.sniper/config.yaml` (ownership section only). This is the ONLY case where a teammate modifies config. Warn the team lead to verify the ownership update after completion.