state-management
Skill100 starsChanged 7 months agoMITView on GitHub
Read, write, and maintain .spec2cloud/state.json across phases and increments. Defines the state schema, read/write protocol, and resume re-validation logic. Use when reading project state, updating state after task completion, or resuming from a previous session.
We split this skill into the rules it gives an agent
9 rules. 0 are common, 4 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 20 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
If in increment-delivery, parse currentIncrement and its steps to determine what's been done and what's next
- Distinctive: line 21
Update the relevant section with the result of the task you just executed
- Very specific: line 22
Update lastUpdated to the current ISO timestamp
- Very specific: line 23
Write the updated state back to .spec2cloud/state.json
- Distinctive: line 56
When operating in brownfield mode, the state includes additional fields for testability tracking and per-feature track assignment.
- Very specific: line 79
When track is "hybrid", each increment in Phase 2 inherits its track from featureTracks.
- Distinctive: line 89
If results match state → continue from where you left off
- Distinctive: line 90
If results differ → update state to reflect reality, then continue
- Very specific: line 103
BLOCKING: If state.json is invalid or inconsistent with actual artifacts, the resume skill will reconstruct the wrong position.
“Common” is measured: kept by at least 6 in 10 of the 20 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
State Management
State lives in .spec2cloud/state.json. You read it at the start of every loop iteration and write it at the end.
Reading State
At the start of every loop iteration:
- Read
.spec2cloud/state.json - Parse
currentPhaseto determine where you are (setup, discovery, or increment-delivery) - If in
increment-delivery, parsecurrentIncrementand itsstepsto determine what's been done and what's next - Parse
humanGatesto check which approvals have been granted
Writing State
At the end of every loop iteration:
- Update the relevant section with the result of the task you just executed
- Update
lastUpdatedto the current ISO timestamp - Write the updated state back to
.spec2cloud/state.json
State File Schema
See references/schema.md for the full JSON schema example and field descriptions.
Increment Object Fields
| Field | Type | Description |
status | "pending" | "in-progress" | "done" | Overall increment delivery status. "done" only when Step 4 (Verify & Ship) completes. |
steps | object | Per-step status tracking: tests, contracts, implementation, verification. |
Step Object Fields
| Step | Key Fields | Description |
tests | e2eSpecs, gherkinFiles, cucumberSteps, vitestFiles | Files generated for this increment's test scaffolding. |
contracts | apiContracts, sharedTypes, infraUpdated | Contract artifacts for this increment. |
implementation | slices (api, web, integration) | Per-slice tracking with modifiedFiles, failingTests, lastTestRun, iteration. |
verification | regression, deployment, smokeTests, docs | Full regression results, deployment URL, smoke test results, docs status. |
Slice Dependencies (within implementation)
Contracts → api (api slice reads contract types)
Contracts → web (web slice reads contract types)
api + web → integration (integration requires both slices done)
integration → verification (verify requires all slices green)Brownfield State Fields
When operating in brownfield mode, the state includes additional fields for testability tracking and per-feature track assignment.
| Field | Type | Description |
brownfield.testability | "full" | "partial" | "none" | Overall testability verdict after the testability gate. |
brownfield.track | "A" | "B" | "hybrid" | Delivery track: A (testable, green baseline), B (doc-only), or hybrid (mix per feature). |
brownfield.testabilityChecklist | object | Six binary checks: canBuild, externalDepsReachable, apiExercisable, uiRenderable, devEnvExists, existingTestsRunnable. |
brownfield.featureTracks | object | Map of featureId → "A" | "B". Only present when track is "hybrid". |
brownfield.greenBaseline | object | Track A metrics: per-feature scenarios count, testsPass boolean, lastVerified ISO timestamp. |
brownfield.behavioralDocs | object | Track B metrics: per-feature scenarios count and manualChecklist item count. |
Brownfield State Transitions
| Trigger | Phase | State Updates |
| Extraction complete | "B1" | currentPhase: "B1", extraction output paths recorded in brownfield.extraction |
| Spec-Enable complete | "B2" | currentPhase: "B2", brownfield.prdGenerated: true, brownfield.frdCount: N |
| Testability gate complete | "B3" | currentPhase: "B3", brownfield.testability, brownfield.track, brownfield.testabilityChecklist recorded |
| Track A baseline green | (still B3) | brownfield.greenBaseline.features populated with per-feature test results |
| Track B docs complete | (still B3) | brownfield.behavioralDocs.features populated with per-feature scenario/checklist counts |
| Path selection (human gate) | "assessment" | brownfield.selectedPaths array recorded (e.g., ["modernize", "security"]) |
| Assessment + planning done | "increment-delivery" | Increments generated, incrementPlan populated, delivery proceeds track-aware |
When track is "hybrid", each increment in Phase 2 inherits its track from featureTracks. Track A increments follow the full test → contract → implement → verify cycle. Track B increments follow a doc-only path (behavioral docs + manual checklists instead of automated green baselines).
On Resume
- Read
.spec2cloud/state.json - Determine current increment and current step within it
- Re-validate by running the appropriate test suite:
- Tests step: verify test files exist and compile
- Implementation step: run tests for the current slice, compare to state
- Verification step: check deployment status
- If results match state → continue from where you left off
- If results differ → update state to reflect reality, then continue
Mandatory Completion Checklist
The orchestrator MUST verify ALL of the following after every state write:
.spec2cloud/state.jsonis valid JSON (parseable without errors)currentPhasereflects the actual phase the orchestrator is incurrentIncrementand increment step match the work just completedlastUpdatedtimestamp is current- No fields are null/undefined that downstream skills depend on (e.g.,
adrs.nextNumber,incrementPlan) - State file is committed alongside the artifacts it describes (not orphaned)
BLOCKING: If state.json is invalid or inconsistent with actual artifacts, the resume skill will reconstruct the wrong position. Fix state before proceeding.
Other versions27 projects use a version of this.
Word for word · 1
- crgarcia12/Liliput★ 4100% same
Edited · 0
None found.
Wrote their own version · 26
- compozy/compozy★ 2.8ksame name
- conorluddy/xclaude-plugin★ 186same name
- github/replica★ 117same name
- cohen-liel/hivemind★ 108same name
- TheBeardedBearSAS/claude-craft★ 108same name
- statelyai/skills★ 48same name
- komluk/scaffolding★ 15same name
- darknecrocities/SkillBuilder★ 13same name
- PMDevSolutions/Aurelius★ 9same name
- YepAPI/skills★ 8same name
16 more not listed
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.
Used alongsideProjects with it also use css-architecture, i18n and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Piyush8296Skillcss-architecture
CSS architecture, Tailwind patterns, responsive design, design tokens, and styling best practices. Use when implementing designs, setting up styling infrastructure, or debugging layout issues.
Also in 3 projects that use this
lbednerSkilli18n
Use when a code or template change introduces a new translation message key, in either the framework CLI (aegis/i18n/locales/) or a generated project's CLI (the app/i18n/locales/ template tree). Covers adding the real English string, stubbing the same key into every other locale for parity, and the separate translation PR that later replaces placeholders with reviewed native text.
Also in 4 projects that use this
mijunriSkilldatabase
数据库脚本与操作规范。脚本放在 db_scripts 目录,遵循查询优化、事务、安全等实践。
Also in 3 projects that use this
NVIDIASkilltesting
Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.
Also in 6 projects that use this
0xSeroSkillsecurity
Also in 4 projects that use this
klauswgSkillperformance
Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".
Also in 3 projects that use this
In this repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- adrSkill
- api-extractorSkill
- architecture-mapperSkill
- aspireSkill
- audit-logSkill
- azure-deploymentSkill
- bug-fixSkill
- build-checkSkill
- cloud-native-assessmentSkill
- cloud-native-plannerSkill
- codebase-scannerSkill
- commit-protocolSkill
- contract-generationSkill
- data-model-extractorSkill
- ddd-modelingSkill
- dependency-inventorySkill
- deploy-diagnosticsSkill
- e2e-generationSkill
- error-handlingSkill
- extension-plannerSkill
- find-skillsSkill
- frd-generatorSkill
- gherkin-generationSkill
- human-gateSkill
- implementationSkill
- modernization-assessmentSkill
- modernization-plannerSkill
- performance-assessmentSkill
- playwright-cliSkill
- prd-generatorSkill
- research-best-practicesSkill
- resumeSkill
- rewrite-assessmentSkill
- rewrite-plannerSkill
- security-assessmentSkill
- security-plannerSkill
- skill-creatorSkill
- skill-discoverySkill
- spec-refinementSkill
- spec-validatorSkill
- tech-stack-resolutionSkill
- test-discoverySkill
- test-generationSkill
- test-runnerSkill
- ui-ux-designSkill
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.

