From 02e7c2882356133605a06b5f690a15b8dbf25545 Mon Sep 17 00:00:00 2001 From: Oskar Kapala Date: Wed, 3 Jun 2026 16:06:40 +0200 Subject: [PATCH] feat(skills): deploy skill for Claude Code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instructs CC to always route deploy/redeploy/ship/wdróż requests through scripts/deploy/deploy.sh, maps exit codes to required actions, and enforces no-bypass rules for gate and branch checks. Co-Authored-By: Claude Sonnet 4.6 --- .claude/skills/deploy/SKILL.md | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .claude/skills/deploy/SKILL.md diff --git a/.claude/skills/deploy/SKILL.md b/.claude/skills/deploy/SKILL.md new file mode 100644 index 0000000..18b1702 --- /dev/null +++ b/.claude/skills/deploy/SKILL.md @@ -0,0 +1,43 @@ +--- +name: deploy +description: Deploy, redeploy, or ship homelab services to a target node. Trigger on any request containing deploy / redeploy / wdróż / zredeployuj / ship for targets control-plane, vps, piha, solaria, or chelsty-infra. +--- + +Always invoke `scripts/deploy/deploy.sh [--dry-run] [--no-gate]` as the **sole entry point**. +Never call `deploy-control-plane.sh`, `deploy-node.sh`, or `deploy-local.sh` directly. + +## Targets + +| Target | What it deploys | +|---|---| +| `control-plane` | observer, supervisor, executor, operator-ui on VPS | +| `vps` | all VPS GitOps services (node-agent, npm, outline, joplin, ai-cluster, …) | +| `piha` | PIHA services (ha-diag-agent, node-agent, redis, …) | +| `solaria` | SOLARIA compute services | +| `chelsty-infra` | CHELSTY LTE edge node (30 s SSH timeout) | + +## Invocation + +```bash +scripts/deploy/deploy.sh # full pipeline +scripts/deploy/deploy.sh --dry-run # preflight + gate only +scripts/deploy/deploy.sh --no-gate # emergency: bypass tests +``` + +## Exit Code Handling + +| Code | Meaning | Required action | +|---|---|---| +| 0 | Success | Report: target, commit hash, gate status, verify status, elapsed time | +| 1 | Preflight failed | Fix the upstream issue (push commits, wake node, switch to master). Never bypass. | +| 2 | Gate failed | Show exactly which test/build failed. Do **not** deploy. Fix the failure first. | +| 3 | Execute failed | Show full deploy output. Ask user whether to investigate or rollback. | +| 4 | Verify failed | Show docker ps output. Discuss rollback with the user. | +| 5 | Sudo handoff | Print the exact manual command from stderr **verbatim** and stop. User must run it. | + +## Rules + +- Never pass `--no-gate` unless the user explicitly requests emergency/bypass mode. +- Never deploy uncommitted or unpushed code — preflight enforces this; do not help circumvent it. +- Canonical branch is `master` — preflight enforces this. +- For exit 5: reproduce the handoff command exactly as printed to stderr, then stop.