/epic:orbitfrom epic
Runs an autonomous pipeline from spec to PR: spec, implement, audit, evaluate, ship, and evolve in one command. Auto-detects execution mode and recovers from crashes via persisted state files.
Ships in epic. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
CRITICAL: Run EPIC_PROJECT_DIR=$(epic path) first. NEVER use .harness/ in the project directory.
You are entering Orbit mode — the full autonomous pipeline from spec to PR in one shot.
At the start of every response during an active orbit:
ls $EPIC_PROJECT_DIR/orbit/PIPELINE-*.json 2>/dev/null"status": "running"phase matches where you left offphase is ahead of where you think you are, trust the file — you may have compactedphase_history contains an entry for the current phase with a completed timestamp, treat that phase as done and advance to the next phase — phase_history wins over the phase field when they disagree.worktree_name is set in pipeline state:
git worktree list | grep "{worktree_name}"cd into the worktree path to continue work"status": "aborted"If no file with "status": "running" exists, orbit was not started or has completed. Do not invent one.
Crash recovery: If updated_at is older than 45 minutes and the pipeline is in status: running, assume a crash occurred. Read the state, determine the last completed phase from phase_history (rule 5 above applies), and resume from there. Report the recovery to the user.
Concurrent-orbit guard — before starting, run:
epic orbit lock # exit 1 + "another orbit is running" if one is active → STOP
On success you own the guard; run epic orbit unlock when the pipeline reaches
a terminal state (complete/aborted). If a crashed orbit left the lock behind,
lock reclaims it automatically once no PIPELINE-*.json is running.
Initialize pipeline state at $EPIC_PROJECT_DIR/orbit/PIPELINE-{timestamp}.json:
{
"id": "{timestamp}",
"mode": null,
"phase": "auto_detect",
"status": "running",
"spec_file": null,
"goal_slug": null,
"branch": null,
"worktree_name": null,
"original_cwd": null,
"audit_fail_count": 0,
"max_retries": 3,
"audit_report": null,
"pr_url": null,
"deadline": "{ISO-8601, now + 30 minutes}",
"started_at": "{ISO-8601}",
"updated_at": "{ISO-8601}",
"phase_history": []
}
DO NOT ask the user for mode selection. Auto-detect the best path:
| Signal | Mode | Reason |
|---|---|---|
| PRD / detailed requirements doc exists in project | council | Rich input → council synthesizes best approach |
| User request is specific and actionable (clear goal, defined scope) | direct | No need for discovery — spec directly |
| User request is vague, unfocused, or "I want to..." without specifics | council | Council frames the problem better than guessing |
| User explicitly says "interactive" or "let me discover first" | interactive | Respect explicit preference |
ls {project}/PRD*.md {project}/docs/PRD*.md {project}/requirements*.md 2>/dev/nulldirectcouncil"mode": "direct|council|interactive")"Orbit mode: {mode} (auto-detected)"Use when: Request is specific and actionable.
$EPIC_PROJECT_DIR/specs/SPEC-{timestamp}.md, run the Readiness gate from skills/spec/SKILL.md (step 3) on it, settle every GAP: from the request and codebase yourself, record each as GAP: … → settled: … (assumption) under the spec's ## Readiness Gate, then write status: approved. If a gap cannot be settled without the user, downgrade to council mode instead of guessing.epic mem add --title "Orbit: {mode} mode decision" --type decision --importance 0.9 --body "CONTEXT"Use when: PRD exists or request needs framing.
$EPIC_PROJECT_DIR/specs/SPEC-{timestamp}.md, run the Readiness gate (spec skill step 3), settle every GAP: from the council output and record each under ## Readiness Gate, then write status: approvedepic mem add --title "Orbit: council decision" --type decision --importance 0.9 --body "CONTEXT"Use when: User explicitly requested interactive mode.
/discover → /spec, then say "orbit go". STOP and wait.SPEC-*.md with status: approved. Proceed to Step 3.This mode is never auto-selected. It requires explicit user opt-in.
goal_slug[ -z "$(git status --porcelain)" ] || (echo "ERROR: Dirty working tree or untracked files. Commit or stash first." && exit 1)
git symbolic-ref -q HEAD || (echo "ERROR: Detached HEAD. Checkout a branch first." && exit 1)
git worktree add .harness/worktrees/orbit-{goal_slug} -b orbit-{goal_slug} origin/{default-branch}
cd .harness/worktrees/orbit-{goal_slug}
.harness/worktrees/ is host-neutral. Do NOT use .claude/worktrees/ —
it is meaningless on Codex and Antigravity.worktree_name and original_cwd in pipeline stategit diff --stataudit_report fieldaudit and behavior verdicts (audit skill Step 4.5). These, plus the eval and CI verdicts, are blended into the score of the next reflect round that analyzes observations (a CI verdict recorded after the PR may land in a later session), so record them even when the result is FAIL.audit_fail_count:
< 3: plan fixes from action items, execute, return to Step 4≥ 3: PAUSE — ask user "continue or abort?"$EPIC_PROJECT_DIR/eval/eval.yamlbenchmarks/baselines/latest.json in CWD (in-repo baseline)benchmarks/eval_runner.py in CWD (auto-detected benchmark)epic eval --json via the eval skill"eval": "WARN" with the warnings in phase_history and proceed to Ship. WARN does not increment audit_fail_count.
3b. Eval SKIPPED (nothing measured, or no baseline yet): record "eval": "SKIPPED" in the pipeline state and proceed to Ship. SKIPPED is not a failure and does not increment audit_fail_count.audit_fail_count:
< 3: plan fixes, execute, return to Step 4≥ 3: PAUSE — ask user "continue or abort?"cargo clean / npm run clean / equivalentgh pr create with spec + audit report in body
pr_url. epic orbit unlock warns
when a pipeline reaches complete without it.gh pr checks <PR_NUMBER> --json name,state
gh pr checks <PR_NUMBER> --watch, auto-fix failures.HEAD=$(gh pr view <PR_NUMBER> --json headRefOid --jq .headRefOid)
gh run list --commit "$HEAD" --json databaseId,name,status,conclusion,url
action_required: append a phase_history
entry recording "ci_status": "approval_required" with the run URLs,
skip the watch (it can never finish), report CI as BLOCKED (not PASS,
not N/A) because a maintainer must approve the runs, and proceed to
Step 7. Step 7 item 2 (green-CI extras) does not run.phase_history entry
recording "ci_watch": "skipped", and proceed to Step 7 (evolve runs
regardless of CI outcome, so the pipeline must never wait on checks
that will never appear).action_required: do not call gh pr checks --watch (with no checks it exits at once with "no checks reported" and reads as a failure, which is not a CI failure). Watch each run for the HEAD commit with gh run watch <run-id> (the databaseId above) and treat its result as the CI result. If the runs cannot be watched, report CI as BLOCKED.Run the evolution engine to analyze this session and generate/improve skills.
Always run — regardless of CI outcome:
epic-harness reflect
This triggers the Ring 3 loop: observe → analyze → seed evolved skills → update metrics.
If $EPIC_PROJECT_DIR/pending_synth.jsonl has records with status: "pending",
synthesize each — launch one subagent per manifest (use your host's subagent
mechanism; do NOT name a model or CLI), then apply the body it produced:
epic-harness evolve accept-synth --skill <name> --file <body.md>
Unconsumed manifests leave the template skill body in place.
If CI green (all checks passed; not when CI is BLOCKED or skipped): additionally run
epic-harness reflect --context --days 1
and record the successful orbit pattern into memory:
epic mem add --title "Orbit: {goal_slug} succeeded" \
--type pattern --importance 0.7 \
--body "Orbit completed. Mode: {mode}. AC: all verified. PR: {url}. Stack: {stack}."
Report the evolution outcome in the final summary (evolved skills generated, score trend).
Update pipeline state: "phase": "evolve", "status": "complete", then run epic orbit unlock.
## Orbit Complete
- Pipeline: PIPELINE-{id}
- Mode: {direct|council|interactive} (auto-detected)
- Spec: SPEC-{timestamp} ({goal_slug})
- Branch: orbit-{goal_slug}
- Worktree: orbit-{goal_slug} (preserved for PR)
- PR: {URL}
- Audit retries: {count}
### Phase Summary
| Phase | Status | Retries |
|-------|--------|---------|
| Spec | approved | 0 |
| Go | complete | 0 |
| Audit | PASS | {count} |
| Eval | {PASS|WARN|SKIPPED} | 0 |
| CI | {PASS|FAIL|BLOCKED|N/A} | 0 |
| Ship | complete | 0 |
| Evolve | complete | 0 |
### Evolution
- Skills evolved: {count}
- Score trend: {improving|stable|declining}
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub epicsagas/epic-harness --plugin epic27 skills in this plugin
/agent-introspectionLoop-breaking self-diagnosis. Use when 3+ consecutive failures occur, circular retries persist, or context overwhelms the session./auditAudit phase. Parallel review: code quality + security + tests + runtime behavior probe. Read-only evaluator agents. Semantic dedup of cross-mode findings. Outputs PASS/WARN/FAIL per dimension. Validates spec coverage./commitConventional Commits 1.0 generator. Stages relevant files, infers type(scope): description, never uses --no-verify./contextWorking-state snapshot guidance. Restates task/files/decisions in one block so state survives context compaction. Compaction timing is the host's job.Other plugins' skills for the same job