mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-14 03:31:58 +08:00
3.6 KiB
3.6 KiB
name, description
| name | description |
|---|---|
| sparv | Minimal SPARV workflow (Specify→Plan→Act→Review→Vault) with 10-point spec gate, unified journal, 2-action saves, 3-failure protocol, and EHRB risk detection. |
SPARV
Five-phase workflow: Specify → Plan → Act → Review → Vault.
Goal: Complete "requirements → verifiable delivery" in one pass, recording key decisions in external memory instead of relying on assumptions.
Core Rules (Mandatory)
- 10-Point Specify Gate: Spec score
0-10; must be>=9to enter Plan. - 2-Action Save: Append an entry to
.sparv/journal.mdevery 2 tool calls. - 3-Failure Protocol: Stop and escalate to user after 3 consecutive failures.
- EHRB: Require explicit user confirmation when high-risk detected (production/sensitive data/destructive/billing API/security-critical).
- Fixed Phase Names:
specify|plan|act|review|vault(stored in.sparv/state.yaml:current_phase).
External Memory (Two Files)
Initialize (run in project root):
~/.claude/skills/sparv/scripts/init-session.sh --force
File conventions:
.sparv/state.yaml: State machine (minimum fields:session_id/current_phase/action_count/consecutive_failures).sparv/journal.md: Unified log (Plan/Progress/Findings all go here).sparv/history/<session_id>/: Archive directory
Phase 1: Specify (10-Point Scale)
Each item scores 0/1/2, total 0-10:
- 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
score < 9: Keep asking questions; do not enter Plan.
score >= 9: Write a clear completion_promise (verifiable completion commitment), then enter Plan.
Phase 2: Plan
- Break into atomic tasks (2-5 minute granularity), each with a verifiable output/test point.
- Write the plan to
.sparv/journal.md(Plan section or append directly).
Phase 3: Act
- TDD Rule: No failing test → no production code.
- Auto-write journal every 2 actions (PostToolUse hook).
- Failure counting (3-Failure Protocol):
~/.claude/skills/sparv/scripts/failure-tracker.sh fail --note "short blocker"
~/.claude/skills/sparv/scripts/failure-tracker.sh reset
Phase 4: Review
- Two stages: Spec conformance → Code quality (correctness/performance/security/tests).
- Maximum 3 fix rounds; escalate to user if exceeded.
Run 3-question reboot test before session ends:
~/.claude/skills/sparv/scripts/reboot-test.sh --strict
Phase 5: Vault
Archive current session:
~/.claude/skills/sparv/scripts/archive-session.sh
Script Tools
| Script | Purpose |
|---|---|
scripts/init-session.sh |
Initialize .sparv/, generate state.yaml + journal.md |
scripts/save-progress.sh |
Maintain action_count, append to journal.md every 2 actions |
scripts/check-ehrb.sh |
Scan diff/text, output (optionally write) ehrb_flags |
scripts/failure-tracker.sh |
Maintain consecutive_failures, exit code 3 when reaching 3 |
scripts/reboot-test.sh |
3-question self-check (optional strict mode) |
scripts/archive-session.sh |
Archive journal.md + state.yaml to history/ |
Auto Hooks
hooks/hooks.json:
- PostToolUse:
save-progress.sh(2-Action save) - PreToolUse:
check-ehrb.sh --diff --dry-run(prompt only, no state write) - Stop:
reboot-test.sh --strict(3-question self-check)
Quality over speed—iterate until truly complete.