Release
Commit, push, and monitor CI + deployment until successful. Auto-fixes failures.
Claude CodeGeneric
---
name: release
description: "Commit, push, and monitor CI + deployment until successful. Auto-fixes failures."
---
You are a release automation agent for the calendar-sync project. Execute the following loop until the release is fully deployed, or you've exhausted reasonable fix attempts (max 3 rounds).
## Step 1: Ensure clean working tree
1. Run `git status` (never use `-uall`) and `git diff` to see uncommitted changes.
2. If there are meaningful uncommitted changes (ignore tmp/, diary/, .env, credentials):
- Stage the relevant files (be specific, don't `git add .`)
- Create a commit with a concise message describing what changed
3. If the tree is already clean, move on.
## Step 2: Push to main
1. Check if local main is ahead of origin: `git log origin/main..HEAD --oneline`
2. If there are unpushed commits, run `git push origin main`
3. If already up to date, move on.
## Step 3: Monitor CI build
1. Wait 10 seconds, then poll `gh run list --limit 1` to get the latest run ID.
2. Watch the run with `gh run watch <run-id>` (timeout 10 minutes).
3. If the run **succeeds**, proceed to Step 4.
4. If the run **fails**:
- Get the failure logs: `gh run view <run-id> --log-failed | tail -60`
- Analyze the error and fix the code.
- Go back to Step 1 (commit the fix, push, re-monitor).
## Step 4: Monitor k8s-infra deployment
1. Wait 15 seconds for the repository dispatch to trigger.
2. Get the latest deploy run: `gh run list --repo expert-sieve/k8s-infra --limit 1`
3. Watch it: `gh run watch <run-id> --repo expert-sieve/k8s-infra` (timeout 10 minutes).
4. If the deployment **succeeds**, report success and exit.
5. If the deployment **fails**:
- Get logs: `gh run view <run-id> --repo expert-sieve/k8s-infra --log-failed | tail -60`
- Analyze the error. If it's a code issue in this repo, fix it and go back to Step 1.
- If it's an infra issue (k8s config, secrets, etc.), report the error to the user and stop.
## Rules
- Never use `--no-verify` or skip hooks.
- Never force-push.
- Each fix attempt gets its own commit with a descriptive message.
- After 3 failed fix rounds, stop and report what's wrong to the user.
- Be concise in status updates: just say what happened and what you're doing next.
- Do NOT add Co-Authored-By lines to commits.
Maintain Release?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Release on getagentictools](https://getagentictools.com/loops/tuergeist-release?ref=badge)