From casegraph-plugin
Use when reading, manually authoring, or analyzing a CaseGraph workspace through the `cg` CLI. Trigger on references to `.casegraph/`, `cg case`, `cg node`, `cg edge`, `cg task`, `cg frontier`, `cg blockers`, `cg analyze`, `cg case view`, or phrases like "show the case", "what's blocked", "analyze impact", "create a case", "show the frontier". Do NOT use for AI-proposed graph changes (use casegraph-patch) or for importer/sink/worker/storage recovery (use casegraph-integrate).
How this skill is triggered — by the user, by Claude, or both
Slash command
/casegraph-plugin:casegraphThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
CaseGraph is an event-sourced, local-first case graph substrate. The `cg` CLI is the primary surface for reading a workspace, hand-editing cases (nodes, edges, tasks, decisions, events, evidence), and running structural analysis (`frontier`, `blockers`, `analyze *`, topology surfaces). This skill covers the read / manual-authoring / analysis path.
CaseGraph is an event-sourced, local-first case graph substrate. The cg CLI is the primary surface for reading a workspace, hand-editing cases (nodes, edges, tasks, decisions, events, evidence), and running structural analysis (frontier, blockers, analyze *, topology surfaces). This skill covers the read / manual-authoring / analysis path.
For AI-proposed changes use casegraph-patch. For importers, sinks, workers, and recovery use casegraph-integrate.
Resolve a working launcher before using the commands below:
cg --help works, use cg.pnpm exec cg --help or npx cg --help.pnpm install and pnpm build, then use pnpm cg --help.@caphtech/casegraph-cli and use either global cg or project-local pnpm exec cg.In the rest of this skill, cg ... means "use the launcher that succeeded here."
The CLI finds the workspace (the nearest directory containing .casegraph/) in this order:
--workspace <path> flagCASEGRAPH_WORKSPACE environment variable.casegraph/ is foundIf unsure whether one exists, check ls .casegraph/workspace.yaml. If absent, initialize with cg init --title "...".
Every frozen core command accepts --format json. The shape is:
{ "ok": true, "data": ... }{ "ok": false, "error": { "code": "...", "message": "..." } }Always use --format json from scripts and check ok before using data.
| Code | Meaning |
|---|---|
| 0 | success |
| 2 | validation error |
| 3 | not found |
| 4 | conflict (e.g. stale base_revision) |
Check exit code and error.code together for granularity.
cg init --title <title>cg case new --id <case_id> --title <title> [--description <text>]cg case listcg case show --case <case_id> — counts and frontier summarycg case view --case <case_id> — read-only ASCII dependency treecg node add --case <id> --id <node_id> --kind <task|decision|event|evidence|goal> --title <t> [--state <todo|doing|waiting|done|cancelled|failed>]cg node update --case <id> <node_id> [--title ...] [--metadata key=value ...]cg edge add --case <id> --id <edge_id> --type <depends_on|waits_for|contributes_to|verifies|alternative_of> --from <from_id> --to <to_id>cg edge remove --case <id> <edge_id>cg task start|done|wait|resume|cancel|fail --case <id> <task_id> [...]
wait accepts --reason <text> and --for <event_id>cg decision decide --case <id> <decision_id> [--result <text>]cg event record --case <id> <event_id>cg evidence add --case <id> --id <id> --for <node_id> [--note <text>]cg frontier --case <id> — actionable set (state in {todo, doing} and is_ready = true)cg blockers --case <id> — blocked nodes with blocker reasons (failed edge / unmet waits_for / unresolved dependency)cg analyze impact --case <id> --from <node_id>cg analyze critical-path --case <id>cg analyze slack --case <id> [--goal <node_id>]cg analyze bottlenecks --case <id> [--goal <node_id>]cg analyze unblock --case <id> --target <node_id>cg cycles --case <id> / cg components --case <id>cg bridges --case <id> / cg cutpoints --case <id> / cg fragility --case <id>Run cg <command> --help for the exact flag shape per release.
Do:
--format json output and check ok plus exit code.Don't:
.casegraph/cases/<case_id>/events.jsonl directly. It is the append-only source of truth; hand edits break reducer replay.case.yaml or .casegraph/cache/state.sqlite as authoritative. Both are projections rebuilt from events. If they drift, run cg cache rebuild and cg validate storage..casegraph/.lock manually. Another cg process may be active.node:sqlite requires Node 22+. Not guarded in code.cg case view is read-only by design..claude/hooks/biome-check.sh) runs biome check --write on edited .ts / .json files inside packages/** and tests/**. Other paths are skipped.casegraph-patchcasegraph-integratedocs/spec/01-domain-model.md, 03-state-and-frontier.md, 05-cli.md, 11-schema-reference.mdnpx claudepluginhub caphtech/casegraph --plugin casegraph-pluginGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.