skills/arc-looping/SKILL.md
Use when running autonomous unattended loops — cross-session execution of DAG tasks without human intervention
npx skillsauth add gregoryho/arcforge arc-loopingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run arcforge workflows overnight without human intervention. Each iteration spawns a fresh Claude session. DAG + git persist state across sessions.
Core principle: Fresh session per task + file-based state = reliable cross-session execution with full auditability.
digraph when_to_use {
"Have a DAG with tasks?" [shape=diamond];
"Tasks can run unattended?" [shape=diamond];
"Need human judgment per task?" [shape=diamond];
"arc-looping" [shape=box];
"arc-agent-driven" [shape=box];
"arc-executing-tasks" [shape=box];
"Create DAG first (arc-planning)" [shape=box];
"Have a DAG with tasks?" -> "Tasks can run unattended?" [label="yes"];
"Have a DAG with tasks?" -> "Create DAG first (arc-planning)" [label="no"];
"Tasks can run unattended?" -> "Need human judgment per task?" [label="yes"];
"Tasks can run unattended?" -> "arc-executing-tasks" [label="no - need human"];
"Need human judgment per task?" -> "arc-agent-driven" [label="yes - within session"];
"Need human judgment per task?" -> "arc-looping" [label="no - fully autonomous"];
}
vs. arc-agent-driven:
node scripts/loop.js --pattern sequential --max-runs 20
node scripts/loop.js --pattern dag --max-runs 20
parallelTasks() to find independent epicsarc-planning first to create specs/<spec-id>/dag.yaml. In multi-spec repos, pass --spec-id <id> to the loop; cross-spec loops are not supported.npm test to confirm clean state--max-runs and --max-cost to bound executionRun loops from the project root, not from inside a worktree.
If you are in a worktree (.arcforge-epic exists), the loop auto-detects both the epic and the spec from the marker (spec_id field) and scopes to that spec's dag.yaml. But running from project root with --pattern dag is the correct approach for multi-epic execution — it handles parallelism internally via parallelTasks().
Never run separate loops in separate worktrees. Each worktree's marker points back to its base spec's dag.yaml, so multiple loops against the same spec will pick up the same tasks and do duplicate work.
For scoped single-epic execution, use --epic:
node scripts/cli.js loop --epic epic-001 --pattern sequential --max-runs 20
Each iteration:
1. Read specs/<spec-id>/dag.yaml → find next task (via coordinator)
2. Build prompt with task context
3. Spawn: claude -p < prompt
4. On success: coordinator.completeTask(taskId)
5. On failure: log error, retry once, then block task
6. Repeat until: all done, max-runs hit, or stop condition
| Condition | What Happens | |-----------|-------------| | All tasks complete | Loop ends with status "complete" | | Max runs reached | Loop ends with status "max_runs" | | Cost limit hit | Loop ends with status "cost_limit" | | Stall detected | No progress in 2+ iterations → stops | | Retry storm | Same error 3+ times → stops | | Sequential failure | Task fails after retry → stops (sequential only) |
Spawn the loop-operator agent to check a running loop:
Use the loop-operator agent to check loop health
It reads .arcforge-loop.json and reports:
.arcforge-loop.json tracks loop state across iterations:
{
"iteration": 12,
"pattern": "sequential",
"started_at": "2026-03-17T22:00:00Z",
"completed_tasks": ["feat-001-01", "feat-001-02"],
"failed_tasks": ["feat-002-03"],
"errors": [{"task_id": "...", "error": "...", "timestamp": "..."}],
"total_cost": 0,
"last_progress_at": "2026-03-17T23:15:00Z",
"status": "running"
}
# Sequential — safest
node scripts/cli.js loop --pattern sequential --max-runs 20
# DAG — parallel-aware
node scripts/cli.js loop --pattern dag --max-runs 50
# With cost limit
node scripts/cli.js loop --max-cost 10 --max-runs 100
# Scoped to one epic (safe for parallel execution)
node scripts/cli.js loop --epic epic-001 --pattern sequential --max-runs 20
Never:
--max-runs on unfamiliar projectsIf loop is failing:
.arcforge-loop.json errors — are they the same error repeating?specs/<spec-id>/dag.yaml — are blocked tasks preventing progress?npm test — is the project in a broken state?Required before:
Works with:
After loop completes (in order):
testing
Use when the user explicitly invokes `/arcforge:arc-auditing-spec <spec-id>` for a read-only advisory audit of an SDD spec family (design, spec, dag, decision anchors). Only triggered by direct user invocation; never auto-invoked from any pipeline skill.
testing
Use when the user wants to create, query, audit, or initialize an Obsidian vault — saving notes/ideas/URLs into it ("save this" / "file this back" included), querying vault knowledge, auditing health (missing links, orphans, drift), ingesting files, or registering vaults. Not for Excalidraw diagrams — use arc-diagramming-obsidian.
data-ai
Use when specs/<spec-id>/dag.yaml has 2+ ready epics and the lead is staying present to monitor epic-level parallel work via agent teammates. Trigger on mentions of agent teams/teammates for multi-epic work, or after arc-planning yields multiple ready epics. For walk-away unattended execution, use arc-looping.
data-ai
Use when the user wants an Excalidraw diagram or any visual representation — architecture, flowchart, mind map — including casual "draw this" / "show me how this works visually". Also use when arc-maintaining-obsidian delegates Synthesis visuals beyond embedded Mermaid.