/ccxp-skills:drive [task-id]from ccxp-skills
Use when the user explicitly asks to work a single task end-to-end — implement, PR, merge, recursing into blockers; never switch laterally to unrelated work
Ships in ccxp-skills. 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.
Read when SKILL.md points to them; scripts run unread.
/ccxp's job.
<skills-root>= this skill's "Base directory" minus its last component; substitute the literal path (skill-conventions§9).
Invariant: one invocation of /drive owns one goal-task and follows its chain of blockers. It exits when the goal-task is merged (or permanently blocked by an external dependency with no actionable sub-task).
<arg> is optional:
/drive — auto-pick using /todo next scoring; gated tasks are skipped (see "Gated tasks" below)/drive T254701 — work on a specific task--dispatch-blockers (combinable with either form above) — at Phase 6 step 3, drive each
blocker via a fresh dispatched sub-agent instead of inline in this conversation. See Phase 6
step 3 for the mechanics. Opt-in only — omitting this flag keeps the default, fully-inline
behavior unchanged.--auto-selected — marks the run as started by an orchestrating skill (/autopilot), not a
human's deliberate single-task request. With an explicit id (what /autopilot dispatches each cycle,
the id its tier cursor and holds chose) the id was resolved by the orchestrator; bare
(/drive --auto-selected) it auto-picks exactly like bare /drive. Only effect: Phase 0's skip rule does not
apply (see Phase 0 below) — nothing else about Phase 1 onward changes.Gated tasks.
status: is gated: Blocked by (case-insensitive; the words SUPERVISED, BLOCKED, needs manual and sign-off are not gates, d174). One shared definition: todo-gated in todo/scripts/_lib.sh, applied by todo-next.sh --skip-gated./autopilot the dispatcher records a hold for a task that did not advance and passes over it until the release condition is met (autopilot/SKILL.md Phase 3 and 4).Before picking new work, make one forward move on the PR backlog by handing off to /address-pr:
Call /address-pr with no args once.
It auto-picks the first open PR authored by us that isn't deferred by ownership (§1's auto-pick.sh, oldest-first, walking past any owned:<other>/unknown candidate instead of stopping at the single oldest), reads that PR's ownership (§1.6 — derived from the implementing task's claimed_by on main), runs the hard merge gate, and then either merges, addresses-and-loops, or exits with a non-actionable status (nothing pickable at all).
After it returns, proceed to Phase 1.
0 open PRs → /address-pr reports "No open PRs to address" and exits; proceed to Phase 1 normally.
Multiple actionable PRs → only the oldest is driven this session; the rest wait for the next session's Phase 0. /drive Phase 0's job is to make ONE forward move on the PR backlog before picking new work, not to drain all of it — this matches the single-goal-task principle the rest of the skill follows.
PRs owned by another session, or blocked on CI / external review / approval / pipeline → /address-pr defers, fixes, or exits without an unsafe merge as appropriate. The §1.6 ownership guard (the anti-steal protection against a concurrent-session-drives-the-same-PR failure mode — a PR lives on GitHub, reachable from every clone, so nothing local stops two sessions from driving it at once without an explicit lock) and the hard merge gate live inside /address-pr, so no separate per-PR pre-classification is needed here.
PR's task is unclaimed (free) → /address-pr §1.6 now claims the task itself (same mechanism as this skill's Phase 1 Claim PR) before driving the PR further — don't just proceed against an unclaimed task (an unclaimed task's PR can sit open, unnoticed, for weeks before this gets caught).
Skip Phase 0 when: a human gave an explicit task ID (/drive T254701) without --auto-selected — they want that specific task worked on, not a PR sweep. Do NOT skip with --auto-selected (e.g. /autopilot's per-cycle dispatch) or bare /drive. preflight.sh <id|-> [--auto-selected] (verdict table under Phase 1) prints this as phase0=run|skip: run it before this phase and obey phase0=; a non-go verdict is acted on after Phase 0 (an --auto-selected run still drains first), except that closed/refused may stop at once.
Before picking new work, check if prior escalations have received replies:
/slack-check-reply allbash <skills-root>/_threads/threads.sh resolve <key> --resolution "<directive>" (exit 3 = absent or already resolved; never hand-edit .claude/state/drive-threads.json)If no task ID given (auto-pick):
/todo sweep first. Auto-pick reads queue.md's order via /todo next, and sweep is the only workflow that keeps queue.md in sync with dev/TODO/ (adds untracked files, strikes closed/parked entries, fixes stale blockers, re-orders on blocker violations). Skipping it risks picking a stale queue entry (a task already closed by another session) or missing blocker-ordering fixes that would have changed the #1 slot. Run it every auto-pick, not just periodically — it's idempotent and a no-op when nothing has drifted./todo next logic — read all dev/TODO/*.md, build dependency graph, score by readiness + priority + unblocks — through bash <skills-root>/todo/scripts/todo-next.sh --skip-gated so gated tasks (Blocked by) are never the #1 pickOpen → Design (in-place). Peer mode is on by default (disable with CCXP_PEER_MODE=0), so cross-session collisions ARE possible (ccxp + interactive sessions run as parallel peers) — see the peer-mode claim block in "Claim PR" below before picking. (With CCXP_PEER_MODE=0, the old one-session-per-clone assumption applies — no separate claim registry, no collisions to detect.)If task ID given:
Pre-claim gates (run right after the id is resolved, before any status/claim write):
A task's claim, journal, and file all live in ONE repo; working it from a different clone takes the claim against the wrong dev/ tree. Run the gate chain and act on its one-line verdict; do not re-derive it by hand:
bash <skills-root>/drive/scripts/preflight.sh <task-id|-> [--auto-selected]
# verdict=<v> phase0=<run|skip> detail=<text>
| Exit | verdict= | Meaning (gate order: clone-locality, claim, lint-frozen) | Do |
|---|---|---|---|
| 0 | go | here, free / mine / reclaimable | claim and continue |
| 10 | held | claimed_by another live session | do not pick; /todo next for another, or exit for an explicit id |
| 11 | frozen | the claim PR could not merge (whole-file frontmatter lint) | report the reason; re-pick or exit. Never open the un-mergeable claim PR |
| 12 | cross-repo | no task file here | below |
| 13 | closed | file only in dev/JOURNAL | do not re-work; file a new task for follow-up |
| 14 | refused | cross-repo while DRIVE_STRICT_CLONE=1 | abort with the reason |
| 2 | (usage) | bad arguments | fix the call |
go with CCXP_PEER_MODE=0 skips the claim gate (no registry). Bare /drive (-) is always go: /todo next only surfaces free, unfrozen tasks of this clone. Deciding what to do about a verdict stays with you.
cross-repo — the task's real hub is a different repo (its owner/repo slug is in detail). This is the same situation Phase 1.5 handles for a declared Target repo: — treat it identically: clone that repo fresh into an ephemeral path (/tmp/T<id>-<slug>-hub, same literal-path, explicit-rm -rf-at-close pattern as Phase 1.5's target clone) and do all remaining work — claim, design, implementation (when it lands in the same repo — the common case), journal-move — from that clone. Never cd into an existing local clone the guard's diagnostic line points at, yours or anyone else's. A clone already checked out locally may be another live session's (interactive or the /ccxp cron's) working tree, mid-operation — that's exactly the collision the maintainer's "we work on our own clones, and if we need to across repo, we create a new clone" decision rules out. If the task also declares a separate Target repo: different from its own hub, that repo gets its own further Phase 1.5 clone as usual — the guard's ephemeral clone only replaces where the hub work happens, not Phase 1.5's target-repo logic.DRIVE_STRICT_CLONE=1 — cross-repo becomes refused (14): abort (for unattended ccxp loops that must never pick a task they can't fully own from their own clone).Status mirror (best-effort, never blocks):
After picking the task and updating its frontmatter status:, mirror that stage to the Project board so the team can see what stage the task is in:
# Frontmatter status → Project Status single-select (e.g. Open → Design)
bash <skills-root>/_session/status.sh <task-id> <Design|In Progress>
_session/README.md for the design.status: field in the task file remains the source of truth; the Project Status field just mirrors it for the board view.Claim PR — land the status change on main before working (maintainer ask 2026-06-10):
main.main still shows the task Open / unclaimed to every other session and peer claim check.status.sh call right above is a best-effort Project-board mirror; most repos in this suite run no such board at all — so treat it as optional visualization only, never as the durability fix this section is actually about.)Close that gap by landing a tiny claim PR as the very first thing, before any design or implementation work:
t<id>-claim off main.status: frontmatter line: Open → In Progress (or Open → Design when a design PR will follow in Phase 2). A short prose note is fine (claimed YYYY-MM-DD). Change nothing else — keep it a pure status-change so it auto-merges under the carve-out in dev/branch-merge-policy.md.gh pr create (its stdout is the new PR's URL — <claim-pr-number> is the trailing path segment, e.g. ${PR_URL##*/}), then run /address-pr <claim-pr-number> — never a bare /address-pr call: bare re-triggers Phase 0's oldest-first backlog auto-pick, not this PR. It auto-merges on the pure-status-change tier once CI is green (no manual approval needed). (No doc-lint guard here — the claim PR is a pure frontmatter status:/claimed_by: change and cannot trip MD032, a body-list rule; the guard runs on the body-doc paths — Phase 4 via /gcpr Step 1.5 and the Phase 7 journal-move.)git checkout main && git pull && git remote prune origin (see Important Notes → Post-merge branch hygiene), then continue to Phase 2/3 on a fresh implementation branch.This makes "somebody is working on T" true on main at claim time — durable, and visible to every other session and the Project board — instead of only after the implementation PR lands, for the price of one fast docs-only PR.
Same-repo / hub-side only: the claim PR touches the hub task file; in cross-repo mode it still lands in the hub repo and is independent of the Phase 1.5 target clone.
Peer mode — cross-session claim lock (default; CCXP_PEER_MODE=0 to disable): Peer mode is on by default — ccxp and interactive sessions run as parallel peers (even sharing GitHub state), so the one-session-per-clone assumption no longer holds and the claim PR becomes the cross-machine lock, not just a status flip.
(Default-on means every session claims — no env-var-symmetry gap.) The lock lives in a single frontmatter field the merge-to-main arbitrates atomically: claimed_by: cc1-<machine-id>:<path-hash> (the canonical single-line conflict point — a clone-stable identity that already carries the working-dir, so a new invocation in the same clone is the same claimant).
Use _session/task_claim.sh instead of a bare status: flip:
preflight.sh above already ran task_claim.sh read/claimant-id/reclaimable and lint_frozen.sh is-frozen for an explicit id (held = another live session, frozen = the claim PR cannot merge). /todo next excludes both kinds of candidate itself, so auto-pick needs no extra check. An unclassifiable freeze probe counts as claimable (never hide pickable work).acquire (release-on-pickup — keeps ≤1 active claim per clone): on the t<id>-claim branch, first run bash <skills-root>/_session/task_claim.sh release-others <id> to free any task this clone still holds from an earlier pickup (it keeps <id>, the one you're about to claim). This is what stops a live session's claims from accumulating on main until /todo next finds nothing pickable. Then bash <skills-root>/_session/task_claim.sh acquire <id> — it sets claimed_by and status: In Progress. Commit the result: the claim on <id> plus any release-others edits to other task files all land in this same claim PR (still docs-only, auto-merge-eligible). The released tasks return to the pickable pool (In Progress → Open; Design, Blocked by, Review and terminal statuses are preserved).claimed_by: line, another session acquired the same task in the same window. Do not force it — git checkout main && git pull && git remote prune origin, then re-pick via /todo next. The merge conflict IS the lock rejecting your acquire.
3a. Verify the claim landed before any other work.
acquire is local-only: it edits the working tree and warns on stderr; the lock exists once the claim PR is on main.bash <skills-root>/_session/task_claim.sh verify-landed <id> (cross-repo: add --repo <hub-owner/repo>) and branch on its stdout token.landed: continue. not-landed: the claim never reached main, stop and land it. claimed:<by>: lost the race, re-pick. unknown: retry once, then stop (fail closed).bash <skills-root>/_session/task_claim.sh release <id> <final-status> clears claimed_by as part of the journal-move/close PR.With CCXP_PEER_MODE=0 (the opt-out), the claim PR flips only status: exactly as described above — no lock, no task_claim.sh — for repos/sessions that don't want cross-session claiming.
main): a repo whose own dev/guidelines.md/CLAUDE.md Branch and Merge Policy declares itself solo/no-CI (direct-to-main, no feature-branch PRs) has no CI to gate the claim PR and no peer session to race — but still wants the two signals a branch + durable claim give: the statusline (statusline-setup/scripts/statusline-command.sh) shows the live branch: (so staying on main the whole task shows nothing useful) and TASK: (from whichever dev/TODO/*.md has claimed_by: set to this clone, which requires the claim to actually land as its own commit rather than being collapsed straight into a later close).t<id>-<slug>, release-others + acquire, commit, git checkout main && git merge --ff-only t<id>-<slug> && bash <skills-root>/_gh/git.sh push to land the claim immediately, then git checkout t<id>-<slug> back and stay there for all of Phase 2/3's work (never commit to main directly mid-task).task_claim.sh release, commit, merge --ff-only back to main, push, delete the branch. Full recipe: /claim skill's own "Solo-repo mode" section (kept in sync with this one).Interaction with the Phase 2 design PR:
Open → Design first (design-writing can take a while; don't leave the board Open meanwhile), then Phase 2 carries the design content.Open → In Progress.If the task file frontmatter has Target repo set, the implementation lives in a DIFFERENT repo from the task file. The hub repo is where the task file lives (dev/TODO/ / dev/JOURNAL/); the target repo is where the code change lands. Typical shape:
- **Target repo**: your-org/example-website.com
If Target repo is unset and the change genuinely lands in this hub repo: same-repo mode — everything happens in the hub repo, skip the rest of this phase.
Undeclared cross-repo. A task can be cross-repo in practice without a
Target repo:line: that key is not on thelint_tasks.pyallowlist, so stamping it would trip the changed-mode frontmatter lint (it re-checks the whole file, failing on the pre-existing non-allowlisted key). A skill/spec change whose code lands inyour-org/ccxp-skills(it edits a*/SKILL.md), a website change inexample-website.com, etc., is cross-repo even with no marker. Treat a task as cross-repo when eitherTarget repo:is set or you can see the implementation lands in another repo. SetTARGET_REPOto the declared value or the one you recognize; the resume guard and pointer-recording below apply in both cases.
/drive's hub-side resume check (git branch -r | grep <id>, Phase 6) is blind to a cross-repo task's work: the work branches + PRs live in the target repo, and the hub task file's status: stays at its pre-implementation value (the cross-repo impl PR never flips the hub status to Review).bash <skills-root>/drive/scripts/cross-repo-guard.sh <task-id> "$TARGET_REPO"
# open <pr> <headRefName> | merged <pr> | none (exit 3 = gh failed: retry or escalate, never treat as none)
open <pr> <branch> (an OPEN PR matches; with several, the lowest number is printed) → do not re-implement. Check out its headRefName (clone the target repo at that branch), verify it against the design + test plan, and drive it through Phase 5 (/address-pr) instead. This is exactly the move that dodged a 4th duplicate.merged <pr> (a MERGED PR matches) and the hub task is still in dev/TODO/ → the implementation already shipped; the task just never got closed in the hub. Skip Phase 3/4 and go straight to Phase 7 (the hub journal-move / close PR).none → proceed to clone + implement below, and record the pointer (Phase 4 cross-repo step 5) so the next tick takes the cheap path instead of re-searching.If set (declared) or recognized (undeclared), enable cross-repo mode by cloning the target repo into a fresh ephemeral path:
TARGET="/tmp/T<task-id>-<slug>-target"
rm -rf "$TARGET" # idempotent: kill any leftover from a prior crashed run
git clone --depth=20 --recurse-submodules \
"[email protected]:${TARGET_REPO}.git" "$TARGET"
trap and no shell variables across calls. Each Bash tool call is its own shell: an EXIT trap would fire (deleting the clone) when that call returns, and $TARGET/$HUB do not survive into the next call.cd /tmp/T<id>-<slug>-target && …), and clean up explicitly in Phase 7 (rm -rf that literal path; the rm-guard hook allows it because it is under /tmp, but not a $VAR it cannot resolve) — plus the orphan sweep below as the backstop for aborted runs.That's it. No safety guards, no JIT-refresh logic. A fresh clone is clean, on main, with no concurrent ops by construction — the entire class of "respect another process's state" coordination disappears because there is no other process in our clone.
Track both paths for the remaining phases:
$HUB) — durable session cwd, where the task file lives.$TARGET) — ephemeral clone, lifetime = this task, deleted in Phase 7 close-up.Phase split:
$HUB./address-pr) run in $TARGET — cd $TARGET before any git or gh operation.Branch naming in the target repo uses the same t<task-id>-<slug> pattern as single-repo mode — the hub task ID is the canonical reference.
Target path: <path>, reuse that path instead of creating an ephemeral clone.Why ephemeral: parallel /drive sessions on the same target repo each get their own ephemeral clone, so the design has zero collision surface. Hub-side has no coordination either — the convention is one session per clone. If you need parallel hub-side work, open a new hub clone. No cross-session state to maintain.
Clone-cost mitigations (defaults baked in above):
--depth=20: enough history for any feature-branch work. fetch --unshallow if Phase 3 reveals a need for deeper history.
--recurse-submodules: correct for repos with submodules. Skip with SUBMODULES=0 env var if the user wants faster clones for repos without them.
For very large repos (e.g. a large monorepo), the user can additionally pass --filter=blob:none via a CLONE_EXTRA_FLAGS env var; defaults stay simple.
Orphan cleanup: explicit rm -rf at Phase 7 covers normal completion; an aborted run leaves its clone behind, so a weekly sweep (ccxp Phase 0 addition, optional) prunes /tmp/T*-target/ older than 7 days as a backstop — the same sweep should also glob /tmp/autopilot-clone-*/ (autopilot/SKILL.md Phase 3's dispatch clone, normally removed by /autopilot off, but orphaned the same way on a crash).
The design lives in the task file (dev/TODO/T<id>-<slug>.md). The first thing that lands is a design PR containing only the task-file changes — no implementation yet. This gives Copilot a chance to review the design and the maintainer a chance to revise it before any code is written.
Read the task file fully — understand problem, existing design, test plan.
If the task has no design section (or only a stub): research the codebase and write the design by filling out repo-conventions/templates/design-doc.md. It is kind-scaled (reuse the Phase 3.0 docs/code classifier): every task gets the §Common sections — TLDR (mandatory, scored — 3-5 skimmable bullets), Problem with reproduction evidence, Context, Solution (or Plan/Scope — same section) with alternatives-rejected, Test plan, Done criteria each mapped to a test or file:line, Closed, Skills invoked; code/bug tasks additionally get §Code-only — Root cause with git archaeology (introduced-in <SHA>, deliberate-vs-oversight) and a Repo file references table. Anchor every claim to a file:line / SHA / command output and label verified vs assumed. Scale to the task — a docs chore omits the code-only sections; the target is the right sections completed, not a line count. One-pager discipline: most tasks read top-to-bottom on one scrolled screen — a 1/2/3-point task earns a few bullets per section, only a 5/8-point or Critical/RCA task earns real length.
Update task status: Open → Design.
Create the design PR — branch t<id>-design, commit ONLY the task-file changes, push, gh pr create (its stdout is the new PR's URL — <design-pr-number> is the trailing path segment, e.g. ${PR_URL##*/}). PR body: 1-paragraph summary of the design + "Design-only PR — implementation lands in a follow-up after this merges." Run /address-pr <design-pr-number> — never a bare /address-pr call: bare re-triggers Phase 0's oldest-first backlog auto-pick, not this PR (CI will be green for docs-only; the independent review covers the design itself; the maintainer reviews and approves).
Wait for the design PR to merge. This is a checkpoint — do NOT proceed to Phase 3 until the design PR is on main.
After merge: git checkout main && git pull && git remote prune origin (see Important Notes → Post-merge branch hygiene), flip the task file's status Design → In Progress (in a follow-up commit on the implementation branch — see Phase 3).
6a. Support tasks (bash <skills-root>/_support/is-support-task.sh <id>): the design needs non-empty ## Repro and ## Regression test; the gate below enforces it. Details: _support/README.md.
Design-score gate (hard gate, Phase 2 → Phase 3). Before any code, score the merged design deterministically:
bash <skills-root>/design-score/scripts/score.sh <task-file>
score >= threshold, default 70) ⇒ proceed to Phase 3.0.score.sh auto-detects code-vs-docs (same classifier as Phase 3.0); pass --kind code|docs to override. This is a cheap deterministic counterpart to the Phase 3.6 completeness gate, run up front so design decay is caught before any code exists.main task file before coding all the same.)When to skip the design PR (rare):
main already, so the design is reviewable in-place.If you skip, note Design approved in-conversation YYYY-MM-DD in the task file's status line so the audit trail is clear. The Phase 1 claim PR is still required when the design PR is skipped — it is the only thing that lands a non-Open status on main before the implementation PR, so the board doesn't read "unclaimed" while you code.
Run bash <skills-root>/drive/scripts/classify-change.sh [base] (default base main); it prints one word and exits 0 (2 usage, 3 not a git repo, 4 base ref does not resolve or the diff cannot run: fetch it or pass origin/main; never treat 4 as empty). Do not re-derive the rule in prose.
Docs: all of dev/**, docs/**, any *.md (incl. README.md, CLAUDE.md, SKILL.md), .github/ISSUE_TEMPLATE/**, .github/pull_request_template.md. Everything else (workflows, scripts/**/*.sh, **/*.bats, Makefile, build configs) is code. Any code → code (mixed: stricter wins); all docs → docs; nothing changed → empty.
code-class: invoke superpowers:test-driven-development BEFORE step 1 below. The TDD skill owns red → green → refactor.
docs-class: skip TDD; continue to step 1.
empty diff: defer classification; re-run after the first commit.
For code-class, non-trivial tasks (per the Phase 3.0 classifier), execute the core work — design → implement → test → verify — as a single sequential Workflow (the Workflow tool): one agent per stage, awaited in order, NO parallel() / no fan-out (maintainer decision 2026-06-13).
Each stage hands its structured result to the next; the final stage adversarially verifies the change before you open the PR.
This is what gives the headless -p /ccxp cron ultracode-style orchestration without ultracode session-mode (which is unreachable for a slash-command -p prompt — verified 2026-06-13).
The Workflow tool is available in headless sessions, and authoring a Workflow from a skill is the sanctioned mechanism for invoking it (the platform permits the Workflow tool when a skill's instructions call for it).
The surrounding lifecycle is unchanged — the Phase 2 design checkpoint, Phase 3.5–3.7 gates, Phase 4 PR, and Phase 7 close-out still apply; the Workflow is just how you execute the design+implement+test work for a substantive task.
Cross-repo: before authoring/running the Workflow, cd $TARGET and confirm pwd matches
$TARGET — the Workflow's agents inherit this cwd, so a wrong cwd makes them edit the wrong
clone (the failure that step 2 below warns about).
Trivial-task guard — stay LINEAR (no Workflow), do the steps below directly, when ANY of:
When a task is borderline, stay linear — the guard is deliberately conservative (a spurious Workflow wastes tokens; a missed one just means a linear task ran linearly).
Sequential template (adapt the prompts to the task; keep it strictly sequential — never add
parallel()):
export const meta = {
name: 'drive-impl',
description: 'Sequential design→implement→test→verify for one code-class task',
phases: [{ title: 'Design' }, { title: 'Implement' }, { title: 'Test' }, { title: 'Verify' }],
}
// One agent per stage, awaited in order — sequential by construction. No parallel(), no fan-out.
phase('Design')
const design = await agent(
`Task T<id>: <one-line goal>. Produce a concrete implementation design — files to change, the
approach, and a test plan — anchored to file:line in the repo at the current working dir.`,
{ label: 'design', schema: { type: 'object', additionalProperties: false,
properties: { files: { type: 'array', items: { type: 'string' } },
approach: { type: 'string' }, testPlan: { type: 'array', items: { type: 'string' } } },
required: ['files', 'approach', 'testPlan'] } })
phase('Implement')
const impl = await agent(
`Implement this design by editing files in the current repo, following its guidelines.
Design: ${JSON.stringify(design)}. Return the files changed and a short summary.`,
{ label: 'implement', schema: { type: 'object', additionalProperties: false,
properties: { filesChanged: { type: 'array', items: { type: 'string' } },
summary: { type: 'string' } }, required: ['filesChanged', 'summary'] } })
phase('Test')
const test = await agent(
`Run the test plan for the change just made (${JSON.stringify(impl.filesChanged)}):
${JSON.stringify(design.testPlan)}. Run the repo's tests; report pass/fail with output.`,
{ label: 'test', schema: { type: 'object', additionalProperties: false,
properties: { passed: { type: 'boolean' }, details: { type: 'string' } },
required: ['passed', 'details'] } })
phase('Verify')
const verdict = await agent(
`Adversarially verify the change is correct AND complete vs the task's done-criteria — try to
find what's wrong or missing. Design: ${JSON.stringify(design)}; tests: ${JSON.stringify(test)}.
Return real issues only (empty array if none).`,
{ label: 'verify', schema: { type: 'object', additionalProperties: false,
properties: { ok: { type: 'boolean' }, issues: { type: 'array', items: { type: 'string' } } },
required: ['ok', 'issues'] } })
return { design, impl, test, verdict }
After the Workflow returns: if Test failed or Verify returned issues, fix them (a direct edit, or another sequential pass) before Phase 4. Review the actual diff yourself — the implement stage ran as a subagent, so confirm the working-tree changes match the design.
cd/cwd) before the Workflow; the Implement/Test stages perform steps 3–5 (write code, write/run tests); then you do step 6 onward after the Workflow returns (commit the agent-produced working tree, then the Phase 3.5–3.7 gates and the Phase 4 PR).Read the design and test plan
Cross-repo mode: cd $TARGET before touching any code. All subsequent git operations run in the target repo. Never edit target-repo files while cwd is still $HUB — that silently creates untracked files in the wrong place.
git or gh pr invocation in cross-repo mode, verify pwd literally matches the expected absolute path — $TARGET for implementation steps (Phase 3 + Phase 4), $HUB for the journal-move PR (Phase 7).pwd check is trivial; the cost of committing to the wrong repo and force-pushing the "fix" is hours./tmp/cc-... clone, and the hub-repo hub, expect to lose cwd at least once and assert defensively.For cross-repo target clones, always clone fresh under /tmp/cc-<repo>-<purpose>-$(date +%s) — never reuse another session's clone or the maintainer's working clone. The Tasks-as-Issues mirror workflow runs on every push, so a stray commit in someone else's clone has visible consequences. The ephemeral clone pattern is what /drive Phase 1.5 codifies; this is the operational reinforcement.
Write the code — follow dev/guidelines.md conventions (the target repo's guidelines take precedence when they differ)
Write tests if the test plan calls for them (scripts in scripts/ must have BATS tests)
Run tests locally: bats tests/ — fix any failures before proceeding
Commit on the feature branch. Fresh base (d129): before every push run bash <skills-root>/_gh/fresh-base.sh check --rebase (exit 0 fresh/rebased; any other exit = stop and fix, never push stale; re-run tests after a rebase, and push a rebased branch that was already pushed with --force-with-lease).
Workflow verification — before any gh workflow run --ref <branch> run bash <skills-root>/_gh/fresh-base.sh remote <branch> (exit 0 required: the pushed branch must contain the latest origin/main). If the change touches workflow files (.github/workflows/*.yml), build scripts, or manifests: trigger the affected workflow on the feature branch and verify it passes before creating the PR. Use --ref <branch> and dry_run=true / skip_upload=true. Wait for completion and confirm success.
Exception 1: brand-new workflows that don't exist on main yet can't be triggered from a branch — note this in the PR and test immediately after merge.
Exception 2 (channel-noise carve-out): if the brand-new workflow's failure path notifies a public/team Slack channel AND the post-merge dispatch would predictably fail (missing source artifacts, unset prerequisites), do NOT do the post-merge dispatch — the failure alert is indistinguishable from a real incident. Trust BATS + actionlint + the first real invocation. See dev/branch-merge-policy.md for the full rule.
Scope guard: Track files changed. If implementation touches more than 8 files not mentioned in the design's "Files changed" table, stop and escalate (see Slack Escalation Protocol):
*T{id}*: Scope check — implementation touching {N} files beyond design scope. Review before continuing.scope-checkMirror-repo guard (before opening ANY GitHub issue, whenever this flow files one): never open an issue on a hashdata-* mirror repo (e.g. Synx-Data-Labs/hashdata-enterprise-dbaas). Mirrors only receive HashData's upstream by sync, nobody triages issues there, and tracking is lost (observed 2026-10-16: a mirror issue stranded a support ticket). Check the target repo name first: the hashdata- prefix, or any github_repo: listed in the hub's upstream/repos.yml, means mirror. If it is one, file the issue upstream on HashData's GitLab via synx-skills:upstream-issue instead, and have the tracking task link that GitLab URL and say "waiting on upstream; fixes arrive via sync". Never open the mirror issue "for now".
New dependency discovered: If implementation reveals a blocker not in the task file — or ANY new issue worth tracking on its own (a regression your own fix caused, a latent bug you tripped over, anything with a "why does this exist" a future reader would ask) — file it before touching any code for it:
bash <skills-root>/_taskid/new.sh --check ./dev then write dev/TODO/<id>-<slug>.md from repo-conventions/templates/task.md in the same breath. Do not reference the ID anywhere else — code comments, test names, commit messages — until the task file exists on disk. An ID minted and used but never filed is an orphaned reference (_taskid/check-orphaned-refs.sh catches this in CI, but don't rely on the backstop over doing it in order — this rule exists because of a real observed incident, not a hypothetical one).scheduled: after the file is written: bash <skills-root>/_ipm/stamp-scheduled.sh dev/TODO/<id>-<slug>.md current (token-free: committed IPM → Project API → next-Monday fallback; update-forward-only) — then promote it to the very front of the queue: /top <id> (see Important Notes).bash <skills-root>/_session/task_claim.sh acquire <id> on a claim-PR branch, same as any other task pickup (Phase 1) — then write the fix. Filed-but-unclaimed is fine when you're just noting it and moving on; claimed-and-being-worked-right-now without a claim on record is the gap this rule closes.*T{id}*: New blocker discovered — created T{new_id} ({title}). Continuing on T{id} if possible, otherwise stopping.blockerTriggers (any of): a test won't go green after 2 fix attempts; a behavior contradicts the design's stated invariant; a pipeline fails in a way the pre-merge check can't explain; you catch yourself "trying things" rather than forming hypotheses.
When triggered, invoke superpowers:systematic-debugging before continuing — it enforces hypothesis-driven debugging over trial-and-error. Soft trigger: invoke when the smell appears, not on every test failure.
Before opening the PR (Phase 4), invoke superpowers:verification-before-completion. It challenges "I'm done" by surfacing un-tested assumptions, missed edge cases, and "it compiles, ships" thinking. Exit only when the skill says ready. For docs-class changes, verification is lighter (markdown parse + link check + frontmatter validity) but still gated — invoke the skill and let it scope to the change kind.
Design-doc completeness gate (cheap structural counterpart to the above): confirm the task file carries the repo-conventions/templates/design-doc.md §Common sections (plus §Code-only for code/bug tasks), and that every ## Done criteria item names the test or file:line that satisfies it. A criterion you can't map to a verification is untested or vague — fix it before the PR, not at close.
Before opening the PR, run the doc-freshness check so a behaviour / structure / setup change ships with the docs that describe it (the gate that would have caught a stale README):
bash <skills-root>/_docs/doc-impact.sh "${BASE_REF:-origin/main}"
It flags repo docs (README*, CLAUDE.md, dev/guidelines.md, */SKILL.md, docs/**) that reference what you changed, or that a newly-added workflow / action / script implies.
For each flag: update the doc on this branch so it lands in the same PR, or — if it's genuinely unaffected — note "reviewed, no change needed".
Kind-scaled via the Phase 3.0 classifier; for a large doc surface, escalate to /proof-read on the touched docs.
Interactive (a human is driving): soft gate — resolve every flag (update or acknowledge) before Phase 4.
Unattended (ccxp loop): never block the loop — update what's clearly in scope, then for any remaining flags file a follow-up doc-conformance task (bash <skills-root>/_taskid/new.sh --check ./dev) — a follow-up, so stage it into the next iteration by stamping scheduled: after the file is written: bash <skills-root>/_ipm/stamp-scheduled.sh dev/TODO/<id>-<slug>.md next, then promote it to the front of the queue (/top <id>; see Important Notes) — and proceed. Drift becomes tracked backlog, not a silent miss.
Cross-repo: run this in $TARGET (the repo whose code changed); doc updates land in the target PR.
Code-class tasks only (per the Phase 3.0 classifier — docs-class changes touch no measurable code; skip with a one-line note). Before opening the PR, measure quality on the task's touched files and append one record to the target repo's append-only scoreboard:
bash <skills-root>/quality-probe/scripts/probe.sh \
--task "T<id>" --range "${BASE_REF:-origin/main}...HEAD" \
--repo-root "${TARGET:-.}" --design-score "<Phase 2 gate score, if known>"
WARNING: <metric> regressed line is the signal, not a gate. This is the deliberate asymmetry with the Phase 2 design-score hard gate — the cheap deterministic check gates; the noisier trailing metrics observe-first until trusted (see quality-probe/SKILL.md).dev/quality/metrics.jsonl line is staged in Phase 4 so the scoreboard is durable on main and /retro Phase 4d can read the trend. (First run in a repo creates the dir/file idempotently.)--design-score N — pass the Phase 2 design-score so the leading + trailing indicators share one record; omit when unknown (recorded null). A missing scanner records that field null + logs a skip — never an error.EXPLAIN-AT-CLOSE, add a line - Quality regression (<metrics>): <one-line explanation> to the task's ## Closed section (Phase 7.0). verify-close.sh fails the close (FAIL quality) when the committed scoreboard has a regressed record for the task and that line is missing, empty or still the placeholder. Cross-repo: the check cannot see the target repo's scoreboard from the hub close, so copy the probe's warning and your explanation into the hub ## Closed by hand.$TARGET; the scoreboard lives in the target repo and lands in the target PR (not the hub).Support tasks: write the e2e test first and record its red output in the PR body; fix and test land in one commit. Before opening the PR run bash <skills-root>/_support/check-regression-commit.sh origin/main..HEAD (_support/README.md).
Use the /gcpr skill workflow:
Same-repo mode:
status: to Done via bash <skills-root>/_session/task_claim.sh release <id> Done (clears claimed_by in the same step — do not hand-edit the status: line directly, or the claim silently survives the close; observed once, where a hand-edit close needed a follow-up release PR), then do the journal move (git mv dev/TODO/{id}.md dev/JOURNAL/{date}-{id}.md, before writing the ## Closed (YYYY-MM-DD) and "Skills invoked" blocks — see the order-of-operations guard in Phase 7.0) as part of the commits. Always immediate, every close — retired the old in-place-only default that deferred the move to the Friday retro's batch journal-sweep (/retro Phase 2b), because that default made most of the week's just-closed tasks invisible to /retro's own Phase 2 classification, which runs before Phase 2b's sweep in the same invocation. After the move, run bash <skills-root>/_taskid/epic-links.sh sync and git add dev/EPICS so the task's link in any dev/EPICS/E*.md follows it to JOURNAL/ (no-op when the repo has no epics or the task is in none).Cross-repo mode:
cd $TARGET (should already be there from Phase 3) — commits, push, and PR all land in the target repo
Do NOT move the task file to JOURNAL in this PR — the task file lives in $HUB and this PR only touches $TARGET. The journal move happens in Phase 7 via a separate hub-repo PR
The PR body must include a link back to the task so reviewers can trace scope:
Task: https://github.com/<hub-owner>/<hub-repo>/blob/main/dev/TODO/T<id>-<slug>.md
Put this as the first line of the Summary section, before the bullets.
Push and create PR in the target repo
Record the cross-repo pointer + flip the hub status — so the next tick's Phase-1.5.0 guard finds this PR by pointer instead of re-searching, and the board reads past-Design. The pointer recording closes the duplication window the moment the PR exists (don't defer it to Phase 7). On a short t<id>-xrepo-pointer branch in $HUB (a tiny docs PR — auto-merges as status-change tier):
## Cross-repo work line to the hub task body (not frontmatter — a target_pr: frontmatter key would need a lint_tasks.py allowlist entry, coupling to the schema fork): - Implementation: <target-repo>#<pr-number> (`<headRefName>`) — opened <YYYY-MM-DD>.status: → Review (it was In Progress from the claim PR), and mirror it: bash <skills-root>/_session/status.sh <id> Review.Lint task frontmatter check (so even a body edit's whole-file lint fails), skip the pointer edit — the Phase-1.5.0 gh pr list --search guard already finds the PR with zero recorded state, so the safety net holds without an unmergeable edit.Use /address-pr <PR number> — it handles CI, Copilot review, comment resolution, test plan verification, pipeline verification, and merge/notify per the tiered merge policy. Do not duplicate its logic here.
If a pipeline or build is triggered for verification (5+ min wait), wait in the background (Bash with run_in_background or Monitor). Do NOT pick up an unrelated task — /drive drives one goal. If there's nothing actionable on the current chain, idle until the background signal arrives.
When the current task (G, the goal) can't progress because it depends on another task (B, the blocker), do NOT switch laterally to an unrelated task. Chase B:
Identify the blocker. A blocker is another T{id} task referenced from G's file as a Blocked by / Depends on entry, or discovered mid-work (e.g., a failing CI is the symptom of an undiagnosed bug — file it as a new task, that's B). A newly-filed blocker is a dependency → auto-stage it into the current iteration (bash <skills-root>/_ipm/stamp-scheduled.sh dev/TODO/<id>-<slug>.md current) and promote it to the front of the queue (/top <id>; see Important Notes).
Park G minimally. Commit and push any clean-state progress on G's branch. Leave G's branch in a pushable state. Record in G's task file: Blocked by T{B} — resumed after B closes. Do NOT mark G done. Mirror the block to the Project view:
bash <skills-root>/_session/status.sh <G-task-id> Blocked
Best-effort; the local Blocked by line in the task file is the source of truth.
Checkpoint discipline (applies to ANY mid-task park, blocker or session-budget checkpoint):
In Progress task, FIRST look for existing work: git fetch -q && git branch -r | grep -i "t{id-digits}" and read the task file's recorded branch pointer. Continue the newest matching branch — do not create a fresh one unless none exists or the existing one is explicitly recorded as abandoned. If the task is cross-repo (Target repo set, a ## Cross-repo work pointer recorded, or the implementation lands in another repo — see Phase 1.5.0), this hub git branch grep is blind to the target-repo work: also run the Phase-1.5.0 guard (bash <skills-root>/_gh/gh.sh pr list --repo "$TARGET_REPO" --search "t{id-digits}" --state all) and drive/verify any existing target PR instead of re-implementing.main.Recurse into B. Default (no flag) — invoke the /drive workflow on B inline, in this
same conversation:
Flip B's Status to the appropriate next state.
Run Phase 2 → Phase 5 on B end-to-end.
If B itself is blocked by another task C, recurse again (same rules). Typical chain depth is 1-2; deeper is a smell — stop and slack.
--dispatch-blockers mode (opt-in, Factor 10 "small, focused agents"). Instead of recursing inline, dispatch B to a fresh sub-agent and only read back its compact result.
Rationale: a fully-inline blocker chain (each blocker's own investigation, fixes, and PR loop) keeps growing the SAME conversation's context for work that is logically independent of the goal-task G — the exact pattern that ballooned this session's context driving a blocker chain whose blockers were each a substantial, self-contained investigation.
Dispatch via the Agent tool, isolation: "worktree" (B's /drive run will checkout
branches and edit files — same reasoning as the cross-repo ephemeral-clone isolation in
Phase 1.5, applied here to a same-repo worktree instead of a clone).
The prompt must be self-contained (the sub-agent has no memory of G or this conversation):
state B's task ID, that the caller is /drive recursing from goal-task G (name G), and the
ask — "drive B to merged (or to a permanently-blocked, escalation-worthy state) via /drive T{B-id}; report back: final status (merged / still blocked, and by what / escalated), the
PR number(s) if any, and one paragraph of what changed."
Read back ONLY that compact report — do not pull the sub-agent's full transcript into this
conversation. Record it in G's task file the same way an inline recursion would (Blocked by T{B} — resumed after B closes, updated once B's report lands).
If the sub-agent reports B is itself blocked by C: do not chase C from here. Either dispatch C the same way (a fresh, independent decision — this is not automatic multi-level fan-out) or fall back to the default inline path — same depth/escalation rules as the inline mode apply (chain depth ≥ 3 is still a smell; still escalate on circular blockers, missing secrets/permissions, or explicit urgency).
This mode is additive: it changes nothing about Phase 2-5 gates, merge policy, or claim mechanics — B is still claimed, designed, implemented, and merged under all the same rules, just by a different agent instance. Default (no flag) behavior is unchanged.
Pop back up. When B merges, git checkout main && git pull && git remote prune origin (see Important Notes → Post-merge branch hygiene), and resume G. Re-evaluate G's blocker list — maybe unblocking B cleared a cascade.
Exit G when it merges (same rules as a top-level task).
Background waits are not blockers. If G is waiting on its own pipeline run (5+ min), just wait — don't interpret that as a cue to grab a new task. The goal of /drive is depth, not throughput.
When to escalate instead of recursing:
After merge (auto or approved):
Final verification. Before declaring the goal-task done, invoke superpowers:verification-before-completion once more from the merged-on-main perspective. Common catches: a follow-up cross-repo PR still needed (the hub journal-move PR); a source GitHub issue not yet closed; a memory rule worth saving from this task's surprises; unchecked "Done when" items.
## Closed section must carry - Quality regression (<metrics>): <explanation>; verify-close.sh enforces it.## Closed (YYYY-MM-DD) section (standardized name — not "Resolution"/"Outcome"/"Done", so /retro and greps find it predictably) per repo-conventions/templates/design-doc.md: shipped-in PR #N + run/evidence links, what's met, what's external/unverified and when it'll be confirmed, and any follow-up tasks filed (T-ids) — file each as a follow-up staged into the next iteration (bash <skills-root>/_ipm/stamp-scheduled.sh dev/TODO/<id>-<slug>.md next) and promoted to the front of the queue (/top <id>; see Important Notes).Then append a "Skills invoked" block to the task body before the close (Phase 4/Phase 7 status: Done flip or immediate journal move), so /retro Phase 4c can grade compliance by grepping JOURNAL:
## Skills invoked
- TDD (`superpowers:test-driven-development`): {yes — Phase 3.0, code-class | no — docs-class}
- Verification (`superpowers:verification-before-completion`): yes — Phase 3.6 + 7.0 + /address-pr §2.a ×{N}
- Systematic debugging (`superpowers:systematic-debugging`): {yes — Phase 3.5 when X | no — didn't get stuck}
- Receiving code review (`superpowers:receiving-code-review`): {yes — /address-pr §2.d, {N} pushbacks | no — no Copilot comments}
Fill the bracketed alternatives from what actually happened; the block lands directly in the dev/JOURNAL/ file at close time — every close journal-moves immediately, no deferred-to-Friday path anymore.
Order-of-operations guard (else the close content is silently dropped).
git mvstages the HEAD blob under the new path; any working-tree edits you made before the move stay unstaged, so a plaingit commitlands a pure 100% rename, 0 insertions/0 deletions — the## Closedsection,status: Done, and checked boxes never reach the committed blob (a real observed case — caught only because the post-mergegit checkout mainaborted on a dirty tree). This bites every close now. Eithergit mvFIRST, then edit at the new JOURNAL path, or after editing run an explicitgit add <journal-path>(orgit commit -a). Then verify before pushing withbash <skills-root>/drive/scripts/verify-close.sh <id>(exit 0 =ok <journal-path>; exit 1 listsFAIL <check>lines for a bare 100% rename, uncommitted edits, status not Done, a survivingclaimed_by, a missing## Closed (section, or a file not moved — fix each and re-run;--base <ref>overridesmainfor the rename check).
Status=Done (run right after Phase 7.0, before the remaining Phase 7 steps):
# Status mirror → Done (the file move to JOURNAL is the source of truth;
# this just keeps the board accurate without waiting for the mirror workflow)
bash <skills-root>/_session/status.sh <task-id> Done
This call is best-effort, idempotent, and never blocks subsequent steps. If /address-pr already wrote Status=Done at merge time, the explicit call here is a no-op (same value).
Same-repo mode:
git checkout main && git pull && git remote prune origin (see Important Notes → Post-merge branch hygiene)
Verify the journal move (dev/TODO/ → dev/JOURNAL/) landed in the PR from Phase 4, with status: Done set on the moved file — every close journal-moves immediately now, there is no in-place-only path left to check instead.
Verify claimed_by was actually cleared, not just status: flipped. If Phase 4's close commit set status: Done via a hand-edit rather than task_claim.sh release <id> Done, the claim can survive the flip; bash <skills-root>/drive/scripts/verify-close.sh <id> reports it as FAIL claim (run on main after the merge). If still set, open a one-line follow-up PR running bash <skills-root>/_session/task_claim.sh release <id> Done — don't hand-edit the field directly; the script is what keeps status: and claimed_by: atomic.
If the task has Source: GitHub issue #N, update and close the issue:
bash <skills-root>/_gh/gh.sh issue reopen <N>
bash <skills-root>/_gh/gh.sh issue close <N> --comment "Fixed in PR #<pr-number>. See {task-id} for details." --reason completed
If we recursed into this task as a blocker for a parent goal-task G: pop back to G. Restore G's branch (git checkout <g-branch>), pull latest main, rebase if needed, update G's task file to clear the Blocked by T{this} line, and resume G from wherever it left off.
If this IS the goal-task: exit /drive. Report "T{id} done — PR #N merged." No next-task pick — /drive drives one goal.
Cross-repo mode (additional steps):
In $TARGET: pull latest main, confirm the merge landed.
cd $HUB and git checkout main && git pull && git remote prune origin (see Important Notes → Post-merge branch hygiene).
Open a separate hub-repo PR that closes the task — every close journal-moves immediately now:
git checkout -b t<id>-journal-move
bash <skills-root>/_session/task_claim.sh release <id> Done # sets status: Done AND clears claimed_by atomically, before the move
git mv dev/TODO/T<id>-<slug>.md dev/JOURNAL/$(date +%F)-T<id>-<slug>.md
# Add a short "## Closed (YYYY-MM-DD)" section pointing at the target PR URL
# (mv FIRST then edit, as above — else `git add` the JOURNAL path before committing)
bash <skills-root>/_taskid/epic-links.sh sync && git add dev/EPICS # repoint epic member links to the JOURNAL path (no-op without epics)
bash <skills-root>/_docs/lint-docs.sh "dev/JOURNAL/$(date +%F)-T<id>-<slug>.md" \
|| echo "::warning::lint-docs: markdown issues remain — CI Markdown Lint will gate" # doc-lint guard, scoped to just this file, check-only — shared script, see /gcpr Step 1.5
git add dev/JOURNAL/$(date +%F)-T<id>-<slug>.md
git commit -m "docs(tasks): close T<id> (shipped in <target-repo>#<pr-number>)"
git show --stat HEAD # must show insertions, NOT "100% rename / 0 insertions"
JOURNAL_PR_URL=$(bash <skills-root>/_gh/gh.sh pr create ...) # gh pr create prints the new PR's URL
JOURNAL_PR_NUMBER=${JOURNAL_PR_URL##*/}
This PR is docs-only, typically auto-mergeable (pure status-move — see the auto-merge carve-out in dev/guidelines.md), and closes the task lifecycle. Run /address-pr $JOURNAL_PR_NUMBER — never a bare /address-pr call: bare re-triggers Phase 0's oldest-first backlog auto-pick, not this PR.
Close the source GitHub issue (same as same-repo).
Pop back to parent goal if recursed; otherwise exit (same as same-repo).
Remove the ephemeral target clone: rm -rf of the literal clone path. This is the only cleanup besides the orphan sweep (Phase 1.5 deliberately sets no trap). Skip this step if Phase 1.5 used the Target path override (the path is user-owned).
(Phase 7.5 parking-lot review removed — lateral housekeeping belongs in /ccxp, not /drive. /drive drives the current goal-task only.)
no_actionable_items while decidable questions sat in Slack threads.)When escalating to the user via Slack, use the MCP slack_send_message tool (not the /slack webhook) so that replies can be tracked.
DRIVE_ESCALATION_CHANNEL_ID — the Slack channel_id escalations post to. Required, no baked-in default — resolved the same way as every other ~/.claude/.env-backed var in this suite: already-exported wins, else ~/.claude/.env (see SLACK_STANDUP_CHANNEL in /slack-check-reply).
slack_send_message call crash the /drive run and do not silently drop the escalation either: skip steps 1-2 below, log a clear ERROR: DRIVE_ESCALATION_CHANNEL_ID not configured — cannot send escalation for T<id> line, and record the escalation's message + type directly in the task file's status note in place of the drive-threads.json entry from step 3 — the escalation is surfaced in the task file, not lost./drive stops or continues (see Escalation Rules below); only the Slack transport degrades, an escalation mechanism is not something that gets skipped with a one-line note the way a read-only search does.$DRIVE_ESCALATION_CHANNEL_ID channelslack_send_message with channel_id: "$DRIVE_ESCALATION_CHANNEL_ID" and the message textbash <skills-root>/_threads/threads.sh add <key> --channel "$DRIVE_ESCALATION_CHANNEL_ID" --ts <message_ts> --type <type> --summary "<summary>" (<key> = task id, or <id>-pr<N> for a PR thread). It creates the state file and directory if missing, writes atomically, and replaces any earlier entry for the same key, so a previous unresolved escalation is superseded by the re-send. A malformed state file exits 4 and is left untouched; never edit .claude/state/drive-threads.json by hand.Use /slack-check-reply <task-id> or /slack-check-reply all. Phase 0.5 runs this automatically.
Stop and slack the user when:
| Trigger | Action |
|---|---|
| Design decision with unclear trade-offs | Slack options, stop |
| Scope creep (>8 files beyond design) | Slack warning, stop |
| Hard blocker discovered | Create task, slack, stop |
| Test failures after 2 fix attempts | Slack with error details, stop |
| Build/CI failure not caused by our changes | Slack, stop |
| Task requires secrets/permissions not available | Slack, stop |
| Owner-only reason (decision, outside party, blocker only the owner can clear) | Stop and report it (below); write nothing to the task file |
Continue autonomously when:
| Trigger | Action |
|---|---|
| Soft blocker (workaround exists) | Create task, note it, continue |
| Copilot style suggestion (not a bug) | Reply with justification, resolve, continue |
| Minor test fix needed | Fix, re-run, continue |
| Design is clear, implementation is straightforward | Code, test, PR, continue |
When a run stops because only the owner can move the task (an open decision, an outside party, a blocker only the owner can clear), do not record the reason in the task file.
/autopilot: end the report with NEEDS-ATTENTION: T<id> — <reason> (and ADVANCED: T<id> — <what moved> if a design PR, a split, a pushed branch or a PR landed first). When the stalled task is a blocker you recursed into (Phase 6), name the blocker, not the goal. The dispatcher then records a needs-human hold.autopilot/SKILL.md "Big tasks").Follow dev/guidelines.md:
t{task-id}-short-description (e.g., t254701-upstream-prepare)fix/short-description or feat/short-descriptionAuto-stage every task you CREATE into an iteration (maintainer policy 2026-06-18) — so it lands on the board's Iterations view, not just the backlog. After writing the task file, stamp its scheduled: frontmatter with _ipm/stamp-scheduled.sh <task-file> <current|next>, keyed by kind:
Dependency / blocker (Phase 3 "New dependency discovered", Phase 6 blocker discovered mid-work) → the current iteration: bash <skills-root>/_ipm/stamp-scheduled.sh dev/TODO/<id>-<slug>.md current — it's needed to unblock the goal-task now.
Follow-up (Phase 3.7 doc-conformance task, Phase 7 close-time follow-ups) → the next iteration: bash <skills-root>/_ipm/stamp-scheduled.sh dev/TODO/<id>-<slug>.md next — deferred work, not this iteration's commitment.
The stamper resolves the Monday token-free (committed IPM file → Project API → next-Monday fallback) and writes it update-forward-only, printing the effective date.
Token-free means it still stages correctly in the ccxp cron (no PAT) — unlike the old _session/iteration.sh inline call, which returned empty without a token and silently left the task unscheduled. It only no-ops on a non-YAML/legacy task file. scheduled is a lint-allowlisted key.
(Closed tasks get their iteration automatically from the close-date via sync-tasks — see that action; this rule is only for live tasks at creation.)
Promote every task you CREATE to the front of the queue (trying this 2026-10-02 — revisit at /retro if it causes churn): right after stamping scheduled: above, also run /top <id> so the new task lands at position 1 of dev/TODO/queue.md, not the tail /stage's default or the next /todo sweep would give it. Applies to every kind /drive creates — blocker and follow-up alike — not just the current-iteration ones: a task filed while driving another to completion is a direct loose end of the work just done (a blocker, a doc-conformance gap, a close-time follow-up), and doing it next while the context is still warm beats letting it sit behind unrelated backlog. This overrides /stage's normal "blocks nothing queued → append" rule specifically for tasks /drive itself files; tasks filed by other means (/new-task, hand-filed, another session) still get /stage's plain append. If a /top'd task is itself Blocked by something open, /top pulls that blocker along to the very front too (its own step 2) — expected, not a bug.
Keep the task file current. Update the task file in dev/TODO/ after every phase transition, checklist item completion, pipeline result (pass or fail), or new issue discovered. The task file is the single source of truth for progress — if it's stale, the user can't tell what happened. Specifically:
[x]Concurrency safety — hard rule. Read-only operations (git log, gh pr view, file reads, API queries) may run in parallel. Side-effecting operations (checkout, stash, edit, commit, push, branch switch) must run sequentially — never in parallel tool calls. Before switching branches (e.g., recursing into a blocker), ensure the current branch has zero uncommitted changes and all pushes are complete. This applies across all phases: Phase 0 (one PR at a time), Phase 6 (clean state before recursing into a blocker), and background notification handling.
Post-merge branch hygiene (every merge, not just the final one). After ANY gh pr merge in this flow — claim PR, design PR, implementation PR, close/release PR — do not just move on to the next branch: git checkout main && git pull && git remote prune origin. --delete-branch removes the branch on GitHub (and locally if you were on it), but your clone's cached remote-tracking ref (refs/remotes/origin/<branch>) lingers until pruned — Phase 6's existing-work check (git branch -r | grep -i "t{id-digits}") can silently match a long-dead branch if this is skipped, and main can be several commits stale for the next branch you cut. (Observed incident: three merges landed back-to-back without a prune step; stale refs for all three lingered until caught and cleaned up manually.) Every "pull latest main" instruction elsewhere in this skill means this full three-part command, not just git pull.
Wait, don't switch. If waiting for a long operation (5+ min) on the goal-task's chain, just wait (Bash run_in_background or Monitor). Do NOT grab an unrelated task. /drive depth > throughput.
Read guidelines first. Always read dev/guidelines.md before making changes.
Read the task file fully before starting — don't skip the design or test plan.
Don't update CLAUDE.md on feature branches — only on main after merge.
Commit messages: conventional commits (fix:, feat:, docs:, refactor:) with Co-Authored-By trailer.
Run tests before pushing — bats tests/ must pass. Don't push broken code.
Context budget: if the task is too large for one session (>500 lines of new code, >10 files), break it into subtasks and implement the first one.
/drive exits when the goal-task merges. No next-task auto-pick. Report:
T{goal-id} done — PR #N merged.
Chain depth: {N levels} (e.g., goal → blocker → blocker's-blocker → merged)
Parked nothing. Ready for the next invocation.
Use /ccxp (lateral "pick next task" strategy) when you want continuous forward progress across the backlog. /drive owns depth; /ccxp owns breadth. Don't mix the two within one invocation.
What SKILL.md sets; muted values are Claude Code's defaults
57 skills in this plugin
/1password-env-setupUse when the user explicitly asks to bootstrap or refresh a repo's 1Password-backed .env — installs the refresh-env helper, generates a hash-checking .envrc, and materializes .env from .env.tpl via op inject/address-prUse when the user explicitly asks to address, verify, or merge a specific open PR (CI, Claude Code review, test plan, tiered merge)/agent-pairingUse when the user explicitly asks to toggle the ccxp-agent main-session agent on/off for this Claude Code profile or check its statusnpx claudepluginhub synx-data-labs/ccxp-skills --plugin ccxp-skills