stateful-planning-protocol
Skill4 starsChanged 6 months agoMITView on GitHub
Use when the user asks for a technical plan, PR breakdown, rollout plan, or refactor plan for stateful systems, especially ones involving authoritative ownership, mirrored state, reconnect behavior, transport protocols, React effects, cached bootstrap payloads, or cross-process/window sync. This skill hardens plans by forcing explicit ownership boundaries, allowed and forbidden triggers, reconnect/cache rules, negative invariants, and loop-prevention regressions.
In this repository10 other files it gives its agents.
- clean-commitSkill
- clean-merge-pushSkill
- cleanSkill
- evolutionary-5-stepSkill
- investigate-fixSkill
- owner-checkSkill
- owner-cleanSkill
- technical-design-dossierSkill
- tty-designSkill
- writing-ticksSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 18 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when writing plans for systems where state can be:
- Distinctive: line 19
Before writing the plan, orient on the actual ownership surfaces in the repo instead of relying on memory.
- Distinctive: line 21
When a repo exposes local navigation helpers, prefer this sequence:
- Distinctive: line 30
Every plan must make it obvious:
- Distinctive: line 38
If a plan cannot answer those questions, it is not ready.
- Distinctive: line 66
If ownership changes by mode, say so explicitly.
- Distinctive: line 114
If the plan mentions bootstrap, replay, reconnect, or recovery, explicitly separate:
- Distinctive: line 120
Never allow the plan to blur these into one action.
- Distinctive: line 122
If the implementation will keep a cached payload, specify:
- Distinctive: line 130
If React effects, subscriptions, observers, or callbacks are involved, list:
- Distinctive: line 146
Do not stop at “what should happen.” Also state “what must never happen.”
- Distinctive: line 167
When relevant, also require:
- Distinctive: line 176
Before finalizing the plan, check:
- Distinctive: line 186
If any answer is no, revise the plan.
- Distinctive: line 190
Use this structure when the skill applies:
- Distinctive: line 203
Keep sections short, but do not omit them.
- Distinctive: line 207
Prefer explicit boundaries over clever wording.
- Distinctive: line 209
If a plan touches bootstrap, replay, reconnect, mirrored status, or effect-driven orchestration, use this skill by default.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stateful Planning Protocol
Use this skill when writing plans for systems where state can be:
- authoritative vs mirrored
- cached vs actively sent
- steady-state vs startup/recovery
- local vs transported across process, window, worker, or device boundaries
This is a planning skill, not an implementation skill. The point is to stop plans from being technically plausible but trigger-ambiguous.
Repo Orientation
Before writing the plan, orient on the actual ownership surfaces in the repo instead of relying on memory.
When a repo exposes local navigation helpers, prefer this sequence:
- repo map or architecture map
- dependency graph for package and ownership boundaries
- repo nav helper for entrypoints and scripts
- saved structural-search recipes for state, effects, transport, or protocol seams
Core Rule
Every plan must make it obvious:
- who owns a piece of state
- who may mirror it
- who may command it
- who may initialize or reset it
- which signals may retrigger each of those actions
If a plan cannot answer those questions, it is not ready.
Required Plan Sections
Include these sections, even if they are brief.
1. Goal And Scope
State what is changing and what is explicitly not changing.
Always include:
- architectural boundaries that stay fixed
- runtime modes that stay unchanged
- out-of-scope optimizations or future follow-ups
2. Ownership Model
Name the single writer for each critical state domain.
At minimum, identify:
- startup owner
- steady-state owner
- mirror-only consumers
- command-only producers
- cache-only holders
If ownership changes by mode, say so explicitly.
Use wording like:
The stage owns steady-state live-input runtime once authoritative mode is active.The desktop may cache reconnect bootstrap payloads but must not reinitialize the live stage during steady state.
3. Allowed Triggers
List the signals that are allowed to cause each of these:
- bootstrap or initialization
- steady-state command send
- cache refresh
- reconnect replay
- recovery or repaint
- UI recomposition if relevant
Be specific about trigger source, not just event name.
Example:
Entering performer-output-authoritative mode may send bootstrap.Transport reconnect may replay the cached bootstrap.Authoritative status updates may refresh reconnect cache inputs but must not send bootstrap immediately.
4. Forbidden Triggers
For stateful or bidirectional systems, this section is mandatory.
List what must not retrigger startup or reset paths.
Common forbidden triggers:
- mirrored status updates
- mirrored telemetry updates
- render acknowledgements
- derived UI state
- effect dependency churn from subordinate state
- stale cached payload changes that should be reconnect-only
Example:
Steady-state authoritative status must not retrigger bootstrap send.Telemetry changes must not affect transport initialization.
5. Cache And Reconnect Semantics
If the plan mentions bootstrap, replay, reconnect, or recovery, explicitly separate:
- cache update
- active send
- replay on reconnect
Never allow the plan to blur these into one action.
If the implementation will keep a cached payload, specify:
- what updates the cache
- what sends immediately
- what replays on reconnect only
6. Effect Dependency Audit
If React effects, subscriptions, observers, or callbacks are involved, list:
- effects that are mode-entry only
- effects that may depend on mirrored state
- effects that must not depend on mirrored state
This section exists to catch feedback loops before implementation.
Examples of risky dependencies:
- stage-owned status inside a desktop bootstrap effect
- telemetry inside initialization effects
- render ack inside steady-state command construction
7. Positive And Negative Invariants
Do not stop at “what should happen.” Also state “what must never happen.”
Include both:
- positive invariants
- negative invariants
Examples:
Bootstrap carries explicit cadence config.Output-config sync updates cadence without reconnect.Authoritative status updates do not emit another bootstrap.Mirrored state cannot re-enter startup paths.
8. Regression Shape
The test plan must include:
- one positive path that proves the intended behavior
- one negative path that proves a loop, echo, or re-bootstrap cannot happen
When relevant, also require:
- reconnect replay test
- stale-session rejection test
- mode transition test
- user-visible smoke on the affected runtime mode
Planning Checklist
Before finalizing the plan, check:
- Did I orient on the current repo seams using the available repo-local tools instead of relying on memory?
- Did I separate initialization, steady state, reconnect, and recovery?
- Did I identify the single writer for each critical state domain?
- Did I name at least one forbidden trigger?
- Did I distinguish cache refresh from active send?
- Did I include at least one “must not loop” regression?
- Did I identify any effect dependency that could turn mirrored state into a reset path?
If any answer is no, revise the plan.
Output Template
Use this structure when the skill applies:
- Summary
- Ownership Model
- Allowed Triggers
- Forbidden Triggers
- Cache / Reconnect Behavior
- Key Changes
- Positive Invariants
- Negative Invariants
- Test Plan
- Assumptions
Keep sections short, but do not omit them.
Notes
- Prefer explicit boundaries over clever wording.
- Plans for authoritative or mirrored systems should bias toward single-writer clarity.
- If a plan touches bootstrap, replay, reconnect, mirrored status, or effect-driven orchestration, use this skill by default.
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.

