Deploy Fix Loop
Fix failing deployments iteratively — read error logs, fix code, push, verify. Repeat until green.
Claude CodeGeneric
---
description: Fix failing deployments iteratively — read error logs, fix code, push, verify. Repeat until green.
allowed-tools: Bash, Read, Edit, Write, Grep, Glob, Agent
---
## Context
After a git push triggers auto-deploy (Netlify, Railway, Vercel), the build or runtime may fail. This skill automates the fix cycle.
## Your Task
Iteratively fix a failing deployment until it succeeds.
### Steps
1. **Identify the deployment platform** from CLAUDE.md or ask user (Netlify, Railway, Vercel, etc.)
2. **Get the error logs:**
- Railway: `railway logs --latest` or user pastes logs
- Netlify: User pastes build log or check deploy status
- Vercel: `vercel logs` or user pastes
- If user pasted logs in chat, use those directly
3. **Diagnose the root cause** from the error output:
- Build error (TypeScript, missing import, syntax) → fix source
- Runtime error (crash on start, missing env var) → fix config
- Dependency error (missing package, version conflict) → fix package.json
- Deploy config error (wrong build command, wrong output dir) → fix deploy config
4. **Fix the code locally:**
- Apply the minimal targeted fix
- Run `npm run build` (or project's build command) to verify locally
- If local build fails, fix that first before pushing
5. **Deploy:**
```bash
git add <changed files>
git commit -m "fix: <what was broken and why>"
git push
Wait for deploy (~45-90 seconds depending on platform)
Verify deployment succeeded:
- Check deploy logs if accessible
- If /live-verify skill available and site is web-accessible, use it
- Otherwise ask user to confirm
If still failing: Read new error logs and repeat from step 3
- Maximum 3 iterations per invocation
- After 3 failures, stop and present a summary of what was tried
Guardrails
- Never force-push or skip CI hooks
- Always verify locally with
npm run buildbefore pushing - Each fix gets its own commit (not amended)
- If the error is an env var or secret, tell the user to set it manually
- If the error is unclear, ask rather than guess
Generated by /reflect-skills from 5 session patterns ```
Maintain Deploy Fix Loop?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Deploy Fix Loop on getagentictools](https://getagentictools.com/loops/dyai2025-deploy-fix-loop?ref=badge)