deploy — GitHub Actions CI/CD

Caution

Every destructive operation requires explicit confirmation. The skill classifies each gh command before executing it — DELETE and PRIVILEGE class operations always prompt. Compound commands are split into individually classified steps.

Tip

Run without args/brewtools:deploy — and the skill auto-detects mode from context: no config yet → setup; config exists → monitor. For complex multi-step DevOps work the deploy-admin agent is spawned automatically.

Quick reference

FieldValue
Command/brewtools:deploy
Arguments<task description> or mode keyword
Modessetup · create · release · deploy · monitor · update-agent
Agentdeploy-admin — auto-delegated for complex ops
ConfigCLAUDE.local.md (gitignored)
Modelopus
ToolsRead, Write, Edit, Bash, Task, AskUserQuestion, Glob, Grep

When to use

  • First-time setupsetup detects repo, enumerates workflows, writes CLAUDE.local.md, generates the deploy-admin agent
  • New workflowcreate generates YAML from 4 battle-tested templates (Build+GHCR, Deploy VPS, Release, Security Scan)
  • Release a versionrelease covers bump → changelog → commit → tag → push → CI verification in one shot
  • Trigger a deploymentdeploy selects a workflow_dispatch workflow, confirms, triggers, monitors run
  • Check CI statusmonitor shows recent runs, workflow states, latest releases, failed run logs
  • Refresh agentupdate-agent re-discovers workflows and regenerates the deploy-admin agent with current data

Examples

# First-time GitHub integration setup
/brewtools:deploy setup
# Release patch version — bump, changelog, tag, push, verify CI
/brewtools:deploy release patch

# Release a specific version
/brewtools:deploy release v3.5.0
# Create a Docker build workflow for GHCR
/brewtools:deploy create new build workflow for ghcr.io

# Trigger a deployment and watch progress
/brewtools:deploy trigger deploy-docs workflow

Flow

  1. Mode detection

    Parses your argument for mode keywords: setup, create, release, deploy, monitor, update-agent. Empty arg with no existing config → setup; with config → monitor.

  2. Environment check

    Verifies gh CLI installation, auth status, token scopes, and repo detection. Reads existing CLAUDE.local.md for GitHub config and workflow inventory.

  3. Setup (first run)

    Detects owner/repo, enumerates workflows and secrets, checks SSH server targets, writes GitHub config to CLAUDE.local.md, adds CLAUDE.local.md to .gitignore, generates deploy-admin agent.

  4. Operation

    create — generates workflow YAML from template, writes to .github/workflows/, updates config. release — probe project tooling → bump → changelog → commit → tag → push → optional post-release script → verify. deploy — confirms classification, triggers workflow_dispatch, polls run status, runs VPS health check if applicable.

  5. Safety gate

    Every gh command is classified before execution. READ and CREATE run freely. MODIFY, SERVICE, DELETE, and PRIVILEGE always ask for confirmation. Confirmation gates on release and deploy show a preview before any push.

  6. Monitor

    Dashboard of recent runs, workflow states, latest releases, and failed run logs — auto-triggered after release/deploy and available standalone via monitor mode.

Release mode knows nothing about your repo until it looks

Note

release runs a Step 0 probe before anything else. It lists .claude/scripts/*.sh, scripts/, the scripts block of package.json and Makefile, and records three values — each defaulting to none:

ValueWhat it holds
BUMP_SCRIPTa bump/version script, or none
POST_SCRIPTa post-release/publish script, or none
CHANGELOGCHANGELOG.md, RELEASE-NOTES.md, or none

none is not a failure. It means that step is skipped or done by hand, and the report says so.

Nothing in the release path is hardcoded to a particular repo layout:

StepBehavior
BumpBUMP_SCRIPT found → run it. none + version files obvious → edit every version file the repo actually has (package.json, pyproject.toml, gradle.properties, Cargo.toml, …) to the same X.Y.Z. none + unclear → ask which files carry the version
ChangelogWritten into the CHANGELOG file from Step 0, matching the heading style already in that file. none → the summary goes into the tag/release body instead
Post-releaseRuns only if POST_SCRIPT was found; otherwise skipped and reported as “no post-release script”
VerifyChecks whichever artifact the project actually publishes — container image, npm/PyPI package, a live /version endpoint, a plugin cache entry. Nothing published → “no external artifact to verify”, not a failure

The multi-package flow with its own bump script, plugin-cache verification and doc links lives in references/release-best-practices.md as a clearly labelled worked EXAMPLE — a pattern to adapt, not commands to run.

Warning

A pushed tag has no rollback. git tag -d and git push --delete only undo a mistake made before anyone fetched it. Once git push origin refs/tags/vX.Y.Z succeeds, deleting or force-moving that tag is irreversible for anyone who already pulled it — their clone keeps the old object under the same name, so the tag now means two different commits to two different people. The escape past that point is always the next patch version, never a rewritten tag.

Delegation

Warning

A big task handed to one agent = an agent gone for an hour. You cannot observe it, you cannot correct it, and it usually drifts off-target. Every Task spawn — deploy-admin included — gets ONE bounded unit: one deliverable, ~5 files, ~10 steps, and never more than one repo / one environment per agent. A multi-repo or multi-environment job is split into N tasks (one per repo, one per environment), all spawned in a single message.

Every spawn prompt carries six fields. A bare one-line task is never enough:

FieldContent
GOALthe overall task and why it exists — the point beyond the file edit
ROLEwhat this agent owns; what it must NOT touch
SCOPEexact paths and commands in bounds + explicit out-of-bounds
CONTEXTwhat is already done, by whom, what runs in parallel — trimmed to what this agent needs
CONSUMERwho or what uses the result next, and the shape it must fit
DONEacceptance criteria + the exact report shape expected back

Safety gates are not delegable. AskUserQuestion is stripped from every subagent at runtime, so a spawned deploy-admin cannot confirm anything — the confirmation gates on release (P4 Step 3) and deploy (P5 Step 4) stay in this skill, in the main conversation. A delegated agent finishes all non-destructive work and ends its return with an ## APPROVAL REQUIRED block instead — one envelope per destructive operation (COMMAND / HOST / EFFECT / ROLLBACK / EVIDENCE / PRECONDITION), or the literal APPROVAL REQUIRED: none. This skill shows the envelopes to the user, then re-spawns the agent with APPROVED: A1 A3 in the prompt — the only authorization a subagent may act on.

Workflows, secrets, and internals

Safety classification

ClassOperationsConfirmation
READgh run list, gh workflow list, gh release view, gh secret listNone
CREATECreate workflow YAML, gh release create --draftNone (non-destructive)
MODIFYEdit workflow, gh secret set, git commit/tagRequired
SERVICEgh workflow run, gh run rerun, git pushRequired
DELETEgh release delete, gh run cancel, remove workflow fileAlways required
PRIVILEGEgh secret delete, branch protection, gh workflow disableAlways required

Workflow templates

TemplateTriggerDescription
Build + Push GHCRtag / branchMulti-platform Docker build, push to ghcr.io
Deploy to VPSworkflow_dispatchSCP + SSH deploy, health check, rollback
Releasetag v*.*.*Extract changelog, create GitHub Release with assets
Security Scanpush / PRCodeQL / Gitleaks / Semgrep with SARIF upload

Configuration storage

GitHub config and workflow inventory are stored in CLAUDE.local.md at the project root. This file is gitignored automatically during setup. Secret names are stored for reference; secret values are never read or written.

The deploy-admin agent is generated with workflow inventory, GitHub config, and SSH server targets baked into its prompt. Run update-agent mode after workflow or config changes to refresh it.

SSH integration

The skill reads SSH server inventory from CLAUDE.local.md (written by the ssh skill) for VPS deployment targets and post-deploy health checks. Run /brewtools:ssh setup first if you need VPS deployments.

Robustness rules

Every Bash call uses && echo "OK" || echo "FAILED" with fail-fast logic. Max 2 retries per operation, max 15 gh calls per invocation. Every bounded call runs through a shared watchdog (real timeout/gtimeout when installed, a bash fallback otherwise — GNU timeout is Homebrew-only on macOS): 30 s for gh commands, 15 min for gh run watch. CI runs are correlated by the pushed commit’s headSha, not by reading the newest rows of gh run list — a bare “latest run” can belong to a concurrent push. A run that can’t be matched or times out is reported as such, never silently treated as success.

Troubleshooting

IssueSolution
gh CLI not installedInstall from https://cli.github.com/
Not authenticatedRun ! gh auth login in Claude Code terminal
Insufficient token scopesRe-authenticate: ! gh auth login -s repo,workflow,write:packages
Workflow not triggeringCheck trigger config in workflow YAML, verify branch/tag pattern
Release CI failed/brewtools:deploy monitor to view failed run logs
VPS deploy failedCheck SSH connectivity with /brewtools:ssh connect to server-name
🤖

deploy-admin agent

The auto-generated agent handles complex multi-step DevOps operations with full workflow inventory context.

📟

SSH skill

Configure SSH server inventory used by deploy for VPS targets and health checks.

🔗

GitHub source

Source code, scripts, and workflow templates.

📄

Brewtools overview

All brewtools skills — text, secrets, SSH, deploy, and more.

Updating plugins

Use /brewtools:plugin-update to check and update the brewcode plugin suite in one command. See the FAQ for details.