Orchestrates the full implementation pipeline after spec review: runs ctdd, simplify, cverify, cupdate-arch, cdocs, then creates a PR. Resumes from any active workflow phase.
Ships in correctless. 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.
Shared constraints apply. Before executing, read
_shared/constraints.mdfrom the parent of this skill's base directory. All constraints there apply to this skill.
You are the pipeline orchestrator. You invoke skills in sequence, monitor for failures, and escalate to the human when autonomous resolution is not possible. You do not write tests or production code yourself — each skill handles its own domain. You are the orchestrator that invokes skills; skills do not auto-continue on their own.
Before doing anything, read the current workflow state by running bash .correctless/hooks/workflow-advance.sh status and check the current phase.
/cauto accepts any active workflow phase and computes the remaining pipeline steps using a fixed phase-to-step mapping. The implementation pipeline mapping is:
| Current Phase | Remaining Pipeline Steps |
|---|---|
review / review-spec | Full pipeline: ctdd → simplify → cverify → cupdate-arch → cdocs → consolidation → PR |
tdd-tests | Resume from ctdd (handles internal TDD phases) → simplify → cverify → cupdate-arch → cdocs → consolidation → PR |
tdd-impl | Resume from ctdd (handles internal TDD phases) → simplify → cverify → cupdate-arch → cdocs → consolidation → PR |
tdd-qa | Resume from ctdd (handles internal TDD phases) → simplify → cverify → cupdate-arch → cdocs → consolidation → PR |
tdd-audit | Resume from ctdd (handles internal TDD phases) → simplify → cverify → cupdate-arch → cdocs → consolidation → PR |
done | simplify → cverify → cupdate-arch → cdocs → consolidation → PR |
verified | cupdate-arch (if high+ intensity) → cdocs → consolidation → PR |
documented | Consolidation → PR only |
Rejected phases: spec and model are rejected — the spec must be reviewed before the implementation pipeline can run. The spec rejection message: "Run /creview or /creview-spec first — /cauto starts after spec review."
Mid-TDD resume semantics are delegated to /ctdd — /cauto trusts /ctdd to handle the internal TDD state machine from wherever it currently is. /ctdd has its own internal phase-aware logic and will not restart from tdd-tests if the workflow is already at tdd-impl or tdd-qa.
When no workflow exists, /cauto delegates to Phase 3 entry logic (INV-019), which transitions through spec creation and review before entering this phase-to-step mapping at review/review-spec.
Before skipping a phase that is behind the current phase (already completed), /cauto validates that the phase's artifacts exist. For the current phase, /cauto invokes the corresponding skill directly without validation — validation only applies to phases being skipped, not phases being resumed.
Validation checks per phase:
ctdd complete → test suite passes. Execute commands.test from workflow-config.json using the Bash tool's timeout parameter, defaulting to 300 seconds. The timeout is configurable via commands.test_timeout in workflow-config.json (integer, seconds). Exit code 0 = validation pass. Non-zero or timeout = validation fail; /cauto re-runs the phase.simplify → no validation needed (optional step).cverify complete → verification report exists at .correctless/verification/{task-slug}-verification.md.cupdate-arch → no validation needed (advisory).cdocs → no validation needed (advisory).If validation fails 2 consecutive times, skip validation and proceed — the phase's own skill will re-verify.
The validation failure is logged in the audit trail with type artifact_validation_failed.
The canonical step name enum is the single source of truth for expected_steps and completed_steps values in the pipeline manifest.
At high+ intensity: ["ctdd", "simplify", "cverify", "cupdate-arch", "cdocs", "consolidation", "pr"]
At standard intensity: ["ctdd", "simplify", "cverify", "cdocs", "consolidation", "pr"] (cupdate-arch excluded — skipped at standard intensity per R-009)
These names correspond to pipeline Steps 1–9. Internal orchestration actions (pre-simplify commit, post-simplify validation, override-log preservation, pipeline summary) are excluded — they are not pipeline steps.
As the FIRST action after the phase gate — before any skill invocation — write a pipeline manifest to .correctless/artifacts/pipeline-manifest-{branch_slug}.json. The manifest must contain:
{
"expected_steps": ["ctdd", "simplify", "cverify", "cupdate-arch", "cdocs", "consolidation", "pr"],
"expected_end_phase": "documented",
"completed_steps": [],
"started_at": "2026-05-08T00:00:00Z",
"branch": "feature/example-feature",
"status": "in_progress"
}
expected_steps: array of canonical step names from the step name enum (R-010), filtered by the current effective intensity. At standard intensity, expected_steps reflects the reduced pipeline without cupdate-arch.expected_end_phase: the workflow phase that indicates pipeline completion — documented for full runs, or the appropriate phase for partial runs.completed_steps: array, initially empty.started_at: ISO 8601 timestamp.branch: current branch name.After each pipeline step completes successfully, append the current step name to completed_steps in the manifest. The append must happen AFTER the step completes but BEFORE the next step begins. Enforcement: prompt-level — SKILL.md instruction ordering.
As the FINAL action — after Step 10 (pipeline summary) — write "status": "complete" to the manifest. A manifest without "status": "complete" indicates truncation. This is how truncation is detected: if /cauto was interrupted or its context exhausted, the manifest will exist but status will not be "complete".
The pipeline manifest is an ephemeral artifact — it is NOT committed during consolidation (Step 8). The manifest lives under .correctless/artifacts/ which is already excluded from consolidation staging by Step 8.2's belt-and-suspenders guard.
Determine the effective intensity using the computation in the shared constraints (_shared/constraints.md). The effective intensity controls pipeline behavior including attempt thresholds and skill activation.
Before any skill invocation, at pipeline startup (after the phase gate, before invoking any skill), check for stale hooks:
source .correctless/scripts/lib.sh
output="$(check_install_freshness "$(pwd)/.correctless" 2>/dev/null)"
Parse the output and emit warnings by status, in order of severity:
source_ahead: "WARNING: {N} source file(s) changed since last setup: {list}. Installed hooks are STALE. Run setup to update — you are running outdated hooks that may not include recent fixes." This is the strongest warning (PR #63 failure class).modified: "WARNING: {N} installed file(s) differ from their install-time checksums: {list}. Run setup to re-install, or ignore if intentionally modified."missing: "WARNING: {N} installed file(s) are missing: {list}. Run setup to re-install."new_file: "WARNING: {N} file(s) in installed directories not in manifest: {list}. These were added after setup."no_manifest: "Install manifest not found — run setup to enable stale-hook detection."All warnings are advisory, not blocking — the pipeline proceeds. If any non-ok statuses are found, log to the audit trail:
{"type": "install_staleness_detected", "timestamp": "...", "skill": "orchestrator", "affected_files": [...], "statuses": {...}}
If all files are ok, no output.
Before any skill invocation, at pipeline startup, verify tool availability for configured operations:
pr_creation preference is gh (the default), check command -v gh. If gh is not found, fail fast with: "gh CLI not installed. Set pr_creation: skip in preferences.md or install gh." This upfront check prevents hours of implementation followed by a PR creation failure.Before any working-tree-mutating action (at pipeline startup, after the tool
availability check), acquire the shared global working-tree lock at the
FIXED, non-branch-scoped path .correctless/artifacts/worktree.lock. This lock
is the mutual-exclusion point between ANY working-tree-mutating orchestrator —
a concurrent /cauto OR a /cchores run — so two orchestrators never share the
mutable working tree (AP-034). Route the acquisition through the shared
primitive (do NOT roll a bespoke mechanism):
source .correctless/scripts/cauto-lock.sh
if ! lock_acquire ".correctless/artifacts/worktree.lock" "/cauto"; then
# message names the HOLDING orchestrator ("working tree is locked by …")
exit 0 # exit cleanly — another orchestrator holds the lock
fi
This is acquired in addition to /cauto's existing per-branch pipeline lock.
The holder label (/cauto) is recorded so a colliding run's error names the
holding orchestrator generically rather than the cauto-only "active on this
branch" wording.
Stale-lock recovery: lock_acquire auto-recovers a stale lock whose
recorded PID is dead (a crashed orchestrator does not permanently wedge the
shared lock) — lock_check_stale cleans the dead-PID lock dir and the acquire
retries. No manual cleanup is needed for a crashed prior run.
Release on every terminal path: call
lock_release ".correctless/artifacts/worktree.lock" on EVERY terminal path —
success (after Step 10 / PR creation), no-op, abort, and error exits — so the
lock is never leaked. The INV-004-style final idempotency re-check (if any) runs
while this lock is held.
Read .correctless/preferences.md if it exists. This file contains project-level preferences that guide autonomous decisions. If the file does not exist, proceed with built-in defaults — do not fail or abort when preferences.md is absent.
Built-in defaults when preferences.md is missing:
gh (create PR via gh pr create)Log a preference_applied audit event for each non-default preference loaded from preferences.md. If all preferences match the built-in defaults (or the file is absent), no preference_applied events are logged.
On invocation, check for an existing escalation file at .correctless/artifacts/escalation-{branch_slug}.md. If present:
completed_skills, failed_skill, failed_at_phase, and other fields.failed_at_phase matches the current workflow phase.Also read any existing pipeline manifest at .correctless/artifacts/pipeline-manifest-{branch_slug}.json. If the manifest exists but status is not "complete", report which steps were missed:
"Pipeline was truncated at step {last_completed}. Missing steps: {list}. Resuming from {next_step}."
The workflow state is authoritative (queried via workflow-advance.sh). The manifest is advisory — when the two conflict, workflow state wins. R-004 reports the divergence as a diagnostic signal, not as a superseding mechanism.
The pipeline invokes skills in this exact order: /ctdd -> /simplify -> /cverify -> /cupdate-arch -> /cdocs.
The orchestrator spawns a sub-agent for each skill, giving each a fresh context. Each skill must complete successfully before the next begins.
The effective intensity computation from shared constraints determines which skills are active:
/cupdate-arch (it has its own intensity gate requiring high+ intensity). The pipeline becomes: /ctdd -> /simplify -> /cverify -> /cdocs -> PR./cupdate-arch.cupdate-arch has an independent intensity gate in its own SKILL.md — it will refuse to run at standard intensity regardless of whether /cauto invokes it.
When /cupdate-arch is skipped due to standard intensity, log a preference_applied audit event with the reason "cupdate-arch skipped: standard intensity".
When dispatching each skill via Task, the orchestrator must include mode: autonomous in the first 10 lines of the task prompt. Example:
mode: autonomous
You are running as part of the /cauto pipeline. Use your Autonomous Defaults section for all decision points instead of pausing for human input. Return your autonomous decisions as structured output at the end of your response in this format:
AUTONOMOUS_DECISIONS_START
{"decision_id": "AD-001", "default_applied": "...", "rationale": "...", "escalation_deferred": false, "original_escalation_reason": null}
{"decision_id": "AD-002", "default_applied": "...", "rationale": "...", "escalation_deferred": true, "original_escalation_reason": "..."}
AUTONOMOUS_DECISIONS_END
Skills detect mode: autonomous by checking their prompt context. When absent, skills run interactively (fail-open — the failure mode "pipeline stalls" is safer than "skill silently applies defaults when user expected to be asked").
Sole-Writer Contract (ABS-030): /cauto is the sole writer of .correctless/artifacts/autonomous-decisions-{branch_slug}.jsonl. Skills do NOT write to this file directly. After each skill completes, /cauto parses the AUTONOMOUS_DECISIONS_START/AUTONOMOUS_DECISIONS_END block from the skill's output and writes each decision via the writer script:
bash scripts/autonomous-decision-writer.sh append "<skill-name>" '<json-line>'
The writer script handles branch_slug derivation, directory creation, and JSONL append internally. Routing all writes through this single script is a sole-writer (who-writes) convention; SFG guards only the Edit/Write tool-path, so a direct Bash redirect to the JSONL is no longer blocked (accepted residual, AP-040). Unlike ABS-029/audit-record.sh, the autonomous-decisions JSONL (ABS-030) has NO cmd_* content gate behind it — the sole-writer convention is the only structural leg, and the residual is a Tier-2 accepted non-goal. Each entry has fields: skill (string), decision_id (AD-xxx or AD-UNLISTED-N), default_applied (string), rationale (string), timestamp (ISO 8601), escalation_deferred (boolean, default false), original_escalation_reason (string, null unless escalation_deferred is true).
JSONL Growth Verification: After each skill invocation, verify the JSONL grew. For skills with interaction_mode: autonomous or hybrid that have known decision points in their ## Autonomous Defaults section, if the skill's response contains no parseable decisions, log a warning in the pipeline summary (advisory, not blocking — first iteration).
AD-UNLISTED Fallback (R-014): When a skill in autonomous mode encounters a decision point not listed in its ## Autonomous Defaults section, it applies the first option (the recommended default) and returns it with decision_id: AD-UNLISTED-{N} and escalation_deferred: true. Unlisted decisions are highlighted separately in the end-of-pipeline summary under the Deferred Escalations heading.
The orchestrator advances the workflow state machine through all required transitions using workflow-advance.sh. It must not skip transitions or write to the state file directly — always use workflow-advance.sh commands.
The full transition sequence for a clean run uses these actual phase names in order:
tdd-tests — RED phase: write failing tests from spec rulestdd-impl — GREEN phase: implement to make tests passtdd-qa — QA phase: independent review of implementationtdd-impl -> tdd-qa if QA finds issues, via the fix command which transitions back to tdd-impl)tdd-audit — Mini-audit phase: adversarial specialist review (cross-component, hostile input, resource bounds)done — TDD complete, ready for simplification and verificationverified — Post-implementation verification passeddocumented — Documentation updated, pipeline completeAt high+ intensity, the optional tdd-verify phase may occur between tdd-qa and tdd-audit (handled internally by /ctdd). The tdd-audit phase runs at all intensity levels.
These transitions are managed by /ctdd internally for phases 1-5, and by /cverify and /cdocs for phases 6-7. The orchestrator monitors the phase after each skill completes.
/ctddSpawn a sub-agent to execute /ctdd. This skill manages the RED -> GREEN -> QA -> mini-audit cycle internally and advances the workflow through tdd-tests, tdd-impl, tdd-qa, tdd-audit, and done phases.
Log a skill_started audit trail entry before invocation.
If /ctdd triggers a spec-update (the spec was found to be wrong during TDD), escalate to the human immediately (R-017). The escalation summary must state which spec rule is unsatisfiable and the problematic rule that cannot be satisfied. This resets the phase back to spec, and the pipeline halts on spec-update. After the human fixes the spec and re-approves review, they re-invoke /cauto — the resumption check (R-016) detects review/review-spec phase and starts the pipeline fresh.
Log a skill_completed audit trail entry after successful completion.
/simplify (R-015)After /ctdd completes, commit all TDD changes with the message "TDD complete" to establish a clean revert point. This commit before simplify ensures atomic rollback is possible.
/simplify (R-012)/simplify is a Claude Code built-in command that operates outside the Correctless trust model. It has no SKILL.md, no allowed-tools, no context: fork, and no audit trail integration. It is treated as an untrusted contributor whose changes are validated post-hoc.
/simplify runs after /ctdd completes (the workflow is in done phase) and before /cverify. There is no workflow-advance.sh transition for /simplify — it runs during the done phase with no phase change.
After /simplify completes:
Check the diff for .correctless/ path modifications: Run git diff HEAD and inspect for changes to any .correctless/ paths or config files. If found, revert with git reset --hard HEAD and continue without simplification. Log the revert as simplify_reverted in the audit trail but do not escalate — continue without the simplification changes.
Re-run the project's test suite: If tests fail after simplify, revert with git reset --hard HEAD and continue without simplification. Log as simplify_reverted but do not escalate.
If tests pass and no protected paths were modified, accept the simplification and create a post-simplify commit.
/cverifySpawn a sub-agent to execute /cverify. Log skill_started before, skill_completed after.
/cupdate-arch (high+ intensity only)At high or critical intensity, spawn a sub-agent to execute /cupdate-arch. Skip at standard intensity (cupdate-arch requires high+ intensity). Log skill_started before, skill_completed after.
/cprune (autonomous, non-blocking)Invoke /cprune in autonomous mode as an internal orchestration action (not a canonical pipeline step — excluded from the ABS-031 step name enum). At high+ intensity, this runs after /cupdate-arch (Step 6). At standard intensity, this runs after /cverify (Step 5) — since /cupdate-arch is skipped at standard, orphaned artifacts and count corrections would otherwise never run.
Pass mode: autonomous in the Task prompt. /cprune executes low-risk actions (orphaned artifact cleanup, count corrections, 90+ day spec archiving) and returns a summary. Include the summary under a "Pruning" heading in the end-of-pipeline summary. /cprune failure is non-blocking — if it fails, log the failure and continue the pipeline.
/cdocsSpawn a sub-agent to execute /cdocs. Log skill_started before, skill_completed after.
After /cdocs completes, run git diff --name-only HEAD and check if CLAUDE.md appears in the changed files. If it does, trigger R-006(e) escalation — CLAUDE.md changes require human approval. Write the escalation file and halt the pipeline; do not proceed to PR creation until the human approves the CLAUDE.md changes.
Between /cdocs and consolidation, sweep the deferred findings backlog. Read .correctless/meta/deferred-findings.json — if the file exists, present ALL findings with status open to the user. In autonomous mode: log open findings as advisory in the pipeline summary; do not block. If the backlog file does not exist, the sweep is a no-op. Sweep failure is non-blocking — if it fails, consolidation proceeds normally.
This is an internal orchestration action, not a canonical pipeline step (excluded from the ABS-031 step enum).
Between /cdocs completion and PR creation, /cauto runs a consolidation step. This step uses scoped staging to prevent accidental commit of secrets or unintended files.
Step 8.1: Stage known pipeline output paths only. The staging set is the union of:
git diff main...HEAD --name-onlyThe explicit pipeline output path list is a constant — future additions to pipeline outputs must be added here. Unknown untracked files are never staged.
.correctless/verification/{task-slug}-verification.md
.correctless/ARCHITECTURE.md
.correctless/AGENT_CONTEXT.md
.correctless/ARCHITECTURE_DEPRECATED.md
.correctless/antipatterns-archived.md
.correctless/CLAUDE_LEARNINGS_ARCHIVED.md
.correctless/artifacts/probe-results-{branch-slug}.json
.correctless/.sfg-lift-active
README.md
CONTRIBUTING.md
docs/workflow-history.md
docs/features/*.md
The .correctless/.sfg-lift-active entry is in the staging allowlist so that, if a lift commit is mid-flight, its restore (sentinel removal) is staged and committed during consolidation rather than silently left in the working tree (RS-020 / AP-037).
Step 8.2: Belt-and-suspenders artifact guard. Verify nothing under .correctless/artifacts/ was staged — if anything was, unstage it, except probe-results files (TB-004c allowlist exception for committed probe data):
# Unstage artifacts except probe-results (probe-results excluded from unstaging per TB-004c)
git diff --cached --name-only | grep '^\.correctless/artifacts/' | grep -v 'probe-results' | xargs -r git reset HEAD --
Step 8.3: Commit. If there are uncommitted changes after steps 8.1–8.2, commit with message: "Add pipeline artifacts for {task-slug}". If there are no uncommitted changes after steps 8.1–8.2, skip steps 8.3–8.4 (no-op).
Step 8.3a: SFG lift-and-restore final-state backstop (CS-018b / AP-037). Before pushing, run the installed final-state backstop and abort on a non-zero exit:
bash .correctless/scripts/check-no-pending-sfg-lift.sh || { echo "ABORT: SFG lift sentinel still present — restore agents/fix-diff-reviewer.md to DEFAULTS and remove .correctless/.sfg-lift-active. See .claude/rules/sfg-deliverable.md"; exit 1; }
This blocks push when a lift commit is in the tree without its restore commit. The script NO-OPs when the deliverable is no longer SFG-protected (RS-028 self-deactivation).
Step 8.3b: Record full-suite-green sentinel (CS-019 / QA-002 / QA2-001). The
consolidation gate ran the FULL tests/test-*.sh suite (commands.test) before reaching
this point. Write the fixed-name test-success sentinel .correctless/artifacts/test-success.sha
whose CONTENT is the current HEAD SHA so the done-transition gate (_done_phase_gate)
has a live sentinel to content-match against (absence is silent; a recorded SHA that no
longer equals HEAD refuses). The filename is fixed — do NOT key it on the HEAD SHA, or the
mismatch branch becomes unreachable. .correctless/artifacts/ is gitignored, so this stays local:
printf '%s\n' "$(git rev-parse HEAD)" > ".correctless/artifacts/test-success.sha"
Step 8.4: Push. Derive remote name from git config --get branch.$(git branch --show-current).remote for tracked branches. If unset (fresh branch), use the first remote from git remote | head -1 with --set-upstream. If git remote returns nothing, abort with: "No git remote configured. Push manually or add a remote."
R-003 must not push to branches matching main, master, develop, or release/* — abort with an error if the current branch matches any of these.
If git push fails (auth failure, rejected push), /cauto aborts with a clear error message including the git error output. The local commit is preserved but the PR step is skipped. Re-running /cauto after fixing the push issue resumes at the PR step (the phase is documented, so the phase-to-step mapping routes to PR-only).
After /cdocs completes and before PR creation, read .correctless/artifacts/autonomous-decisions-{branch_slug}.jsonl and present a summary to the human.
Summary format:
Deferred Escalation Confirmation Gate (R-013): If any deferred escalations exist, present them as a confirmation prompt before PR creation. List each deferred escalation with its default and original escalation reason, then: "{N} deferred escalations were made autonomously. Review above and confirm to proceed with PR creation, or request re-run of specific skills interactively." The human must confirm before the PR is created. Normal autonomous decisions (non-deferred) do not gate PR creation.
Create a PR according to the pr_creation preference from preferences.md:
gh (default): Create a PR via gh pr create. The PR title is derived from the spec task name. The PR body must include:
/cverifyskip: Skip PR creation, just report pipeline completion.Log a preference_applied audit event with the selected PR creation mode (e.g., "pr_creation: gh", "pr_creation: skip", or "pr_creation: custom").
Log pipeline_completed in the audit trail.
On any terminal state (pipeline completed, escalation, or failure), preserve the override log for cross-run pattern detection. Run:
source scripts/override-scrutiny.sh && preserve_override_log "$(git rev-parse --show-toplevel)" "{task-slug}" "$(git branch --show-current)"
This copies override entries for the current branch from .correctless/artifacts/override-log.json to .correctless/meta/overrides/{task-slug}-{YYYYMMDD}.json with a metadata wrapper. Zero-override runs are preserved (they are data, not absence of data). The 50-file cap (R-006) is enforced automatically by the function.
After PR creation (or after the last pipeline step if pr_creation: skip), print a structured summary with three sections. Also include a Pipeline Completeness line showing {completed_count}/{expected_count} steps completed. If all expected steps completed AND status is "complete", show "(all steps completed)". If steps are missing, show "(incomplete — {missing_steps})".
Every QA finding, review decision, override, and architectural decision from the pipeline, each with its disposition (fixed, deferred, accepted). Includes findings from the verification report. Deferred items are always shown with their reason.
Items from sources without a severity field (verification findings, override activity) are always shown inline — they are not subject to severity-based truncation.
Data sources (per R-006): The Findings & Decisions section reads from these sources:
.correctless/artifacts/qa-findings-{task-slug}.json — QA findings and their dispositions.correctless/verification/{task-slug}-verification.md — verification findings (parse Rule Coverage and Smells sections).correctless/artifacts/review-decisions-{task-slug}.json — review triage decisions (if Phase 3 review ran).correctless/artifacts/override-log-{branch-slug}.json — override activity (if any overrides were issued).correctless/artifacts/audit-trail-{branch-slug}.jsonl — escalation events, simplify reverts, and architectural decision eventsIf a source file doesn't exist, that source is omitted from the summary (not an error).
Note: QA findings and the verification report use {task-slug} (the feature name from workflow init). Override log, audit trail, and token log use {branch-slug} (derived from the branch name via branch_slug() in scripts/lib.sh). These are different values — task-slug is e.g. scanner-expansion, branch-slug is e.g. feature-scanner-expansion-0c9277.
Truncation rule: If the Findings & Decisions section has more than 20 items from severity-bearing sources, truncation applies:
deferred are always shown inline (the user needs to see what got punted regardless of severity)Items not matching any of these four criteria go into a count-and-reference summary, e.g.: "QA Findings: 47 total — 3 HIGH + 2 deferred shown below, see qa-findings-{task-slug}.json for full list"
A table with one row per pipeline step. Use skill names (ctdd, simplify, cverify, cupdate-arch, cdocs) as row identifiers, not workflow phase names (tdd-tests, tdd-impl, etc.). No phase-to-skill name mapping is needed — the table shows what was invoked, which is what humans care about.
Each row shows: step name, duration, token count, and result (pass/fail/skipped/reverted/incomplete).
Duration: last skill_completed elapsed_ms minus first skill_started elapsed_ms for that skill name (clock-independent, uses audit trail's authoritative time representation). For skills with multiple attempts (retries, QA rounds), the span covers all attempts. The orchestrator logs skill_started/skill_completed for all pipeline steps including /simplify, which does not log its own entries. Phases that never completed (pipeline aborted mid-run, detected by skill_started without matching skill_completed) appear with duration up to the abort point and result (incomplete).
Token count: computed by summing total_tokens from .correctless/artifacts/token-log-{branch-slug}.jsonl entries where the skill field matches the row's skill name. If the token log doesn't exist or has no entries for a skill, the token column shows —.
File paths for: spec, verification report, QA findings file, audit trail, and PR URL. Documentation and architecture changes get a one-line summary each (e.g., "README, AGENT_CONTEXT updated; PAT-014, PAT-015 added").
When a failure persists after N attempts within a single skill, stop the pipeline and write a structured escalation summary to .correctless/artifacts/escalation-{branch_slug}.md.
The attempt threshold varies by effective intensity (matching /ctdd failure thresholds):
| Intensity | Threshold |
|---|---|
| standard | 3 |
| high | 2 |
| critical | 2 |
The escalation file uses YAML frontmatter for machine-parseable fields with human-readable prose below:
---
completed_skills:
- ctdd
- simplify
failed_skill: cverify
failed_at_phase: verified
failed_at_substep: null
attempts_before_escalation: 2
pipeline_config:
intensity: high
preferences_snapshot:
pr_creation: gh
escalation_sensitivity: default
---
## Escalation Summary
[Human-readable explanation of what failed and why]
## Context
[Relevant error output, test failures, or architectural conflicts]
Required frontmatter fields: completed_skills (list), failed_skill (string), failed_at_phase (string), failed_at_substep (string, nullable — for inter-skill operations like post-simplify test run), attempts_before_escalation (integer), pipeline_config (object with intensity and preferences snapshot).
Log escalation_triggered in the audit trail and then pipeline_failed.
When the orchestrator detects a potential architectural decision during any skill execution, it must escalate to the human rather than making the decision autonomously. Detection heuristics:
.correctless/ARCHITECTURE.md outside the cupdate-arch phase — treat any gate-blocked architecture doc change as an architectural escalation.Detection is best-effort for heuristics (a), (c), (d) — these are LLM judgment calls. The mechanical backstop is R-005: if an undetected architectural decision causes a skill to fail, the failure threshold catches it.
The shared constraint "Never auto-invoke the next skill" remains the default behavior for all skills. /cauto leaves constraints.md untouched and preserves the auto-invoke boundary as-is. Instead, /cauto is the orchestrator that invokes skills — each skill still tells its caller "what comes next" and stops. The orchestrator, not the skill, decides to proceed. Skills invoked outside of /cauto continue to respect the no-auto-invoke boundary.
Log orchestration decisions to the audit trail at .correctless/artifacts/audit-trail-{branch_slug}.jsonl. Each orchestration entry must have:
type: one of the 8 event types:
skill_started — before invoking a pipeline skillskill_completed — after a skill finishes successfullypreference_applied — when a preference from preferences.md influences a decisionescalation_triggered — when escalation to human is initiatedsimplify_reverted — when simplify changes are reverted (R-015)artifact_validation_failed — when a skipped phase's artifact validation fails (R-002). Includes additional fields: phase (which phase failed validation), expected_artifact (what was checked), and validation_error (why it failed)pipeline_completed — successful pipeline completionpipeline_failed — pipeline stopped due to escalation or unrecoverable errortimestamp: ISO 8601 formatskill: skill name (e.g., ctdd, cverify) or orchestrator for pipeline-level eventselapsed_ms: milliseconds since pipeline startEmit progress updates between each skill invocation. Progress is observable via the audit trail entries which include elapsed_ms and skill transition data. Conversational progress updates to the user (e.g., "Starting /cverify...") are best-effort and not mechanically enforced. The audit trail provides the reliable progress record.
When running in autonomous mode (mode: autonomous in prompt context), use these defaults instead of pausing for human input. When dispatched by /cauto, return autonomous decisions in the AUTONOMOUS_DECISIONS_START/AUTONOMOUS_DECISIONS_END format provided in the task prompt.
escalate: always. Default if deferred: halt pipeline. Rationale: human spec approval is non-negotiable (PRH-001).escalate: always. Default if deferred: halt pipeline. Rationale: CLAUDE.md changes alter system instructions.escalate: always. Default if deferred: halt pipeline. Rationale: deferred escalations may contain architectural decisions that need human review before PR creation.Phase 2 extends the pipeline with a policy-driven decision engine that resolves most runtime decisions without human intervention.
Decisions are routed through a tiered hierarchy — no tier may be skipped:
auto-policy.json. Same inputs always produce the same output. No LLM reasoning. Dual-pass: pre-routing and post-Tier-2 validation.Task(subagent_type="correctless:decision-agent") with minimal context per INV-006. Tools pinned to Read, Grep, Glob only.Task(subagent_type="correctless:supervisor"). Activates on escalation, phase transitions, and budget warnings.The supervisor returns structured JSON with decision, reasoning, and flags. Valid terminal decisions: approve, reject, hard_stop. If the supervisor returns an unexpected or unrecognized decision value, treat it as hard_stop (default to hard_stop on unrecognized responses). If the supervisor returns redirect, treat it as hard_stop — redirect is not a valid terminal decision.
Token and time budgets are checked before and after each skill invocation:
When Tier 4 fires, write structured escalation to .correctless/artifacts/escalation-{slug}.md with:
/cauto resume "decision"All pipeline progress is preserved — no work is lost on hard stop.
Priority ordering for multiple simultaneous hard-stop conditions (highest priority first):
When multiple hard-stop conditions exist simultaneously, log all active conditions as a DD-xxx entry with tier "system" and category "hard_stop_multiplex."
On /cauto resume "decision":
Stale escalation (phase mismatch) triggers a fresh start, not a crash.
Before each supervisor activation, verify the intent hash against the stored value in workflow state. Intent mismatch triggers immediate hard stop with reason "intent summary tampered."
Phase 3 extends /cauto to handle the full workflow from prompt to PR, including spec creation and review.
When /cauto is invoked and no active workflow exists on the current branch (no existing workflow state), /cauto accepts the invocation and enters the spec phase. It initializes the workflow via bash .correctless/hooks/workflow-advance.sh init and proceeds to spec creation.
When invoked with an active workflow in review or review-spec phase, existing Phase 2 behavior is preserved unchanged (INV-027 backward compatibility).
Branch guard (BND-005): Before initializing, check the current branch. If on main or master branch, refuse invocation with: "Error: /cauto cannot run on main/master. Create a feature branch first." The pipeline must not run on main or master.
When starting from no workflow, /cauto supports two entry modes:
/cspec to run the Socratic brainstorm with the human, producing a spec interactively./cauto validates the provided spec file exists and is non-empty (BND-003), then installs it as the workflow spec and skips /cspec.In both modes, the spec must exist and be non-empty before review begins. If a provided spec file does not exist or is empty, abort with an error message including the path (BND-003).
After the spec exists, invoke the review skill (/creview-spec at high+ intensity, /creview at standard). Review agents produce findings.
All review findings are passed to the supervisor agent for triage via Task(subagent_type="correctless:supervisor") with activation_type: review_triage. The supervisor evaluates each finding and returns accept, reject, or hard_stop per finding.
Review triage always goes through the supervisor agent — never inline triage logic (PRH-004). Supervisor responses must come from the supervisor agent's actual output — never from default values, pattern matching, or boilerplate auto-answers (PRH-005). If a supervisor response is malformed, treat all findings as hard-stopped (BND-004).
Supervisor unavailable fallback (BND-002): If the supervisor invocation fails (Task returns error), fall back to treating all findings as hard-stopped — present all findings to the human during the spec approval gate.
After autonomous review completes and findings are incorporated, /cauto pauses and presents the spec to the human for approval. The mandatory spec approval gate is non-negotiable — the human must always approve before implementation begins.
Present to the human:
The human's options: approve (proceed to implementation), reject (abort pipeline), or revise (human edits spec, then re-approve).
When the human approves, record spec_approved_by: "human" and spec_approved_at: <ISO timestamp> in workflow state (INV-025). Providing a spec does not imply approval — explicit human confirmation is always required.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pipeline-orchestration, workflow-automation, pr-creation, tdd
/correctless:cautofrom correctless
npx claudepluginhub joshft/correctless --plugin correctless33 skills in this plugin
/carchitectStructured architecture definition. Two modes — reverse-engineer from existing code or greenfield directed discovery. Produces .correctless/ARCHITECTURE.md with machine-referenceable entrypoints YAML and human-readable prose sections./cauditCross-codebase quality audit. Use after a major feature lands or periodically for systemic bug detection. Presets: QA, Hacker, Performance, UX./cchoresFully-autonomous issue-resolution pipeline. Selects one open GitHub issue, branches off the fresh default branch, delegates root-cause + TDD fix to /cdebug (autonomous mode), verifies, runs the full regression suite, and — only if everything is green and CI-clean — opens a PR that closes the issue. Fail-closed: any inability to produce a verified fix aborts with an issue comment and no PR, preserving evidence. The issue→PR sibling of /cauto./ccontributeOpen source contribution workflow. Learns the target project's conventions, patterns, and CI requirements before writing code. Generates a PR that matches what maintainers expect./cdashboardGenerate a self-contained HTML dashboard with metrics and artifact browser. Opens via file:// protocol./cdebugStructured bug investigation workflow. Root cause analysis, hypothesis testing, TDD fix with agent separation, escalation after 3 failed attempts. Use when stuck on a bug.Other plugins' skills for the same job