From arcforge
Provides isolated git worktrees for parallel branches, experiments, and review checkouts in any repo. Automatically escalates epic-context work to an arcforge coordinator.
How this skill is triggered — by the user, by Claude, or both
Slash command
/arcforge:arc-using-worktreesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Isolated git worktrees for any repo. Two tiers: a **generic tier** for any
Isolated git worktrees for any repo. Two tiers: a generic tier for any branch, experiment, or review checkout, and a composition tier that hands epic work to the coordinator. Both derive the canonical path at runtime — you never invent one.
Evaluate top-down; first match wins.
| # | Signal | Tier / Route |
|---|---|---|
| 1 | .arcforge-epic exists in cwd | Already inside an epic worktree. Never create a nested worktree. Work → arc-implementing; integration → arc-finishing (its Step 0 selects the epic path). Raw git merge here is denied by arc-guard — that refusal is correct; don't fight it. |
| 2 | specs/<spec-id>/dag.yaml exists AND the work matches an epic id in it | Composition tier — escalate to the coordinator (below). |
| 3 | dag.yaml exists but the work is NOT an epic (experiment, hotfix, review checkout) | Generic tier. Legitimate inside an arcforge project. |
| 4 | No arcforge state at all | Generic tier. Full standalone value. |
A user-stated custom path overrides everything — honor it via raw git;
worktree list will still show it, annotated external.
Invoke the CLI through the blessed convention. Put this header at the top of
the shell block (under Claude Code the SessionStart hook already exports
ARCFORGE_ROOT, so the fallback is a harmless no-op):
: "${ARCFORGE_ROOT:=$HOME/.agents/arcforge}"
if [ ! -d "$ARCFORGE_ROOT" ]; then
echo "ERROR: ARCFORGE_ROOT=$ARCFORGE_ROOT does not exist. Set ARCFORGE_ROOT to your arcforge checkout." >&2
exit 1
fi
node "${ARCFORGE_ROOT}/scripts/cli.js" worktree add <name> [--branch <b>] [--from <ref>] [--setup] --json
The command prints JSON. Read the path field for the worktree location — do
not reconstruct it from pattern knowledge, and do not hardcode it.
Conventions:
<name>. An existing branch is checked out as-is.--from (default: base HEAD).--setup auto-detects and runs the project installer in the new worktree.node "${ARCFORGE_ROOT}/scripts/cli.js" worktree list --json
The generic status surface. Each entry is annotated kind:
base | epic | generic | external. (Use this, not status --json —
status is the epic-tier surface.)
There is no switch subcommand. To move into a worktree, cd to the path
field from the add or list JSON.
node "${ARCFORGE_ROOT}/scripts/cli.js" worktree remove <name> [--force]
A dirty worktree refuses removal without --force. A worktree carrying an
.arcforge-epic marker is refused outright and redirected to the coordinator —
that one is epic-tier state, not yours to remove here.
When the work matches an epic id in specs/<spec-id>/dag.yaml, do not use
the generic tier. Escalate to the coordinator with one command:
node "${ARCFORGE_ROOT}/scripts/cli.js" expand --epic <id> --project-setup
The branch is <spec-id>/<epic-id> (engine-derived — do not pass -b). Read
the absolute path from the JSON output. The full epic lifecycle is owned by
arc-coordinating; this skill only points you there.
Both tiers hand off to /arc-finishing; its Step 0 discriminates on
.arcforge-epic and runs the right path:
.arcforge-epic present → epic path (coordinator integrates; arc-guard
enforces).node "${ARCFORGE_ROOT}/scripts/cli.js" worktree remove <name>.Stop immediately if you catch yourself thinking:
git worktree add it directly" — NO. The CLI derives the
canonical path; raw git loses list/remove/finish coherence, and in epic
context it breaks the .arcforge-epic marker + dag.yaml update that the
coordinator depends on../worktrees/" — NO. The
canonical path is derived at runtime; putting it elsewhere makes every
downstream tool fail to find it.path
field from the CLI's JSON output.expand refused" — NO. The refusal is correct
(epic not in DAG, dependencies incomplete). Report blocked; do not drop to
the generic tier to route around it.─────────────────────────────────────────────────
✅ Worktree ready: <name>
Path: <absolute path from CLI JSON>
Branch: <branch from CLI JSON>
Kind: <generic | epic>
Next: cd to the path, then /arc-finishing (Step 0 discriminates on .arcforge-epic) when work is complete
─────────────────────────────────────────────────
─────────────────────────────────────────────────
⚠️ Worktree operation blocked
Target: <name or epic id>
Reason: <exact stderr from the CLI>
Common causes:
- Generic: name already exists, dirty tree without --force, branch conflict
- Epic: epic not in dag.yaml, dependencies incomplete, marker'd tree (use the coordinator)
Report the exact CLI error and stop.
─────────────────────────────────────────────────
arc-coordinating (single-epic expansion), arc-agent-driven, arc-executing-tasksarc-coordinating (full epic lifecycle)/arc-finishing (Step 0 discriminates on .arcforge-epic) to integratenpx claudepluginhub gregoryho/arcforge --plugin arcforgeGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.