| name | deploy |
| description | vutuv deploy: never push to main directly. Branch → mix precommit green → PR → wait for CI green → squash-merge. The merge to main is what triggers the production deploy. |
| argument-hint | [message] |
| allowed-tools | Bash, Read, Grep, Glob, Agent |
Deploy Skill (vutuv)
In this repository /deploy means: open a pull request, wait for CI to go
green, then merge it. It never means "commit and push to main". A push to
main fires .github/workflows/deploy.yml and deploys to production
immediately, so main is reached only through a merged, CI-green PR — the merge
commit is the deploy trigger.
This project skill overrides the personal deploy skill in
~/.claude/skills/deploy/. When both are offered, use this one.
Token/latency discipline. The expensive part is mix precommit over the
test suite, and the naive loop ingests its full output once per iteration:
- Never stream a check's output into context. Redirect it to a log and judge
it by the command's own exit code. On a green run that is ~5 tokens instead
of thousands. Read the log only when the exit code is non-zero, and then only
the failing part.
- Iterate cheap, gate once. When something fails, re-run only the failing
thing to confirm each fix; run the full
mix precommit exactly once, at the
end, as the final gate.
Steps
-
Get onto a branch. git status --short --branch.
- On a feature branch already → keep it.
- On
main → create one from the current work (git switch -c <topic>,
a short kebab-case name describing the change). Never commit on main.
-
First precommit run (redirected, exit-code only).
mix precommit > precommit.log 2>&1
Judge it by this command's own exit code. Do NOT append ; echo "EXIT=$?"
and do NOT pipe into tail/grep: that makes the shell report the last
command's code (always 0) and silently masks a red precommit.
- Exit 0 → step 4. Do not read the log; it passed.
- Non-zero → step 3. Do not read the whole log into the main thread.
-
Fix the failures in a subagent (only when step 2 was red). Launch a
general-purpose subagent with the Agent tool and this brief:
mix precommit failed; its output is in precommit.log at the repo root.
Make it pass. Rules:
- Fix ALL reported issues, even ones unrelated to the current work
(compiler warnings-as-errors,
mix format, credo --strict, tests).
For formatting, just run mix format — don't hand-edit whitespace.
- Iterate cheap: confirm each fix by re-running only the failing
thing —
mix test --failed, or mix test path/to/file.exs:LINE, or
mix credo --strict path — always redirected to a log and judged by
exit code, never streamed.
- Gate once: when you believe it's green, run the full alias one final
time as
mix precommit > precommit.log 2>&1 (no trailing echo, no
pipe) and judge it by that command's own exit code. It must exit 0.
- Report back in a few lines: what was broken, what you changed, and the
final exit code of the full
mix precommit. Do not paste test output.
Do not proceed unless the subagent reports the full mix precommit exited 0.
If it can't get to green, stop and tell the user what's still failing.
When the user really wants a direct push
Only on an explicit, unambiguous instruction for that specific push ("push
straight to main", "skip the PR"). Say once that it bypasses CI-before-deploy,
then do it. A plain /deploy is never that instruction.