Install any skill in seconds. Free to start, no credit card required.
Get Started Free →STATE.md reading, writing, and field-level updates. Provides cross-session state persistence via .planning/STATE.md with structured fields for current task, completed phases, blockers, decisions, and quick tasks.
.claude/skills/a5c-ai-state-management/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -27% | 0% |
| case-01 | ✗→✗ | = Same ✗ | 692% | 0% |
| case-02 | ✗→✗ | = Same ✗ | 47% | 0% |
last_updated: 2026-03-02T14:30:00Z session_count: 12 current_milestone: v1.0
| Date | Decision | Rationale | |------|----------|-----------| | 2026-02-28 | Use PostgreSQL over SQLite | Need concurrent writes for API | | 2026-03-01 | Skip Phase 71.1 (Redis cache) | Not needed for v1.0 |
| # | Task | Status | Date | |---|------|--------|------| | 001 | Fix login redirect | done | 2026-02-28 | | 002 | Add rate limiting | in-progress | 2026-03-02 |
### 2. Update Individual Fields
Update a single field without affecting the rest of the document:
update current_phase -> 73 update current_task -> "Build API endpoints for user management" update status -> "planning"
Use `Edit` tool to perform surgical updates on specific lines.
### 3. Append to List Fields
Add items to list-type fields:
append completed_phases -> "Phase 72: OAuth2 authentication" append decisions -> { date: "2026-03-02", decision: "Use JWT tokens", rationale: "Stateless auth for API" } append blockers -> { severity: "MEDIUM", description: "Need design mockups", owner: "@designer" }
### 4. Remove from List Fields
Remove items when resolved:
remove blocker -> "API key for OAuth provider not configured"
Mark blockers as resolved rather than deleting (change `[ ]` to `[x]`).
### 5. Quick Tasks Table Management
Add, update, and query quick tasks:
add_quick_task -> { number: 3, task: "Update README", status: "pending" } update_quick_task -> { number: 2, status: "done" } query_quick_tasks -> { status: "in-progress" }
### 6. Cross-Session Memory
STATE.md persists across context resets. On session start:
1. Read STATE.md to restore project context
2. Increment `session_count` in frontmatter
3. Update `last_updated` timestamp
4. Report state summary to orchestrator
### 7. Decision Log
Structured decision tracking with timestamps and rationale:
| Date | Decision | Rationale | |------|----------|-----------| | 2026-03-02 | Use JWT tokens | Stateless auth for API |
### 8. Blocker Tracking
Track blockers with severity and ownership:
Severity levels: `HIGH` (blocks current work), `MEDIUM` (blocks future work), `LOW` (inconvenience).
## Tool Use Instructions
### Reading State
1. Use `Read` to load `.planning/STATE.md`
2. Parse frontmatter for metadata (last_updated, session_count, current_milestone)
3. Parse markdown sections into structured fields
4. Return parsed state object
### Updating a Field
1. Use `Read` to load current STATE.md
2. Locate the target field/section
3. Use `Edit` with precise old_string/new_string to update only the target
4. Verify edit succeeded by reading the section back
### Appending to Lists
1. Use `Read` to find the end of the target list section
2. Use `Edit` to insert new item at the correct position
3. For tables, append new row before the section break
### Resolving Blockers
1. Use `Read` to find the blocker text
2. Use `Edit` to change `- [ ]` to `- [x]` and append resolution date
## Process Integration
This skill is used by most GSD processes:
- `execute-phase.js` - Update current_task as each task completes, track position
- `verify-work.js` - Add/resolve blockers based on verification results
- `audit-milestone.js` - Read completed_phases for coverage analysis
- `progress.js` - Read full state for progress display and routing
- `quick.js` - Add/update quick tasks table
- `debug.js` - Track debug sessions, add blockers for unresolved issues
- `complete-milestone.js` - Clear completed_phases, reset current_task
- `add-tests.js` - Update state with test coverage info
## Output Format
{ "operation": "read|update|append|remove", "field": "current_phase|completed_phases|blockers|decisions|quick_tasks", "status": "success|error", "previousValue": "...", "newValue": "...", "stateSnapshot": { "currentPhase": 72, "currentTask": "Implement OAuth2", "completedPhases": 70, 71], "activeBlockers": 1, "quickTasksTotal": 3, "quickTasksPending": 1 } }
## Configuration
| Setting | Default | Description |
|---------|---------|-------------|
| `stateFile` | `.planning/STATE.md` | Path to STATE.md |
| `autoTimestamp` | `true` | Auto-update last_updated on write |
| `autoSessionCount` | `true` | Auto-increment session_count on read |
| `blockerSeverityLevels` | `HIGH,MEDIUM,LOW` | Valid blocker severities |
## Error Handling
| Error | Cause | Resolution |
|-------|-------|------------|
| `STATE.md not found` | Planning directory not initialized | Run gsd-tools init first |
| `Section not found` | Unexpected STATE.md format | Rebuild STATE.md from template |
| `Edit collision` | Non-unique text match for edit | Provide more context in old_string |
| `Frontmatter parse error` | Malformed YAML frontmatter | Fix YAML syntax or regenerate |
| `Concurrent modification` | Multiple processes editing state | STATE.md is not lock-protected; serialize access |
## Constraints
- STATE.md must remain human-readable markdown at all times
- Never delete historical entries (blockers, decisions); mark as resolved instead
- Frontmatter must be valid YAML
- Quick task numbers must be sequential
- All timestamps must be ISO 8601 format
- Decision log must be append-only (no editing past decisions)
- Blocker resolution must preserve the original blocker text| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 5,141 | 6,074 | +18% | 1 | 1 | 0% | 240 | 1,901 | +692% | 0 | 0 | — |
case-02 | fail→fail | 6,169 | 4,419 | -28% | 1 | 1 | 0% | 1,351 | 1,981 | +47% | 0 | 0 | — |
case-03 | fail→fail | 6,863 | 4,711 | -31% | 1 | 1 | 0% | 1,532 | 2,019 | +32% | 0 | 0 | — |
case-04 | fail→fail | 3,432 | 4,505 | +31% | 1 | 1 | 0% | 599 | 1,986 | +232% | 0 | 0 | — |
case-05 | fail→pass | 9,366 | 3,065 | -67% | 1 | 1 | 0% | 1,604 | 2,266 | +41% | 0 | 0 | — |
case-06 | fail→pass | 11,556 | 2,978 | -74% | 1 | 1 | 0% | 1,826 | 2,214 | +21% | 0 | 0 | — |
case-07 | fail→fail | 4,613 | 3,995 | -13% | 1 | 1 | 0% | 936 | 1,929 | +106% | 0 | 0 | — |
case-08 | fail→pass | 14,358 | 1,540 | -89% | 1 | 1 | 0% | 2,589 | 1,889 | -27% | 0 | 0 | — |
case-09 | fail→fail | 5,261 | 1,626 | -69% | 1 | 1 | 0% | 906 | 1,942 | +114% | 0 | 0 | — |
case-10 | fail→fail | 3,663 | 3,491 | -5% | 1 | 1 | 0% | 703 | 1,849 | +163% | 0 | 0 | — |
case-11 | fail→fail | 1,612 | 3,845 | +139% | 1 | 1 | 0% | 246 | 1,835 | +646% | 0 | 0 | — |
case-12 | fail→fail | 6,166 | 3,261 | -47% | 1 | 1 | 0% | 1,111 | 2,343 | +111% | 0 | 0 | — |
case-13 | fail→fail | 6,055 | 2,978 | -51% | 1 | 1 | 0% | 1,070 | 2,190 | +105% | 0 | 0 | — |
case-14 | fail→fail | 8,708 | 2,417 | -72% | 1 | 1 | 0% | 1,469 | 2,074 | +41% | 0 | 0 | — |
case-15 | fail→fail | 7,127 | 3,945 | -45% | 1 | 1 | 0% | 1,464 | 1,808 | +23% | 0 | 0 | — |
case-16 | fail→fail | 4,913 | 4,379 | -11% | 1 | 1 | 0% | 812 | 1,881 | +132% | 0 | 0 | — |
case-17 | fail→fail | 9,320 | 4,830 | -48% | 1 | 1 | 0% | 1,747 | 2,444 | +40% | 0 | 0 | — |
case-18 | fail→fail | 3,711 | 1,580 | -57% | 1 | 1 | 0% | 713 | 1,914 | +168% | 0 | 0 | — |
case-19 | fail→fail | 5,292 | 4,118 | -22% | 1 | 1 | 0% | 956 | 1,913 | +100% | 0 | 0 | — |
case-20 | fail→fail | 5,599 | 5,397 | -4% | 1 | 1 | 0% | 1,081 | 2,562 | +137% | 0 | 0 | — |
case-21 | fail→fail | 7,319 | 8,766 | +20% | 1 | 1 | 0% | 1,488 | 3,179 | +114% | 0 | 0 | — |
case-22 | fail→fail | 21,591 | 8,528 | -61% | 1 | 1 | 0% | 3,552 | 3,561 | +0% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 12 counted toward the lift figure. The other 10 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +14 percentage points is the difference between those two pass rates over the 12 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.