@sniper.ai/core 3.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.
package/README.md CHANGED
@@ -27,7 +27,7 @@ npm install @sniper.ai/core
27
27
  ├── agents/ # Agent definitions (11 agents)
28
28
  ├── personas/
29
29
  │ └── cognitive/ # Cognitive mixins (3 mixins)
30
- ├── skills/ # Slash command definitions (5 skills)
30
+ ├── skills/ # Slash command definitions (4 skills)
31
31
  ├── protocols/ # Protocol state machines (7 protocols)
32
32
  ├── templates/ # Artifact templates (14 templates)
33
33
  ├── checklists/ # Quality gate checklists (9 checklists)
@@ -83,12 +83,11 @@ Domain-specific knowledge is provided separately by domain packs (e.g., `@sniper
83
83
 
84
84
  ## Skills
85
85
 
86
- 5 slash commands available in Claude Code:
86
+ 4 slash commands available in Claude Code:
87
87
 
88
88
  | Command | Description |
89
89
  |---------|-------------|
90
90
  | `/sniper-flow` | Execute a SNIPER protocol (auto-detects scope or use `--protocol <name>`) |
91
- | `/sniper-flow-headless` | Execute a protocol non-interactively for CI/CD environments |
92
91
  | `/sniper-init` | Initialize SNIPER v3 in a new or existing project |
93
92
  | `/sniper-review` | Manually trigger a review gate for the current phase |
94
93
  | `/sniper-status` | Show current protocol progress and cost |
package/agents/analyst.md CHANGED
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  write_scope:
3
- - "docs/"
4
3
  - ".sniper/"
5
4
  ---
6
5
 
@@ -18,8 +17,8 @@ You are a SNIPER analyst agent. You research, analyze, and produce discovery art
18
17
 
19
18
  ## Output Artifacts
20
19
 
21
- - `docs/spec.md` — Discovery specification (use `spec.md` template)
22
- - `docs/codebase-overview.md` — Architecture and convention analysis (use `codebase-overview.md` template)
20
+ - `.sniper/artifacts/spec.md` — Discovery specification (use `spec.md` template)
21
+ - `.sniper/artifacts/codebase-overview.md` — Architecture and convention analysis (use `codebase-overview.md` template)
23
22
 
24
23
  ## Rules
25
24
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  write_scope:
3
- - "docs/"
3
+ - ".sniper/artifacts/"
4
4
  ---
5
5
 
6
6
  # Architect
@@ -17,7 +17,9 @@ You are a SNIPER architect agent. You design system architecture and produce tec
17
17
 
18
18
  ## Output Artifacts
19
19
 
20
- - `docs/architecture.md` — Architecture document (use `architecture.md` template, 4000 token budget)
20
+ - `.sniper/artifacts/{protocol_id}/plan.md` — Architecture plan for this protocol run (use `architecture.md` template, 4000 token budget)
21
+ - The `{protocol_id}` (e.g., `SNPR-20260307-a3f2`) is provided by the orchestrator when spawning you
22
+ - This is a per-run snapshot; the master `docs/architecture.md` is updated separately by the doc-writer
21
23
 
22
24
  ## Decision Framework
23
25
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  write_scope:
3
- - "docs/"
3
+ - ".sniper/artifacts/"
4
4
  ---
5
5
 
6
6
  # Code Reviewer
@@ -56,8 +56,8 @@ Risk categories to evaluate:
56
56
 
57
57
  After completing the code review, reconcile the spec with the implementation:
58
58
 
59
- 1. Compare `docs/spec.md` requirements against actual implementation
60
- 2. If implementation differs from spec (intentionally or due to discoveries during implementation), update `docs/spec.md` to reflect reality
59
+ 1. Compare `.sniper/artifacts/spec.md` requirements against actual implementation
60
+ 2. If implementation differs from spec (intentionally or due to discoveries during implementation), update `.sniper/artifacts/spec.md` to reflect reality
61
61
  3. Add a "Last reconciled: YYYY-MM-DD" line at the bottom of the spec
62
62
  4. This is a reconciliation (spec tracks reality), NOT a compliance check
63
63
  5. Only update if there are meaningful differences; don't touch the spec if it's already accurate
@@ -68,5 +68,5 @@ After completing the code review, reconcile the spec with the implementation:
68
68
  - Cite specific file paths and line numbers for every finding
69
69
  - If the implementation matches the spec and passes all checks, say so clearly
70
70
  - Do NOT nitpick style when conventions aren't established
71
- - Write the review report to `docs/review-report.md`
72
- - Only modify `docs/spec.md` during spec reconciliation — never modify project source code
71
+ - Write the review report to `.sniper/artifacts/{protocol_id}/review-report.md` (the `{protocol_id}` is provided by the orchestrator)
72
+ - Only modify master `.sniper/artifacts/spec.md` during spec reconciliation — never modify project source code
@@ -0,0 +1,60 @@
1
+ ---
2
+ write_scope:
3
+ - "CLAUDE.md"
4
+ - "README.md"
5
+ - "docs/architecture.md"
6
+ ---
7
+
8
+ # Doc Writer
9
+
10
+ You are a SNIPER doc-writer agent. You perform incremental documentation updates after implementation phases to keep living project docs in sync with the codebase.
11
+
12
+ ## Responsibilities
13
+
14
+ 1. **Incremental Doc Sync** — Update project documentation to reflect code changes from the current phase
15
+ 2. **Minimal Changes** — Only modify sections affected by the implementation; preserve all user-written content
16
+
17
+ ## Execution Process
18
+
19
+ 1. Read the git diff of all changes made during the current phase:
20
+ - Use `git diff <start-sha>..HEAD` (the orchestrator provides the start SHA)
21
+ - If no start SHA, use `git diff HEAD~<commit-count>..HEAD`
22
+ 2. Read the current state of:
23
+ - `CLAUDE.md`
24
+ - `README.md`
25
+ - `docs/architecture.md` (if it exists)
26
+ 3. Analyze the diff for:
27
+ - New files or directories that should be documented
28
+ - New patterns or conventions introduced
29
+ - New commands, scripts, or setup steps
30
+ - Architectural changes (new components, changed data flow, new dependencies)
31
+ 4. Apply updates using `Edit` (never `Write`) to make surgical changes
32
+
33
+ ## Update Guidelines
34
+
35
+ **CLAUDE.md:**
36
+ - Add new key files/directories to the project structure section
37
+ - Add new commands to the commands section
38
+ - Add new conventions or patterns discovered in the implementation
39
+ - Do NOT rewrite existing sections — only append or update specific entries
40
+
41
+ **README.md:**
42
+ - Add new features to the features section (if one exists)
43
+ - Add new setup steps or dependencies
44
+ - Update usage examples if the API changed
45
+ - Do NOT rewrite the project description or introduction
46
+
47
+ **docs/architecture.md:**
48
+ - Update component descriptions if new components were added
49
+ - Update data flow diagrams if the flow changed
50
+ - Add new integration points or external dependencies
51
+ - Do NOT restructure the document
52
+
53
+ ## Rules
54
+
55
+ - ALWAYS use `Edit` (not `Write`) to preserve user-written content
56
+ - NEVER rewrite entire files — make targeted, minimal edits
57
+ - NEVER add documentation for unchanged code
58
+ - NEVER modify source code files — only documentation files
59
+ - If a doc file doesn't exist, skip it (don't create it)
60
+ - Keep updates concise — match the existing style and tone of each document
@@ -5,7 +5,7 @@ write_scope:
5
5
 
6
6
  # Gate Reviewer
7
7
 
8
- You are a SNIPER gate reviewer agent. You run automated checks at phase boundaries and produce gate results. You are triggered automatically by hooks.
8
+ You are a SNIPER gate reviewer agent. You run automated checks at phase boundaries and produce gate results.
9
9
 
10
10
  ## Responsibilities
11
11
 
@@ -13,9 +13,19 @@ You are a SNIPER gate reviewer agent. You run automated checks at phase boundari
13
13
  2. **Result Recording** — Write a gate result YAML to `.sniper/gates/`
14
14
  3. **Pass/Fail Decision** — A gate passes only if ALL `blocking: true` checks pass
15
15
 
16
- ## Execution Process
16
+ ## Protocol ID Resolution
17
+
18
+ The orchestrator provides the current `protocol_id` (e.g., `SNPR-20260307-a3f2`) when spawning you. Before executing checks:
17
19
 
18
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)
19
29
  2. For each check:
20
30
  - If `command` is specified, run it via Bash and check exit code
21
31
  - If `check` is specified, evaluate the condition (file existence, grep match, etc.)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  write_scope:
3
- - "docs/"
3
+ - ".sniper/artifacts/"
4
4
  ---
5
5
 
6
6
  # Product Manager
@@ -26,8 +26,10 @@ Use the EARS (Easy Approach to Requirements Syntax) patterns:
26
26
 
27
27
  ## Output Artifacts
28
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)
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
31
33
 
32
34
  ## Rules
33
35
 
@@ -16,13 +16,19 @@ You are a SNIPER retro analyst agent. You run automated retrospectives after pro
16
16
  5. **Retro Report** — Write structured retro to `.sniper/retros/`
17
17
  6. **Velocity Tracking** — Record execution metrics to `.sniper/memory/velocity.yaml` for budget calibration
18
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
+
19
24
  ## Analysis Process
20
25
 
21
- 1. Read `.sniper/checkpoints/` for the completed protocol's checkpoint history
26
+ 1. Read `.sniper/checkpoints/{protocol_id}-*` for the completed protocol's checkpoint history
22
27
  2. Read `.sniper/gates/` for gate results (pass/fail patterns)
23
28
  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
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`
26
32
 
27
33
  ## Retro Report Schema
28
34
 
@@ -4,20 +4,20 @@ description: Discovery phase quality gate
4
4
  checks:
5
5
  - id: spec_produced
6
6
  description: Discovery spec exists
7
- check: file:docs/spec.md
7
+ check: file:.sniper/artifacts/spec.md
8
8
  blocking: true
9
9
 
10
10
  - id: scope_defined
11
11
  description: Spec defines in-scope requirements
12
- check: grep:docs/spec.md:"## Requirements"
12
+ check: grep:.sniper/artifacts/spec.md:"## Requirements"
13
13
  blocking: true
14
14
 
15
15
  - id: out_of_scope_explicit
16
16
  description: Spec explicitly lists out-of-scope items
17
- check: grep:docs/spec.md:"## Out of Scope"
17
+ check: grep:.sniper/artifacts/spec.md:"## Out of Scope"
18
18
  blocking: false
19
19
 
20
20
  - id: codebase_overview
21
21
  description: Codebase overview exists (if ingesting existing project)
22
- check: file:docs/codebase-overview.md
22
+ check: file:.sniper/artifacts/codebase-overview.md
23
23
  blocking: false
@@ -4,15 +4,15 @@ description: Ingest document phase quality gate — verifies spec was produced f
4
4
  checks:
5
5
  - id: spec_produced
6
6
  description: Discovery spec exists
7
- check: file:docs/spec.md
7
+ check: file:.sniper/artifacts/spec.md
8
8
  blocking: true
9
9
 
10
10
  - id: scope_defined
11
11
  description: Spec defines in-scope requirements
12
- check: grep:docs/spec.md:"## Requirements"
12
+ check: grep:.sniper/artifacts/spec.md:"## Requirements"
13
13
  blocking: true
14
14
 
15
15
  - id: out_of_scope_explicit
16
16
  description: Spec explicitly lists out-of-scope items
17
- check: grep:docs/spec.md:"## Out of Scope"
17
+ check: grep:.sniper/artifacts/spec.md:"## Out of Scope"
18
18
  blocking: false
@@ -4,15 +4,15 @@ description: Ingest scan phase quality gate — verifies codebase overview was p
4
4
  checks:
5
5
  - id: codebase_overview_exists
6
6
  description: Codebase overview document exists
7
- check: file:docs/codebase-overview.md
7
+ check: file:.sniper/artifacts/codebase-overview.md
8
8
  blocking: true
9
9
 
10
10
  - id: overview_has_structure
11
11
  description: Overview includes project structure section
12
- check: grep:docs/codebase-overview.md:"## "
12
+ check: grep:.sniper/artifacts/codebase-overview.md:"## "
13
13
  blocking: false
14
14
 
15
15
  - id: overview_nonempty
16
16
  description: Overview is not a stub (at least 50 lines)
17
- command: "test $(wc -l < docs/codebase-overview.md) -ge 50"
17
+ command: "test $(wc -l < .sniper/artifacts/codebase-overview.md) -ge 50"
18
18
  blocking: false
@@ -1,21 +1,22 @@
1
1
  name: multi-faceted-review
2
2
  description: Multi-dimensional review gate — scope, standards, and risk
3
+ # Note: {protocol_id} is resolved at gate-review time from the active checkpoint
3
4
 
4
5
  checks:
5
6
  # Scope Validation — does the implementation match requirements?
6
7
  - id: scope_spec_match
7
8
  description: Implementation addresses all spec requirements
8
- check: file:docs/spec.md
9
+ check: file:.sniper/artifacts/spec.md
9
10
  blocking: true
10
11
 
11
12
  - id: scope_acceptance_criteria
12
13
  description: All acceptance criteria from stories are addressed
13
- check: "grep:docs/stories/:shall"
14
+ check: "grep:.sniper/artifacts/{protocol_id}/stories/:shall"
14
15
  blocking: true
15
16
 
16
17
  - id: scope_no_creep
17
18
  description: No undocumented features added beyond spec
18
- check: file:docs/review-report.md
19
+ check: file:.sniper/artifacts/{protocol_id}/review-report.md
19
20
  blocking: false
20
21
 
21
22
  # Standards Enforcement — does the code follow conventions?
@@ -37,20 +38,20 @@ checks:
37
38
  # Risk Scoring — are there security, performance, or reliability risks?
38
39
  - id: risk_security
39
40
  description: No OWASP Top 10 vulnerabilities detected
40
- check: 'grep:docs/review-report.md:"## Security"'
41
+ check: 'grep:.sniper/artifacts/{protocol_id}/review-report.md:"## Security"'
41
42
  blocking: true
42
43
 
43
44
  - id: risk_performance
44
45
  description: No obvious performance regressions
45
- check: 'grep:docs/review-report.md:"## Performance"'
46
+ check: 'grep:.sniper/artifacts/{protocol_id}/review-report.md:"## Performance"'
46
47
  blocking: false
47
48
 
48
49
  - id: risk_error_handling
49
50
  description: Error cases are handled gracefully
50
- check: 'grep:docs/review-report.md:"## Error Handling"'
51
+ check: 'grep:.sniper/artifacts/{protocol_id}/review-report.md:"## Error Handling"'
51
52
  blocking: false
52
53
 
53
54
  - id: risk_data_integrity
54
55
  description: No data loss or corruption risks
55
- check: 'grep:docs/review-report.md:"## Data Integrity"'
56
+ check: 'grep:.sniper/artifacts/{protocol_id}/review-report.md:"## Data Integrity"'
56
57
  blocking: true
@@ -1,36 +1,36 @@
1
1
  name: plan
2
2
  description: Planning phase quality gate
3
+ # Note: {protocol_id} is resolved at gate-review time from the active checkpoint
3
4
 
4
5
  checks:
5
6
  - id: has_context_section
6
- check: grep:docs/architecture.md:"## Context"
7
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## Context"
7
8
  blocking: true
8
- description: Architecture doc includes Context section
9
+ description: Architecture plan includes Context section
9
10
  - id: has_decisions_section
10
- check: grep:docs/architecture.md:"## Decisions"
11
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## Decisions"
11
12
  blocking: true
12
- description: Architecture doc includes Decisions section
13
+ description: Architecture plan includes Decisions section
13
14
  - id: has_components_section
14
- check: grep:docs/architecture.md:"## Components"
15
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## Components"
15
16
  blocking: true
16
- description: Architecture doc includes Components section
17
+ description: Architecture plan includes Components section
17
18
  - id: has_data_model_section
18
- check: grep:docs/architecture.md:"## Data Model"
19
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## Data Model"
19
20
  blocking: true
20
- description: Architecture doc includes Data Model section
21
+ description: Architecture plan includes Data Model section
21
22
 
22
23
  - id: ears_criteria
23
24
  description: All stories have EARS acceptance criteria
24
- check: grep:docs/stories/:"shall"
25
+ check: grep:.sniper/artifacts/{protocol_id}/stories/:"shall"
25
26
  blocking: true
26
27
 
27
28
  - id: open_questions
28
29
  description: No unresolved open questions remain
29
- # '|' separates alternation patterns (grep -E style)
30
- check: "!grep:docs/:\\*\\*TBD\\*\\*|\\*\\*TODO\\*\\*|\\*\\*OPEN\\*\\*"
30
+ check: "!grep:.sniper/artifacts/{protocol_id}/:\\*\\*TBD\\*\\*|\\*\\*TODO\\*\\*|\\*\\*OPEN\\*\\*"
31
31
  blocking: false
32
32
 
33
33
  - id: token_budget
34
- description: Architecture doc within character budget (~4000 tokens 16000 chars)
35
- check: wc:docs/architecture.md:<16000
34
+ description: Architecture plan within character budget (~4000 tokens = 16000 chars)
35
+ check: wc:.sniper/artifacts/{protocol_id}/plan.md:<16000
36
36
  blocking: false
@@ -1,18 +1,19 @@
1
1
  name: refactor-analyze
2
2
  description: Refactor analysis phase quality gate — verifies analysis artifacts
3
+ # Note: {protocol_id} is resolved at gate-review time from the active checkpoint
3
4
 
4
5
  checks:
5
6
  - id: analysis_produced
6
- description: Refactoring analysis spec exists
7
- check: file:docs/spec.md
7
+ description: Refactoring analysis plan exists
8
+ check: file:.sniper/artifacts/{protocol_id}/plan.md
8
9
  blocking: true
9
10
 
10
11
  - id: refactor_targets_identified
11
12
  description: Analysis identifies specific refactoring targets
12
- check: grep:docs/spec.md:"## "
13
+ check: grep:.sniper/artifacts/{protocol_id}/plan.md:"## "
13
14
  blocking: false
14
15
 
15
16
  - id: analysis_nonempty
16
17
  description: Analysis is not a stub (at least 20 lines)
17
- command: "test $(wc -l < docs/spec.md) -ge 20"
18
+ command: "test $(wc -l < .sniper/artifacts/{protocol_id}/plan.md) -ge 20"
18
19
  blocking: false
@@ -1,5 +1,6 @@
1
1
  name: review
2
2
  description: Review phase quality gate
3
+ # Note: {protocol_id} is resolved at gate-review time from the active checkpoint
3
4
 
4
5
  checks:
5
6
  - id: gate_checks_pass
@@ -9,7 +10,7 @@ checks:
9
10
 
10
11
  - id: spec_reconciliation
11
12
  description: Review report confirms spec compliance
12
- check: file:docs/review-report.md
13
+ check: file:.sniper/artifacts/{protocol_id}/review-report.md
13
14
  blocking: true
14
15
 
15
16
  - id: no_regressions
@@ -19,10 +20,10 @@ checks:
19
20
 
20
21
  - id: no_blocking_findings
21
22
  description: No blocking findings in review report
22
- check: "!grep:docs/review-report.md:### Blocking"
23
+ check: "!grep:.sniper/artifacts/{protocol_id}/review-report.md:### Blocking"
23
24
  blocking: true
24
25
 
25
26
  - id: spec_reconciled
26
27
  description: Spec has been reconciled with implementation
27
- check: "grep:docs/spec.md:Last reconciled:"
28
+ check: "grep:.sniper/artifacts/spec.md:Last reconciled:"
28
29
  blocking: false
@@ -2,29 +2,38 @@
2
2
  "hooks": {
3
3
  "PreToolUse": [
4
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"
5
+ "matcher": { "tools": ["Write"] },
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "description": "Enforce lead orchestrator write scope restriction",
10
+ "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' >&2; exit 2; fi"
11
+ }
12
+ ]
9
13
  }
10
14
  ],
11
15
  "PostToolUse": [
12
16
  {
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"
17
+ "matcher": { "tools": ["Bash"] },
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "description": "Self-healing CI: detect test/lint failures and instruct agent to fix",
22
+ "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"
23
+ }
24
+ ]
16
25
  }
17
26
  ],
18
27
  "Stop": [
19
28
  {
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"
29
+ "matcher": {},
30
+ "hooks": [
31
+ {
32
+ "type": "command",
33
+ "description": "Run gate reviewer at phase boundaries",
34
+ "command": "if [ -f .sniper/pending-gate.yaml ]; then echo 'Gate review pending — spawning gate-reviewer agent'; fi"
35
+ }
36
+ ]
28
37
  }
29
38
  ]
30
39
  }
@@ -2,9 +2,14 @@
2
2
  "hooks": {
3
3
  "PostToolUse": [
4
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"
5
+ "matcher": { "tools": ["Bash"] },
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "description": "Auto-capture CI failure signals from test/lint output",
10
+ "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"
11
+ }
12
+ ]
8
13
  }
9
14
  ]
10
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sniper.ai/core",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "SNIPER framework core — agents, skills, protocols, checklists, templates, and hooks",
5
5
  "type": "module",
6
6
  "exports": {
@@ -12,7 +12,10 @@ phases:
12
12
  checklist: discover
13
13
  human_approval: false
14
14
  outputs:
15
- - docs/spec.md
16
- - docs/codebase-overview.md
15
+ - .sniper/artifacts/spec.md # Living master doc — not per-protocol (explore has no versioned artifacts)
16
+ - .sniper/artifacts/codebase-overview.md # Living master doc — not per-protocol
17
17
 
18
+ # Note: explore/ingest protocols write to master docs (.sniper/artifacts/spec.md, .sniper/artifacts/codebase-overview.md)
19
+ # rather than per-protocol directories (.sniper/artifacts/{protocol_id}/). A meta.yaml and registry entry
20
+ # are still created by /sniper-flow, but the artifact directory may be empty.
18
21
  auto_retro: false # Exploration doesn't need retros
@@ -8,22 +8,24 @@ phases:
8
8
  agents:
9
9
  - architect
10
10
  - product-manager
11
- spawn_strategy: team
11
+ spawn_strategy: sequential # Architect designs first, PM writes stories from that
12
+ interactive_review: true # Present plan to user for review/feedback before proceeding
12
13
  gate:
13
14
  checklist: plan
14
15
  human_approval: true
15
16
  outputs:
16
- - docs/architecture.md
17
- - docs/prd.md
18
- - docs/stories/
17
+ - .sniper/artifacts/{protocol_id}/plan.md
18
+ - .sniper/artifacts/{protocol_id}/prd.md
19
+ - .sniper/artifacts/{protocol_id}/stories/
19
20
 
20
21
  - name: implement
21
22
  description: Feature implementation
22
23
  agents:
23
24
  - fullstack-dev
24
25
  - qa-engineer
25
- spawn_strategy: team
26
+ spawn_strategy: parallel # Multiple subagents via Task, not full TeamCreate
26
27
  plan_approval: true
28
+ doc_sync: true # Run doc-writer after this phase to update living docs
27
29
  gate:
28
30
  checklist: implement
29
31
  human_approval: false
@@ -40,6 +42,6 @@ phases:
40
42
  checklist: review
41
43
  human_approval: true
42
44
  outputs:
43
- - docs/review-report.md
45
+ - .sniper/artifacts/{protocol_id}/review-report.md
44
46
 
45
47
  auto_retro: true
@@ -12,8 +12,8 @@ phases:
12
12
  checklist: discover
13
13
  human_approval: false
14
14
  outputs:
15
- - docs/spec.md
16
- - docs/codebase-overview.md
15
+ - .sniper/artifacts/spec.md # Living master doc
16
+ - .sniper/artifacts/codebase-overview.md # Living master doc
17
17
 
18
18
  - name: plan
19
19
  description: Architecture design, PRD creation, story breakdown
@@ -21,6 +21,7 @@ phases:
21
21
  - architect
22
22
  - product-manager
23
23
  spawn_strategy: team # Multiple agents, use TeamCreate
24
+ interactive_review: true # Present plan to user for review/feedback before proceeding
24
25
  coordination:
25
26
  - between: [architect, product-manager]
26
27
  topic: Architecture must be approved before stories reference it
@@ -28,9 +29,9 @@ phases:
28
29
  checklist: plan
29
30
  human_approval: true # Human reviews the plan before implementation
30
31
  outputs:
31
- - docs/architecture.md
32
- - docs/prd.md
33
- - docs/stories/
32
+ - .sniper/artifacts/{protocol_id}/plan.md
33
+ - .sniper/artifacts/{protocol_id}/prd.md
34
+ - .sniper/artifacts/{protocol_id}/stories/
34
35
 
35
36
  - name: implement
36
37
  description: Code implementation with worktree isolation
@@ -39,6 +40,7 @@ phases:
39
40
  - qa-engineer
40
41
  spawn_strategy: team
41
42
  plan_approval: true # Each agent must get plan approved before coding
43
+ doc_sync: true # Run doc-writer after this phase to update living docs
42
44
  gate:
43
45
  checklist: implement
44
46
  human_approval: false
@@ -58,6 +60,6 @@ phases:
58
60
  multi_model_checklist: multi-faceted-review
59
61
  human_approval: true # Human final sign-off
60
62
  outputs:
61
- - docs/review-report.md
63
+ - .sniper/artifacts/{protocol_id}/review-report.md
62
64
 
63
65
  auto_retro: true # Trigger retro-analyst after completion