@sniper.ai/core 1.0.1 → 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.
- package/README.md +119 -39
- package/agents/analyst.md +30 -0
- package/agents/architect.md +36 -0
- package/agents/backend-dev.md +43 -0
- package/agents/code-reviewer.md +72 -0
- package/agents/frontend-dev.md +43 -0
- package/agents/fullstack-dev.md +44 -0
- package/agents/gate-reviewer.md +62 -0
- package/agents/lead-orchestrator.md +51 -0
- package/agents/product-manager.md +38 -0
- package/agents/qa-engineer.md +37 -0
- package/agents/retro-analyst.md +98 -0
- package/checklists/discover.yaml +23 -0
- package/checklists/implement.yaml +28 -0
- package/checklists/ingest-document.yaml +18 -0
- package/checklists/ingest-extract.yaml +13 -0
- package/checklists/ingest-scan.yaml +18 -0
- package/checklists/multi-faceted-review.yaml +56 -0
- package/checklists/plan.yaml +36 -0
- package/checklists/refactor-analyze.yaml +18 -0
- package/checklists/review.yaml +28 -0
- package/claude-md.template +42 -0
- package/config.template.yaml +156 -0
- package/hooks/settings-hooks.json +31 -0
- package/hooks/signal-hooks.json +11 -0
- package/package.json +23 -5
- package/personas/cognitive/devils-advocate.md +24 -0
- package/personas/cognitive/performance-focused.md +23 -0
- package/personas/cognitive/security-first.md +24 -0
- package/protocols/explore.yaml +18 -0
- package/protocols/feature.yaml +45 -0
- package/protocols/full.yaml +63 -0
- package/protocols/hotfix.yaml +19 -0
- package/protocols/ingest.yaml +39 -0
- package/protocols/patch.yaml +30 -0
- package/protocols/refactor.yaml +41 -0
- package/schemas/checkpoint.schema.yaml +133 -0
- package/schemas/cost.schema.yaml +97 -0
- package/schemas/dependency-graph.schema.yaml +37 -0
- package/schemas/gate-result.schema.yaml +101 -0
- package/schemas/knowledge-manifest.schema.yaml +39 -0
- package/schemas/live-status.schema.yaml +122 -0
- package/schemas/protocol.schema.yaml +100 -0
- package/schemas/retro.schema.yaml +95 -0
- package/schemas/revert-plan.schema.yaml +40 -0
- package/schemas/signal.schema.yaml +39 -0
- package/schemas/velocity.schema.yaml +52 -0
- package/schemas/workspace-lock.schema.yaml +34 -0
- package/schemas/workspace.schema.yaml +82 -0
- package/skills/sniper-flow/SKILL.md +243 -0
- package/skills/sniper-flow-headless/SKILL.md +105 -0
- package/skills/sniper-init/SKILL.md +103 -0
- package/skills/sniper-review/SKILL.md +49 -0
- package/skills/sniper-status/SKILL.md +79 -0
- package/templates/architecture.md +23 -0
- package/templates/checkpoint.yaml +27 -0
- package/templates/codebase-overview.md +19 -0
- package/templates/cost.yaml +23 -0
- package/templates/custom-protocol.yaml +98 -0
- package/templates/knowledge-manifest.yaml +32 -0
- package/templates/live-status.yaml +26 -0
- package/templates/multi-faceted-review-report.md +28 -0
- package/templates/review-report.md +25 -0
- package/templates/signal-record.yaml +37 -0
- package/templates/spec.md +28 -0
- package/templates/story.md +19 -0
- package/templates/velocity.yaml +9 -0
- package/templates/workspace-config.yaml +44 -0
- package/framework/checklists/code-review.md +0 -33
- package/framework/checklists/discover-review.md +0 -33
- package/framework/checklists/doc-review.md +0 -39
- package/framework/checklists/plan-review.md +0 -52
- package/framework/checklists/sprint-review.md +0 -41
- package/framework/checklists/story-review.md +0 -30
- package/framework/claude-md.template +0 -37
- package/framework/commands/sniper-compose.md +0 -237
- package/framework/commands/sniper-discover.md +0 -397
- package/framework/commands/sniper-doc.md +0 -441
- package/framework/commands/sniper-init.md +0 -372
- package/framework/commands/sniper-plan.md +0 -608
- package/framework/commands/sniper-review.md +0 -305
- package/framework/commands/sniper-solve.md +0 -375
- package/framework/commands/sniper-sprint.md +0 -601
- package/framework/commands/sniper-status.md +0 -276
- package/framework/config.template.yaml +0 -117
- package/framework/personas/cognitive/devils-advocate.md +0 -30
- package/framework/personas/cognitive/mentor-explainer.md +0 -29
- package/framework/personas/cognitive/performance-focused.md +0 -30
- package/framework/personas/cognitive/security-first.md +0 -29
- package/framework/personas/cognitive/systems-thinker.md +0 -29
- package/framework/personas/cognitive/user-empathetic.md +0 -29
- package/framework/personas/domain/.gitkeep +0 -0
- package/framework/personas/process/analyst.md +0 -29
- package/framework/personas/process/architect.md +0 -30
- package/framework/personas/process/developer.md +0 -32
- package/framework/personas/process/doc-analyst.md +0 -63
- package/framework/personas/process/doc-reviewer.md +0 -62
- package/framework/personas/process/doc-writer.md +0 -42
- package/framework/personas/process/product-manager.md +0 -32
- package/framework/personas/process/qa-engineer.md +0 -31
- package/framework/personas/process/scrum-master.md +0 -31
- package/framework/personas/process/ux-designer.md +0 -31
- package/framework/personas/technical/ai-ml.md +0 -33
- package/framework/personas/technical/api-design.md +0 -32
- package/framework/personas/technical/backend.md +0 -32
- package/framework/personas/technical/database.md +0 -32
- package/framework/personas/technical/frontend.md +0 -33
- package/framework/personas/technical/infrastructure.md +0 -32
- package/framework/personas/technical/security.md +0 -34
- package/framework/settings.template.json +0 -6
- package/framework/spawn-prompts/_template.md +0 -22
- package/framework/teams/discover.yaml +0 -57
- package/framework/teams/doc.yaml +0 -76
- package/framework/teams/plan.yaml +0 -86
- package/framework/teams/solve.yaml +0 -48
- package/framework/teams/sprint.yaml +0 -68
- package/framework/templates/architecture.md +0 -72
- package/framework/templates/brief.md +0 -52
- package/framework/templates/doc-api.md +0 -53
- package/framework/templates/doc-guide.md +0 -35
- package/framework/templates/doc-readme.md +0 -49
- package/framework/templates/epic.md +0 -33
- package/framework/templates/personas.md +0 -118
- package/framework/templates/prd.md +0 -69
- package/framework/templates/risks.md +0 -64
- package/framework/templates/security.md +0 -90
- package/framework/templates/sprint-review.md +0 -32
- package/framework/templates/story.md +0 -37
- package/framework/templates/ux-spec.md +0 -54
- package/framework/workflows/discover-only.md +0 -39
- package/framework/workflows/full-lifecycle.md +0 -56
- package/framework/workflows/quick-feature.md +0 -44
- package/framework/workflows/sprint-cycle.md +0 -47
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sniper.ai/core",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "SNIPER framework core —
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "SNIPER framework core — agents, skills, protocols, checklists, templates, and hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
|
8
|
-
"./
|
|
8
|
+
"./agents/*": "./agents/*",
|
|
9
|
+
"./personas/*": "./personas/*",
|
|
10
|
+
"./skills/*": "./skills/*",
|
|
11
|
+
"./protocols/*": "./protocols/*",
|
|
12
|
+
"./checklists/*": "./checklists/*",
|
|
13
|
+
"./templates/*": "./templates/*",
|
|
14
|
+
"./hooks/*": "./hooks/*",
|
|
15
|
+
"./schemas/*": "./schemas/*",
|
|
16
|
+
"./config.template.yaml": "./config.template.yaml",
|
|
17
|
+
"./claude-md.template": "./claude-md.template"
|
|
9
18
|
},
|
|
10
19
|
"files": [
|
|
11
|
-
"
|
|
20
|
+
"agents",
|
|
21
|
+
"personas",
|
|
22
|
+
"skills",
|
|
23
|
+
"protocols",
|
|
24
|
+
"checklists",
|
|
25
|
+
"templates",
|
|
26
|
+
"hooks",
|
|
27
|
+
"schemas",
|
|
28
|
+
"config.template.yaml",
|
|
29
|
+
"claude-md.template"
|
|
12
30
|
],
|
|
13
31
|
"keywords": [
|
|
14
32
|
"sniper",
|
|
@@ -16,7 +34,7 @@
|
|
|
16
34
|
"claude",
|
|
17
35
|
"framework",
|
|
18
36
|
"agent",
|
|
19
|
-
"
|
|
37
|
+
"protocol"
|
|
20
38
|
],
|
|
21
39
|
"license": "MIT",
|
|
22
40
|
"repository": {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Devil's Advocate Thinking
|
|
2
|
+
|
|
3
|
+
Apply this cognitive lens to all decisions:
|
|
4
|
+
|
|
5
|
+
## Assumption-Challenging Framework
|
|
6
|
+
|
|
7
|
+
- **Question the happy path**: For every design or implementation, ask "What happens when this fails?"
|
|
8
|
+
- **Challenge consensus**: When everyone agrees, ask "What are we all missing?"
|
|
9
|
+
- **Stress test assumptions**: Find the input, load, or scenario that breaks the assumption.
|
|
10
|
+
- **Identify single points of failure**: What one thing, if it breaks, takes everything down?
|
|
11
|
+
|
|
12
|
+
## Edge Case Identification
|
|
13
|
+
|
|
14
|
+
When reviewing or writing code, actively seek:
|
|
15
|
+
1. **Boundary values** — Empty strings, zero, negative numbers, max int, null, undefined
|
|
16
|
+
2. **Timing issues** — Race conditions, out-of-order events, stale data, clock skew
|
|
17
|
+
3. **Scale breaks** — What happens at 10x current load? 100x? What about zero items?
|
|
18
|
+
4. **Partial failures** — Network timeouts mid-operation, partial writes, interrupted transactions
|
|
19
|
+
5. **State corruption** — What if the system crashes between step 2 and step 3?
|
|
20
|
+
6. **User misbehavior** — Duplicate submissions, back button, multiple tabs, copy-paste attacks
|
|
21
|
+
|
|
22
|
+
## Constructive Dissent
|
|
23
|
+
|
|
24
|
+
The goal is not to block progress but to surface risks early. Every challenge should come with a concrete scenario, not vague doubt. "This could fail if X" is useful. "This seems risky" is not.
|