session-state
Skill288 starsChanged 5 days agoMITView on GitHub
Track implementation decisions and progress in specs/state.yaml to prevent context rot. Use at the start of a session to load context, and whenever a significant decision is made or a milestone is reached.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- NickKostovny/marketing-playbookstheir own version, first seen Nov 8, 2026
- Data-Wise/crafttheir own version, first seen Oct 31, 2026
- LazyIsEfficient/agentic-ostheir own version, first seen Oct 22, 2026
- itsmuskanagarwal/claude-packtheir own version, first seen Oct 11, 2026
- camunda/camundatheir own version, first seen Oct 8, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- camunda/camunda★ 4.4ksame name
- LazyIsEfficient/agentic-os★ 17same name
- Data-Wise/craft★ 4same name
- itsmuskanagarwal/claude-pack★ 0same name
- NickKostovny/marketing-playbooks★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository162 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- .cursor/rules/align-grid.mdcCursor rule
- .cursor/rules/assess-impact.mdcCursor rule
- .cursor/rules/audit-code.mdcCursor rule
- .cursor/rules/audit-plan.mdcCursor rule
- .cursor/rules/build-epic.mdcCursor rule
- .cursor/rules/change-request.mdcCursor rule
- .cursor/rules/commit-message.mdcCursor rule
- .cursor/rules/compose-workflow.mdcCursor rule
- .cursor/rules/craft-skill.mdcCursor rule
- .cursor/rules/deepen-architecture.mdcCursor rule
- .cursor/rules/define-language.mdcCursor rule
- .cursor/rules/define-success.mdcCursor rule
- .cursor/rules/delegate-task.mdcCursor rule
- .cursor/rules/deploy.mdcCursor rule
- .cursor/rules/design-interface.mdcCursor rule
- .cursor/rules/develop-tdd.mdcCursor rule
- .cursor/rules/diagnose-root.mdcCursor rule
- .cursor/rules/diagnose-stall.mdcCursor rule
- .cursor/rules/dispatch-agents.mdcCursor rule
- .cursor/rules/edit-document.mdcCursor rule
- .cursor/rules/elaborate-spec.mdcCursor rule
- .cursor/rules/enforce-first.mdcCursor rule
- .cursor/rules/evolve-skill.mdcCursor rule
- .cursor/rules/execute-plan.mdcCursor rule
- .cursor/rules/extract-design.mdcCursor rule
- .cursor/rules/find-way.mdcCursor rule
- .cursor/rules/fix-bug.mdcCursor rule
- .cursor/rules/gate-trace.mdcCursor rule
- .cursor/rules/generate-allure-report.mdcCursor rule
- .cursor/rules/grill-me.mdcCursor rule
- .cursor/rules/grill-with-docs.mdcCursor rule
- .cursor/rules/guard-git.mdcCursor rule
- .cursor/rules/harden-vps.mdcCursor rule
- .cursor/rules/hook-commits.mdcCursor rule
- .cursor/rules/inspect-quality.mdcCursor rule
- .cursor/rules/investigate-bug.mdcCursor rule
- .cursor/rules/kickoff-branch.mdcCursor rule
- .cursor/rules/maintain-wiki.mdcCursor rule
- .cursor/rules/map-codebase.mdcCursor rule
- .cursor/rules/migrate-spec.mdcCursor rule
- .cursor/rules/model-domain.mdcCursor rule
- .cursor/rules/orchestrate-project.mdcCursor rule
- .cursor/rules/organize-workspace.mdcCursor rule
- .cursor/rules/plan-refactor.mdcCursor rule
- .cursor/rules/plan-release.mdcCursor rule
- .cursor/rules/plan-tests.mdcCursor rule
- .cursor/rules/plan-work.mdcCursor rule
- .cursor/rules/publish-package.mdcCursor rule
- .cursor/rules/quick-fix.mdcCursor rule
- .cursor/rules/release-branch.mdcCursor rule
- .cursor/rules/request-review.mdcCursor rule
- .cursor/rules/research-first.mdcCursor rule
- .cursor/rules/reset-baseline.mdcCursor rule
- .cursor/rules/respond-review.mdcCursor rule
- .cursor/rules/run-benchmark.mdcCursor rule
- .cursor/rules/run-evals.mdcCursor rule
- .cursor/rules/run-planning.mdcCursor rule
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 1 is distinctive, and 7 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
When a story modifies existing behavior, patch only between matching marker pairs in CLAUDE.md / AGENTS.md learned-preferences fence — see …
- Very specific: line 28
When ending a session or before a context-heavy spawn, update handoff in state.yaml:
- Very specific: line 53
If specs/state.yaml does not exist, or if starting a new major phase:
- Distinctive: line 61
When starting a new session or after a significant context flush:
- Very specific: line 81
Every multi-step flow (>3 steps) in bigpowers uses a cycle counter in state.yaml:
- Very specific: line 89
Checkpoint: After each step/phase completes, increment the counter in state.yaml and update handoff.next_skill.
- Very specific: line 110
After archiving, reset handoff.open_decisions to an empty list.
- Very specific: line 141
Duplicate Plan: Don't copy release-plan.yaml or epic shards into state.yaml.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- story: e45s23 -->Session State
HARD GATE — HARD GATE — Session state must be synchronized with git state. If state.yaml conflicts with the working tree, halt and ask for clarification. Do NOT assume state is correct.
Track the current state of implementation, including decisions made, pending tasks, and open questions, to ensure continuity across session boundaries and prevent "context rot."
Session-state implements the isolate strategy from the context-engineering framework (docs/references/context-engineering.md): each agent gets exactly the context it needs — no more — by recording decisions so the next agent can cold-start without replaying history. The four strategies (write, select, compress, isolate) work together: session-state handles isolation, terse-mode handles compression, survey-context handles selection, and CONVENTIONS.md ensures token-efficient writing.
Goal
Maintain a single source of truth for the current session in specs/state.yaml. This complements long-term docs in specs/tech-architecture/ and delivery detail in specs/epics/ + specs/release-plan.yaml.
Legacy markdown (specs/archive/STATE.md, RELEASE-PLAN.md) is not SoT when YAML exists — use specs/state.yaml only.
When a story modifies existing behavior, patch only between matching marker pairs in CLAUDE.md / AGENTS.md learned-preferences fence — see e45s21.
Handoff block (cold start)
When ending a session or before a context-heavy spawn, update handoff in state.yaml:
handoff:
last_step_completed: "e02s01 verify-work passed"
open_decisions:
- "Use folder mode for e07 (>5 stories)"
required_reading:
- CONVENTIONS.md
- specs/epics/e02-verification/epic.yaml
next_skill: develop-tddStrategic compaction
| Trigger | Action |
| Phase transition (Plan → Build → Verify) | Compact handoff; archive verbose decisions to ADR |
| Context > 70% estimated | Run terse-mode for status only; move detail to specs/ |
Before dispatch-agents wave | state.yaml only channel between spawns |
Workflow
1. Initialize (Session Start)
If specs/state.yaml does not exist, or if starting a new major phase:
- Read
specs/release-plan.yamlandspecs/product/SCOPE_LATEST.yaml. - Get git metadata:
git branch --show-currentandgit rev-parse --short HEAD. - Create
specs/state.yamlwith active flow, git, handoff, and epic cycle if in build.
2. Load (Context Refresh)
When starting a new session or after a significant context flush:
- Read
specs/state.yamlto understand where the previous agent left off. - Read
specs/execution-status.yamlfor story progress (do not infer from release-plan). - Verify git matches
state.yamlgit.branch/git.hash.
3. Update (Decision Point/Milestone)
Whenever a significant decision is made or a milestone is reached:
- Patch via
bash scripts/bp-yaml-set.sh specs/state.yaml git.hash <hash>(or edit directly). - Patch
handoffandlearned_preferences/workspace_factsinCLAUDE.mdfenced block when durable user preferences or repo facts crystallize (e45s23). - Update
handoff.open_decisionswith rationale. - Update
epic_cyclewhen advancingship-epicsteps. - Record open questions under
handoff.open_decisionsor an ADR.
→ verify: bash scripts/validate-specs-yaml.sh
Universal checkpoint pattern
Every multi-step flow (>3 steps) in bigpowers uses a cycle counter in state.yaml:
| Flow | Cycle key | Step field | Phases/Steps |
| build-epic | epic_cycle | current_step | 8 (survey → release) |
| fix-bug | bug_cycle | current_step | 5 (investigate → release) |
| orchestrate-project | project_cycle | current_phase | 6 (discover → release) |
Checkpoint: After each step/phase completes, increment the counter in state.yaml and update handoff.next_skill.
Resume: On session start, read the current step/phase from the cycle key — continue from there, not from step 1.
Completed steps: Track completed steps in completed_steps (comma-separated string) for audit trail.
Strategic compaction
Print the current session state: cat specs/state.yaml, then display active_flow and handoff.next_skill for quick reference.
reset-state (absorbed)
Clear ephemeral session state. Set active_epic_id, active_story_id, and epic_cycle.current_step to null in specs/state.yaml. Use when ending a phase or starting a new project context.
compact-state (absorbed)
Archive verbose decisions before a context transition. Move all entries from handoff.open_decisions to their appropriate location:
- System-wide decisions →
specs/adr/NNNN-slug.md(global Architectural Decision Records) - Epic-scoped decisions →
specs/epics/<active_epic_id>-<slug>/adr/NNNN-slug.md(epic-local ADRs, archived with epic)
After archiving, reset handoff.open_decisions to an empty list.
File Format: specs/state.yaml
active_flow: build_epic # planning | build_epic | fix_bug
active_epic_id: e02
active_story_id: e02s01 # required when epic mode: folder
active_bug_id: null # BUG-2026-06-01T143022 when fix_bug
release:
target_version: null # NOT tracked manually — semantic-release decides at merge
last_tag: v2.28.0 # mirror of `gh release view`, reference only
last_publish: null
epic_cycle:
current_step: develop-tdd
next_skill: develop-tdd
completed_steps: [kickoff-branch]
bug_cycle:
current_step: null
completed_steps: []
git:
branch: feat/e02-verify
hash: abc1234
handoff:
last_step_completed: null
open_decisions: []
next_skill: survey-contextAnti-Patterns
- Duplicate Plan: Don't copy
release-plan.yamlor epic shards intostate.yaml. - Stale State: Forgetting to update
state.yamlafter a major refactor or decision. - Status in release-plan: Story/epic status lives only in
execution-status.yaml.
<!-- story: e03s03 --><!-- story: e04s01 -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

