arc
Use when running the full plan-to-merged-PR pipeline, when resuming an interrupted arc with --resume, or when any named phase fails (forge, plan-review, plan-refinement, verification, semantic-verification, design-extraction, design-prototype, design-verification, design-iteration, work, gap-analysis, codex-gap-analysis, gap-remediation, goldmask-verification, code-review, goldmask-correlation, mend, verify-mend, test, pre-ship-validation, bot-review-wait, pr-comment-resolution, ship, merge). Use when checkpoint resume is needed after a crash or session end. 29-phase pipeline with convergence loops, Goldmask risk analysis, pre-ship validation, bot review integration, cross-model verification, and conditional design sync (Figma VSM extraction, prototype generation, fidelity verification, iteration). Keywords: arc, pipeline, --resume, checkpoint, convergence, forge, mend, bot review, PR comments, ship, merge, design sync, Figma, VSM, 29 phases. <example> user: "/rune:arc plans/feat-user-auth-plan.md" assistant: "The Tarnished begins the arc — 29 phases of forge, review, design sync, goldmask, test, mend, convergence, pre-ship validation, bot review, ship, and merge..." </example> <example> user: "/rune:arc --resume" assistant: "Resuming arc from Phase 5 (WORK) — validating checkpoint integrity..." </example>
From runenpx claudepluginhub vinhnxv/rune --plugin runeThis skill is limited to using the following tools:
evals/evals.jsonevals/files/convergence-checkpoint.jsonevals/files/goldmask-findings.jsonevals/files/old-schema-checkpoint.jsonevals/files/sample-checkpoint.jsonevals/files/sample-plan.mdevals/files/ship-ready-checkpoint.jsonreferences/arc-architecture.mdreferences/arc-checkpoint-init.mdreferences/arc-codex-phases.mdreferences/arc-delegation-checklist.mdreferences/arc-failure-policy.mdreferences/arc-monitoring-task.mdreferences/arc-naming-conventions.mdreferences/arc-phase-bot-review-wait.mdreferences/arc-phase-cleanup.mdreferences/arc-phase-code-review.mdreferences/arc-phase-completion-stamp.mdreferences/arc-phase-constants.mdreferences/arc-phase-deploy-verify.md/rune:arc — End-to-End Orchestration Pipeline
Chains twenty-nine phases into a single automated pipeline. Each phase runs as its own Claude Code turn with fresh context — the arc-phase-stop-hook.sh drives phase iteration via the Stop hook pattern. Artifact-based handoff connects phases. Checkpoint state enables resume after failure.
Context budget advisory: Full arc run: 29 phases x ~3.5min avg = ~95 minutes (lower bound). Context compaction is almost guaranteed in a single session. For constrained sessions, use --no-forge to skip Phase 1 enrichment, or split into multiple /rune:arc --resume sessions. The PreCompact hook saves checkpoint state automatically.
Load skills: roundtable-circle, context-weaving, rune-echoes, rune-orchestration, elicitation, codex-cli, team-sdk, testing, agent-browser, polling-guard, zsh-compat, design-sync
CRITICAL — Agent Teams Enforcement (ATE-1)
EVERY phase that summons agents MUST follow this exact pattern. No exceptions.
1. TeamCreate({ team_name: "{phase-prefix}-{id}" }) ← CREATE TEAM FIRST
2. TaskCreate({ subject: ..., description: ... }) ← CREATE TASKS
3. Agent({ team_name: "...", name: "...", ← SPAWN WITH team_name
subagent_type: "general-purpose", ← ALWAYS general-purpose
prompt: "You are {agent-name}...", ... }) ← IDENTITY VIA PROMPT
4. Monitor → Shutdown → TeamDelete with fallback ← CLEANUP
NEVER DO:
Agent({ ... })withoutteam_name— bare Agent calls bypass Agent Teams entirely.- Using named
subagent_typevalues — always usesubagent_type: "general-purpose"and inject agent identity via the prompt.
ENFORCEMENT: The enforce-teams.sh PreToolUse hook blocks bare Agent calls when a Rune workflow is active.
Phase Number → Name Mapping
The pipeline uses named phases (not numeric IDs) in PHASE_ORDER. The numeric labels below are for human reference only — execution order is always determined by position in PHASE_ORDER.
| # | Phase Key | Type | Timeout | Delegated To |
|---|---|---|---|---|
| 1 | forge | Team | 15 min | /rune:forge |
| 2 | plan_review | Team | 15 min | /rune:appraise (inspect mode) |
| 2.5 | plan_refine | Inline | 3 min | — |
| 2.7 | verification | Inline | 30 sec | — |
| 2.8 | semantic_verification | Team | 12 min | Codex (conditional) |
| 3 | design_extraction | Team | 10 min | Conditional: design_sync.enabled |
| 3.2 | design_prototype | Team | 10 min | Conditional: design_sync.enabled + VSM files |
| 4.5 | task_decomposition | Team | 10 min | Codex (conditional) |
| 5 | work | Team | 35 min | /rune:strive |
| 5.1 | drift_review | Inline | 2 min | — |
| 3.3 | storybook_verification | Team | 15 min | Conditional: storybook.enabled |
| 5.2 | design_verification | Team | 8 min | Conditional: VSM files |
| 5.3 | ux_verification | Team | 5 min | Conditional: ux.enabled |
| 5.5 | gap_analysis | Team | 12 min | — |
| 5.6 | codex_gap_analysis | Team | 16 min | Codex (conditional) |
| 5.8 | gap_remediation | Team | 15 min | — |
| 5.7 | goldmask_verification | Team | 15 min | /rune:goldmask |
| 6 | code_review | Team | 15 min | /rune:appraise --deep |
| 6.5 | goldmask_correlation | Inline | 1 min | — |
| 7 | mend | Team | 23 min | /rune:mend |
| 7.3 | verify_mend | Inline | 4 min | — |
| 7.4 | design_iteration | Team | 15 min | Conditional: design fidelity |
| 7.7 | test | Team | 25-50 min | Testing agents |
| 7.8 | test_coverage_critique | Team | 15 min | Codex (conditional) |
| 7.9 | deploy_verify | Team | 5 min | Conditional: deployment verification |
| 8.5 | pre_ship_validation | Inline | 6 min | — |
| 8.55 | release_quality_check | Team | 10 min | Codex (conditional) |
| 9 | ship | Inline | 5 min | — |
| 9.1 | bot_review_wait | Inline | 15 min | Conditional: --bot-review |
| 9.2 | pr_comment_resolution | Inline | 20 min | Conditional: --bot-review |
| 9.5 | merge | Inline | 10 min | — |
Non-monotonic numbering: Phase 5.8 (gap_remediation) executes before 5.7 (goldmask_verification). Always use
PHASE_ORDERarray position, not numeric IDs.
Usage
/rune:arc <plan_file.md> # Full pipeline
/rune:arc <plan_file.md> --no-forge # Skip research enrichment
/rune:arc <plan_file.md> --approve # Require human approval for work tasks
/rune:arc --resume # Resume from last checkpoint
/rune:arc <plan_file.md> --skip-freshness # Skip freshness validation
/rune:arc <plan_file.md> --confirm # Pause on all-CONCERN escalation
/rune:arc <plan_file.md> --no-pr # Skip PR creation (Phase 9)
/rune:arc <plan_file.md> --no-merge # Skip auto-merge (Phase 9.5)
/rune:arc <plan_file.md> --draft # Create PR as draft
/rune:arc <plan_file.md> --bot-review # Enable bot review wait + comment resolution
/rune:arc <plan_file.md> --no-bot-review # Force-disable bot review
/rune:arc <plan_file.md> --no-accept-external # Prompt when unrelated changes detected (default: accept)
Flags
| Flag | Description | Default |
|---|---|---|
--no-forge | Skip Phase 1 (research enrichment), use plan as-is | Off |
--approve | Require human approval for each work task (Phase 5 only) | Off |
--resume | Resume from last checkpoint. Plan path auto-detected from checkpoint | Off |
--skip-freshness | Skip plan freshness check (bypass stale-plan detection) | Off |
--confirm | Pause for user input when all plan reviewers raise CONCERN verdicts | Off |
--no-pr | Skip Phase 9 (PR creation) | Off |
--no-merge | Skip Phase 9.5 (auto merge) | Off |
--no-test | Skip Phase 7.7 (testing) | Off |
--draft | Create PR as draft | Off |
--accept-external | Accept external changes (bug fixes, audit commits) on branch without prompting | On |
--no-accept-external | Prompt user when unrelated changes are detected on branch | Off |
--bot-review | Enable bot review wait + PR comment resolution (Phase 9.1/9.2) | Off |
--no-bot-review | Force-disable bot review (overrides both --bot-review and talisman) | Off |
--status | Show current arc phase, progress, and elapsed time (delegates to rune-status.sh) | Off |
Note: Worktree mode for
/rune:strive(Phase 5) is activated viawork.worktree.enabled: truein talisman.yml, not via a--worktreeflag on arc.
External Changes Policy (accept_external_changes)
When --accept-external is passed (or arc.defaults.accept_external_changes: true in talisman), the pipeline tolerates commits on the working branch that are NOT part of the plan. This is common when:
- Running
/rune:arc-batchwhere prior arcs leave commits on the branch - Running
/rune:auditor manual bug fixes in a parallel session that commit to the same branch - Cherry-picking hotfixes onto the arc's working branch
Behavior when enabled:
- Do NOT pause or prompt the user about unrelated changes — continue autonomously
- Gap analysis evaluates only plan criteria coverage; external changes are not flagged as drift
- Code review reviews all changes but does not halt for code outside plan scope
- All commits (plan-related and external) are included in the PR
Default: true (accept external changes silently). Use --no-accept-external or arc.defaults.accept_external_changes: false to restore the prompting behavior.
Workflow Lock (writer)
const lockConflicts = Bash(`cd "${CWD}" && source plugins/rune/scripts/lib/workflow-lock.sh && rune_check_conflicts "writer"`)
if (lockConflicts.includes("CONFLICT")) {
AskUserQuestion({ question: `Active workflow conflict:\n${lockConflicts}\nProceed anyway?` })
}
Bash(`cd "${CWD}" && source plugins/rune/scripts/lib/workflow-lock.sh && rune_acquire_lock "arc" "writer"`)
Pre-flight
See arc-preflight.md for the full pre-flight sequence.
Read and execute the arc-preflight.md algorithm at dispatcher init.
Plan Freshness Check (FRESH-1)
See freshness-gate.md for the full algorithm.
Read and execute the algorithm. Store freshnessResult for checkpoint initialization below.
Context Monitoring Bridge Check (non-blocking advisory)
const bridgePattern = `/tmp/rune-ctx-*.json`
const bridgeFiles = Bash(`ls ${bridgePattern} 2>/dev/null | head -1`).trim()
if (!bridgeFiles) {
warn(`Context monitoring bridge not detected.`)
}
const ctxBridgeFile = bridgeFiles || null
Phase Constants
Read arc-phase-constants.md for PHASE_ORDER, PHASE_TIMEOUTS, CYCLE_BUDGET, calculateDynamicTimeout(), FORBIDDEN_PHASE_KEYS, and updateCascadeTracker().
Initialize Checkpoint (ARC-2)
See arc-checkpoint-init.md for the full initialization.
Read and execute the arc-checkpoint-init.md algorithm.
Inter-Phase Cleanup Guard (ARC-6)
See arc-preflight.md for prePhaseCleanup().
Read(references/arc-preflight.md)
Read(references/arc-phase-cleanup.md)
Stale Arc Team Scan
See arc-preflight.md for the stale team scan algorithm.
Status (--status)
Early return — display current arc phase, progress, and elapsed time without entering the pipeline.
if (args.includes("--status")) {
const output = Bash(`"${CLAUDE_PLUGIN_ROOT}/scripts/rune-status.sh"`)
// Display current phase, elapsed time, completed/total phases
return output
}
Resume (--resume)
See arc-resume.md for the full resume algorithm.
if (args.includes("--resume")) {
Read(references/arc-preflight.md)
Read(references/arc-phase-cleanup.md)
Read and execute the arc-resume.md algorithm.
}
Pre-Flight: State File Conflict Detection
Enforces ONE arc at a time — checks for existing state files from previous or concurrent sessions. Handles 6 cases (F1-F6) including hard blocks, resume prompts, and stale cleanup.
See arc-state-conflict.md for the full conflict detection algorithm and case table.
Phase Loop State File
Writes the YAML state file that drives arc-phase-stop-hook.sh. Includes session isolation fields (config_dir, owner_pid, session_id), checkpoint path, and arc flags.
CRITICAL: session_id MUST use SKILL.md substitution ("${CLAUDE_SESSION_ID}") — NOT Bash('echo $CLAUDE_SESSION_ID') which is unavailable in Bash tool context.
See arc-phase-loop-state.md for the full state file template and write logic.
Discipline Integration
Integrates at 3 points: Phase 5 (work loop with AC criteria), Phase 8.5 (SCR/proof metrics), Post-Arc (echo persist). Config: discipline.enabled (default: true), discipline.block_on_fail (default: false). See strive/references/discipline-work-loop.md and discipline/references/metrics-schema.md.
First Phase Invocation
Execute the first pending phase from the checkpoint. The Stop hook (arc-phase-stop-hook.sh) handles all subsequent phases automatically.
CRITICAL — Single-Phase-Per-Turn Rule: You MUST execute exactly ONE phase per turn, then STOP responding. Do NOT batch-process multiple phases in a single turn. Do NOT skip conditional phases (semantic_verification, design_extraction, design_prototype, task_decomposition) based on assumptions — each phase has its own gate logic in its reference file that MUST be executed. The Stop hook advances to the next phase automatically. Violating this rule causes phases to be skipped without proper gate evaluation.
// Check for context-critical shutdown signal before starting next phase (Layer 1)
const shutdownSignalCheck = (() => {
try {
const sid = "${CLAUDE_SESSION_ID}" || Bash(`echo "\${RUNE_SESSION_ID:-}"`).trim()
const signalPath = `tmp/.rune-shutdown-signal-${sid}.json`
const signal = JSON.parse(Read(signalPath))
return signal?.signal === "context_warning"
} catch { return false }
})()
if (shutdownSignalCheck) {
warn("CTX-WARNING: Context pressure detected between phases. Skipping remaining phases.")
// Mark remaining phases as skipped in checkpoint
for (const p of PHASE_ORDER) {
if (checkpoint.phases[p]?.status === 'pending') {
checkpoint.phases[p].status = 'skipped'
checkpoint.phases[p].skip_reason = 'context_pressure'
}
}
Write(checkpointPath, checkpoint)
return
}
// Find first pending phase
const firstPending = PHASE_ORDER.find(p => checkpoint.phases[p]?.status === 'pending')
if (!firstPending) {
log("All phases already complete. Nothing to execute.")
return
}
// Schema v19: stamp phase start time before executing
checkpoint.phases[firstPending].started_at = new Date().toISOString()
Write(checkpointPath, checkpoint)
// Read and execute the phase reference file
const refFile = getPhaseReferenceFile(firstPending)
Read(refFile)
// Execute the phase algorithm as described in the reference file.
// When done, update checkpoint.phases[firstPending].status to "completed".
// Schema v19: stamp phase completion time and compute duration
const completionTs = Date.now()
checkpoint.phases[firstPending].completed_at = new Date(completionTs).toISOString()
const phaseStartMs = new Date(checkpoint.phases[firstPending].started_at).getTime()
checkpoint.totals = checkpoint.totals ?? { phase_times: {}, total_duration_ms: null, cost_at_completion: null }
checkpoint.totals.phase_times[firstPending] = Number.isFinite(phaseStartMs) ? completionTs - phaseStartMs : null
// Then STOP responding — the Stop hook will advance to the next phase.
Phase-to-reference mapping: See arc-phase-stop-hook.sh _phase_ref() function for the canonical phase → reference file mapping.
Timing instrumentation: Each phase MUST stamp started_at before execution and completed_at + totals.phase_times[phaseName] (duration in ms) after. The Stop hook re-injects this same pattern for all subsequent phases via the phase prompt template. The totals.phase_times map accumulates durations across the full pipeline.
Spec Continuity (Plan Path Propagation)
The plan_file path written to the phase loop state file and checkpoint is propagated to downstream phases that need the original plan specification as their source-of-truth. Each phase reference file reads plan_file from the checkpoint before spawning agents.
| Phase | Checkpoint Key | Purpose |
|---|---|---|
plan_review (Phase 2) | plan_file_path → review agents | Reviewers read plan to evaluate scope and detect drift |
gap_analysis (Phase 5.5) | plan_file_path → gap agents | Gap agents compare plan acceptance criteria vs. committed code |
test (Phase 7.7) | plan_file_path → test agents | Test agents derive coverage targets from plan requirements |
pre_ship_validation (Phase 8.5) | plan_file_path → validation gate | Pre-ship gate reads plan to verify all stated criteria are met before PR |
Rule: Phases that consume plan_file_path MUST read it from checkpoint.plan_file (not from the state file or flags). Workers receive it as planFilePath in their context prompt so they can cross-reference the original spec, even when the pipeline spans multiple sessions via --resume.
Post-Arc (Final Phase)
These steps run after Phase 9.5 MERGE (the last phase). The Stop hook injects a completion prompt when all phases are done.
Timing Totals + Completion Stamp (schema v19)
Before calling the Plan Completion Stamp, record arc-level timing metrics:
// Schema v19: record arc completion time and total duration
const completedAtTs = new Date().toISOString()
checkpoint.completed_at = completedAtTs
checkpoint.totals = checkpoint.totals ?? { phase_times: {}, total_duration_ms: null, cost_at_completion: null }
checkpoint.totals.total_duration_ms = Date.now() - new Date(checkpoint.started_at).getTime()
// Read cost from statusline bridge file (non-blocking — skip if unavailable)
if (ctxBridgeFile) {
try {
const bridge = JSON.parse(Bash(`cat "${ctxBridgeFile}" 2>/dev/null`))
checkpoint.totals.cost_at_completion = bridge.cost ?? null
} catch (e) { /* bridge unavailable — leave null */ }
}
Write(checkpointPath, checkpoint)
Plan Completion Stamp
See arc-phase-completion-stamp.md. Runs FIRST after merge — writes persistent record before context-heavy steps.
Result Signal (automatic)
Written automatically by arc-result-signal-writer.sh PostToolUse hook. No manual call needed. See arc-result-signal.md.
Echo Persist + Completion Report
See post-arc.md for echo persist and completion report template.
Discipline accountability echo: When discipline.enabled: true and convergence metrics exist in the arc checkpoint, write a pipeline-level discipline echo to .rune/echoes/discipline/MEMORY.md with aggregate SCR, first-pass rate, failure code distribution, and trend detection vs historical averages. See discipline/references/accountability-protocol.md for the full echo format and trend detection algorithm.
Proof Manifest Persistence (Discipline Integration, v1.173.0)
Persists the proof manifest (SCR + DSR per criterion) as a PR comment after ship/merge. Includes code compliance and design compliance (when design_sync.enabled). Uses --body-file for injection-safe PR comments.
See arc-proof-manifest.md for the full manifest schema and persistence logic.
Lock Release
Bash(`cd "${CWD}" && source plugins/rune/scripts/lib/workflow-lock.sh && rune_release_all_locks`)
Final Sweep (ARC-9) + Response Completion
See post-arc.md. 30-second budget. After sweep, finish your response immediately — IGNORE zombie teammate messages (Stop hook handles cleanup).
References
- Architecture & Pipeline Overview — Pipeline diagram, orchestrator design, transition contracts
- Phase Constants — PHASE_ORDER, PHASE_TIMEOUTS, CYCLE_BUDGET, shared utilities
- Failure Policy — Per-phase failure handling matrix
- Checkpoint Init — Schema v20, 3-layer config resolution
- Resume — Checkpoint restoration, schema migration
- Pre-flight — Git state, branch creation, stale team scan, prePhaseCleanup
- Phase Cleanup — postPhaseCleanup, PHASE_PREFIX_MAP
- Freshness Gate — 5-signal plan drift detection
- Phase Tool Matrix — Per-phase tool restrictions and time budgets
- Delegation Checklist — Phase delegation contracts (RUN/SKIP/ADAPT)
- Naming Conventions — Gate/validator/sentinel/guard taxonomy
- Post-Arc — Echo persist, completion report, ARC-9 sweep
- Completion Stamp — Plan file completion record
- Result Signal — Deterministic completion signal for stop hooks
- Stagnation Sentinel — Error pattern detection, budget enforcement
- Codex Phases — Phases 2.8, 4.5, 5.6, 7.8, 8.55
- Task Decomposition — Phase 4.5
- Design Extraction — Phase 3 (conditional)
- Storybook Verification — Phase 3.3 (conditional:
storybook.enabled) - Design Verification — Phase 5.2 (conditional)
- State Conflict Detection — Pre-flight F1-F6 conflict cases
- Phase Loop State — State file template for Stop hook driver
- Proof Manifest — Discipline proof manifest persistence (v1.173.0)