feat: add sparv enhanced rules v1.1

- 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>
This commit is contained in:
cexll
2026-01-17 13:12:10 +08:00
parent 6985a30a6a
commit e122d8ff25
4 changed files with 228 additions and 0 deletions

View File

@@ -137,6 +137,35 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
EOF
}
# Initialize kb.md (knowledge base) if not exists
init_kb() {
local kb_file="$SPARV_ROOT/kb.md"
[ -f "$kb_file" ] && return 0
cat > "$kb_file" << 'EOF'
# Knowledge Base
Cross-session knowledge accumulated during SPARV workflows.
---
## Patterns
<!-- Reusable code patterns discovered -->
## Decisions
<!-- Architectural choices + rationale -->
<!-- Format: - [YYYY-MM-DD]: decision | rationale -->
## Gotchas
<!-- Common pitfalls + solutions -->
<!-- Format: - [issue]: cause | solution -->
EOF
}
# Check for active session
active_session="$(find_active_session)"
@@ -162,6 +191,7 @@ mkdir -p "$HISTORY_DIR"
# Initialize global files
init_history_index
init_changelog
init_kb
# Create state.yaml
cat > "$SESSION_DIR/state.yaml" << EOF