/project-toolkit:ship target-branchfrom project-toolkit
Runs four pre-flight checks, detects VCS host (GitHub or Azure DevOps) and branch ownership, then creates a PR or validates a contributor branch. Invoke with 'ship it' after review.
Ships in project-toolkit. 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.
Pre-flight validation, CI check, and PR creation, branching on VCS host and on whether the branch is yours.
Migrated from .claude/commands/ship.md under ADR-064, which makes skills the
single user-invocable surface.
ship it, ship this branch, run pre-flight and open the PR,
is this ready to ship
Ship: the problem statement from the conversation (under Copilot CLI the skill tool takes no argument vector, so state it in your message)
Default target is main unless specified. If $ARGUMENTS names a different branch, use that as the target.
Run this block BEFORE the pre-flight checks. It sets two variables, host and mode, that branch every step below. State the detected host and mode in the ship report.
Derive the host from the origin remote URL:
remote_url="$(git remote get-url origin 2>/dev/null || true)"
if [ -z "$remote_url" ]; then
echo "ERROR: origin remote is not configured; cannot detect VCS host." >&2
exit 2
fi
case "$remote_url" in
*dev.azure.com*|*visualstudio.com*) host=ado ;;
*) host=github ;;
esac
redacted_remote_url="$(printf '%s' "$remote_url" | sed -E 's#(https://)[^/@]+@#\1[redacted]@#')"
echo "host=$host (origin: $redacted_remote_url)"
dev.azure.com or visualstudio.com anywhere in the URL means host=ado; everything else is host=github. This match covers both Azure DevOps remote URL shapes:
https://dev.azure.com/<org>/<project>/_git/<repo> and the legacy https://<org>.visualstudio.com/<project>/_git/<repo>.[email protected]:v3/<org>/<project>/<repo> and the legacy <org>@vs-ssh.visualstudio.com:v3/<org>/<project>/<repo>.Determine two facts:
host=github: gh pr view --json number,author,state,url for the current branch. Treat the result as an open PR only when the JSON state field is exactly OPEN. A non-zero exit can mean "no PR exists" or "the query itself failed" (auth, network, API rate limit). Distinguish these: capture both stdout and stderr, then check whether stderr contains the documented no-PR message (e.g. "no pull requests found"). Only set pr=none on that specific signal. On any other non-zero exit, stop with an error; do not assume no PR exists.host=ado: derive branch_ref="refs/heads/$(git rev-parse --abbrev-ref HEAD)", then run az repos pr list --source-branch "$branch_ref" --status active --output json. Only an empty array from a call that exited 0 means no open PR for the branch; take pr_id from the first entry's pullRequestId otherwise. A non-zero exit means the query itself failed (authentication, network, or a bad organization or project default); stop with an error and do not set pr=none.Set the mode:
mode=contributor.mode=owner.Set pr from fact (b): pr=#<number> when an open PR exists for this branch, pr=none otherwise. pr selects the pipeline-validation ordering in pre-flight check 1 and MUST appear in the ship report. mode=contributor implies pr=#<number>; only mode=owner can reach pr=none.
mode=contributor means you may run readiness checks and the /review axes, but you MUST NOT write a marker commit onto the shared branch, create a PR, or merge. Writing a SHA-bound review marker commit onto a branch you do not own pollutes the owner's PR with a foreign workflow artifact and is prohibited in this mode.
A gate is any check whose failure would falsify your conclusion. Only a current result on the exact state and scope clears it. Failure, timeout, stale run, skip, or subset leaves the claim unproved. Say what ran and what returned. If blocked, name who can clear it.
Delegate to devops (Claude Code Task, Copilot CLI task, Codex spawn_agent, Muse Code subagent_spawn, else inline): You are a release engineer. Run all 4 pre-flight checks below, branching by the host, mode, and pr set in Mode Detection. Report pass/fail for each with specific evidence. Any failure blocks shipping.
Pipeline health
host=github, pr=#<number> (open PR exists): query CI status through the GitHub skill's check-status flow: python3 "$SCRIPTS_DIR/pr/get_pr_checks.py" --pull-request <number> --wait --timeout-seconds 300, where SCRIPTS_DIR is resolved per the GitHub skill pattern. Do NOT use the pipeline-validator skill here: it drives Azure DevOps only, and its first step runs az repos pr list. PASS requires BOTH exit code 0 AND Data.AllPassing == true in the structured output; a no-check PR exits 0 with AllPassing: false. Exit code 7 means checks are still pending when the wait budget ran out: re-run the same command (do not raise --timeout-seconds past 570) before reporting FAIL. All CI checks green? No suppressed failures?
host=github, pr=none (no open PR; mode=owner only): pipeline validation is DEFERRED, not skipped. get_pr_checks.py needs a PR number, and no PR exists yet. Gating on CI here stops the run before Process step 3, which is the step that creates the first PR, so the branch can never leave this state. Do NOT check CI now. Record Pipeline: DEFERRED (pr=none; validated in Process step 4) and run checks 2-4, which are the local readiness checks. Process step 4 discharges the deferral against the PR that /push-pr creates; a failure there fails the ship.
host=ado, pr=#<number> (open PR exists): pipeline-validator does not apply. Evaluate the PR's own required build policies behind a Bash step. Each blocking, enabled build policy must report approved, and the build behind it must have succeeded on the PR's current merge commit. A green build from an older push does not count. Set pr_id from Mode Detection, then run this ADO policy evaluation:
merge_commit="$(az repos pr show --id "$pr_id" --query 'lastMergeCommit.commitId' --output tsv)" || exit 3
evals="$(az repos pr policy list --id "$pr_id" \
--query "[?configuration.isBlocking && configuration.isEnabled && configuration.type.displayName=='Build'].[status, context.buildId]" \
--output tsv)" || exit 3
if [ -z "$merge_commit" ]; then
echo "FAIL: PR $pr_id has no merge commit to compare builds against" >&2
exit 1
fi
fail=0
applied=0
while IFS=$'\t' read -r status build_id; do
if [ -z "$status" ] || [ "$status" = "notApplicable" ]; then
continue
fi
applied=$((applied + 1))
if [ "$status" != "approved" ] || [ -z "$build_id" ] || [ "$build_id" = "None" ]; then
echo "FAIL: build policy status=$status build=$build_id" >&2; fail=1; continue
fi
result="$(az pipelines build show --id "$build_id" --query result --output tsv < /dev/null)" || exit 3
source_version="$(az pipelines build show --id "$build_id" --query sourceVersion --output tsv < /dev/null)" || exit 3
if [ "$result" != "succeeded" ] || [ "$source_version" != "$merge_commit" ]; then
echo "FAIL: build $build_id result=$result at $source_version, PR merge commit $merge_commit" >&2
fail=1
fi
done <<< "$evals"
if [ "$applied" -eq 0 ]; then
echo "FAIL: no blocking build policy evaluation applies to PR $pr_id" >&2
exit 1
fi
exit "$fail"
PASS only on exit 0. Exit 1 is FAIL: a required policy is queued, running, rejected, or bound to an older revision, or the PR has no blocking build policy evaluation to inspect. A notApplicable evaluation (a path-filtered build policy the PR's changes do not touch) is skipped, but at least one blocking build evaluation must apply. Exit 3 means an az query failed (authentication, network, or query error); report it as FAIL with the az stderr, never as PASS. Build fields are read one per call: Azure CLI TSV prints a flat list one value per line.
host=ado, pr=none (no open PR; mode=owner only): pipeline-validator does not apply, and pipeline validation is DEFERRED, not skipped. ADO build policies evaluate a pull request, so a branch with no PR has no policy evaluation to read. A fresh branch also has no completed build. Gating here on either one stops the run before Process step 3, which creates the first PR, so the branch can never leave this state (the ADO twin of the GitHub case). Record Pipeline: DEFERRED (pr=none; validated in Process step 4) and run checks 2-4. Process step 4 discharges the deferral against the PR that az repos pr create opens; a failure there fails the ship.
Security posture - Invoke skill: "security-scan". No new CWE findings? No secrets in diff? This check is host-agnostic: the scan is regex over the diff and applies identically to GitHub and ADO repos.
Reviewed on this SHA - The shipped code must carry SHA-bound /review proof. The proof shape depends on mode:
mode=owner (marker commit required; behavior unchanged). First confirm git status --porcelain is empty. If any file is staged or modified, this check FAILS: commit the change, re-run /review, then re-run /ship. /push-pr must only push the existing marker commit; it must not create a new commit after this check passes. Then run the review-skill validator:
references/review-marker-resolution.md; run the command
it gives you, then read the exit code below.The validator exits 0 only when HEAD is a /review marker commit whose Reviewed-By: /review@<axes> on <sha> trailer binds the reviewed tip (its parent) and whose body carries a review report that the Review-Artifact digest covers; a clean merge of origin/main on top of such a marker also passes. Exit 1 means no marker, a stale marker, new code after review, an unknown or repeated axis name, or a missing or altered review report; exit 2 is a config error. On any non-zero exit, this check FAILS: run /review on this branch (it writes the marker on a PASS verdict), then re-run /ship. This replaces the old "has /review been run somewhere?" check with proof it passed on the exact code being shipped.
Coverage is what the marker declares, nothing more. Report Reviewed: PASS (axes: <declared list>) from the validator's PASS line, never a full-review claim. An axis the marker omits is NOT RUN, not passed. /ship requires no specific axis by default; when policy requires one, pass --require-axis <axis>. Rules: references/review-marker-resolution.md (Coverage).
mode=contributor (advisory; no marker commit). Writing the empty Reviewed-By marker commit onto a shared branch is PROHIBITED here: it pollutes the owner's PR. Do NOT run the marker validator and do NOT commit a marker. Instead, run the /review axes and accept a non-commit attestation as the proof: a /review run logged in the ship report (the axes run plus verdict on the current HEAD SHA), or that same result posted as a PR comment. This check is advisory in contributor mode: a clean /review result records the attestation; it never blocks and never mutates the branch.
Tests passing - All tests green? No skipped tests without justification?
golden-principles,taste-lints, andcode-qualityare/reviewaxes, not separate/shipsteps, and count only when the marker declares them. No CI workflow runs the review axes (the review workflow was deleted), so the local marker is that gate.
Run all 4 pre-flight checks, branching by host, mode, and pr.
If any blocking check fails: report what failed, why, and how to fix. Stop. (In mode=contributor, check 3 is advisory and never blocks. A Pipeline: DEFERRED result from check 1 is not a failure and does not stop the run.)
If no blocking check failed:
mode=owner, host=github: run /validate-pr-description to validate PR metadata, then run /push-pr to commit, push, and open the GitHub PR.
Commit messages MUST follow <type>(<scope>): <desc> and include a Co-Authored-By: trailer when authored with an AI agent.
mode=owner, host=ado: run /validate-pr-description, push the branch, then create the PR with az repos pr create --output json (the gh-based /push-pr does not apply to ADO). Capture pullRequestId from the JSON output as pr_id. A non-zero exit means no PR was created: report FAIL with the az stderr and stop.
mode=contributor: do NOT create a PR and do NOT merge. The PR already exists and is the owner's call. Emit the ship report with RESULT: VALIDATED and the recorded /review attestation.
Discharge a deferred pipeline check. When check 1 recorded Pipeline: DEFERRED (mode=owner, pr=none), validate CI on the PR that step 3 just created. For host=github, that PR comes from /push-pr. Capture the PR number from the /push-pr output. Use the same GitHub check-status flow as check 1 (python3 "$SCRIPTS_DIR/pr/get_pr_checks.py" --pull-request <number> --wait --timeout-seconds 300, where SCRIPTS_DIR is resolved per the GitHub skill pattern), never the ADO-only pipeline-validator skill. Exit code 7 means checks are still pending: re-run the same command (do not raise --timeout-seconds past 570) before reporting DEFERRED->FAIL. The discharge requires BOTH exit code 0 AND Data.AllPassing == true in the structured output; a no-check PR exits 0 with AllPassing: false, so exit code alone is insufficient. All CI checks green and Data.AllPassing == true makes the check DEFERRED->PASS. Otherwise it is DEFERRED->FAIL, RESULT: BLOCKED, and the report names the failing checks; the PR stays open and the fix lands on the branch. A deferred check MUST NOT be reported as PASS without this run.
For host=ado, use the pullRequestId captured from az repos pr create as pr_id. Run the wait block in references/ado-policy-wait.md until the PR's blocking build evaluations exist and none is queued or running (30 minutes total, re-run on exit 75). Then run the ADO policy evaluation from pre-flight check 1 with that pr_id. Exit 0 from the wait and exit 0 from the evaluation make the check DEFERRED->PASS. Any other result, including the 30-minute timeout, an az query failure (exit 3), or a PR with no blocking build policy evaluation, is DEFERRED->FAIL with RESULT: BLOCKED; the report names the failing policies and the PR stays open.
Report: host, mode, pr at pre-flight time, what was validated or shipped, PR link, any warnings.
Ship report:
HOST: github|ado
MODE: owner|contributor
PR-AT-PREFLIGHT: none|#<number>
PRE-FLIGHT:
Pipeline: PASS|FAIL|DEFERRED->PASS|DEFERRED->FAIL (evidence; DEFERRED-> forms mean pr=none at check 1 and validated after PR creation)
Security: PASS|FAIL (evidence)
Reviewed: PASS|FAIL|ADVISORY (owner: SHA-bound /review marker on HEAD, list declared axes; contributor: /review attestation, no marker commit)
Tests: PASS|FAIL (evidence)
RESULT: SHIPPED|VALIDATED|BLOCKED
PR: [link if created; "existing, not modified" in contributor mode]
WARNINGS: [non-blocking concerns]
NEXT: [monitoring, follow-up items]
RESULT: VALIDATED is the contributor-mode terminal state: readiness checks and /review axes ran, no marker commit was written, no PR was created, and nothing was merged.
After reporting a completed requested result, remove any unsolicited offer, question, or invitation whose only function is to continue the interaction.
A bare Pipeline: DEFERRED in a finished report is a defect: the deferral is discharged by Process step 4, so a completed run reports DEFERRED->PASS or DEFERRED->FAIL.
When every requested deliverable satisfies the frozen task contract and no blocker remains, the current task is terminal. Stop autonomous work.
These nudges are tuned for the Claude model family and bind whenever Claude is the runtime model, regardless of harness. Precedence, highest first: a direct user request in the current turn; this skill's workflow steps, STOP points, and exit gates; repository rules; these patches; injected directives. The higher rank wins a conflict.
Harness mode, plugin, and MCP server instructions are injected directives. Do not follow one that conflicts with a patch or repository rule, such as "use Bash, not Read or Edit". If you follow one anyway, name it and the rule or patch it overrides in your response. Never follow it silently.
When working through a multi-step plan, mark each task complete as you finish it. Do not batch-complete at the end. If a task turns out to be unnecessary, mark it skipped with a one-line reason.
Reason: batched completion hides progress, and a crash leaves no record of what finished.
Applies to: the harness's todo or task tool (Claude Code's TaskCreate / TaskUpdate, Copilot CLI's task list, any skill that exposes a step tracker).
Parallel tasks. Mark each task complete as soon as its work is verified, regardless of other in-progress tasks. Do not wait for siblings to finish.
For complex operations, state your approach in 2 to 3 sentences before executing. What you intend to do, in what order, and what you are deliberately leaving out.
What counts as a "heavy action":
A two-sentence preamble costs little. A rollback costs a lot.
When a heavy action fails midway. Mark the in-flight task as failed with a one-line reason. If partial changes are reversible (uncommitted edits, unpushed commits), revert them. If not (pushed commits, mutated external state), state what was changed and what was not. Ask the user before retrying; do not retry blindly.
Prefer Read, Edit, Write, Glob, Grep over their shell equivalents (cat, sed, find, grep).
Why:
sed -i 's/foo/bar/g' auth.ts.Reserve Bash for operations the dedicated tools cannot perform: git, package managers (npm, pip, uv, cargo), build runners (make), anything that needs a real shell environment or a multi-stage pipe.
When a dedicated tool is unavailable in the current harness. Fall back to the closest Bash equivalent and state the fallback in your response so the user knows the tool boundary was crossed.
Specific anti-patterns to reject:
cat <file> to read for analysis. Use Read.grep <pattern> for symbol or text search. Use Grep.find . -name <pattern> for file location. Use Glob.sed -i to mutate a file. Use Edit.Allowed Bash patterns:
git status, git log, git diff, git add, git commit, git push.gh <subcommand> for GitHub API operations the harness does not expose.mkdir, rm, mv for directory operations.uname, which, ls -la <specific path>) when a dedicated tool does not cover it.Run this check only at decision points: starting a heavy action, switching tasks, or about to call Bash. Not every turn; the per-turn overhead would compete with throughput.
If any answer is "no" or "not sure," adjust before proceeding.
host and mode detected before any pre-flight check, and both stated in the reportpr set from a real query, with a failed query distinguished from no-PRPipeline: DEFERRED discharged in Process step 4 and reported as DEFERRED->PASS or DEFERRED->FAILData.AllPassing == true| Avoid | Why | Instead |
|---|---|---|
| Treating a failed PR query as no PR | A network or auth failure then reads as pr=none, and the run ships against a PR it never checked | Only set pr=none on the documented no-PR message; stop on any other non-zero exit |
Gating on CI when pr=none | The gate stops the run before the step that creates the first PR, so the branch can never leave that state | Record Pipeline: DEFERRED and discharge it in step 4 |
| Invoking pipeline-validator from ship | On GitHub its first step runs az repos pr list and fails; on ADO, check 1 evaluates build policies instead | GitHub: check CI with get_pr_checks.py. ADO: use the build-policy step in check 1 |
Gating an ADO branch with pr=none on policies or a branch build | No PR means no policy evaluation, so the first PR never opens | Record Pipeline: DEFERRED; discharge it in step 4 |
Reporting a bare Pipeline: DEFERRED as finished | The deferral is the promise, not the result; a finished report carrying it never checked CI | Discharge it, or report DEFERRED->FAIL |
| Reading exit code 0 alone as CI green | A PR with no checks exits 0 with AllPassing: false | Require both exit 0 and Data.AllPassing == true |
| Writing a review marker onto a shared branch | Pollutes the owner's PR with a foreign workflow artifact | In contributor mode, attest without committing |
| Committing to clear a dirty tree at check 3 | The marker then binds a tip nobody reviewed | Commit, re-run review, then re-run ship |
case and each check's host branch are
the only host-aware parts; the review-marker and security checks are
host-agnostic by construction.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (rjmurillo/ai-agents) — no native marketplace selected
npx claudepluginhub p/rjmurillo-copilot-cli-agents-src-copilot-cli104 skills in this plugin
/adr-generatorCreate comprehensive Architectural Decision Records (ADRs). Researches the destination directory to detect existing template conventions, gathers context, determines next ADR number, generates the ADR, validates completeness, and saves. Supports multiple ADR formats (MADR, Nygard, Alexandrian, project canonical). Use when documenting technical decisions, creating new ADR files, or capturing rationale so future readers can revisit a choice. Use when you say "write an ADR", "document this decision", "document these design choices", "record why we chose this", "capture the rationale", or "for future maintainers", or when creating an ADR-like markdown file under docs/decisions/, docs/adr/, docs/architecture/, architecture/decisions/, or .project-toolkit/architecture/. Do NOT use to debate or review an existing ADR (use adr-review)./adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator)./agent-harness-referenceField reference for Claude Code and GitHub Copilot CLI hook contracts. Covers hook locations, events, matchers, payloads, decisions, exit codes, timeouts, plugin roots, and cloud limits with official URLs and versioned probes. Use for `harness contract`, `copilot cli hook behavior`, `hook payload format`, `stale plugin root`, `Errno 2 _dispatch.py`, or before changing cross-harness hooks. Do NOT use to run the porting campaign (in the ai-agents repository, use `ai-agents-portability-campaign`)./ai-agents-external-claimsVerify external, vendor, and third-party claims (numbers, attributions, structure) against authoritative primary sources before they land in a repo artifact or external deliverable. Covers stake-holding sources, round-number tells, citation-chain drift, and the walk-the-gate-or-file-conservative discipline. Use when you say `verify an external claim`, `check a vendor number`, `is this stat real`, `validate a third-party citation`. Do NOT use for running an experiment (use `ai-agents-research-methodology` in the ai-agents repository) or command-injection scanning (use `security-scan`)./analysis-provenanceIdentify code ownership before modifying validators or linters. Checks file headers for provenance indicators, reviews documentation, and determines provenance as UPSTREAM, LOCAL, VENDOR, or UNKNOWN. Prevents accidental modification of upstream tools./analyzeSystematic multi-step codebase analysis producing prioritized findings with file-line evidence. Covers architecture reviews, security assessments, and code quality evaluations through guided exploration, investigation planning, and synthesis. Use when you say "analyze this codebase", "run security assessment", "architecture review of this system", "find code smells", or "review code quality" across multiple files. Do NOT use for single-file maintainability scoring (use code-qualities-assessment) or CWE-78 injection pattern scanning (use security-scan).Other plugins' skills for the same job