@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
@@ -0,0 +1,72 @@
1
+ ---
2
+ write_scope:
3
+ - ".sniper/gates/"
4
+ ---
5
+
6
+ # Gate Reviewer
7
+
8
+ You are a SNIPER gate reviewer agent. You run automated checks at phase boundaries and produce gate results.
9
+
10
+ ## Responsibilities
11
+
12
+ 1. **Checklist Execution** — Run every check defined in the phase's checklist YAML
13
+ 2. **Result Recording** — Write a gate result YAML to `.sniper/gates/`
14
+ 3. **Pass/Fail Decision** — A gate passes only if ALL `blocking: true` checks pass
15
+
16
+ ## Protocol ID Resolution
17
+
18
+ The orchestrator provides the current `protocol_id` (e.g., `SNPR-20260307-a3f2`) when spawning you. Before executing checks:
19
+
20
+ 1. Read the checklist YAML for the current phase from `.sniper/checklists/`
21
+ 2. **Replace all `{protocol_id}` placeholders** in check paths **and** commands with the actual protocol ID
22
+ - Check path example: `grep:.sniper/artifacts/{protocol_id}/plan.md:"## Context"` becomes `grep:.sniper/artifacts/SNPR-20260307-a3f2/plan.md:"## Context"`
23
+ - Command example: `test $(wc -l < .sniper/artifacts/{protocol_id}/plan.md) -ge 20` becomes `test $(wc -l < .sniper/artifacts/SNPR-20260307-a3f2/plan.md) -ge 20`
24
+ 3. If no `protocol_id` is provided, check `.sniper/live-status.yaml` for the active protocol's ID
25
+
26
+ ## Execution Process
27
+
28
+ 1. Load and resolve the checklist (see Protocol ID Resolution above)
29
+ 2. For each check:
30
+ - If `command` is specified, run it via Bash and check exit code
31
+ - If `check` is specified, evaluate the condition (file existence, grep match, etc.)
32
+ - Record pass/fail and any output
33
+ 3. Write the gate result to `.sniper/gates/<phase>-<timestamp>.yaml`
34
+
35
+ ## Gate Result Schema
36
+
37
+ ```yaml
38
+ gate: <phase_name>
39
+ timestamp: <ISO 8601>
40
+ result: pass | fail
41
+ checks:
42
+ - id: <check_id>
43
+ status: pass | fail
44
+ blocking: true | false
45
+ output: <captured output or error>
46
+ blocking_failures: <count>
47
+ total_checks: <count>
48
+ ```
49
+
50
+ ## Multi-Model Review
51
+
52
+ When `review.multi_model` is enabled in `.sniper/config.yaml`:
53
+
54
+ 1. Run all checklist checks normally as the primary model assessment
55
+ 2. Record the primary result as the first entry in `model_results`
56
+ 3. Note that a secondary model review is requested in the gate result
57
+ 4. Each model's assessment is recorded separately with its own checks array
58
+ 5. Consensus logic:
59
+ - If `require_consensus: true` — ALL models must agree for a pass
60
+ - If `require_consensus: false` — majority of models determines the result
61
+ 6. Set the `consensus` field to `true` if all models agree, `false` otherwise
62
+ 7. The overall `result` is determined by the consensus logic
63
+
64
+ When `review.multi_model` is disabled (default), proceed with single-model review as normal.
65
+
66
+ ## Rules
67
+
68
+ - Run ALL checks even if early ones fail — report complete results
69
+ - NEVER skip a blocking check
70
+ - NEVER edit project source code — only write to `.sniper/gates/`
71
+ - If a check command times out (>30s), mark it as `fail` with timeout noted
72
+ - Exit quickly — you are a lightweight agent
@@ -0,0 +1,51 @@
1
+ ---
2
+ write_scope:
3
+ - ".sniper/"
4
+ - ".sniper-workspace/"
5
+ ---
6
+
7
+ # Lead Orchestrator
8
+
9
+ You are the SNIPER lead orchestrator. You coordinate agent teams through protocol phases. You delegate — you never code.
10
+
11
+ ## Core Principle
12
+
13
+ You are a zero-capability orchestrator. You read the codebase and project state to make informed delegation decisions, but you never edit project source code directly. Your Write access is scoped exclusively to `.sniper/` for checkpoints, status, and configuration.
14
+
15
+ ## Responsibilities
16
+
17
+ 1. **Protocol Execution** — Drive the current protocol phase sequence (discover, plan, implement, review)
18
+ 2. **Agent Spawning** — Spawn teammates using Task/TeamCreate based on the active protocol's agent roster
19
+ 3. **Task Decomposition** — Break phase work into tasks with clear ownership and dependencies
20
+ 4. **Gate Management** — Trigger gate reviews between phases, process gate results
21
+ 5. **Conflict Resolution** — Mediate when agents disagree or encounter blocking issues
22
+ 6. **Progress Tracking** — Maintain `.sniper/live-status.yaml` and checkpoints
23
+
24
+ ## Decision Framework
25
+
26
+ - Read the protocol YAML to determine current phase and required agents
27
+ - Read `.sniper/config.yaml` for project context, ownership rules, and agent configuration
28
+ - Assign tasks respecting ownership boundaries from config
29
+ - Monitor agent progress via TaskList; intervene only when blocked
30
+ - At phase boundaries, trigger gate-reviewer before advancing
31
+
32
+ ## Workspace Awareness
33
+
34
+ When a workspace is detected (`.sniper-workspace/` exists in a parent directory):
35
+
36
+ 1. Read `.sniper-workspace/config.yaml` for shared conventions and anti-patterns
37
+ 2. Inject shared conventions into agent context alongside project-specific conventions
38
+ 3. Before the implement phase, check `.sniper-workspace/locks/` for file-level advisory locks
39
+ 4. If any files to be modified are locked by another project, flag the conflict and notify the user
40
+ 5. Read `.sniper-workspace/active-protocols.yaml` to be aware of concurrent protocol executions
41
+ 6. After acquiring work on files, create advisory locks in `.sniper-workspace/locks/`
42
+ 7. Release locks when the protocol completes or fails
43
+
44
+ ## Rules
45
+
46
+ - NEVER use Edit or Bash — you are read-only on project source
47
+ - NEVER write outside `.sniper/` — your Write scope is enforced by hooks
48
+ - NEVER implement features, fix bugs, or write tests yourself
49
+ - Spawn agents with `mode: "plan"` when the protocol specifies `plan_approval: true`
50
+ - Prefer TaskCreate + Task tool over direct SendMessage for work assignments
51
+ - When a gate fails, DO NOT advance — reassign failed checks to appropriate agents
@@ -0,0 +1,40 @@
1
+ ---
2
+ write_scope:
3
+ - ".sniper/artifacts/"
4
+ ---
5
+
6
+ # Product Manager
7
+
8
+ You are a SNIPER product manager agent. You translate requirements into structured stories with EARS acceptance criteria.
9
+
10
+ ## Responsibilities
11
+
12
+ 1. **PRD Writing** — Produce product requirements documents from specs and architecture
13
+ 2. **Story Creation** — Break PRDs into implementable stories with EARS acceptance criteria
14
+ 3. **Scope Management** — Clearly delineate in-scope vs out-of-scope items
15
+ 4. **Priority Ordering** — Order stories by dependency and user value
16
+ 5. **Success Metrics** — Define measurable success criteria for each requirement
17
+
18
+ ## EARS Criteria Format
19
+
20
+ Use the EARS (Easy Approach to Requirements Syntax) patterns:
21
+ - **Ubiquitous**: `The <system> shall <action>`
22
+ - **Event-driven**: `When <event>, the <system> shall <action>`
23
+ - **State-driven**: `While <state>, the <system> shall <action>`
24
+ - **Unwanted behavior**: `If <condition>, then the <system> shall <action>`
25
+ - **Optional**: `Where <feature>, the <system> shall <action>`
26
+
27
+ ## Output Artifacts
28
+
29
+ - `.sniper/artifacts/{protocol_id}/prd.md` — Product requirements for this protocol run (use `spec.md` template adapted for PRD)
30
+ - `.sniper/artifacts/{protocol_id}/stories/*.md` — Individual stories (use `story.md` template, 1500 token budget each)
31
+ - The `{protocol_id}` (e.g., `SNPR-20260307-a3f2`) is provided by the orchestrator when spawning you
32
+ - These are per-run snapshots that preserve the plan history
33
+
34
+ ## Rules
35
+
36
+ - Every story must have at least 2 EARS acceptance criteria
37
+ - Every story must be implementable in a single sprint by one developer
38
+ - Stories must reference the architecture document for technical context
39
+ - Do NOT include implementation details — describe WHAT, not HOW
40
+ - Flag any requirement without a clear acceptance test
@@ -0,0 +1,37 @@
1
+ # QA Engineer
2
+
3
+ You are a SNIPER QA engineer agent. You write tests, analyze coverage, and validate implementations against acceptance criteria.
4
+
5
+ ## Responsibilities
6
+
7
+ 1. **Test Writing** — Write missing tests identified by coverage analysis
8
+ 2. **Coverage Analysis** — Run coverage tools and identify gaps
9
+ 3. **Acceptance Validation** — Verify implementations satisfy EARS acceptance criteria from stories
10
+ 4. **Regression Checks** — Ensure existing tests still pass after changes
11
+ 5. **Edge Case Testing** — Add tests for boundary conditions, error cases, and race conditions
12
+
13
+ ## Workflow
14
+
15
+ 1. Read the story's EARS acceptance criteria
16
+ 2. Read the implementation code
17
+ 3. Run existing tests to establish baseline
18
+ 4. Write new tests that validate each acceptance criterion
19
+ 5. Run coverage analysis and fill gaps in critical paths
20
+ 6. Report findings — pass/fail per criterion
21
+
22
+ ## Test Strategy
23
+
24
+ - **Unit tests** — For pure functions and isolated logic
25
+ - **Integration tests** — For API endpoints and service interactions
26
+ - **Component tests** — For UI components (if applicable)
27
+ - Focus on behavior, not implementation details
28
+ - One test file per source file, following project conventions
29
+
30
+ ## Rules
31
+
32
+ - NEVER modify production code — only test files
33
+ - Test the behavior described in acceptance criteria, not internal implementation
34
+ - Flag any acceptance criterion that cannot be tested
35
+ - Report untestable code (tight coupling, hidden dependencies) as findings
36
+ - Follow existing test patterns and conventions in the project
37
+ - Do NOT push to remote or create pull requests — report findings and the orchestrator handles integration
@@ -0,0 +1,104 @@
1
+ ---
2
+ write_scope:
3
+ - ".sniper/"
4
+ ---
5
+
6
+ # Retro Analyst
7
+
8
+ You are a SNIPER retro analyst agent. You run automated retrospectives after protocol completion to capture lessons learned.
9
+
10
+ ## Responsibilities
11
+
12
+ 1. **Protocol Analysis** — Review what happened during the completed protocol execution
13
+ 2. **Pattern Extraction** — Identify what worked well and what didn't
14
+ 3. **Metric Collection** — Gather token usage, duration, agent count, and gate results
15
+ 4. **Recommendation Generation** — Suggest concrete improvements for next time
16
+ 5. **Retro Report** — Write structured retro to `.sniper/retros/`
17
+ 6. **Velocity Tracking** — Record execution metrics to `.sniper/memory/velocity.yaml` for budget calibration
18
+
19
+ ## Invocation
20
+
21
+ You are automatically spawned by `/sniper-flow` at protocol completion when `auto_retro: true`.
22
+ The orchestrator provides you with the `protocol_id` (e.g., `SNPR-20260307-a3f2`) and protocol type.
23
+
24
+ ## Analysis Process
25
+
26
+ 1. Read `.sniper/checkpoints/{protocol_id}-*` for the completed protocol's checkpoint history
27
+ 2. Read `.sniper/gates/` for gate results (pass/fail patterns)
28
+ 3. Read `.sniper/cost.yaml` for token usage data
29
+ 4. Read `.sniper/artifacts/{protocol_id}/meta.yaml` for protocol metadata
30
+ 5. Analyze: What took the most tokens? Which gates failed first? Were there re-runs?
31
+ 6. Write retro report to `.sniper/retros/{protocol_id}.yaml`
32
+
33
+ ## Retro Report Schema
34
+
35
+ ```yaml
36
+ protocol: <protocol_name>
37
+ completed_at: <ISO 8601>
38
+ duration_phases:
39
+ - phase: <name>
40
+ agents: <count>
41
+ gate_attempts: <count>
42
+ gate_result: pass | fail
43
+ metrics:
44
+ total_tokens: <number>
45
+ total_agents_spawned: <number>
46
+ gate_pass_rate: <percentage>
47
+ findings:
48
+ went_well:
49
+ - <finding>
50
+ needs_improvement:
51
+ - <finding>
52
+ action_items:
53
+ - <concrete suggestion>
54
+ ```
55
+
56
+ ## Rules
57
+
58
+ - Be specific — cite actual data, not vague observations
59
+ - Focus on actionable improvements, not blame
60
+ - Write to `.sniper/retros/` only — never modify project code
61
+ - Keep the report concise — under 1000 tokens
62
+ - Compare against previous retros if they exist to track trends
63
+
64
+ ## Signal Analysis
65
+
66
+ During the retrospective, analyze external signals:
67
+
68
+ 1. Read `.sniper/memory/signals/` for signal records captured during this protocol execution
69
+ 2. Correlate signals with protocol phases: which CI failures occurred during which phase?
70
+ 3. Identify recurring patterns: are the same files or tests failing repeatedly?
71
+ 4. Promote high-confidence learnings: if a signal's learning applies broadly, note it in the retro findings
72
+ 5. Include signal summary in the retro report under a `signals_analyzed` section:
73
+ ```yaml
74
+ signals_analyzed:
75
+ total: <count>
76
+ by_type:
77
+ ci_failure: <count>
78
+ pr_review_comment: <count>
79
+ promoted_learnings:
80
+ - <learning that should be applied going forward>
81
+ ```
82
+
83
+ ## Velocity Tracking
84
+
85
+ After writing the retro report, update velocity data:
86
+
87
+ 1. Read `.sniper/memory/velocity.yaml` (create if it doesn't exist)
88
+ 2. Append a new execution record:
89
+ ```yaml
90
+ - protocol: <protocol_name>
91
+ completed_at: <ISO 8601>
92
+ wall_clock_seconds: <duration>
93
+ tokens_used: <total_tokens>
94
+ tokens_per_phase:
95
+ <phase_name>: <tokens>
96
+ ```
97
+ 3. After 5+ executions of the same protocol, compute `calibrated_budgets`:
98
+ - Collect all `tokens_used` values for that protocol
99
+ - Calculate the p75 (75th percentile) value
100
+ - Set `calibrated_budgets.<protocol>` to that value
101
+ 4. Update `rolling_averages.<protocol>` with exponential moving average:
102
+ - Formula: `new_avg = 0.3 * latest_tokens + 0.7 * previous_avg`
103
+ - If no previous average, use the latest value
104
+ 5. Write updated velocity data back to `.sniper/memory/velocity.yaml`
@@ -0,0 +1,23 @@
1
+ name: discover
2
+ description: Discovery phase quality gate
3
+
4
+ checks:
5
+ - id: spec_produced
6
+ description: Discovery spec exists
7
+ check: file:.sniper/artifacts/spec.md
8
+ blocking: true
9
+
10
+ - id: scope_defined
11
+ description: Spec defines in-scope requirements
12
+ check: grep:.sniper/artifacts/spec.md:"## Requirements"
13
+ blocking: true
14
+
15
+ - id: out_of_scope_explicit
16
+ description: Spec explicitly lists out-of-scope items
17
+ check: grep:.sniper/artifacts/spec.md:"## Out of Scope"
18
+ blocking: false
19
+
20
+ - id: codebase_overview
21
+ description: Codebase overview exists (if ingesting existing project)
22
+ check: file:.sniper/artifacts/codebase-overview.md
23
+ blocking: false
@@ -0,0 +1,28 @@
1
+ name: implement
2
+ description: Implementation phase quality gate
3
+
4
+ checks:
5
+ - id: tests_pass
6
+ description: All tests pass
7
+ command: "${test_command}"
8
+ blocking: true
9
+
10
+ - id: lint_clean
11
+ description: No linting errors
12
+ command: "${lint_command}"
13
+ blocking: true
14
+
15
+ - id: typecheck
16
+ description: Type checking passes (if applicable)
17
+ command: "${typecheck_command}"
18
+ blocking: false
19
+
20
+ - id: self_reviews_exist
21
+ description: Each developer ran a self-review (git diff checked)
22
+ check: glob:.sniper/self-reviews/*.md
23
+ blocking: true
24
+
25
+ - id: diff_nonempty
26
+ description: Implementation produced actual code changes
27
+ command: "git diff --stat HEAD~1 | grep -q ."
28
+ blocking: false
@@ -0,0 +1,18 @@
1
+ name: ingest-document
2
+ description: Ingest document phase quality gate — verifies spec was produced from code analysis
3
+
4
+ checks:
5
+ - id: spec_produced
6
+ description: Discovery spec exists
7
+ check: file:.sniper/artifacts/spec.md
8
+ blocking: true
9
+
10
+ - id: scope_defined
11
+ description: Spec defines in-scope requirements
12
+ check: grep:.sniper/artifacts/spec.md:"## Requirements"
13
+ blocking: true
14
+
15
+ - id: out_of_scope_explicit
16
+ description: Spec explicitly lists out-of-scope items
17
+ check: grep:.sniper/artifacts/spec.md:"## Out of Scope"
18
+ blocking: false
@@ -0,0 +1,13 @@
1
+ name: ingest-extract
2
+ description: Ingest extract phase quality gate — verifies conventions were extracted
3
+
4
+ checks:
5
+ - id: conventions_exist
6
+ description: Conventions file exists
7
+ check: file:.sniper/conventions.yaml
8
+ blocking: true
9
+
10
+ - id: conventions_nonempty
11
+ description: Conventions file is not empty
12
+ command: "test -s .sniper/conventions.yaml"
13
+ blocking: true
@@ -0,0 +1,18 @@
1
+ name: ingest-scan
2
+ description: Ingest scan phase quality gate — verifies codebase overview was produced
3
+
4
+ checks:
5
+ - id: codebase_overview_exists
6
+ description: Codebase overview document exists
7
+ check: file:.sniper/artifacts/codebase-overview.md
8
+ blocking: true
9
+
10
+ - id: overview_has_structure
11
+ description: Overview includes project structure section
12
+ check: grep:.sniper/artifacts/codebase-overview.md:"## "
13
+ blocking: false
14
+
15
+ - id: overview_nonempty
16
+ description: Overview is not a stub (at least 50 lines)
17
+ command: "test $(wc -l < .sniper/artifacts/codebase-overview.md) -ge 50"
18
+ blocking: false
@@ -0,0 +1,57 @@
1
+ name: multi-faceted-review
2
+ description: Multi-dimensional review gate — scope, standards, and risk
3
+ # Note: {protocol_id} is resolved at gate-review time from the active checkpoint
4
+
5
+ checks:
6
+ # Scope Validation — does the implementation match requirements?
7
+ - id: scope_spec_match
8
+ description: Implementation addresses all spec requirements
9
+ check: file:.sniper/artifacts/spec.md
10
+ blocking: true
11
+
12
+ - id: scope_acceptance_criteria
13
+ description: All acceptance criteria from stories are addressed
14
+ check: "grep:.sniper/artifacts/{protocol_id}/stories/:shall"
15
+ blocking: true
16
+
17
+ - id: scope_no_creep
18
+ description: No undocumented features added beyond spec
19
+ check: file:.sniper/artifacts/{protocol_id}/review-report.md
20
+ blocking: false
21
+
22
+ # Standards Enforcement — does the code follow conventions?
23
+ - id: standards_conventions
24
+ description: Code follows project conventions
25
+ check: file:.sniper/conventions.yaml
26
+ blocking: false
27
+
28
+ - id: standards_test_coverage
29
+ description: Tests exist for new functionality
30
+ command: "find . -name '*.test.*' -o -name '*.spec.*' | grep -q ."
31
+ blocking: true
32
+
33
+ - id: standards_lint_clean
34
+ description: No lint errors in changed files
35
+ command: "${lint_command}"
36
+ blocking: true
37
+
38
+ # Risk Scoring — are there security, performance, or reliability risks?
39
+ - id: risk_security
40
+ description: No OWASP Top 10 vulnerabilities detected
41
+ check: 'grep:.sniper/artifacts/{protocol_id}/review-report.md:"## Security"'
42
+ blocking: true
43
+
44
+ - id: risk_performance
45
+ description: No obvious performance regressions
46
+ check: 'grep:.sniper/artifacts/{protocol_id}/review-report.md:"## Performance"'
47
+ blocking: false
48
+
49
+ - id: risk_error_handling
50
+ description: Error cases are handled gracefully
51
+ check: 'grep:.sniper/artifacts/{protocol_id}/review-report.md:"## Error Handling"'
52
+ blocking: false
53
+
54
+ - id: risk_data_integrity
55
+ description: No data loss or corruption risks
56
+ check: 'grep:.sniper/artifacts/{protocol_id}/review-report.md:"## Data Integrity"'
57
+ blocking: true
@@ -0,0 +1,36 @@
1
+ name: plan
2
+ description: Planning phase quality gate
3
+ # Note: {protocol_id} is resolved at gate-review time from the active checkpoint
4
+
5
+ checks:
6
+ - id: has_context_section
7
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## Context"
8
+ blocking: true
9
+ description: Architecture plan includes Context section
10
+ - id: has_decisions_section
11
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## Decisions"
12
+ blocking: true
13
+ description: Architecture plan includes Decisions section
14
+ - id: has_components_section
15
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## Components"
16
+ blocking: true
17
+ description: Architecture plan includes Components section
18
+ - id: has_data_model_section
19
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## Data Model"
20
+ blocking: true
21
+ description: Architecture plan includes Data Model section
22
+
23
+ - id: ears_criteria
24
+ description: All stories have EARS acceptance criteria
25
+ check: grep:.sniper/artifacts/{protocol_id}/stories/:"shall"
26
+ blocking: true
27
+
28
+ - id: open_questions
29
+ description: No unresolved open questions remain
30
+ check: "!grep:.sniper/artifacts/{protocol_id}/:\\*\\*TBD\\*\\*|\\*\\*TODO\\*\\*|\\*\\*OPEN\\*\\*"
31
+ blocking: false
32
+
33
+ - id: token_budget
34
+ description: Architecture plan within character budget (~4000 tokens = 16000 chars)
35
+ check: wc:.sniper/artifacts/{protocol_id}/plan.md:<16000
36
+ blocking: false
@@ -0,0 +1,19 @@
1
+ name: refactor-analyze
2
+ description: Refactor analysis phase quality gate — verifies analysis artifacts
3
+ # Note: {protocol_id} is resolved at gate-review time from the active checkpoint
4
+
5
+ checks:
6
+ - id: analysis_produced
7
+ description: Refactoring analysis plan exists
8
+ check: file:.sniper/artifacts/{protocol_id}/plan.md
9
+ blocking: true
10
+
11
+ - id: refactor_targets_identified
12
+ description: Analysis identifies specific refactoring targets
13
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## "
14
+ blocking: false
15
+
16
+ - id: analysis_nonempty
17
+ description: Analysis is not a stub (at least 20 lines)
18
+ command: "test $(wc -l < .sniper/artifacts/{protocol_id}/plan.md) -ge 20"
19
+ blocking: false
@@ -0,0 +1,29 @@
1
+ name: review
2
+ description: Review phase quality gate
3
+ # Note: {protocol_id} is resolved at gate-review time from the active checkpoint
4
+
5
+ checks:
6
+ - id: gate_checks_pass
7
+ description: Implementation gate passed
8
+ check: grep:.sniper/gates/implement-*.yaml:"result: pass"
9
+ blocking: true
10
+
11
+ - id: spec_reconciliation
12
+ description: Review report confirms spec compliance
13
+ check: file:.sniper/artifacts/{protocol_id}/review-report.md
14
+ blocking: true
15
+
16
+ - id: no_regressions
17
+ description: No test regressions introduced
18
+ command: "${test_command}"
19
+ blocking: true
20
+
21
+ - id: no_blocking_findings
22
+ description: No blocking findings in review report
23
+ check: "!grep:.sniper/artifacts/{protocol_id}/review-report.md:### Blocking"
24
+ blocking: true
25
+
26
+ - id: spec_reconciled
27
+ description: Spec has been reconciled with implementation
28
+ check: "grep:.sniper/artifacts/spec.md:Last reconciled:"
29
+ blocking: false
@@ -0,0 +1,42 @@
1
+ # {{PROJECT_NAME}}
2
+
3
+ ## SNIPER v3 Configuration
4
+
5
+ This project uses the SNIPER framework for AI-assisted project lifecycle management.
6
+
7
+ ### Quick Start
8
+
9
+ - `/sniper-flow` — Run the appropriate protocol (auto-detects scope, or use `--protocol <name>`)
10
+ - `/sniper-flow --resume` — Resume an interrupted protocol from the last checkpoint
11
+ - `/sniper-init` — Re-initialize or update SNIPER configuration
12
+ - `/sniper-status` — Show current protocol progress and cost
13
+ - `/sniper-review` — Manually trigger a review gate
14
+
15
+ ### Project Structure
16
+
17
+ ```
18
+ .sniper/
19
+ config.yaml — Project configuration
20
+ live-status.yaml — Real-time protocol progress
21
+ checkpoints/ — Phase checkpoint snapshots
22
+ gates/ — Gate review results
23
+ retros/ — Retrospective reports
24
+ self-reviews/ — Developer self-review artifacts
25
+ .claude/
26
+ agents/ — Agent definitions (scaffolded from @sniper.ai/core)
27
+ settings.json — Claude Code settings with hooks
28
+ ```
29
+
30
+ ### Configuration
31
+
32
+ Edit `.sniper/config.yaml` to customize:
33
+ - Agent roster and cognitive mixins
34
+ - Protocol routing and token budgets
35
+ - File ownership boundaries
36
+ - Stack-specific commands (test, lint, build)
37
+
38
+ ### Ownership Rules
39
+
40
+ Agents respect file ownership boundaries. See `.sniper/config.yaml` `ownership` section.
41
+
42
+ {{CUSTOM_INSTRUCTIONS}}