@sniper.ai/core 3.4.0 → 4.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 +0 -2
- package/agents/analyst.md +0 -1
- package/agents/architect.md +1 -1
- package/agents/product-manager.md +1 -1
- package/agents/retro-analyst.md +5 -30
- package/checklists/define.yaml +0 -5
- package/checklists/design.yaml +0 -5
- package/checklists/plan.yaml +0 -5
- package/checklists/retro.yaml +0 -6
- package/config.template.yaml +0 -17
- package/package.json +1 -1
- package/protocols/explore.yaml +0 -1
- package/protocols/feature.yaml +0 -2
- package/protocols/full.yaml +0 -2
- package/protocols/hotfix.yaml +0 -1
- package/protocols/ingest.yaml +0 -1
- package/protocols/patch.yaml +0 -1
- package/protocols/refactor.yaml +0 -2
- package/schemas/checkpoint.schema.yaml +0 -16
- package/schemas/live-status.schema.yaml +0 -17
- package/schemas/protocol.schema.yaml +0 -5
- package/schemas/retro.schema.yaml +0 -14
- package/skills/sniper-flow/SKILL.md +7 -19
- package/skills/sniper-init/SKILL.md +0 -1
- package/skills/sniper-status/SKILL.md +1 -21
- package/templates/architecture.md +0 -7
- package/templates/checkpoint.yaml +0 -5
- package/templates/custom-protocol.yaml +2 -7
- package/templates/discovery-brief.md +0 -7
- package/templates/live-status.yaml +0 -5
- package/templates/prd.md +0 -8
- package/templates/story.md +0 -5
- package/schemas/cost.schema.yaml +0 -97
- package/schemas/velocity.schema.yaml +0 -52
- package/templates/cost.yaml +0 -23
- package/templates/velocity.yaml +0 -9
package/README.md
CHANGED
|
@@ -109,9 +109,7 @@ Domain-specific knowledge is provided separately by domain packs (e.g., `@sniper
|
|
|
109
109
|
| `workspace-config.yaml` | YAML | Workspace configuration |
|
|
110
110
|
| `knowledge-manifest.yaml` | YAML | Knowledge base manifest |
|
|
111
111
|
| `checkpoint.yaml` | YAML | Protocol checkpoint state |
|
|
112
|
-
| `cost.yaml` | YAML | Token cost tracking |
|
|
113
112
|
| `live-status.yaml` | YAML | Live protocol status |
|
|
114
|
-
| `velocity.yaml` | YAML | Velocity calibration data |
|
|
115
113
|
| `signal-record.yaml` | YAML | Signal event record |
|
|
116
114
|
|
|
117
115
|
## Checklists
|
package/agents/analyst.md
CHANGED
|
@@ -25,6 +25,5 @@ You are a SNIPER analyst agent. You research, analyze, and produce discovery art
|
|
|
25
25
|
- Ground every finding in evidence — cite file paths, line numbers, or URLs
|
|
26
26
|
- Distinguish facts from assumptions explicitly
|
|
27
27
|
- Flag unknowns as open questions rather than guessing
|
|
28
|
-
- Respect token budgets annotated in templates
|
|
29
28
|
- Do NOT make architectural decisions — surface options with tradeoffs for the architect
|
|
30
29
|
- The discovery brief is research output, not a specification — frame it as findings and constraints, not design
|
package/agents/architect.md
CHANGED
|
@@ -17,7 +17,7 @@ You are a SNIPER architect agent. You design system architecture and produce tec
|
|
|
17
17
|
|
|
18
18
|
## Output Artifacts
|
|
19
19
|
|
|
20
|
-
- `.sniper/artifacts/{protocol_id}/plan.md` — Architecture plan for this protocol run (use `architecture.md` template
|
|
20
|
+
- `.sniper/artifacts/{protocol_id}/plan.md` — Architecture plan for this protocol run (use `architecture.md` template)
|
|
21
21
|
- The `{protocol_id}` (e.g., `SNPR-20260307-a3f2`) is provided by the orchestrator when spawning you
|
|
22
22
|
- This is a per-run snapshot; the master `docs/architecture.md` is updated separately by the doc-writer
|
|
23
23
|
|
|
@@ -41,7 +41,7 @@ Use the EARS (Easy Approach to Requirements Syntax) patterns:
|
|
|
41
41
|
## Output Artifacts
|
|
42
42
|
|
|
43
43
|
- `.sniper/artifacts/{protocol_id}/prd.md` — Product requirements for this protocol run (use `prd.md` template)
|
|
44
|
-
- `.sniper/artifacts/{protocol_id}/stories/*.md` — Individual stories (use `story.md` template
|
|
44
|
+
- `.sniper/artifacts/{protocol_id}/stories/*.md` — Individual stories (use `story.md` template)
|
|
45
45
|
- The `{protocol_id}` (e.g., `SNPR-20260307-a3f2`) is provided by the orchestrator when spawning you
|
|
46
46
|
- These are per-run snapshots that preserve the plan history
|
|
47
47
|
|
package/agents/retro-analyst.md
CHANGED
|
@@ -11,10 +11,9 @@ You are a SNIPER retro analyst agent. You run automated retrospectives after pro
|
|
|
11
11
|
|
|
12
12
|
1. **Protocol Analysis** — Review what happened during the completed protocol execution
|
|
13
13
|
2. **Pattern Extraction** — Identify what worked well and what didn't
|
|
14
|
-
3. **Metric Collection** — Gather
|
|
14
|
+
3. **Metric Collection** — Gather duration, agent count, and gate results
|
|
15
15
|
4. **Recommendation Generation** — Suggest concrete improvements for next time
|
|
16
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
17
|
|
|
19
18
|
## Invocation
|
|
20
19
|
|
|
@@ -25,10 +24,9 @@ The orchestrator provides you with the `protocol_id` (e.g., `SNPR-20260307-a3f2`
|
|
|
25
24
|
|
|
26
25
|
1. Read `.sniper/checkpoints/{protocol_id}-*` for the completed protocol's checkpoint history
|
|
27
26
|
2. Read `.sniper/gates/` for gate results (pass/fail patterns)
|
|
28
|
-
3. Read `.sniper/
|
|
29
|
-
4.
|
|
30
|
-
5.
|
|
31
|
-
6. Write retro report to `.sniper/retros/{protocol_id}.yaml`
|
|
27
|
+
3. Read `.sniper/artifacts/{protocol_id}/meta.yaml` for protocol metadata
|
|
28
|
+
4. Analyze: Which gates failed first? Were there re-runs?
|
|
29
|
+
5. Write retro report to `.sniper/retros/{protocol_id}.yaml`
|
|
32
30
|
|
|
33
31
|
## Retro Report Schema
|
|
34
32
|
|
|
@@ -41,7 +39,6 @@ duration_phases:
|
|
|
41
39
|
gate_attempts: <count>
|
|
42
40
|
gate_result: pass | fail
|
|
43
41
|
metrics:
|
|
44
|
-
total_tokens: <number>
|
|
45
42
|
total_agents_spawned: <number>
|
|
46
43
|
gate_pass_rate: <percentage>
|
|
47
44
|
findings:
|
|
@@ -58,7 +55,7 @@ findings:
|
|
|
58
55
|
- Be specific — cite actual data, not vague observations
|
|
59
56
|
- Focus on actionable improvements, not blame
|
|
60
57
|
- Write to `.sniper/retros/` only — never modify project code
|
|
61
|
-
- Keep the report concise
|
|
58
|
+
- Keep the report concise
|
|
62
59
|
- Compare against previous retros if they exist to track trends
|
|
63
60
|
|
|
64
61
|
## Learning Extraction
|
|
@@ -132,25 +129,3 @@ During the retrospective, analyze external signals from both legacy and new stor
|
|
|
132
129
|
recurrence: <count>
|
|
133
130
|
```
|
|
134
131
|
|
|
135
|
-
## Velocity Tracking
|
|
136
|
-
|
|
137
|
-
After writing the retro report, update velocity data:
|
|
138
|
-
|
|
139
|
-
1. Read `.sniper/memory/velocity.yaml` (create if it doesn't exist)
|
|
140
|
-
2. Append a new execution record:
|
|
141
|
-
```yaml
|
|
142
|
-
- protocol: <protocol_name>
|
|
143
|
-
completed_at: <ISO 8601>
|
|
144
|
-
wall_clock_seconds: <duration>
|
|
145
|
-
tokens_used: <total_tokens>
|
|
146
|
-
tokens_per_phase:
|
|
147
|
-
<phase_name>: <tokens>
|
|
148
|
-
```
|
|
149
|
-
3. After 5+ executions of the same protocol, compute `calibrated_budgets`:
|
|
150
|
-
- Collect all `tokens_used` values for that protocol
|
|
151
|
-
- Calculate the p75 (75th percentile) value
|
|
152
|
-
- Set `calibrated_budgets.<protocol>` to that value
|
|
153
|
-
4. Update `rolling_averages.<protocol>` with exponential moving average:
|
|
154
|
-
- Formula: `new_avg = 0.3 * latest_tokens + 0.7 * previous_avg`
|
|
155
|
-
- If no previous average, use the latest value
|
|
156
|
-
5. Write updated velocity data back to `.sniper/memory/velocity.yaml`
|
package/checklists/define.yaml
CHANGED
|
@@ -21,8 +21,3 @@ checks:
|
|
|
21
21
|
description: PRD explicitly defines what is out of scope
|
|
22
22
|
check: grep:.sniper/artifacts/{protocol_id}/prd.md:"## Out of Scope"
|
|
23
23
|
blocking: true # Out of scope must be explicit — this is where scope creep dies
|
|
24
|
-
|
|
25
|
-
- id: token_budget
|
|
26
|
-
description: PRD is concise (under 12000 chars)
|
|
27
|
-
check: wc:.sniper/artifacts/{protocol_id}/prd.md:<12000
|
|
28
|
-
blocking: false
|
package/checklists/design.yaml
CHANGED
|
@@ -36,8 +36,3 @@ checks:
|
|
|
36
36
|
description: No unresolved open questions remain
|
|
37
37
|
check: "!grep:.sniper/artifacts/{protocol_id}/plan.md:\\*\\*TBD\\*\\*|\\*\\*TODO\\*\\*|\\*\\*OPEN\\*\\*"
|
|
38
38
|
blocking: false
|
|
39
|
-
|
|
40
|
-
- id: token_budget
|
|
41
|
-
description: Architecture plan within character budget (~4000 tokens = 16000 chars)
|
|
42
|
-
check: wc:.sniper/artifacts/{protocol_id}/plan.md:<16000
|
|
43
|
-
blocking: false
|
package/checklists/plan.yaml
CHANGED
|
@@ -26,8 +26,3 @@ checks:
|
|
|
26
26
|
description: No unresolved open questions remain
|
|
27
27
|
check: "!grep:.sniper/artifacts/{protocol_id}/plan.md:\\*\\*TBD\\*\\*|\\*\\*TODO\\*\\*|\\*\\*OPEN\\*\\*"
|
|
28
28
|
blocking: false
|
|
29
|
-
|
|
30
|
-
- id: token_budget
|
|
31
|
-
description: Architecture plan within character budget (~4000 tokens = 16000 chars)
|
|
32
|
-
check: wc:.sniper/artifacts/{protocol_id}/plan.md:<16000
|
|
33
|
-
blocking: false
|
package/checklists/retro.yaml
CHANGED
package/config.template.yaml
CHANGED
|
@@ -44,16 +44,6 @@ routing:
|
|
|
44
44
|
# Default protocol when auto-detect is ambiguous
|
|
45
45
|
default: feature
|
|
46
46
|
|
|
47
|
-
# Protocol token budgets (override protocol defaults)
|
|
48
|
-
budgets:
|
|
49
|
-
full: 2000000
|
|
50
|
-
feature: 800000
|
|
51
|
-
patch: 200000
|
|
52
|
-
ingest: 1000000
|
|
53
|
-
explore: 500000
|
|
54
|
-
refactor: 600000
|
|
55
|
-
hotfix: 100000
|
|
56
|
-
|
|
57
47
|
# Trigger tables — map file patterns to agents or protocols
|
|
58
48
|
# Example:
|
|
59
49
|
# - pattern: "src/api/**"
|
|
@@ -64,12 +54,6 @@ routing:
|
|
|
64
54
|
# protocol: full
|
|
65
55
|
triggers: []
|
|
66
56
|
|
|
67
|
-
# Cost enforcement
|
|
68
|
-
cost:
|
|
69
|
-
warn_threshold: 0.7 # Warn at 70% of budget
|
|
70
|
-
soft_cap: 0.9 # Soft cap at 90% — agents must justify continuing
|
|
71
|
-
hard_cap: 1.0 # Hard cap at 100% — stop execution
|
|
72
|
-
|
|
73
57
|
# Review configuration
|
|
74
58
|
review:
|
|
75
59
|
multi_model: false # Enable multi-model review for gate checks
|
|
@@ -161,5 +145,4 @@ learning:
|
|
|
161
145
|
visibility:
|
|
162
146
|
live_status: true # Maintain .sniper/live-status.yaml
|
|
163
147
|
checkpoints: true # Write phase checkpoints
|
|
164
|
-
cost_tracking: true # Track token usage
|
|
165
148
|
# auto_retro: true # DEPRECATED — use retro phase in protocols instead
|
package/package.json
CHANGED
package/protocols/explore.yaml
CHANGED
package/protocols/feature.yaml
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
name: feature
|
|
2
2
|
description: Incremental feature — define, design, solve, implement, review, retro
|
|
3
|
-
budget: 800000 # 800K tokens
|
|
4
3
|
|
|
5
4
|
phases:
|
|
6
5
|
- name: define
|
|
@@ -75,5 +74,4 @@ phases:
|
|
|
75
74
|
human_approval: false
|
|
76
75
|
outputs:
|
|
77
76
|
- .sniper/retros/{protocol_id}.yaml
|
|
78
|
-
- .sniper/memory/velocity.yaml
|
|
79
77
|
- .sniper/memory/learnings/
|
package/protocols/full.yaml
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
name: full
|
|
2
2
|
description: Complete project lifecycle — discovery through review
|
|
3
|
-
budget: 2000000 # 2M tokens
|
|
4
3
|
|
|
5
4
|
phases:
|
|
6
5
|
- name: discover
|
|
@@ -91,7 +90,6 @@ phases:
|
|
|
91
90
|
human_approval: false
|
|
92
91
|
outputs:
|
|
93
92
|
- .sniper/retros/{protocol_id}.yaml
|
|
94
|
-
- .sniper/memory/velocity.yaml
|
|
95
93
|
- .sniper/memory/learnings/
|
|
96
94
|
|
|
97
95
|
- name: curate
|
package/protocols/hotfix.yaml
CHANGED
package/protocols/ingest.yaml
CHANGED
package/protocols/patch.yaml
CHANGED
package/protocols/refactor.yaml
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
name: refactor
|
|
2
2
|
description: Code improvement — analyze, refactor, and review
|
|
3
|
-
budget: 600000 # 600K tokens
|
|
4
3
|
|
|
5
4
|
phases:
|
|
6
5
|
- name: analyze
|
|
@@ -50,5 +49,4 @@ phases:
|
|
|
50
49
|
human_approval: false
|
|
51
50
|
outputs:
|
|
52
51
|
- .sniper/retros/{protocol_id}.yaml
|
|
53
|
-
- .sniper/memory/velocity.yaml
|
|
54
52
|
- .sniper/memory/learnings/
|
|
@@ -92,22 +92,6 @@ properties:
|
|
|
92
92
|
- draft
|
|
93
93
|
- complete
|
|
94
94
|
description: Whether the artifact is a draft or complete.
|
|
95
|
-
token_usage:
|
|
96
|
-
type: object
|
|
97
|
-
description: Token consumption metrics for this phase.
|
|
98
|
-
properties:
|
|
99
|
-
phase_tokens:
|
|
100
|
-
type: integer
|
|
101
|
-
minimum: 0
|
|
102
|
-
description: Tokens consumed during this phase.
|
|
103
|
-
cumulative_tokens:
|
|
104
|
-
type: integer
|
|
105
|
-
minimum: 0
|
|
106
|
-
description: Total tokens consumed across all phases up to and including this one.
|
|
107
|
-
budget_remaining:
|
|
108
|
-
type: number
|
|
109
|
-
minimum: 0
|
|
110
|
-
description: Remaining token budget.
|
|
111
95
|
commits:
|
|
112
96
|
type: array
|
|
113
97
|
description: Git commits made during this phase, used for logical revert.
|
|
@@ -126,23 +126,6 @@ properties:
|
|
|
126
126
|
type: string
|
|
127
127
|
format: date-time
|
|
128
128
|
description: ISO 8601 timestamp of when the gate review completed.
|
|
129
|
-
cost:
|
|
130
|
-
type: object
|
|
131
|
-
description: Current cost snapshot.
|
|
132
|
-
properties:
|
|
133
|
-
tokens_used:
|
|
134
|
-
type: integer
|
|
135
|
-
minimum: 0
|
|
136
|
-
description: Total tokens consumed so far.
|
|
137
|
-
budget:
|
|
138
|
-
type: number
|
|
139
|
-
minimum: 0
|
|
140
|
-
description: Total token budget.
|
|
141
|
-
percent:
|
|
142
|
-
type: number
|
|
143
|
-
minimum: 0
|
|
144
|
-
maximum: 100
|
|
145
|
-
description: Percentage of budget consumed.
|
|
146
129
|
next_action:
|
|
147
130
|
type: string
|
|
148
131
|
description: Description of the next expected action or step.
|
|
@@ -6,7 +6,6 @@ type: object
|
|
|
6
6
|
required:
|
|
7
7
|
- name
|
|
8
8
|
- description
|
|
9
|
-
- budget
|
|
10
9
|
- phases
|
|
11
10
|
properties:
|
|
12
11
|
name:
|
|
@@ -15,10 +14,6 @@ properties:
|
|
|
15
14
|
description:
|
|
16
15
|
type: string
|
|
17
16
|
description: Human-readable description of the protocol's purpose.
|
|
18
|
-
budget:
|
|
19
|
-
type: integer
|
|
20
|
-
minimum: 1
|
|
21
|
-
description: Maximum token budget for the entire protocol execution.
|
|
22
17
|
phases:
|
|
23
18
|
type: array
|
|
24
19
|
minItems: 1
|
|
@@ -82,18 +82,4 @@ properties:
|
|
|
82
82
|
type: array
|
|
83
83
|
items: { type: string }
|
|
84
84
|
description: IDs of learnings created from this retro's findings.
|
|
85
|
-
velocity:
|
|
86
|
-
type: object
|
|
87
|
-
description: Velocity metrics for this execution, used for budget calibration.
|
|
88
|
-
properties:
|
|
89
|
-
wall_clock_seconds:
|
|
90
|
-
type: number
|
|
91
|
-
minimum: 0
|
|
92
|
-
description: Total wall clock time for the protocol execution in seconds.
|
|
93
|
-
tokens_per_phase:
|
|
94
|
-
type: object
|
|
95
|
-
description: Token usage broken down by phase name.
|
|
96
|
-
additionalProperties:
|
|
97
|
-
type: integer
|
|
98
|
-
minimum: 0
|
|
99
85
|
additionalProperties: false
|
|
@@ -57,8 +57,7 @@ For each phase in the protocol, execute these 5 steps:
|
|
|
57
57
|
|
|
58
58
|
1. Read protocol YAML for the current phase definition
|
|
59
59
|
2. Read `.sniper/config.yaml` for agent config, ownership, commands
|
|
60
|
-
3.
|
|
61
|
-
4. Compose agents per [Reference: Agent Composition](#reference-agent-composition)
|
|
60
|
+
3. Compose agents per [Reference: Agent Composition](#reference-agent-composition)
|
|
62
61
|
|
|
63
62
|
### Execute
|
|
64
63
|
|
|
@@ -79,11 +78,10 @@ phase: <phase>
|
|
|
79
78
|
timestamp: <ISO 8601>
|
|
80
79
|
status: completed | failed
|
|
81
80
|
agents: [status per agent]
|
|
82
|
-
token_usage: [phase + cumulative]
|
|
83
81
|
commits: [git SHAs produced]
|
|
84
82
|
```
|
|
85
83
|
|
|
86
|
-
Update `.sniper/live-status.yaml` with current phase
|
|
84
|
+
Update `.sniper/live-status.yaml` with current phase and agent statuses.
|
|
87
85
|
|
|
88
86
|
After the `solve` phase completes, populate the `stories` array in `.sniper/live-status.yaml` by reading story files from `.sniper/artifacts/{protocol_id}/stories/`. During `implement`, update each story's status (`in_progress` → `completed`) as agents finish work on it.
|
|
89
87
|
|
|
@@ -107,25 +105,15 @@ After the `solve` phase completes, populate the `stories` array in `.sniper/live
|
|
|
107
105
|
|
|
108
106
|
1. Write final checkpoint
|
|
109
107
|
2. Update `.sniper/live-status.yaml` with `status: completed`
|
|
110
|
-
3. Update `.sniper/artifacts/{protocol_id}/meta.yaml` with final status,
|
|
108
|
+
3. Update `.sniper/artifacts/{protocol_id}/meta.yaml` with final status, commits, agents used
|
|
111
109
|
4. Update `.sniper/artifacts/registry.md` entry from `in_progress` to `completed`
|
|
112
|
-
5. Present summary: phases completed, gate results,
|
|
110
|
+
5. Present summary: phases completed, gate results, learnings created
|
|
113
111
|
6. **Backward compatibility:** If the protocol has `auto_retro: true` but no `retro` phase in its phases list (custom protocols), spawn retro-analyst as a single-agent phase before completing
|
|
114
112
|
|
|
115
|
-
## Cost Tracking
|
|
116
|
-
|
|
117
|
-
Maintain `.sniper/cost.yaml` throughout execution. At each checkpoint:
|
|
118
|
-
- `warn_threshold` → log warning, continue
|
|
119
|
-
- `soft_cap` → pause, ask user whether to continue
|
|
120
|
-
- `hard_cap` → checkpoint and stop gracefully
|
|
121
|
-
|
|
122
|
-
Read thresholds from `.sniper/config.yaml` cost section.
|
|
123
|
-
|
|
124
113
|
## Rules
|
|
125
114
|
|
|
126
115
|
- ALWAYS generate a protocol ID and create `.sniper/artifacts/{protocol_id}/` before spawning any agent
|
|
127
116
|
- ALWAYS checkpoint between phases
|
|
128
|
-
- ALWAYS respect token budgets
|
|
129
117
|
- ALWAYS present the plan for interactive review when `interactive_review: true`
|
|
130
118
|
- NEVER skip a gate — every phase transition goes through its gate
|
|
131
119
|
- NEVER advance past a failed blocking gate check
|
|
@@ -217,9 +205,9 @@ When a phase has `interactive_review: true`:
|
|
|
217
205
|
> **Note:** The retro is now a first-class phase in protocols (full, feature, refactor). This reference is retained for backward compatibility with custom protocols using `auto_retro: true`.
|
|
218
206
|
|
|
219
207
|
When `auto_retro: true` and no `retro` phase exists in the protocol:
|
|
220
|
-
1. Spawn `retro-analyst` as a single-agent phase with: protocol ID, checkpoint history, gate results
|
|
221
|
-
2. The retro-analyst writes a report to `.sniper/retros/{protocol_id}.yaml`, extracts learnings to `.sniper/memory/learnings/`,
|
|
222
|
-
3. Run the retro gate checklist (retro report exists
|
|
208
|
+
1. Spawn `retro-analyst` as a single-agent phase with: protocol ID, checkpoint history, gate results
|
|
209
|
+
2. The retro-analyst writes a report to `.sniper/retros/{protocol_id}.yaml`, extracts learnings to `.sniper/memory/learnings/`, and checks effectiveness of previously applied learnings
|
|
210
|
+
3. Run the retro gate checklist (retro report exists)
|
|
223
211
|
|
|
224
212
|
## Reference: Review Gate Feedback Capture
|
|
225
213
|
|
|
@@ -76,7 +76,6 @@ Create the following directory structure:
|
|
|
76
76
|
memory/
|
|
77
77
|
learnings/ ← Unified learning store (replaces signals/)
|
|
78
78
|
signals/ ← Legacy — kept for backward compat, migrated by memory-curator
|
|
79
|
-
velocity.yaml
|
|
80
79
|
archive/ ← Deprecated learnings archived here
|
|
81
80
|
.claude/
|
|
82
81
|
agents/ ← Copied from @sniper.ai/core/agents/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sniper-status
|
|
3
|
-
description: Show current SNIPER protocol progress
|
|
3
|
+
description: Show current SNIPER protocol progress
|
|
4
4
|
arguments: []
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -15,7 +15,6 @@ Display the current state of SNIPER in this project.
|
|
|
15
15
|
Read the following files (skip if they don't exist):
|
|
16
16
|
- `.sniper/config.yaml` — Project configuration
|
|
17
17
|
- `.sniper/live-status.yaml` — Active protocol progress
|
|
18
|
-
- `.sniper/cost.yaml` — Token usage tracking
|
|
19
18
|
|
|
20
19
|
If `.sniper/config.yaml` doesn't exist, display: "SNIPER is not initialized. Run `/sniper-init` first."
|
|
21
20
|
|
|
@@ -34,21 +33,10 @@ Format and display:
|
|
|
34
33
|
- Agent status per active phase
|
|
35
34
|
- Gate results for completed phases
|
|
36
35
|
|
|
37
|
-
**Cost Summary** (if tracking enabled):
|
|
38
|
-
- Tokens used vs budget
|
|
39
|
-
- Budget percentage with visual bar
|
|
40
|
-
- Warning if approaching soft/hard cap
|
|
41
|
-
|
|
42
36
|
**Recent Activity**:
|
|
43
37
|
- Last 3 checkpoints with timestamps
|
|
44
38
|
- Last gate result
|
|
45
39
|
|
|
46
|
-
**Velocity Trends** (if velocity data exists):
|
|
47
|
-
- Read `.sniper/memory/velocity.yaml`
|
|
48
|
-
- Show last 5 executions per protocol with tokens used
|
|
49
|
-
- Show calibrated budget vs configured budget comparison
|
|
50
|
-
- Show trend direction: ↑ (increasing usage), ↓ (decreasing usage), → (stable)
|
|
51
|
-
|
|
52
40
|
### 3. Format Output
|
|
53
41
|
|
|
54
42
|
Use clear formatting:
|
|
@@ -63,17 +51,9 @@ Phase: implement [===========-----] 68%
|
|
|
63
51
|
|
|
64
52
|
Gates:
|
|
65
53
|
plan: PASS (2025-01-15)
|
|
66
|
-
|
|
67
|
-
Cost: 245K / 800K tokens (31%)
|
|
68
|
-
[======--------------] 31%
|
|
69
|
-
|
|
70
|
-
Velocity:
|
|
71
|
-
feature: 612K avg (calibrated: 750K, configured: 800K) →
|
|
72
|
-
patch: 145K avg (calibrated: 180K, configured: 200K) ↓
|
|
73
54
|
```
|
|
74
55
|
|
|
75
56
|
## Rules
|
|
76
57
|
|
|
77
58
|
- Read-only — this skill never modifies any files
|
|
78
59
|
- If no protocol is active, show config summary only
|
|
79
|
-
- If cost tracking is disabled, skip cost section
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
# Architecture
|
|
2
|
-
<!-- Budget: 4000 tokens max -->
|
|
3
2
|
|
|
4
3
|
## Context
|
|
5
|
-
<!-- ~400 tokens: Technical context, constraints, existing system landscape -->
|
|
6
4
|
|
|
7
5
|
## Decisions
|
|
8
|
-
<!-- ~800 tokens: Key architectural decisions with rationale -->
|
|
9
6
|
<!-- For each decision: Context | Options Considered | Decision | Consequences -->
|
|
10
7
|
|
|
11
8
|
## Components
|
|
12
|
-
<!-- ~1000 tokens: Component breakdown with responsibilities -->
|
|
13
9
|
<!-- For each component: Name | Responsibility | Dependencies | Owner -->
|
|
14
10
|
|
|
15
11
|
## Data Model
|
|
16
|
-
<!-- ~600 tokens: Core entities and relationships -->
|
|
17
12
|
|
|
18
13
|
## API Contracts
|
|
19
|
-
<!-- ~800 tokens: Key API interfaces including error cases -->
|
|
20
14
|
<!-- For each endpoint: Method | Path | Request | Response | Errors -->
|
|
21
15
|
|
|
22
16
|
## Infrastructure
|
|
23
|
-
<!-- ~400 tokens: Deployment, scaling, monitoring considerations -->
|
|
@@ -13,10 +13,6 @@ name: my-protocol
|
|
|
13
13
|
# description (required): What this protocol accomplishes.
|
|
14
14
|
description: Describe the goal of your custom protocol
|
|
15
15
|
|
|
16
|
-
# budget (required): Maximum token budget for the entire execution.
|
|
17
|
-
# Common ranges: 100K (hotfix), 800K (feature), 2M (full lifecycle)
|
|
18
|
-
budget: 500000
|
|
19
|
-
|
|
20
16
|
# phases (required): Ordered list of phases. Each phase runs sequentially.
|
|
21
17
|
# The protocol engine executes phases top-to-bottom, gating between each.
|
|
22
18
|
phases:
|
|
@@ -94,10 +90,10 @@ phases:
|
|
|
94
90
|
- .sniper/artifacts/{protocol_id}/review-report.md
|
|
95
91
|
|
|
96
92
|
# ── Phase 4: Retro (recommended) ──────────────────────────
|
|
97
|
-
# Runs the retro-analyst to extract learnings
|
|
93
|
+
# Runs the retro-analyst to extract learnings and check
|
|
98
94
|
# learning effectiveness. Replaces the old auto_retro flag.
|
|
99
95
|
- name: retro
|
|
100
|
-
description: Retrospective — extract learnings
|
|
96
|
+
description: Retrospective — extract learnings
|
|
101
97
|
agents:
|
|
102
98
|
- retro-analyst
|
|
103
99
|
spawn_strategy: single
|
|
@@ -106,7 +102,6 @@ phases:
|
|
|
106
102
|
human_approval: false
|
|
107
103
|
outputs:
|
|
108
104
|
- .sniper/retros/{protocol_id}.yaml
|
|
109
|
-
- .sniper/memory/velocity.yaml
|
|
110
105
|
- .sniper/memory/learnings/
|
|
111
106
|
|
|
112
107
|
# ── Phase 5: Curate (optional) ────────────────────────────
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
# Discovery Brief
|
|
2
|
-
<!-- Budget: 3000 tokens max -->
|
|
3
2
|
<!-- This is research output, not a specification. Frame as findings and constraints, not design decisions. -->
|
|
4
3
|
|
|
5
4
|
## Context
|
|
6
|
-
<!-- ~300 tokens: What exists today, what triggered this investigation -->
|
|
7
5
|
|
|
8
6
|
## Findings
|
|
9
|
-
<!-- ~800 tokens: Key discoveries from codebase analysis, research, and requirements elicitation -->
|
|
10
7
|
<!-- Ground every finding in evidence — cite file paths, line numbers, or URLs -->
|
|
11
8
|
|
|
12
9
|
## Constraints
|
|
13
|
-
<!-- ~400 tokens: Technical constraints, dependencies, and limitations discovered -->
|
|
14
10
|
|
|
15
11
|
## Risks
|
|
16
|
-
<!-- ~300 tokens: Technical risks, unknowns, and potential blockers -->
|
|
17
12
|
|
|
18
13
|
## Out of Scope
|
|
19
|
-
<!-- ~200 tokens: Explicitly list what this work should NOT cover -->
|
|
20
14
|
|
|
21
15
|
## Open Questions
|
|
22
|
-
<!-- ~200 tokens: Unresolved questions that need answers before defining requirements -->
|
|
23
16
|
<!-- Distinguish facts from assumptions explicitly -->
|
package/templates/prd.md
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
# Product Requirements Document
|
|
2
|
-
<!-- Budget: 3000 tokens max -->
|
|
3
2
|
<!-- This defines WHAT to build and WHY — not HOW. Architecture comes later. -->
|
|
4
3
|
|
|
5
4
|
## Context
|
|
6
|
-
<!-- ~300 tokens: What exists today and why this work is needed -->
|
|
7
5
|
|
|
8
6
|
## Problem
|
|
9
|
-
<!-- ~400 tokens: What specific problem are we solving -->
|
|
10
7
|
|
|
11
8
|
## Users
|
|
12
|
-
<!-- ~200 tokens: Who are the users and what do they need -->
|
|
13
9
|
|
|
14
10
|
## Requirements
|
|
15
|
-
<!-- ~800 tokens: EARS-format requirements -->
|
|
16
11
|
<!-- Use: "The <system> shall <action>" for each requirement -->
|
|
17
12
|
|
|
18
13
|
### Functional Requirements
|
|
@@ -20,11 +15,8 @@
|
|
|
20
15
|
### Non-Functional Requirements
|
|
21
16
|
|
|
22
17
|
## Out of Scope
|
|
23
|
-
<!-- ~200 tokens: Explicitly list what this work does NOT cover -->
|
|
24
18
|
<!-- This section is mandatory — scope creep dies here -->
|
|
25
19
|
|
|
26
20
|
## Success Criteria
|
|
27
|
-
<!-- ~300 tokens: Measurable outcomes that define "done" -->
|
|
28
21
|
|
|
29
22
|
## Open Questions
|
|
30
|
-
<!-- ~200 tokens: Unresolved questions that need answers before design -->
|
package/templates/story.md
CHANGED
|
@@ -6,16 +6,12 @@ completed_at:
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Story: [TITLE]
|
|
9
|
-
<!-- Budget: 1500 tokens max -->
|
|
10
9
|
|
|
11
10
|
## Context
|
|
12
|
-
<!-- ~200 tokens: Why this story exists, link to architecture/spec -->
|
|
13
11
|
|
|
14
12
|
## Task
|
|
15
|
-
<!-- ~400 tokens: What needs to be done, specific and actionable -->
|
|
16
13
|
|
|
17
14
|
## Acceptance Criteria
|
|
18
|
-
<!-- ~600 tokens: EARS-format criteria -->
|
|
19
15
|
<!-- Each criterion must be independently testable -->
|
|
20
16
|
|
|
21
17
|
1. When [event], the system shall [action]
|
|
@@ -23,4 +19,3 @@ completed_at:
|
|
|
23
19
|
3. If [condition], then the system shall [action]
|
|
24
20
|
|
|
25
21
|
## Technical Notes
|
|
26
|
-
<!-- ~300 tokens: Implementation hints, relevant code locations, gotchas -->
|
package/schemas/cost.schema.yaml
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
$schema: "https://json-schema.org/draft/2020-12/schema"
|
|
2
|
-
$id: "https://sniper.ai/schemas/cost"
|
|
3
|
-
title: Cost Tracking
|
|
4
|
-
description: Schema for SNIPER cost tracking that monitors token usage and budget across phases.
|
|
5
|
-
type: object
|
|
6
|
-
required:
|
|
7
|
-
- protocol
|
|
8
|
-
- started_at
|
|
9
|
-
- budget
|
|
10
|
-
properties:
|
|
11
|
-
protocol:
|
|
12
|
-
type: string
|
|
13
|
-
description: The SNIPER protocol version identifier.
|
|
14
|
-
started_at:
|
|
15
|
-
type: string
|
|
16
|
-
format: date-time
|
|
17
|
-
description: ISO 8601 timestamp of when cost tracking began.
|
|
18
|
-
budget:
|
|
19
|
-
type: number
|
|
20
|
-
minimum: 0
|
|
21
|
-
description: Total token budget allocated for the project.
|
|
22
|
-
phases:
|
|
23
|
-
type: array
|
|
24
|
-
description: Per-phase cost breakdown.
|
|
25
|
-
items:
|
|
26
|
-
type: object
|
|
27
|
-
required:
|
|
28
|
-
- name
|
|
29
|
-
properties:
|
|
30
|
-
name:
|
|
31
|
-
type: string
|
|
32
|
-
description: Phase name (e.g. discover, plan, implement, review).
|
|
33
|
-
started_at:
|
|
34
|
-
type: string
|
|
35
|
-
format: date-time
|
|
36
|
-
description: ISO 8601 timestamp of when this phase started.
|
|
37
|
-
completed_at:
|
|
38
|
-
type: string
|
|
39
|
-
format: date-time
|
|
40
|
-
description: ISO 8601 timestamp of when this phase completed.
|
|
41
|
-
tokens_used:
|
|
42
|
-
type: integer
|
|
43
|
-
minimum: 0
|
|
44
|
-
description: Total tokens consumed during this phase.
|
|
45
|
-
agents:
|
|
46
|
-
type: array
|
|
47
|
-
description: Per-agent cost breakdown within this phase.
|
|
48
|
-
items:
|
|
49
|
-
type: object
|
|
50
|
-
required:
|
|
51
|
-
- name
|
|
52
|
-
- tokens_used
|
|
53
|
-
properties:
|
|
54
|
-
name:
|
|
55
|
-
type: string
|
|
56
|
-
description: Agent persona name.
|
|
57
|
-
tokens_used:
|
|
58
|
-
type: integer
|
|
59
|
-
minimum: 0
|
|
60
|
-
description: Tokens consumed by this agent.
|
|
61
|
-
totals:
|
|
62
|
-
type: object
|
|
63
|
-
description: Aggregate cost totals.
|
|
64
|
-
properties:
|
|
65
|
-
tokens_used:
|
|
66
|
-
type: integer
|
|
67
|
-
minimum: 0
|
|
68
|
-
description: Total tokens consumed across all phases.
|
|
69
|
-
budget_remaining:
|
|
70
|
-
type: number
|
|
71
|
-
minimum: 0
|
|
72
|
-
description: Remaining token budget.
|
|
73
|
-
budget_percent_used:
|
|
74
|
-
type: number
|
|
75
|
-
minimum: 0
|
|
76
|
-
maximum: 100
|
|
77
|
-
description: Percentage of budget consumed.
|
|
78
|
-
enforcement:
|
|
79
|
-
type: object
|
|
80
|
-
description: Budget enforcement thresholds expressed as fractions of the total budget.
|
|
81
|
-
properties:
|
|
82
|
-
warn_threshold:
|
|
83
|
-
type: number
|
|
84
|
-
minimum: 0
|
|
85
|
-
maximum: 1
|
|
86
|
-
description: Fraction of budget at which a warning is issued.
|
|
87
|
-
soft_cap:
|
|
88
|
-
type: number
|
|
89
|
-
minimum: 0
|
|
90
|
-
maximum: 1
|
|
91
|
-
description: Fraction of budget at which soft enforcement begins (e.g. require confirmation).
|
|
92
|
-
hard_cap:
|
|
93
|
-
type: number
|
|
94
|
-
minimum: 0
|
|
95
|
-
maximum: 1
|
|
96
|
-
description: Fraction of budget at which execution is halted.
|
|
97
|
-
additionalProperties: false
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
$schema: "https://json-schema.org/draft/2020-12/schema"
|
|
2
|
-
$id: "https://sniper.ai/schemas/velocity"
|
|
3
|
-
title: Velocity
|
|
4
|
-
description: Protocol execution history and calibrated budgets for adaptive budget selection.
|
|
5
|
-
type: object
|
|
6
|
-
required:
|
|
7
|
-
- executions
|
|
8
|
-
properties:
|
|
9
|
-
executions:
|
|
10
|
-
type: array
|
|
11
|
-
description: History of protocol executions with timing and token data.
|
|
12
|
-
items:
|
|
13
|
-
type: object
|
|
14
|
-
required:
|
|
15
|
-
- protocol
|
|
16
|
-
- completed_at
|
|
17
|
-
- tokens_used
|
|
18
|
-
properties:
|
|
19
|
-
protocol:
|
|
20
|
-
type: string
|
|
21
|
-
description: Protocol name that was executed.
|
|
22
|
-
completed_at:
|
|
23
|
-
type: string
|
|
24
|
-
format: date-time
|
|
25
|
-
description: ISO 8601 timestamp of when the execution completed.
|
|
26
|
-
wall_clock_seconds:
|
|
27
|
-
type: number
|
|
28
|
-
minimum: 0
|
|
29
|
-
description: Wall clock duration of the execution in seconds.
|
|
30
|
-
tokens_used:
|
|
31
|
-
type: integer
|
|
32
|
-
minimum: 0
|
|
33
|
-
description: Total tokens consumed during the execution.
|
|
34
|
-
tokens_per_phase:
|
|
35
|
-
type: object
|
|
36
|
-
description: Token usage broken down by phase name.
|
|
37
|
-
additionalProperties:
|
|
38
|
-
type: integer
|
|
39
|
-
minimum: 0
|
|
40
|
-
calibrated_budgets:
|
|
41
|
-
type: object
|
|
42
|
-
description: p75 of token usage from last 5+ executions, keyed by protocol name.
|
|
43
|
-
additionalProperties:
|
|
44
|
-
type: integer
|
|
45
|
-
minimum: 0
|
|
46
|
-
rolling_averages:
|
|
47
|
-
type: object
|
|
48
|
-
description: Exponential moving average of token usage, keyed by protocol name.
|
|
49
|
-
additionalProperties:
|
|
50
|
-
type: number
|
|
51
|
-
minimum: 0
|
|
52
|
-
additionalProperties: false
|
package/templates/cost.yaml
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Cost tracking for protocol execution
|
|
2
|
-
protocol: ""
|
|
3
|
-
started_at: ""
|
|
4
|
-
budget: 0
|
|
5
|
-
|
|
6
|
-
phases: []
|
|
7
|
-
# - name: discover
|
|
8
|
-
# started_at: ""
|
|
9
|
-
# completed_at: ""
|
|
10
|
-
# tokens_used: 0
|
|
11
|
-
# agents:
|
|
12
|
-
# - name: analyst
|
|
13
|
-
# tokens_used: 0
|
|
14
|
-
|
|
15
|
-
totals:
|
|
16
|
-
tokens_used: 0
|
|
17
|
-
budget_remaining: 0
|
|
18
|
-
budget_percent_used: 0
|
|
19
|
-
|
|
20
|
-
enforcement:
|
|
21
|
-
warn_threshold: 0.7 # Warn at 70% budget
|
|
22
|
-
soft_cap: 0.9 # Soft cap at 90% — agents must justify continuation
|
|
23
|
-
hard_cap: 1.0 # Hard cap at 100% — stop execution
|
package/templates/velocity.yaml
DELETED