RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/danielvm-git/bigpowers

Cursor rule

.cursor/rules/session-state.mdc

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.

Cursor rules

Quality

82/100

Scores the file, not the repository.

Length

789 words

15 headings · 2 code blocks

Repository

114

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
danielvm-git/bigpowers/.cursor/rules/session-state.mdcRawGitHub
1---
2description: "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."
3alwaysApply: false
4---
5 
6# story: e45s23
7 
8# Session State
9> **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.
10 
11 
12Track the current state of implementation, including decisions made, pending tasks, and open questions, to ensure continuity across session boundaries and prevent "context rot."
13 
14Session-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.
15 
16## Goal
17 
18Maintain 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`.
19 
20Legacy markdown (`specs/archive/STATE.md`, `RELEASE-PLAN.md`) is **not** SoT when YAML exists — use `specs/state.yaml` only.
21 
22When a story modifies existing behavior, patch only between matching marker pairs in `CLAUDE.md` / `AGENTS.md` `learned-preferences` fence — see e45s21.
23 
24## Handoff block (cold start)
25 
26When ending a session or before a context-heavy spawn, update `handoff` in `state.yaml`:
27 
28```yaml
29handoff:
30 last_step_completed: "e02s01 verify-work passed"
31 open_decisions:
32 - "Use folder mode for e07 (>5 stories)"
33 required_reading:
34 - CONVENTIONS.md
35 - specs/epics/e02-verification/epic.yaml
36 next_skill: develop-tdd
37```
38 
39## Strategic compaction
40 
41| Trigger | Action |
42|---------|--------|
43| Phase transition (Plan → Build → Verify) | Compact handoff; archive verbose decisions to ADR |
44| Context > 70% estimated | Run terse-mode for status only; move detail to specs/ |
45| Before `dispatch-agents` wave | `state.yaml` only channel between spawns |
46 
47## Workflow
48 
49### 1. Initialize (Session Start)
50 
51If `specs/state.yaml` does not exist, or if starting a new major phase:
52 
53- [ ] Read `specs/release-plan.yaml` and `specs/product/SCOPE_LATEST.yaml`.
54- [ ] Get git metadata: `git branch --show-current` and `git rev-parse --short HEAD`.
55- [ ] Create `specs/state.yaml` with active flow, git, handoff, and epic cycle if in build.
56 
57### 2. Load (Context Refresh)
58 
59When starting a new session or after a significant context flush:
60 
61- [ ] Read `specs/state.yaml` to understand where the previous agent left off.
62- [ ] Read `specs/execution-status.yaml` for story progress (do not infer from release-plan).
63- [ ] Verify git matches `state.yaml` `git.branch` / `git.hash`.
64 
65### 3. Update (Decision Point/Milestone)
66 
67Whenever a significant decision is made or a milestone is reached:
68 
69- [ ] Patch via `bash scripts/bp-yaml-set.sh specs/state.yaml git.hash <hash>` (or edit directly).
70- [ ] Patch `handoff` and `learned_preferences` / `workspace_facts` in `CLAUDE.md` fenced block when durable user preferences or repo facts crystallize (e45s23).
71- [ ] Update `handoff.open_decisions` with rationale.
72- [ ] Update `epic_cycle` when advancing `ship-epic` steps.
73- [ ] Record open questions under `handoff.open_decisions` or an ADR.
74 
75→ verify: `bash scripts/validate-specs-yaml.sh`
76 
77## Universal checkpoint pattern
78 
79Every multi-step flow (>3 steps) in bigpowers uses a cycle counter in `state.yaml`:
80 
81| Flow | Cycle key | Step field | Phases/Steps |
82|------|-----------|------------|-------------|
83| build-epic | `epic_cycle` | `current_step` | 8 (survey → release) |
84| fix-bug | `bug_cycle` | `current_step` | 5 (investigate → release) |
85| orchestrate-project | `project_cycle` | `current_phase` | 6 (discover → release) |
86 
87**Checkpoint:** After each step/phase completes, increment the counter in `state.yaml` and update `handoff.next_skill`.
88 
89**Resume:** On session start, read the current step/phase from the cycle key — continue from there, not from step 1.
90 
91**Completed steps:** Track completed steps in `completed_steps` (comma-separated string) for audit trail.
92 
93## Strategic compaction
94 
95Print the current session state: `cat specs/state.yaml`, then display `active_flow` and `handoff.next_skill` for quick reference.
96 
97### reset-state (absorbed)
98 
99Clear 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.
100 
101### compact-state (absorbed)
102 
103Archive verbose decisions before a context transition. Move all entries from `handoff.open_decisions` to their appropriate location:
104 
105- **System-wide decisions** → `specs/adr/NNNN-slug.md` (global Architectural Decision Records)
106- **Epic-scoped decisions** → `specs/epics/<active_epic_id>-<slug>/adr/NNNN-slug.md` (epic-local ADRs, archived with epic)
107 
108After archiving, reset `handoff.open_decisions` to an empty list.
109 
110## File Format: specs/state.yaml
111 
112```yaml
113active_flow: build_epic # planning | build_epic | fix_bug
114active_epic_id: e02
115active_story_id: e02s01 # required when epic mode: folder
116active_bug_id: null # BUG-2026-06-01T143022 when fix_bug
117release:
118 target_version: null # NOT tracked manually — semantic-release decides at merge
119 last_tag: v2.28.0 # mirror of `gh release view`, reference only
120 last_publish: null
121epic_cycle:
122 current_step: develop-tdd
123 next_skill: develop-tdd
124 completed_steps: [kickoff-branch]
125bug_cycle:
126 current_step: null
127 completed_steps: []
128git:
129 branch: feat/e02-verify
130 hash: abc1234
131handoff:
132 last_step_completed: null
133 open_decisions: []
134 next_skill: survey-context
135```
136 
137## Anti-Patterns
138 
139- **Duplicate Plan**: Don't copy `release-plan.yaml` or epic shards into `state.yaml`.
140- **Stale State**: Forgetting to update `state.yaml` after a major refactor or decision.
141- **Status in release-plan**: Story/epic status lives only in `execution-status.yaml`.
142 
143 
144<!-- story: e03s03 -->
145<!-- story: e04s01 -->
146 

Commands it names

  • git:
  • git branch --show-current
  • git rev-parse --short HEAD
  • git.branch
  • git.hash
  • gh release view

Sections

  • story: e45s23
  • Session State
  • Goal
  • Handoff block (cold start)
  • Strategic compaction
  • Workflow
  • 1. Initialize (Session Start)
  • 2. Load (Context Refresh)
  • 3. Update (Decision Point/Milestone)
  • Universal checkpoint pattern
  • Strategic compaction
  • reset-state (absorbed)
  • compact-state (absorbed)
  • File Format: specs/state.yaml
  • Anti-Patterns

What it covers

lint-formatcode-styleagent-behaviour

Stack — with the evidence

shell

(0.80)

node

(0.70)

react

(0.70)

astro

(0.70)

express

(0.70)

vitest

(0.70)

typescript

(0.60)

javascript

(0.60)

python

(0.60)

github-actions

(0.60)

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
danielvm-git
Language
—
License
—
Archived
no

All configs in this repo

Also in danielvm-git/bigpowers

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
danielvm-git/bigpowers.cursor/rules/align-grid.mdc · 114Cursor rulesnodeshell+8lint-formatdo-notagent-behaviour65/1003 days ago
danielvm-git/bigpowers.cursor/rules/assess-impact.mdc · 114Cursor rulesshellnode+8testtesting-strategydeployment66/1003 days ago
danielvm-git/bigpowers.cursor/rules/audit-code.mdc · 114Cursor rulesshellnode+8setuptestlint-formatstyle+466/1003 days ago
danielvm-git/bigpowers.cursor/rules/audit-plan.mdc · 114Cursor rulesnodeshell+8buildteststylegit74/1003 days ago
danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 114Cursor rulesshellnode+8buildgit58/1003 days ago
danielvm-git/bigpowers.cursor/rules/change-request.mdc · 114Cursor rulesshellnode+8no sections48/1003 days ago
danielvm-git/bigpowers.cursor/rules/commit-message.mdc · 114Cursor rulesshellnode+8lint-formatstyletypesgit+382/1003 days ago
danielvm-git/bigpowers.cursor/rules/compose-workflow.mdc · 114Cursor rulesshellnode+8styledo-notagent-behaviour65/1003 days ago
danielvm-git/bigpowers.cursor/rules/context7-mcp.mdc · 114Cursor rulesshellnode+8style54/1003 days ago
danielvm-git/bigpowers.cursor/rules/craft-skill.mdc · 114Cursor rulesshellnode+8stylearchgitdo-not69/1003 days ago
danielvm-git/bigpowers.cursor/rules/deepen-architecture.mdc · 114Cursor rulesshellnode+8testtesting-strategydo-not57/1003 days ago
danielvm-git/bigpowers.cursor/rules/define-language.mdc · 114Cursor rulesshellnode+8lint-formatdo-not65/1003 days ago
danielvm-git/bigpowers.cursor/rules/define-success.mdc · 114Cursor rulesshellnode+8no sections4/1003 days ago
danielvm-git/bigpowers.cursor/rules/delegate-task.mdc · 114Cursor rulesshellnode+8git62/1003 days ago
danielvm-git/bigpowers.cursor/rules/deploy.mdc · 114Cursor rulesnodeshell+8setupbuildtestdeployment77/1003 days ago
danielvm-git/bigpowers.cursor/rules/design-interface.mdc · 114Cursor rulesshellnode+8styleagent-behaviour58/1003 days ago
danielvm-git/bigpowers.cursor/rules/develop-tdd.mdc · 114Cursor rulesshellnode+8teststylearchtesting-strategy+585/1003 days ago
danielvm-git/bigpowers.cursor/rules/diagnose-root.mdc · 114Cursor rulesshellnode+8no sections39/1003 days ago
danielvm-git/bigpowers.cursor/rules/diagnose-stall.mdc · 114Cursor rulesshellnode+8no sections44/1003 days ago
danielvm-git/bigpowers.cursor/rules/dispatch-agents.mdc · 114Cursor rulesshellnode+8git54/1003 days ago
Diff against .cursor/rules/align-grid.mdc Diff against .cursor/rules/assess-impact.mdc Diff against .cursor/rules/audit-code.mdc Diff against .cursor/rules/audit-plan.mdc Diff against .cursor/rules/build-epic.mdc Diff against .cursor/rules/change-request.mdc Diff against .cursor/rules/commit-message.mdc Diff against .cursor/rules/compose-workflow.mdc Diff against .cursor/rules/context7-mcp.mdc Diff against .cursor/rules/craft-skill.mdc Diff against .cursor/rules/deepen-architecture.mdc Diff against .cursor/rules/define-language.mdc Diff against .cursor/rules/define-success.mdc Diff against .cursor/rules/delegate-task.mdc Diff against .cursor/rules/deploy.mdc Diff against .cursor/rules/design-interface.mdc Diff against .cursor/rules/develop-tdd.mdc Diff against .cursor/rules/diagnose-root.mdc Diff against .cursor/rules/diagnose-stall.mdc Diff against .cursor/rules/dispatch-agents.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack