state-management
Simplified state file management with consolidated FLOW.md (project) and ITEM-XXX.md (per-item) files
What this skill does
# State Management Skill
This skill provides techniques for managing workflow state through simplified, consolidated markdown files. The refactored structure uses just two file patterns: a single `FLOW.md` at project level and one `ITEM-XXX.md` per work item.
## Core Principles
1. **Minimal Footprint**: Only two file patterns instead of 9+
2. **Single Source of Truth**: FLOW.md contains backlog + project context, ITEM-XXX.md contains everything about one item
3. **Human Readable**: All state in plain markdown, easy to edit
4. **Checkpoint Recovery**: State enables resumption from any interruption
5. **Context Budget Awareness**: Track and report context usage
## Directory Structure
```
.flow/
├── FLOW.md # Project state + backlog (single file)
└── items/
├── ITEM-001.md # All state for work item 001
├── ITEM-002.md # All state for work item 002
└── ...
```
## State Files Overview
| File | Purpose | Contains |
|------|---------|----------|
| `FLOW.md` | Project-level state | Vision, backlog, active item, capabilities cache |
| `ITEM-XXX.md` | Per-item state | Phase, decisions, requirements, tasks, checkpoint |
## FLOW.md Structure
The single project file contains:
### Sections
1. **Vision**: High-level project vision
2. **Backlog**: Table of all work items with status
3. **Active Item**: Currently active item pointer
4. **Capabilities Cache**: Discovered plugin mappings with timestamp
### Template
See `templates.md` for the full FLOW.md template.
## ITEM-XXX.md Structure
Each work item has a single consolidated file containing:
### Sections
1. **Header**: Item ID, title, timestamps
2. **Phase**: Current phase and progress (DISCUSS/PLAN/EXECUTE/VERIFY)
3. **Decisions**: Numbered decisions with rationale
4. **Requirements**: Extracted functional/non-functional requirements
5. **Tasks**: XML-structured atomic tasks (when in EXECUTE)
6. **Checkpoint**: Current state snapshot for resume
### Template
See `templates.md` for the full ITEM-XXX.md template.
## Work Item States
Items progress through these phases:
| Phase | Description | Next Phase |
|-------|-------------|------------|
| `BACKLOG` | Defined but not started | DISCUSS |
| `DISCUSS` | Gathering requirements | PLAN |
| `PLAN` | Creating task plan | EXECUTE |
| `EXECUTE` | Implementing tasks | VERIFY |
| `VERIFY` | Validating implementation | DONE |
| `DONE` | Completed | (terminal) |
| `ON_HOLD` | Paused intentionally | Previous |
| `BLOCKED` | Waiting on dependency | Previous |
## State Operations
### Initialize Project
```markdown
1. Create .flow/ directory if not exists
2. Create .flow/items/ directory
3. Scan for installed plugins
4. Detect project type from file patterns
5. Create FLOW.md with empty backlog + capabilities
```
### Create Work Item (`/flow-workflow:start`)
```markdown
1. Read FLOW.md to get next item number
2. Generate ITEM-XXX ID
3. Create .flow/items/ITEM-XXX.md with DISCUSS phase
4. Update FLOW.md backlog table
5. Set as active item in FLOW.md
```
### Switch Active Item
```markdown
1. Update checkpoint in current item's file
2. Update FLOW.md active item pointer
3. Load new item's context
```
### Phase Transition
```markdown
1. Verify completion criteria for current phase
2. Update phase in ITEM-XXX.md
3. Create checkpoint snapshot
4. Initialize next phase section
```
### Create Checkpoint
```markdown
1. Record current phase and task progress
2. Capture context budget percentage
3. List next recommended action
4. Add timestamp
```
### Resume from Checkpoint
```markdown
1. Read FLOW.md to get active item
2. Read ITEM-XXX.md checkpoint section
3. Restore context from checkpoint
4. Identify next action
5. Continue workflow
```
## Context Budget Tracking
Track context usage in FLOW.md and report:
```markdown
## Context Monitor
- Current session: [X]% (limit: 50% before fresh agent)
- Last auto-spawn: [TIMESTAMP]
- Fresh agents this session: [N]
```
## State Validation
Before any phase transition, validate:
1. **Completeness**: Required sections filled
2. **Consistency**: No contradictory decisions
3. **Recoverability**: Checkpoint exists for current progress
## Best Practices
### Writing State Updates
- Use timestamps in ISO format
- Include brief rationale for decisions
- Mark status clearly (DONE, BLOCKED, etc.)
- Keep checkpoint current
### Reading State for Context
- Load FLOW.md first for active item
- Load ITEM-XXX.md for current phase details
- Check checkpoint before proceeding
### Handling Phase Transitions
- Always create checkpoint before transition
- Update both FLOW.md backlog and ITEM-XXX.md
- Announce transition to user
## Migration from Old Format
If legacy `.flow/` structure detected (BACKLOG.md, ACTIVE.md, PROJECT.md, etc.):
1. Read existing state files
2. Consolidate into FLOW.md
3. Consolidate per-item files into ITEM-XXX.md
4. Backup old files to `.flow/legacy/`
5. Report migration complete
## Integration Points
State management integrates with:
- **Capability Discovery**: Cache plugin mappings in FLOW.md
- **Workflow Orchestration**: Phase transitions and checkpoints
- **Smart Continuation**: Resume from checkpoint via `/flow-workflow:go`
See `templates.md` for full file templates.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.