Ship the current changes. Only run when the user explicitly invokes
.
Never start this process proactively.
ships whatever the current work is. First detect which case you are in:
Detect with
gh pr view --json number,state,headRefName,mergeable,mergeStateStatus
on the current branch. If there is an OPEN PR for it, this is the whole job:
Run the project's validation pipeline and require all of them to pass before
continuing. Detect the package manager from lockfile /
field
(
,
,
).
Order is signal-first: a real defect (types, tests)
surfaces before cosmetics (lint) and packaging (build). Typical pipeline:
If any step fails, STOP and report the failure. Do not commit.
Note on local build env: some projects keep an empty credential var exported in
the shell that shadows
(Next.js gives
precedence). If
the build fails on an env var that is actually present in
, retry the
build with that var unset, e.g.
env -u ANTHROPIC_API_KEY <pm> run build
. Only
do this for local validation — never bake it into the committed build script.
This is gate 2 of Step 1's pipeline (after typecheck, before lint/build). Run the
unit/component and e2e tests that exercise the files this change touched — not
the whole suite. The goal is to catch
regressions inside the diff's blast radius without paying for an unrelated full
run. The full suite is CI's job; here we run what the change can break.
-
Find the touched files — union of uncommitted and committed-but-unpushed:
bash
git status --porcelain | awk '{print $2}'
git diff --name-only origin/<default-branch>...HEAD
-
Unit / component (Vitest): let the module graph pick the dependent tests
— Vitest runs every test that transitively imports a changed file, including
the colocated
:
bash
<pm>x vitest related --run <changed .ts/.tsx files…>
Pass the changed source files (test files are fine too). If the project
has no Vitest, fall back to running each changed module's colocated test
file. This is fast — it's the primary gate.
-
E2E / visual (Playwright), only when relevant:
- Always run any touched spec:
<pm>x playwright test <changed *.spec.ts>
.
- For touched source files, run the e2e specs that exercise that surface
— map by feature dir / route / component name (grep the specs for the route
or symbol). If nothing clearly maps, say so and skip. Never fall back to
the full e2e suite here.
- Reuse a running dev server if one is up, or set ; the
Playwright config may already .
- If a touched UI surface changed appearance and a visual/snapshot spec
covers it, run it — and if the baseline legitimately changed, regenerate it
() and include the new baseline in the commit.
-
Everything selected must pass before commit — same stop condition as
Step 1. A failure here means fix or report, do not ship.
If the project keeps
, append a short entry: what changed,
decisions made, gotchas, and anything worth promoting to CLAUDE.md.
This is a
solo operation: commit directly on and push. No feature
branches, no PRs. (Only create a branch / open a PR if the user explicitly asks
for a review step.)
-
Stage the relevant changes, write a clear conventional-commit message.
-
End the commit message with the project's required trailer if one exists:
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
-
Commit on
and
. Pushing
is what triggers
the production deploy (and any deploy notifications).