analysis-state-management

Maintains durable YAML-based analysis state in docs/analysis/ for resumable long-running empirical projects.

2|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/lancegui/causal-powers --skill analysis-state-management-lancegui
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: analysis-state-management
Source: https://github.com/lancegui/causal-powers/tree/main/evals/prompt-pilot-state-did/transcripts/current/stage1/instructions/skills/analysis-state-management
Command: npx skills add https://github.com/lancegui/causal-powers --skill analysis-state-management-lancegui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Long empirical analyses lose context when chat sessions are compacted or cleared, forcing agents to reread one bloated plan file and repeat work. This Skill replaces that habit with a small YAML index and task-specific records so any fresh session resumes from durable on-disk state. ## Core Features & Use Cases - Schema v2 state layout: A single default read of docs/analysis/index.yaml routes to phase records, a decisions ledger, an artifact registry, runs, and handoffs. - Phase contracts with topology: Each phase file carries goal, scope, acceptance checks, required plausibility threats, and a topology of spine/leaf nodes that exposes independent work for parallel execution. - Draft-review-approve discipline: Approval lives only in the user's chat sign-off, never in the phase file, and post-approval contract changes count as drift requiring re-approval. - Use Case: A multi-week econometric study survives /clear and compaction: a fresh agent reads index.yaml, loads only the named records, and continues from next_action without rereading the whole plan. ## Quick Start Set up a docs/analysis/ state folder for my current analysis project and record the active phase, decisions, and artifacts so a fresh session can resume it.

Frequently Asked Questions about analysis-state-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make an AI analysis session resumable after context compaction?▼

Store state in docs/analysis/index.yaml as the single default read, pointing to phase records, decisions, and artifacts. On resume, read only the index and the records it names, then continue from its next_action field instead of rereading a long plan file.

How do I structure a long-running data analysis plan across sessions?▼

Use one YAML file per phase under docs/analysis/phases/ carrying goal, scope, acceptance checks, plausibility threats, and a topology of spine and leaf nodes. Keep decisions in a compact ledger and map outputs to producing scripts in an artifact registry.

What is the difference between schema v1 current.yaml and schema v2 index.yaml?▼

Schema v2 merges the v1 current.yaml live-state fields (updated, active_phase, next_action, blockers) directly into index.yaml, so there is one default read instead of two. A live current.yaml next to index.yaml is drift and should be migrated or removed.

Can the AI record its own approval of an analysis phase plan?▼

No. Approval truth lives only in the user's explicit chat sign-off, never in the phase file, since the model writes that file itself. A phase record with status approved or an approved key is a red flag that must be fixed.

When should a subagent handoff be written during analysis?▼

Write a compact YAML handoff when delegating continuation to a fresh subagent, recording files touched, commands run, large outputs, and the next prompt. If context pressure exceeds 50 percent, hand off and stop rather than continuing into a new phase.