/sniper-learn
Manage the SNIPER learning store. Submit new learnings from experience, review existing learnings, or deprecate outdated ones.
Mode Selection
--review given? → Review mode
--deprecate <id> given? → Deprecate mode
learning text given? → Submit mode
Nothing given? → Submit mode (prompt for learning text)Submit Mode
Submit a new learning from human experience or observation.
Process
Capture the learning text from the argument or prompt the user:
- "What did you learn? Describe the pattern, rule, or insight."
Ask clarifying questions (present as multi-select, all optional):
- Agents: Which agents should see this learning? (default: all)
- Options: analyst, architect, product-manager, fullstack-dev, backend-dev, frontend-dev, qa-engineer, code-reviewer
- Phases: Which protocol phases does this apply to? (default: all)
- Options: discover, plan, solve, implement, review
- Files: Any specific file patterns? (default: all)
- Accept glob patterns like
src/api/**,*.test.ts
- Accept glob patterns like
- Agents: Which agents should see this learning? (default: all)
Ask for anti-pattern and correction (optional):
- "Is there a specific anti-pattern to avoid?"
- "What should be done instead?"
Create the learning record:
22 linesyamlid: L-{YYYYMMDD}-{4-char-hex} status: active confidence: 0.9 created_at: {ISO 8601} updated_at: {ISO 8601} source: type: human detail: "Submitted via /sniper-learn" learning: {learning text} anti_pattern: {if provided} correction: {if provided} scope: agents: {selected or null} phases: {selected or null} files: {selected or null} applied_in: [] reinforced_by: [] contradicted_by: [] history: - timestamp: {ISO 8601} event: created actor: humanWrite to
.sniper/memory/learnings/{id}.yamlConfirm: "Learning
{id}created with confidence 0.9. It will be composed into agent prompts for matching phases/agents."
Review Mode
Review, curate, and manage existing learnings.
Process
Spawn the memory-curator agent from
.claude/agents/memory-curator.md- Pass it the task: "Run full curation — consolidation, contradiction detection, staleness check, spec drift detection, signal migration, and pruning."
Present curator summary to the user
Show flagged items requiring human decision:
- Contradictions between high-confidence learnings
- Stale learnings that might still apply
- Spec drift detections
For each flagged item, ask the user:
- Keep — maintain current status
- Deprecate — set status to deprecated
- Edit — modify the learning text/scope
Show final state:
5 linesActive learnings: N Validated: N Deprecated: N Archived: N Average confidence: X.XX
Deprecate Mode
Deprecate a specific learning by ID.
Process
- Read
.sniper/memory/learnings/{id}.yaml - If not found, report error: "Learning
{id}not found." - Show the learning to the user for confirmation:
- Learning text, current confidence, source, created date
- Confirm: "Deprecate this learning?"
- Update the learning:
status: deprecatedconfidence: 0.0- Add history entry:4 linesyaml
- timestamp: {ISO 8601} event: human_invalidated actor: human detail: "Deprecated via /sniper-learn --deprecate"
- Confirm: "Learning
{id}deprecated. It will no longer be composed into agent prompts."
Rules
- Human-submitted learnings ALWAYS start at confidence 0.9
- ALWAYS write to
.sniper/memory/learnings/— never to signals - ALWAYS include a history entry for every change
- If
.sniper/memory/learnings/doesn't exist, create it - If
.sniper/memory/signals/contains files, suggest running--reviewto migrate them
