@sniper.ai/core 2.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -98
- package/agents/analyst.md +29 -0
- package/agents/architect.md +38 -0
- package/agents/backend-dev.md +43 -0
- package/agents/code-reviewer.md +72 -0
- package/agents/doc-writer.md +60 -0
- package/agents/frontend-dev.md +43 -0
- package/agents/fullstack-dev.md +44 -0
- package/agents/gate-reviewer.md +72 -0
- package/agents/lead-orchestrator.md +51 -0
- package/agents/product-manager.md +40 -0
- package/agents/qa-engineer.md +37 -0
- package/agents/retro-analyst.md +104 -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 +57 -0
- package/checklists/plan.yaml +36 -0
- package/checklists/refactor-analyze.yaml +19 -0
- package/checklists/review.yaml +29 -0
- package/claude-md.template +42 -0
- package/config.template.yaml +156 -0
- package/hooks/settings-hooks.json +40 -0
- package/hooks/signal-hooks.json +16 -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 +21 -0
- package/protocols/feature.yaml +47 -0
- package/protocols/full.yaml +65 -0
- package/protocols/hotfix.yaml +19 -0
- package/protocols/ingest.yaml +42 -0
- package/protocols/patch.yaml +30 -0
- package/protocols/refactor.yaml +43 -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-meta.schema.yaml +58 -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 +196 -0
- package/skills/sniper-init/SKILL.md +102 -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/registry.md +4 -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/debug-review.md +0 -34
- package/framework/checklists/discover-review.md +0 -33
- package/framework/checklists/doc-review.md +0 -39
- package/framework/checklists/feature-review.md +0 -42
- package/framework/checklists/ingest-review.md +0 -42
- package/framework/checklists/memory-review.md +0 -30
- package/framework/checklists/perf-review.md +0 -33
- package/framework/checklists/plan-review.md +0 -52
- package/framework/checklists/refactor-review.md +0 -33
- package/framework/checklists/security-review.md +0 -34
- package/framework/checklists/sprint-review.md +0 -41
- package/framework/checklists/story-review.md +0 -30
- package/framework/checklists/test-review.md +0 -32
- package/framework/checklists/workspace-review.md +0 -34
- package/framework/claude-md.template +0 -37
- package/framework/commands/sniper-audit.md +0 -1549
- package/framework/commands/sniper-compose.md +0 -323
- package/framework/commands/sniper-debug.md +0 -337
- package/framework/commands/sniper-discover.md +0 -423
- package/framework/commands/sniper-doc.md +0 -441
- package/framework/commands/sniper-feature.md +0 -515
- package/framework/commands/sniper-ingest.md +0 -506
- package/framework/commands/sniper-init.md +0 -388
- package/framework/commands/sniper-memory.md +0 -219
- package/framework/commands/sniper-plan.md +0 -630
- package/framework/commands/sniper-review.md +0 -369
- package/framework/commands/sniper-solve.md +0 -408
- package/framework/commands/sniper-sprint.md +0 -716
- package/framework/commands/sniper-status.md +0 -481
- package/framework/commands/sniper-workspace-feature.md +0 -267
- package/framework/commands/sniper-workspace-init.md +0 -252
- package/framework/commands/sniper-workspace-status.md +0 -112
- package/framework/commands/sniper-workspace-validate.md +0 -138
- package/framework/config.template.yaml +0 -196
- 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/architecture-cartographer.md +0 -25
- package/framework/personas/process/code-archaeologist.md +0 -22
- package/framework/personas/process/code-investigator.md +0 -29
- package/framework/personas/process/code-reviewer.md +0 -26
- package/framework/personas/process/contract-designer.md +0 -31
- package/framework/personas/process/convention-miner.md +0 -27
- package/framework/personas/process/coverage-analyst.md +0 -24
- 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/flake-hunter.md +0 -30
- package/framework/personas/process/impact-analyst.md +0 -23
- package/framework/personas/process/integration-validator.md +0 -29
- package/framework/personas/process/log-analyst.md +0 -22
- package/framework/personas/process/migration-architect.md +0 -24
- package/framework/personas/process/perf-profiler.md +0 -27
- package/framework/personas/process/product-manager.md +0 -32
- package/framework/personas/process/qa-engineer.md +0 -31
- package/framework/personas/process/release-manager.md +0 -23
- package/framework/personas/process/retro-analyst.md +0 -30
- package/framework/personas/process/scrum-master.md +0 -31
- package/framework/personas/process/threat-modeler.md +0 -30
- package/framework/personas/process/triage-lead.md +0 -23
- package/framework/personas/process/ux-designer.md +0 -31
- package/framework/personas/process/vuln-scanner.md +0 -27
- package/framework/personas/process/workspace-orchestrator.md +0 -30
- 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 -25
- package/framework/teams/debug.yaml +0 -56
- package/framework/teams/discover.yaml +0 -57
- package/framework/teams/doc.yaml +0 -76
- package/framework/teams/feature-plan.yaml +0 -61
- package/framework/teams/ingest.yaml +0 -85
- package/framework/teams/perf.yaml +0 -33
- package/framework/teams/plan.yaml +0 -86
- package/framework/teams/refactor.yaml +0 -34
- package/framework/teams/retro.yaml +0 -30
- package/framework/teams/review-pr.yaml +0 -73
- package/framework/teams/review-release.yaml +0 -70
- package/framework/teams/security.yaml +0 -59
- package/framework/teams/solve.yaml +0 -48
- package/framework/teams/sprint.yaml +0 -68
- package/framework/teams/test.yaml +0 -59
- package/framework/teams/workspace-feature.yaml +0 -69
- package/framework/teams/workspace-validation.yaml +0 -27
- package/framework/templates/arch-delta.md +0 -74
- package/framework/templates/architecture.md +0 -95
- package/framework/templates/brief.md +0 -73
- package/framework/templates/bug-report.md +0 -55
- package/framework/templates/contract-validation-report.md +0 -68
- package/framework/templates/contract.yaml +0 -60
- package/framework/templates/conventions.md +0 -59
- package/framework/templates/coverage-report.md +0 -67
- 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 -47
- package/framework/templates/feature-brief.md +0 -54
- package/framework/templates/feature-spec.md +0 -53
- package/framework/templates/flaky-report.md +0 -64
- package/framework/templates/investigation.md +0 -49
- package/framework/templates/memory-anti-pattern.yaml +0 -16
- package/framework/templates/memory-convention.yaml +0 -17
- package/framework/templates/memory-decision.yaml +0 -16
- package/framework/templates/migration-plan.md +0 -47
- package/framework/templates/optimization-plan.md +0 -59
- package/framework/templates/performance-profile.md +0 -64
- package/framework/templates/personas.md +0 -118
- package/framework/templates/postmortem.md +0 -69
- package/framework/templates/pr-review.md +0 -50
- package/framework/templates/prd.md +0 -92
- package/framework/templates/refactor-scope.md +0 -52
- package/framework/templates/release-readiness.md +0 -66
- package/framework/templates/retro.yaml +0 -44
- package/framework/templates/risks.md +0 -64
- package/framework/templates/security.md +0 -111
- package/framework/templates/sprint-review.md +0 -32
- package/framework/templates/story.md +0 -53
- package/framework/templates/threat-model.md +0 -71
- package/framework/templates/ux-spec.md +0 -71
- package/framework/templates/vulnerability-report.md +0 -56
- package/framework/templates/workspace-brief.md +0 -52
- package/framework/templates/workspace-plan.md +0 -50
- 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
- package/framework/workflows/workspace-feature.md +0 -71
|
@@ -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,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"PreToolUse": [
|
|
4
|
+
{
|
|
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
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"PostToolUse": [
|
|
16
|
+
{
|
|
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
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"Stop": [
|
|
28
|
+
{
|
|
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
|
+
]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"PostToolUse": [
|
|
4
|
+
{
|
|
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
|
+
]
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
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.1.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.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Performance-Focused Thinking
|
|
2
|
+
|
|
3
|
+
Apply this cognitive lens to all decisions:
|
|
4
|
+
|
|
5
|
+
## Efficiency-First Evaluation
|
|
6
|
+
|
|
7
|
+
- **Measure before optimizing**: Never guess at bottlenecks. Profile first, optimize second.
|
|
8
|
+
- **Complexity awareness**: Know the Big-O of your data structures and algorithms. O(n^2) is a red flag for any collection that could grow.
|
|
9
|
+
- **Resource consciousness**: Consider memory allocation, network round-trips, and I/O operations as costs.
|
|
10
|
+
|
|
11
|
+
## Performance Checklist
|
|
12
|
+
|
|
13
|
+
When reviewing or writing code, always check:
|
|
14
|
+
1. **N+1 queries** — Is the code making a query per item in a loop? Batch instead.
|
|
15
|
+
2. **Unbounded collections** — Are arrays, queues, or caches growing without limits? Add bounds.
|
|
16
|
+
3. **Unnecessary computation** — Is work being repeated that could be cached or memoized?
|
|
17
|
+
4. **Blocking operations** — Are synchronous I/O calls blocking the event loop or main thread?
|
|
18
|
+
5. **Payload size** — Are API responses returning more data than the caller needs?
|
|
19
|
+
6. **Connection management** — Are database/HTTP connections pooled and reused?
|
|
20
|
+
|
|
21
|
+
## Tradeoff Framework
|
|
22
|
+
|
|
23
|
+
Performance improvements must justify their complexity cost. A 10% speedup that doubles code complexity is rarely worth it. A 10x speedup that adds one line is always worth it.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Security-First Thinking
|
|
2
|
+
|
|
3
|
+
Apply this cognitive lens to all decisions:
|
|
4
|
+
|
|
5
|
+
## Threat-First Decision Framework
|
|
6
|
+
|
|
7
|
+
- **Before implementing**: Ask "How could this be abused?" for every external input, API endpoint, and data flow
|
|
8
|
+
- **Default deny**: Require explicit allowlisting over blocklisting. Reject unknown inputs.
|
|
9
|
+
- **Least privilege**: Request minimum permissions. Scope access to what's needed now, not what might be needed later.
|
|
10
|
+
- **Defense in depth**: Never rely on a single security control. Validate at boundaries AND internally.
|
|
11
|
+
|
|
12
|
+
## Security Evaluation Checklist
|
|
13
|
+
|
|
14
|
+
When reviewing or writing code, always check:
|
|
15
|
+
1. Input validation — Is all external input sanitized before use?
|
|
16
|
+
2. Authentication — Is the caller verified before any action?
|
|
17
|
+
3. Authorization — Does the caller have permission for THIS specific action?
|
|
18
|
+
4. Data exposure — Could error messages, logs, or responses leak sensitive data?
|
|
19
|
+
5. Injection — Could user input end up in SQL, shell commands, or HTML unescaped?
|
|
20
|
+
6. Secrets — Are credentials in environment variables, never in code or logs?
|
|
21
|
+
|
|
22
|
+
## When In Doubt
|
|
23
|
+
|
|
24
|
+
Flag the security concern explicitly rather than making assumptions. A false positive is far cheaper than a vulnerability.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: explore
|
|
2
|
+
description: Exploratory analysis — understand a codebase or problem space
|
|
3
|
+
budget: 500000 # 500K tokens
|
|
4
|
+
|
|
5
|
+
phases:
|
|
6
|
+
- name: discover
|
|
7
|
+
description: Research, analyze, and document findings
|
|
8
|
+
agents:
|
|
9
|
+
- analyst
|
|
10
|
+
spawn_strategy: single
|
|
11
|
+
gate:
|
|
12
|
+
checklist: discover
|
|
13
|
+
human_approval: false
|
|
14
|
+
outputs:
|
|
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
|
+
|
|
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.
|
|
21
|
+
auto_retro: false # Exploration doesn't need retros
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: feature
|
|
2
|
+
description: Incremental feature — plan, implement, review
|
|
3
|
+
budget: 800000 # 800K tokens
|
|
4
|
+
|
|
5
|
+
phases:
|
|
6
|
+
- name: plan
|
|
7
|
+
description: Feature design and story creation
|
|
8
|
+
agents:
|
|
9
|
+
- architect
|
|
10
|
+
- product-manager
|
|
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
|
|
13
|
+
gate:
|
|
14
|
+
checklist: plan
|
|
15
|
+
human_approval: true
|
|
16
|
+
outputs:
|
|
17
|
+
- .sniper/artifacts/{protocol_id}/plan.md
|
|
18
|
+
- .sniper/artifacts/{protocol_id}/prd.md
|
|
19
|
+
- .sniper/artifacts/{protocol_id}/stories/
|
|
20
|
+
|
|
21
|
+
- name: implement
|
|
22
|
+
description: Feature implementation
|
|
23
|
+
agents:
|
|
24
|
+
- fullstack-dev
|
|
25
|
+
- qa-engineer
|
|
26
|
+
spawn_strategy: parallel # Multiple subagents via Task, not full TeamCreate
|
|
27
|
+
plan_approval: true
|
|
28
|
+
doc_sync: true # Run doc-writer after this phase to update living docs
|
|
29
|
+
gate:
|
|
30
|
+
checklist: implement
|
|
31
|
+
human_approval: false
|
|
32
|
+
outputs:
|
|
33
|
+
- source code changes
|
|
34
|
+
- test files
|
|
35
|
+
|
|
36
|
+
- name: review
|
|
37
|
+
description: Code review
|
|
38
|
+
agents:
|
|
39
|
+
- code-reviewer
|
|
40
|
+
spawn_strategy: single
|
|
41
|
+
gate:
|
|
42
|
+
checklist: review
|
|
43
|
+
human_approval: true
|
|
44
|
+
outputs:
|
|
45
|
+
- .sniper/artifacts/{protocol_id}/review-report.md
|
|
46
|
+
|
|
47
|
+
auto_retro: true
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: full
|
|
2
|
+
description: Complete project lifecycle — discovery through review
|
|
3
|
+
budget: 2000000 # 2M tokens
|
|
4
|
+
|
|
5
|
+
phases:
|
|
6
|
+
- name: discover
|
|
7
|
+
description: Research, analyze codebase, produce discovery spec
|
|
8
|
+
agents:
|
|
9
|
+
- analyst
|
|
10
|
+
spawn_strategy: single # One agent, no team needed
|
|
11
|
+
gate:
|
|
12
|
+
checklist: discover
|
|
13
|
+
human_approval: false
|
|
14
|
+
outputs:
|
|
15
|
+
- .sniper/artifacts/spec.md # Living master doc
|
|
16
|
+
- .sniper/artifacts/codebase-overview.md # Living master doc
|
|
17
|
+
|
|
18
|
+
- name: plan
|
|
19
|
+
description: Architecture design, PRD creation, story breakdown
|
|
20
|
+
agents:
|
|
21
|
+
- architect
|
|
22
|
+
- product-manager
|
|
23
|
+
spawn_strategy: team # Multiple agents, use TeamCreate
|
|
24
|
+
interactive_review: true # Present plan to user for review/feedback before proceeding
|
|
25
|
+
coordination:
|
|
26
|
+
- between: [architect, product-manager]
|
|
27
|
+
topic: Architecture must be approved before stories reference it
|
|
28
|
+
gate:
|
|
29
|
+
checklist: plan
|
|
30
|
+
human_approval: true # Human reviews the plan before implementation
|
|
31
|
+
outputs:
|
|
32
|
+
- .sniper/artifacts/{protocol_id}/plan.md
|
|
33
|
+
- .sniper/artifacts/{protocol_id}/prd.md
|
|
34
|
+
- .sniper/artifacts/{protocol_id}/stories/
|
|
35
|
+
|
|
36
|
+
- name: implement
|
|
37
|
+
description: Code implementation with worktree isolation
|
|
38
|
+
agents:
|
|
39
|
+
- fullstack-dev
|
|
40
|
+
- qa-engineer
|
|
41
|
+
spawn_strategy: team
|
|
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
|
|
44
|
+
gate:
|
|
45
|
+
checklist: implement
|
|
46
|
+
human_approval: false
|
|
47
|
+
outputs:
|
|
48
|
+
- source code changes
|
|
49
|
+
- test files
|
|
50
|
+
|
|
51
|
+
- name: review
|
|
52
|
+
description: Code review and final quality gate
|
|
53
|
+
agents:
|
|
54
|
+
- code-reviewer
|
|
55
|
+
spawn_strategy: single
|
|
56
|
+
gate:
|
|
57
|
+
# Uses multi-faceted-review checklist when review.multi_model is enabled in config;
|
|
58
|
+
# otherwise falls back to standard review checklist
|
|
59
|
+
checklist: review
|
|
60
|
+
multi_model_checklist: multi-faceted-review
|
|
61
|
+
human_approval: true # Human final sign-off
|
|
62
|
+
outputs:
|
|
63
|
+
- .sniper/artifacts/{protocol_id}/review-report.md
|
|
64
|
+
|
|
65
|
+
auto_retro: true # Trigger retro-analyst after completion
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: hotfix
|
|
2
|
+
description: Critical fix — fastest path to production
|
|
3
|
+
budget: 100000 # 100K tokens
|
|
4
|
+
|
|
5
|
+
phases:
|
|
6
|
+
- name: implement
|
|
7
|
+
description: Emergency fix with minimal overhead
|
|
8
|
+
agents:
|
|
9
|
+
- fullstack-dev
|
|
10
|
+
spawn_strategy: single
|
|
11
|
+
plan_approval: false
|
|
12
|
+
gate:
|
|
13
|
+
checklist: implement
|
|
14
|
+
blocking: false
|
|
15
|
+
outputs:
|
|
16
|
+
- source code changes
|
|
17
|
+
- test files
|
|
18
|
+
|
|
19
|
+
auto_retro: false # Hotfixes are too urgent for retros
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: ingest
|
|
2
|
+
description: Codebase ingestion — scan, document, extract conventions
|
|
3
|
+
budget: 1000000 # 1M tokens
|
|
4
|
+
|
|
5
|
+
phases:
|
|
6
|
+
- name: scan
|
|
7
|
+
description: Deep scan of existing codebase
|
|
8
|
+
agents:
|
|
9
|
+
- analyst
|
|
10
|
+
spawn_strategy: single
|
|
11
|
+
gate:
|
|
12
|
+
checklist: ingest-scan
|
|
13
|
+
human_approval: false
|
|
14
|
+
outputs:
|
|
15
|
+
- .sniper/artifacts/codebase-overview.md # Living master doc — not per-protocol
|
|
16
|
+
|
|
17
|
+
- name: document
|
|
18
|
+
description: Generate documentation from code analysis
|
|
19
|
+
agents:
|
|
20
|
+
- analyst
|
|
21
|
+
spawn_strategy: single
|
|
22
|
+
gate:
|
|
23
|
+
checklist: ingest-document
|
|
24
|
+
human_approval: false
|
|
25
|
+
outputs:
|
|
26
|
+
- .sniper/artifacts/spec.md # Living master doc — not per-protocol
|
|
27
|
+
|
|
28
|
+
- name: extract
|
|
29
|
+
description: Extract conventions, patterns, and anti-patterns
|
|
30
|
+
agents:
|
|
31
|
+
- analyst
|
|
32
|
+
spawn_strategy: single
|
|
33
|
+
gate:
|
|
34
|
+
checklist: ingest-extract
|
|
35
|
+
human_approval: false
|
|
36
|
+
outputs:
|
|
37
|
+
- .sniper/conventions.yaml
|
|
38
|
+
|
|
39
|
+
# Note: ingest protocols write to master docs (.sniper/artifacts/spec.md, .sniper/artifacts/codebase-overview.md)
|
|
40
|
+
# rather than per-protocol directories (.sniper/artifacts/{protocol_id}/). A meta.yaml and registry entry
|
|
41
|
+
# are still created by /sniper-flow, but the artifact directory may be empty.
|
|
42
|
+
auto_retro: false
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: patch
|
|
2
|
+
description: Quick fix — implement and review only
|
|
3
|
+
budget: 200000 # 200K tokens
|
|
4
|
+
|
|
5
|
+
phases:
|
|
6
|
+
- name: implement
|
|
7
|
+
description: Bug fix or small change
|
|
8
|
+
agents:
|
|
9
|
+
- fullstack-dev
|
|
10
|
+
spawn_strategy: single
|
|
11
|
+
plan_approval: false # Quick fixes skip plan approval
|
|
12
|
+
gate:
|
|
13
|
+
checklist: implement
|
|
14
|
+
human_approval: false
|
|
15
|
+
outputs:
|
|
16
|
+
- source code changes
|
|
17
|
+
- test files
|
|
18
|
+
|
|
19
|
+
- name: review
|
|
20
|
+
description: Code review
|
|
21
|
+
agents:
|
|
22
|
+
- code-reviewer
|
|
23
|
+
spawn_strategy: single
|
|
24
|
+
gate:
|
|
25
|
+
checklist: review
|
|
26
|
+
human_approval: true
|
|
27
|
+
outputs:
|
|
28
|
+
- .sniper/artifacts/{protocol_id}/review-report.md
|
|
29
|
+
|
|
30
|
+
auto_retro: false # Patches are too small for retros
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: refactor
|
|
2
|
+
description: Code improvement — analyze, refactor, and review
|
|
3
|
+
budget: 600000 # 600K tokens
|
|
4
|
+
|
|
5
|
+
phases:
|
|
6
|
+
- name: analyze
|
|
7
|
+
description: Analyze code structure and identify refactoring targets
|
|
8
|
+
agents:
|
|
9
|
+
- analyst
|
|
10
|
+
spawn_strategy: single
|
|
11
|
+
interactive_review: true # Let user review the analysis before refactoring
|
|
12
|
+
gate:
|
|
13
|
+
checklist: refactor-analyze
|
|
14
|
+
human_approval: false
|
|
15
|
+
outputs:
|
|
16
|
+
- .sniper/artifacts/{protocol_id}/plan.md # Analysis/plan for this refactor
|
|
17
|
+
|
|
18
|
+
- name: implement
|
|
19
|
+
description: Apply refactoring changes
|
|
20
|
+
agents:
|
|
21
|
+
- fullstack-dev
|
|
22
|
+
spawn_strategy: single
|
|
23
|
+
plan_approval: false
|
|
24
|
+
doc_sync: true # Run doc-writer after this phase to update living docs
|
|
25
|
+
gate:
|
|
26
|
+
checklist: implement
|
|
27
|
+
human_approval: false
|
|
28
|
+
outputs:
|
|
29
|
+
- source code changes
|
|
30
|
+
- test files
|
|
31
|
+
|
|
32
|
+
- name: review
|
|
33
|
+
description: Review refactored code
|
|
34
|
+
agents:
|
|
35
|
+
- code-reviewer
|
|
36
|
+
spawn_strategy: single
|
|
37
|
+
gate:
|
|
38
|
+
checklist: review
|
|
39
|
+
human_approval: true
|
|
40
|
+
outputs:
|
|
41
|
+
- .sniper/artifacts/{protocol_id}/review-report.md
|
|
42
|
+
|
|
43
|
+
auto_retro: true
|