Spaces:
Sleeping
GSD Runbook
Operational procedures for debugging, validation, and recovery.
Quick Commands
Status Check
PowerShell:
# Current git status
git status
# Recent commits
git log --oneline -10
# Current branch
git branch --show-current
Bash:
# Current git status
git status
# Recent commits
git log --oneline -10
# Current branch
git branch --show-current
Wave Validation
Verify Wave Completion
Before marking a wave complete:
All tasks have commits:
git log --oneline -N # N = number of tasks in waveAll verifications passed (documented in SUMMARY.md)
STATE.md updated with current position
State snapshot created
Wave Rollback
If a wave needs to be reverted:
# Find commit before wave started
git log --oneline -20
# Reset to that commit (keeps changes staged)
git reset --soft <commit-hash>
# Or hard reset (discards changes)
git reset --hard <commit-hash>
Debugging Procedures
3-Strike Rule
After 3 consecutive failed debug attempts:
Stop — Don't try a 4th approach in same session
Document in STATE.md:
## Debug Session **Problem:** {description} **Attempts:** 1. {approach 1} → {result} 2. {approach 2} → {result} 3. {approach 3} → {result} **Hypothesis:** {current theory} **Recommended next:** {suggested approach}Fresh session — Start new conversation with documented context
Log Inspection
Find relevant logs:
# Search for error patterns
Select-String -Path "*.log" -Pattern "error|exception|failed" -CaseSensitive:$false
# Search for error patterns
grep -ri "error\|exception\|failed" *.log
Verification Commands
Build Verification
# Node.js
npm run build
if ($LASTEXITCODE -eq 0) { Write-Host "✅ Build passed" }
# Python
python -m py_compile src/**/*.py
Test Verification
# Node.js
npm test
# Python
pytest -v
# Go
go test ./...
Lint Verification
# Node.js
npm run lint
# Python
ruff check .
# Go
golangci-lint run
State Recovery
From STATE.md
When resuming work:
- Read STATE.md for current position
- Check "Last Action" for context
- Follow "Next Steps" to continue
- Verify recent commits match documented progress
From Git History
If STATE.md is outdated:
# See recent work
git log --oneline -20
# Check specific commit details
git show <commit-hash> --stat
# View file at specific commit
git show <commit-hash>:path/to/file
Context Pollution Recovery
If quality is degrading mid-session:
- Create state snapshot immediately
- Update STATE.md with full context
- Commit any pending work
- Start fresh session
- Run
/resumeto reload context
Search Commands
Find in Codebase
PowerShell:
# Find pattern in files
Select-String -Path "src/**/*.ts" -Pattern "TODO" -Recurse
# Find files by name
Get-ChildItem -Recurse -Filter "*.config.*"
Bash:
# Find pattern in files (with ripgrep)
rg "TODO" --type ts
# Find pattern in files (with grep)
grep -r "TODO" src/
# Find files by name
find . -name "*.config.*"
Search-First Workflow
Before reading any file:
Search for relevant terms:
Select-String -Path "**/*.md" -Pattern "architecture" -RecurseIdentify candidate files from results
Read only relevant sections:
Get-Content file.md | Select-Object -Skip 49 -First 20 # Lines 50-70
Common Issues
"SPEC.md not FINALIZED"
Cause: Planning lock prevents implementation
Fix:
- Open
.gsd/SPEC.md - Complete all required sections
- Change status to
Status: FINALIZED - Retry command
"Context degrading"
Symptoms: Shorter responses, skipped steps, inconsistency
Fix:
- Create state snapshot
- Commit current work
- Start fresh session
- Run
/resume
"Commit failed"
Causes: Staged conflicts, hook failures
Debug:
git status
git diff --staged
Checklist Templates
Pre-Execution Checklist
- SPEC.md is FINALIZED
- ROADMAP.md has current phase
- STATE.md loaded and understood
- Previous wave verified complete
Post-Wave Checklist
- All tasks committed
- Verifications documented
- STATE.md updated
- State snapshot created
- No uncommitted changes
Session End Checklist
- Current work committed
- STATE.md has "Next Steps"
- JOURNAL.md updated (if milestone)
- No loose ends
See PROJECT_RULES.md for canonical rules. See docs/model-selection-playbook.md for model guidance.