- Add Uncertainty Declaration (G3): declare assumptions when score < 2 - Add Requirement Routing: Quick/Full mode based on scope - Add Context Acquisition: optional kb.md check before Specify - Add Knowledge Base: .sparv/kb.md for cross-session patterns - Add changelog-update.sh: maintain CHANGELOG by type Generated with SWE-Agent.ai Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
3.6 KiB
SPARV Methodology (Short)
This document is a quick reference; the canonical spec is in SKILL.md.
Five Phases
- Specify: Write requirements as verifiable specs (10-point gate)
- Plan: Break into atomic tasks (2-5 minute granularity)
- Act: TDD-driven implementation; write to journal every 2 actions
- Review: Spec conformance → Code quality; maximum 3 fix rounds
- Vault: Archive session (state + journal)
Enhanced Rules (v1.1)
Uncertainty Declaration (G3)
When any Specify dimension scores < 2:
- Declare:
UNCERTAIN: <what> | ASSUMPTION: <fallback> - List all assumptions in journal before Plan
- Offer 2-3 options for ambiguous requirements
Requirement Routing
| Mode | Condition | Flow |
|---|---|---|
| Quick | score >= 9 AND <= 3 files AND no EHRB | Specify → Act → Review |
| Full | otherwise | Specify → Plan → Act → Review → Vault |
Context Acquisition (Optional)
Before Specify scoring:
- Check
.sparv/kb.mdfor existing patterns/decisions - If insufficient, scan codebase for relevant files
- Document findings in journal under
## Context
Knowledge Base Maintenance
During Vault phase, update .sparv/kb.md:
- Patterns: Reusable code patterns discovered
- Decisions: Architectural choices + rationale
- Gotchas: Common pitfalls + solutions
CHANGELOG Update
~/.claude/skills/sparv/scripts/changelog-update.sh --type <Added|Changed|Fixed|Removed> --desc "..."
Specify (10-Point Scale)
Each item scores 0/1/2, total 0-10; >=9 required to enter Plan:
- Value: Why do it, are benefits/metrics verifiable
- Scope: MVP + what's out of scope
- Acceptance: Testable acceptance criteria
- Boundaries: Error/performance/compatibility/security critical boundaries
- Risk: EHRB/dependencies/unknowns + handling approach
If below threshold, keep asking—don't "just start coding."
Journal Convention (Unified Log)
All Plan/Progress/Findings go into .sparv/journal.md.
Recommended format (just append, no need to "insert into specific sections"):
## 14:32 - Action #12
- Tool: Edit
- Result: Updated auth flow
- Next: Add test for invalid token
2-Action Save
Hook triggers save-progress.sh after each tool call; script only writes to journal when action_count is even.
3-Failure Protocol
When you fail consecutively, escalate by level:
- Diagnose and fix (read errors, verify assumptions, minimal fix)
- Alternative approach (change strategy/entry point)
- Escalate (stop: document blocker + attempted solutions + request user decision)
Tools:
~/.claude/skills/sparv/scripts/failure-tracker.sh fail --note "short reason"
~/.claude/skills/sparv/scripts/failure-tracker.sh reset
3-Question Reboot Test
Self-check before session ends (or when lost):
- Where am I? (current_phase)
- Where am I going? (next_phase)
- How do I prove completion? (completion_promise + evidence at journal end)
~/.claude/skills/sparv/scripts/reboot-test.sh --strict
EHRB (High-Risk Changes)
Detection items (any match requires explicit user confirmation):
- Production access
- Sensitive data
- Destructive operations
- Billing external API
- Security-critical changes
~/.claude/skills/sparv/scripts/check-ehrb.sh --diff --fail-on-flags
state.yaml (Minimal Schema)
Scripts only enforce 4 core fields; other fields are optional:
session_id: "20260114-143022"
current_phase: "act"
action_count: 14
consecutive_failures: 0
max_iterations: 12
iteration_count: 0
completion_promise: "All acceptance criteria have tests and are green."
ehrb_flags: []