@sniper.ai/core 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/README.md +88 -98
  2. package/agents/analyst.md +30 -0
  3. package/agents/architect.md +36 -0
  4. package/agents/backend-dev.md +43 -0
  5. package/agents/code-reviewer.md +72 -0
  6. package/agents/frontend-dev.md +43 -0
  7. package/agents/fullstack-dev.md +44 -0
  8. package/agents/gate-reviewer.md +62 -0
  9. package/agents/lead-orchestrator.md +51 -0
  10. package/agents/product-manager.md +38 -0
  11. package/agents/qa-engineer.md +37 -0
  12. package/agents/retro-analyst.md +98 -0
  13. package/checklists/discover.yaml +23 -0
  14. package/checklists/implement.yaml +28 -0
  15. package/checklists/ingest-document.yaml +18 -0
  16. package/checklists/ingest-extract.yaml +13 -0
  17. package/checklists/ingest-scan.yaml +18 -0
  18. package/checklists/multi-faceted-review.yaml +56 -0
  19. package/checklists/plan.yaml +36 -0
  20. package/checklists/refactor-analyze.yaml +18 -0
  21. package/checklists/review.yaml +28 -0
  22. package/claude-md.template +42 -0
  23. package/config.template.yaml +156 -0
  24. package/hooks/settings-hooks.json +31 -0
  25. package/hooks/signal-hooks.json +11 -0
  26. package/package.json +23 -5
  27. package/personas/cognitive/devils-advocate.md +24 -0
  28. package/personas/cognitive/performance-focused.md +23 -0
  29. package/personas/cognitive/security-first.md +24 -0
  30. package/protocols/explore.yaml +18 -0
  31. package/protocols/feature.yaml +45 -0
  32. package/protocols/full.yaml +63 -0
  33. package/protocols/hotfix.yaml +19 -0
  34. package/protocols/ingest.yaml +39 -0
  35. package/protocols/patch.yaml +30 -0
  36. package/protocols/refactor.yaml +41 -0
  37. package/schemas/checkpoint.schema.yaml +133 -0
  38. package/schemas/cost.schema.yaml +97 -0
  39. package/schemas/dependency-graph.schema.yaml +37 -0
  40. package/schemas/gate-result.schema.yaml +101 -0
  41. package/schemas/knowledge-manifest.schema.yaml +39 -0
  42. package/schemas/live-status.schema.yaml +122 -0
  43. package/schemas/protocol.schema.yaml +100 -0
  44. package/schemas/retro.schema.yaml +95 -0
  45. package/schemas/revert-plan.schema.yaml +40 -0
  46. package/schemas/signal.schema.yaml +39 -0
  47. package/schemas/velocity.schema.yaml +52 -0
  48. package/schemas/workspace-lock.schema.yaml +34 -0
  49. package/schemas/workspace.schema.yaml +82 -0
  50. package/skills/sniper-flow/SKILL.md +243 -0
  51. package/skills/sniper-flow-headless/SKILL.md +105 -0
  52. package/skills/sniper-init/SKILL.md +103 -0
  53. package/skills/sniper-review/SKILL.md +49 -0
  54. package/skills/sniper-status/SKILL.md +79 -0
  55. package/templates/architecture.md +23 -0
  56. package/templates/checkpoint.yaml +27 -0
  57. package/templates/codebase-overview.md +19 -0
  58. package/templates/cost.yaml +23 -0
  59. package/templates/custom-protocol.yaml +98 -0
  60. package/templates/knowledge-manifest.yaml +32 -0
  61. package/templates/live-status.yaml +26 -0
  62. package/templates/multi-faceted-review-report.md +28 -0
  63. package/templates/review-report.md +25 -0
  64. package/templates/signal-record.yaml +37 -0
  65. package/templates/spec.md +28 -0
  66. package/templates/story.md +19 -0
  67. package/templates/velocity.yaml +9 -0
  68. package/templates/workspace-config.yaml +44 -0
  69. package/framework/checklists/code-review.md +0 -33
  70. package/framework/checklists/debug-review.md +0 -34
  71. package/framework/checklists/discover-review.md +0 -33
  72. package/framework/checklists/doc-review.md +0 -39
  73. package/framework/checklists/feature-review.md +0 -42
  74. package/framework/checklists/ingest-review.md +0 -42
  75. package/framework/checklists/memory-review.md +0 -30
  76. package/framework/checklists/perf-review.md +0 -33
  77. package/framework/checklists/plan-review.md +0 -52
  78. package/framework/checklists/refactor-review.md +0 -33
  79. package/framework/checklists/security-review.md +0 -34
  80. package/framework/checklists/sprint-review.md +0 -41
  81. package/framework/checklists/story-review.md +0 -30
  82. package/framework/checklists/test-review.md +0 -32
  83. package/framework/checklists/workspace-review.md +0 -34
  84. package/framework/claude-md.template +0 -37
  85. package/framework/commands/sniper-audit.md +0 -1549
  86. package/framework/commands/sniper-compose.md +0 -323
  87. package/framework/commands/sniper-debug.md +0 -337
  88. package/framework/commands/sniper-discover.md +0 -423
  89. package/framework/commands/sniper-doc.md +0 -441
  90. package/framework/commands/sniper-feature.md +0 -515
  91. package/framework/commands/sniper-ingest.md +0 -506
  92. package/framework/commands/sniper-init.md +0 -388
  93. package/framework/commands/sniper-memory.md +0 -219
  94. package/framework/commands/sniper-plan.md +0 -630
  95. package/framework/commands/sniper-review.md +0 -369
  96. package/framework/commands/sniper-solve.md +0 -408
  97. package/framework/commands/sniper-sprint.md +0 -716
  98. package/framework/commands/sniper-status.md +0 -481
  99. package/framework/commands/sniper-workspace-feature.md +0 -267
  100. package/framework/commands/sniper-workspace-init.md +0 -252
  101. package/framework/commands/sniper-workspace-status.md +0 -112
  102. package/framework/commands/sniper-workspace-validate.md +0 -138
  103. package/framework/config.template.yaml +0 -196
  104. package/framework/personas/cognitive/devils-advocate.md +0 -30
  105. package/framework/personas/cognitive/mentor-explainer.md +0 -29
  106. package/framework/personas/cognitive/performance-focused.md +0 -30
  107. package/framework/personas/cognitive/security-first.md +0 -29
  108. package/framework/personas/cognitive/systems-thinker.md +0 -29
  109. package/framework/personas/cognitive/user-empathetic.md +0 -29
  110. package/framework/personas/domain/.gitkeep +0 -0
  111. package/framework/personas/process/analyst.md +0 -29
  112. package/framework/personas/process/architect.md +0 -30
  113. package/framework/personas/process/architecture-cartographer.md +0 -25
  114. package/framework/personas/process/code-archaeologist.md +0 -22
  115. package/framework/personas/process/code-investigator.md +0 -29
  116. package/framework/personas/process/code-reviewer.md +0 -26
  117. package/framework/personas/process/contract-designer.md +0 -31
  118. package/framework/personas/process/convention-miner.md +0 -27
  119. package/framework/personas/process/coverage-analyst.md +0 -24
  120. package/framework/personas/process/developer.md +0 -32
  121. package/framework/personas/process/doc-analyst.md +0 -63
  122. package/framework/personas/process/doc-reviewer.md +0 -62
  123. package/framework/personas/process/doc-writer.md +0 -42
  124. package/framework/personas/process/flake-hunter.md +0 -30
  125. package/framework/personas/process/impact-analyst.md +0 -23
  126. package/framework/personas/process/integration-validator.md +0 -29
  127. package/framework/personas/process/log-analyst.md +0 -22
  128. package/framework/personas/process/migration-architect.md +0 -24
  129. package/framework/personas/process/perf-profiler.md +0 -27
  130. package/framework/personas/process/product-manager.md +0 -32
  131. package/framework/personas/process/qa-engineer.md +0 -31
  132. package/framework/personas/process/release-manager.md +0 -23
  133. package/framework/personas/process/retro-analyst.md +0 -30
  134. package/framework/personas/process/scrum-master.md +0 -31
  135. package/framework/personas/process/threat-modeler.md +0 -30
  136. package/framework/personas/process/triage-lead.md +0 -23
  137. package/framework/personas/process/ux-designer.md +0 -31
  138. package/framework/personas/process/vuln-scanner.md +0 -27
  139. package/framework/personas/process/workspace-orchestrator.md +0 -30
  140. package/framework/personas/technical/ai-ml.md +0 -33
  141. package/framework/personas/technical/api-design.md +0 -32
  142. package/framework/personas/technical/backend.md +0 -32
  143. package/framework/personas/technical/database.md +0 -32
  144. package/framework/personas/technical/frontend.md +0 -33
  145. package/framework/personas/technical/infrastructure.md +0 -32
  146. package/framework/personas/technical/security.md +0 -34
  147. package/framework/settings.template.json +0 -6
  148. package/framework/spawn-prompts/_template.md +0 -25
  149. package/framework/teams/debug.yaml +0 -56
  150. package/framework/teams/discover.yaml +0 -57
  151. package/framework/teams/doc.yaml +0 -76
  152. package/framework/teams/feature-plan.yaml +0 -61
  153. package/framework/teams/ingest.yaml +0 -85
  154. package/framework/teams/perf.yaml +0 -33
  155. package/framework/teams/plan.yaml +0 -86
  156. package/framework/teams/refactor.yaml +0 -34
  157. package/framework/teams/retro.yaml +0 -30
  158. package/framework/teams/review-pr.yaml +0 -73
  159. package/framework/teams/review-release.yaml +0 -70
  160. package/framework/teams/security.yaml +0 -59
  161. package/framework/teams/solve.yaml +0 -48
  162. package/framework/teams/sprint.yaml +0 -68
  163. package/framework/teams/test.yaml +0 -59
  164. package/framework/teams/workspace-feature.yaml +0 -69
  165. package/framework/teams/workspace-validation.yaml +0 -27
  166. package/framework/templates/arch-delta.md +0 -74
  167. package/framework/templates/architecture.md +0 -95
  168. package/framework/templates/brief.md +0 -73
  169. package/framework/templates/bug-report.md +0 -55
  170. package/framework/templates/contract-validation-report.md +0 -68
  171. package/framework/templates/contract.yaml +0 -60
  172. package/framework/templates/conventions.md +0 -59
  173. package/framework/templates/coverage-report.md +0 -67
  174. package/framework/templates/doc-api.md +0 -53
  175. package/framework/templates/doc-guide.md +0 -35
  176. package/framework/templates/doc-readme.md +0 -49
  177. package/framework/templates/epic.md +0 -47
  178. package/framework/templates/feature-brief.md +0 -54
  179. package/framework/templates/feature-spec.md +0 -53
  180. package/framework/templates/flaky-report.md +0 -64
  181. package/framework/templates/investigation.md +0 -49
  182. package/framework/templates/memory-anti-pattern.yaml +0 -16
  183. package/framework/templates/memory-convention.yaml +0 -17
  184. package/framework/templates/memory-decision.yaml +0 -16
  185. package/framework/templates/migration-plan.md +0 -47
  186. package/framework/templates/optimization-plan.md +0 -59
  187. package/framework/templates/performance-profile.md +0 -64
  188. package/framework/templates/personas.md +0 -118
  189. package/framework/templates/postmortem.md +0 -69
  190. package/framework/templates/pr-review.md +0 -50
  191. package/framework/templates/prd.md +0 -92
  192. package/framework/templates/refactor-scope.md +0 -52
  193. package/framework/templates/release-readiness.md +0 -66
  194. package/framework/templates/retro.yaml +0 -44
  195. package/framework/templates/risks.md +0 -64
  196. package/framework/templates/security.md +0 -111
  197. package/framework/templates/sprint-review.md +0 -32
  198. package/framework/templates/story.md +0 -53
  199. package/framework/templates/threat-model.md +0 -71
  200. package/framework/templates/ux-spec.md +0 -71
  201. package/framework/templates/vulnerability-report.md +0 -56
  202. package/framework/templates/workspace-brief.md +0 -52
  203. package/framework/templates/workspace-plan.md +0 -50
  204. package/framework/workflows/discover-only.md +0 -39
  205. package/framework/workflows/full-lifecycle.md +0 -56
  206. package/framework/workflows/quick-feature.md +0 -44
  207. package/framework/workflows/sprint-cycle.md +0 -47
  208. package/framework/workflows/workspace-feature.md +0 -71
@@ -0,0 +1,38 @@
1
+ ---
2
+ write_scope:
3
+ - "docs/"
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
+ - `docs/prd.md` — Product requirements (use `spec.md` template adapted for PRD)
30
+ - `docs/stories/*.md` — Individual stories (use `story.md` template, 1500 token budget each)
31
+
32
+ ## Rules
33
+
34
+ - Every story must have at least 2 EARS acceptance criteria
35
+ - Every story must be implementable in a single sprint by one developer
36
+ - Stories must reference the architecture document for technical context
37
+ - Do NOT include implementation details — describe WHAT, not HOW
38
+ - 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,98 @@
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
+ ## Analysis Process
20
+
21
+ 1. Read `.sniper/checkpoints/` for the completed protocol's checkpoint history
22
+ 2. Read `.sniper/gates/` for gate results (pass/fail patterns)
23
+ 3. Read `.sniper/cost.yaml` for token usage data
24
+ 4. Analyze: What took the most tokens? Which gates failed first? Were there re-runs?
25
+ 5. Write retro report
26
+
27
+ ## Retro Report Schema
28
+
29
+ ```yaml
30
+ protocol: <protocol_name>
31
+ completed_at: <ISO 8601>
32
+ duration_phases:
33
+ - phase: <name>
34
+ agents: <count>
35
+ gate_attempts: <count>
36
+ gate_result: pass | fail
37
+ metrics:
38
+ total_tokens: <number>
39
+ total_agents_spawned: <number>
40
+ gate_pass_rate: <percentage>
41
+ findings:
42
+ went_well:
43
+ - <finding>
44
+ needs_improvement:
45
+ - <finding>
46
+ action_items:
47
+ - <concrete suggestion>
48
+ ```
49
+
50
+ ## Rules
51
+
52
+ - Be specific — cite actual data, not vague observations
53
+ - Focus on actionable improvements, not blame
54
+ - Write to `.sniper/retros/` only — never modify project code
55
+ - Keep the report concise — under 1000 tokens
56
+ - Compare against previous retros if they exist to track trends
57
+
58
+ ## Signal Analysis
59
+
60
+ During the retrospective, analyze external signals:
61
+
62
+ 1. Read `.sniper/memory/signals/` for signal records captured during this protocol execution
63
+ 2. Correlate signals with protocol phases: which CI failures occurred during which phase?
64
+ 3. Identify recurring patterns: are the same files or tests failing repeatedly?
65
+ 4. Promote high-confidence learnings: if a signal's learning applies broadly, note it in the retro findings
66
+ 5. Include signal summary in the retro report under a `signals_analyzed` section:
67
+ ```yaml
68
+ signals_analyzed:
69
+ total: <count>
70
+ by_type:
71
+ ci_failure: <count>
72
+ pr_review_comment: <count>
73
+ promoted_learnings:
74
+ - <learning that should be applied going forward>
75
+ ```
76
+
77
+ ## Velocity Tracking
78
+
79
+ After writing the retro report, update velocity data:
80
+
81
+ 1. Read `.sniper/memory/velocity.yaml` (create if it doesn't exist)
82
+ 2. Append a new execution record:
83
+ ```yaml
84
+ - protocol: <protocol_name>
85
+ completed_at: <ISO 8601>
86
+ wall_clock_seconds: <duration>
87
+ tokens_used: <total_tokens>
88
+ tokens_per_phase:
89
+ <phase_name>: <tokens>
90
+ ```
91
+ 3. After 5+ executions of the same protocol, compute `calibrated_budgets`:
92
+ - Collect all `tokens_used` values for that protocol
93
+ - Calculate the p75 (75th percentile) value
94
+ - Set `calibrated_budgets.<protocol>` to that value
95
+ 4. Update `rolling_averages.<protocol>` with exponential moving average:
96
+ - Formula: `new_avg = 0.3 * latest_tokens + 0.7 * previous_avg`
97
+ - If no previous average, use the latest value
98
+ 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:docs/spec.md
8
+ blocking: true
9
+
10
+ - id: scope_defined
11
+ description: Spec defines in-scope requirements
12
+ check: grep:docs/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:docs/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:docs/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:docs/spec.md
8
+ blocking: true
9
+
10
+ - id: scope_defined
11
+ description: Spec defines in-scope requirements
12
+ check: grep:docs/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:docs/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:docs/codebase-overview.md
8
+ blocking: true
9
+
10
+ - id: overview_has_structure
11
+ description: Overview includes project structure section
12
+ check: grep:docs/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 < docs/codebase-overview.md) -ge 50"
18
+ blocking: false
@@ -0,0 +1,56 @@
1
+ name: multi-faceted-review
2
+ description: Multi-dimensional review gate — scope, standards, and risk
3
+
4
+ checks:
5
+ # Scope Validation — does the implementation match requirements?
6
+ - id: scope_spec_match
7
+ description: Implementation addresses all spec requirements
8
+ check: file:docs/spec.md
9
+ blocking: true
10
+
11
+ - id: scope_acceptance_criteria
12
+ description: All acceptance criteria from stories are addressed
13
+ check: "grep:docs/stories/:shall"
14
+ blocking: true
15
+
16
+ - id: scope_no_creep
17
+ description: No undocumented features added beyond spec
18
+ check: file:docs/review-report.md
19
+ blocking: false
20
+
21
+ # Standards Enforcement — does the code follow conventions?
22
+ - id: standards_conventions
23
+ description: Code follows project conventions
24
+ check: file:.sniper/conventions.yaml
25
+ blocking: false
26
+
27
+ - id: standards_test_coverage
28
+ description: Tests exist for new functionality
29
+ command: "find . -name '*.test.*' -o -name '*.spec.*' | grep -q ."
30
+ blocking: true
31
+
32
+ - id: standards_lint_clean
33
+ description: No lint errors in changed files
34
+ command: "${lint_command}"
35
+ blocking: true
36
+
37
+ # Risk Scoring — are there security, performance, or reliability risks?
38
+ - id: risk_security
39
+ description: No OWASP Top 10 vulnerabilities detected
40
+ check: 'grep:docs/review-report.md:"## Security"'
41
+ blocking: true
42
+
43
+ - id: risk_performance
44
+ description: No obvious performance regressions
45
+ check: 'grep:docs/review-report.md:"## Performance"'
46
+ blocking: false
47
+
48
+ - id: risk_error_handling
49
+ description: Error cases are handled gracefully
50
+ check: 'grep:docs/review-report.md:"## Error Handling"'
51
+ blocking: false
52
+
53
+ - id: risk_data_integrity
54
+ description: No data loss or corruption risks
55
+ check: 'grep:docs/review-report.md:"## Data Integrity"'
56
+ blocking: true
@@ -0,0 +1,36 @@
1
+ name: plan
2
+ description: Planning phase quality gate
3
+
4
+ checks:
5
+ - id: has_context_section
6
+ check: grep:docs/architecture.md:"## Context"
7
+ blocking: true
8
+ description: Architecture doc includes Context section
9
+ - id: has_decisions_section
10
+ check: grep:docs/architecture.md:"## Decisions"
11
+ blocking: true
12
+ description: Architecture doc includes Decisions section
13
+ - id: has_components_section
14
+ check: grep:docs/architecture.md:"## Components"
15
+ blocking: true
16
+ description: Architecture doc includes Components section
17
+ - id: has_data_model_section
18
+ check: grep:docs/architecture.md:"## Data Model"
19
+ blocking: true
20
+ description: Architecture doc includes Data Model section
21
+
22
+ - id: ears_criteria
23
+ description: All stories have EARS acceptance criteria
24
+ check: grep:docs/stories/:"shall"
25
+ blocking: true
26
+
27
+ - id: open_questions
28
+ description: No unresolved open questions remain
29
+ # '|' separates alternation patterns (grep -E style)
30
+ check: "!grep:docs/:\\*\\*TBD\\*\\*|\\*\\*TODO\\*\\*|\\*\\*OPEN\\*\\*"
31
+ blocking: false
32
+
33
+ - id: token_budget
34
+ description: Architecture doc within character budget (~4000 tokens ≈ 16000 chars)
35
+ check: wc:docs/architecture.md:<16000
36
+ blocking: false
@@ -0,0 +1,18 @@
1
+ name: refactor-analyze
2
+ description: Refactor analysis phase quality gate — verifies analysis artifacts
3
+
4
+ checks:
5
+ - id: analysis_produced
6
+ description: Refactoring analysis spec exists
7
+ check: file:docs/spec.md
8
+ blocking: true
9
+
10
+ - id: refactor_targets_identified
11
+ description: Analysis identifies specific refactoring targets
12
+ check: grep:docs/spec.md:"## "
13
+ blocking: false
14
+
15
+ - id: analysis_nonempty
16
+ description: Analysis is not a stub (at least 20 lines)
17
+ command: "test $(wc -l < docs/spec.md) -ge 20"
18
+ blocking: false
@@ -0,0 +1,28 @@
1
+ name: review
2
+ description: Review phase quality gate
3
+
4
+ checks:
5
+ - id: gate_checks_pass
6
+ description: Implementation gate passed
7
+ check: grep:.sniper/gates/implement-*.yaml:"result: pass"
8
+ blocking: true
9
+
10
+ - id: spec_reconciliation
11
+ description: Review report confirms spec compliance
12
+ check: file:docs/review-report.md
13
+ blocking: true
14
+
15
+ - id: no_regressions
16
+ description: No test regressions introduced
17
+ command: "${test_command}"
18
+ blocking: true
19
+
20
+ - id: no_blocking_findings
21
+ description: No blocking findings in review report
22
+ check: "!grep:docs/review-report.md:### Blocking"
23
+ blocking: true
24
+
25
+ - id: spec_reconciled
26
+ description: Spec has been reconciled with implementation
27
+ check: "grep:docs/spec.md:Last reconciled:"
28
+ 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}}
@@ -0,0 +1,156 @@
1
+ # SNIPER v3 Configuration
2
+ # Generated by `sniper init`
3
+
4
+ project:
5
+ name: ""
6
+ type: "" # saas | api | mobile | cli | library | monorepo
7
+ description: ""
8
+
9
+ # Agent configuration
10
+ agents:
11
+ max_teammates: 5
12
+ plan_approval: true # Require plan approval for implementation agents
13
+ coordination_timeout: 30 # Seconds to wait for agent coordination
14
+
15
+ # Base agents to include (from @sniper.ai/core/agents/)
16
+ base:
17
+ - lead-orchestrator
18
+ - analyst
19
+ - architect
20
+ - product-manager
21
+ - backend-dev
22
+ - frontend-dev
23
+ - qa-engineer
24
+ - code-reviewer
25
+ - gate-reviewer
26
+ - retro-analyst
27
+
28
+ # Cognitive mixins applied to agents during scaffolding
29
+ # Format: agent-name: [mixin1, mixin2]
30
+ mixins: {}
31
+ # Example:
32
+ # backend-dev: [security-first, performance-focused]
33
+ # architect: [devils-advocate]
34
+
35
+ # Protocol routing — how /sniper-flow selects a protocol
36
+ routing:
37
+ # File-count thresholds for auto-detection
38
+ auto_detect:
39
+ patch_max_files: 5 # <= 5 files changed → patch protocol
40
+ feature_max_files: 20 # <= 20 files changed → feature protocol
41
+ # > 20 files → full protocol
42
+
43
+ # Default protocol when auto-detect is ambiguous
44
+ default: feature
45
+
46
+ # Protocol token budgets (override protocol defaults)
47
+ budgets:
48
+ full: 2000000
49
+ feature: 800000
50
+ patch: 200000
51
+ ingest: 1000000
52
+ explore: 500000
53
+ refactor: 600000
54
+ hotfix: 100000
55
+
56
+ # Trigger tables — map file patterns to agents or protocols
57
+ # Example:
58
+ # - pattern: "src/api/**"
59
+ # agent: backend-dev
60
+ # - pattern: "*.test.ts"
61
+ # agent: qa-engineer
62
+ # - pattern: "infrastructure/**"
63
+ # protocol: full
64
+ triggers: []
65
+
66
+ # Cost enforcement
67
+ cost:
68
+ warn_threshold: 0.7 # Warn at 70% of budget
69
+ soft_cap: 0.9 # Soft cap at 90% — agents must justify continuing
70
+ hard_cap: 1.0 # Hard cap at 100% — stop execution
71
+
72
+ # Review configuration
73
+ review:
74
+ multi_model: false # Enable multi-model review for gate checks
75
+ models: # Models to use when multi_model is enabled
76
+ - opus
77
+ - sonnet
78
+ require_consensus: true # All models must agree for a pass (false = majority wins)
79
+
80
+ # File ownership boundaries
81
+ ownership:
82
+ backend:
83
+ - "src/backend/"
84
+ - "src/api/"
85
+ - "src/services/"
86
+ - "src/db/"
87
+ frontend:
88
+ - "src/frontend/"
89
+ - "src/components/"
90
+ - "src/hooks/"
91
+ - "src/styles/"
92
+ - "src/pages/"
93
+ infrastructure:
94
+ - "docker/"
95
+ - ".github/"
96
+ - "infra/"
97
+ - "scripts/"
98
+ tests:
99
+ - "tests/"
100
+ - "__tests__/"
101
+ - "*.test.*"
102
+ - "*.spec.*"
103
+ docs:
104
+ - "docs/"
105
+
106
+ # Stack detection hints (auto-populated by `sniper init`)
107
+ stack:
108
+ language: ""
109
+ frontend: null
110
+ backend: null
111
+ database: null
112
+ infrastructure: null
113
+ test_runner: null
114
+ package_manager: ""
115
+ # Commands used by checklists and gate checks
116
+ commands:
117
+ test: ""
118
+ lint: ""
119
+ typecheck: ""
120
+ build: ""
121
+
122
+ # Plugin configuration
123
+ plugins: []
124
+ # - name: typescript
125
+ # package: "@sniper.ai/plugin-typescript"
126
+
127
+ # Domain knowledge configuration (Feature 9)
128
+ # knowledge:
129
+ # directory: ".sniper/knowledge"
130
+ # manifest: "manifest.yaml"
131
+ # max_total_tokens: 50000
132
+
133
+ # MCP Knowledge Base server (Feature 10)
134
+ # mcp_knowledge:
135
+ # enabled: false
136
+ # directory: ".sniper/knowledge"
137
+ # auto_index: true
138
+
139
+ # Headless / CI mode defaults (Feature 3)
140
+ # headless:
141
+ # auto_approve_gates: false
142
+ # output_format: json
143
+ # log_level: info
144
+ # timeout_minutes: 60
145
+ # fail_on_gate_failure: true
146
+
147
+ # Workspace reference (Feature 1)
148
+ # workspace:
149
+ # ref: "../.sniper-workspace"
150
+
151
+ # Visibility settings
152
+ visibility:
153
+ live_status: true # Maintain .sniper/live-status.yaml
154
+ checkpoints: true # Write phase checkpoints
155
+ cost_tracking: true # Track token usage
156
+ auto_retro: true # Run retro after protocol completion
@@ -0,0 +1,31 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "Write",
6
+ "description": "Enforce lead orchestrator write scope restriction",
7
+ "command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -q '\"file_path\"' && ! echo \"$CLAUDE_TOOL_INPUT\" | grep -q '.sniper/'; then echo 'BLOCK: Lead orchestrator can only write to .sniper/ directory'; exit 2; fi",
8
+ "agent": "lead-orchestrator"
9
+ }
10
+ ],
11
+ "PostToolUse": [
12
+ {
13
+ "matcher": "Bash",
14
+ "description": "Self-healing CI: detect test/lint failures and instruct agent to fix",
15
+ "command": "if echo \"$CLAUDE_TOOL_OUTPUT\" | grep -qiE '(FAIL|FAILED|ERROR|AssertionError|SyntaxError|TypeError|ReferenceError|lint.*error|eslint.*error|tsc.*error)'; then echo 'WARN: Test or lint failure detected. Fix the failing test/lint issue before proceeding to the next task.'; fi"
16
+ }
17
+ ],
18
+ "Stop": [
19
+ {
20
+ "description": "Run gate reviewer at phase boundaries",
21
+ "command": "if [ -f .sniper/pending-gate.yaml ]; then echo 'Gate review pending — spawning gate-reviewer agent'; fi",
22
+ "agent": "gate-reviewer"
23
+ },
24
+ {
25
+ "description": "Run retro analyst after protocol completion",
26
+ "command": "if [ -f .sniper/protocol-complete.yaml ]; then echo 'Protocol complete — spawning retro-analyst agent'; fi",
27
+ "agent": "retro-analyst"
28
+ }
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "Bash",
6
+ "description": "Auto-capture CI failure signals from test/lint output",
7
+ "command": "if echo \"$CLAUDE_TOOL_OUTPUT\" | grep -qiE '(FAIL|FAILED|ERROR|exit code [1-9])'; then SIGNAL_DIR=\".sniper/memory/signals\"; mkdir -p \"$SIGNAL_DIR\"; TS=$(node -e \"process.stdout.write(new Date().toISOString())\"); EPOCH=$(node -e \"process.stdout.write(String(Date.now()))\"); SIGNAL_FILE=\"$SIGNAL_DIR/$(echo $TS | cut -c1-10 | tr -d '-')-ci_failure-${EPOCH}.yaml\"; echo \"type: ci_failure\" > \"$SIGNAL_FILE\"; echo \"source: bash-output\" >> \"$SIGNAL_FILE\"; echo \"timestamp: ${TS}\" >> \"$SIGNAL_FILE\"; echo \"summary: CI failure detected in command output\" >> \"$SIGNAL_FILE\"; echo 'Signal captured to '\"$SIGNAL_FILE\"; fi"
8
+ }
9
+ ]
10
+ }
11
+ }