Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

feat(commands): Add /deploy for Cloudflare Workers

Jezd3b5a3bf3c72
diff --git a/commands/README.md b/commands/README.md
index 8e91e861..522332df 100644
--- a/commands/README.md
+++ b/commands/README.md
@@ -1,6 +1,6 @@
# Claude Code Slash Commands
-Nine slash commands for automating project exploration, planning, session workflow, knowledge capture, skill creation, and release safety with Claude Code.
+Ten slash commands for automating project exploration, planning, session workflow, knowledge capture, skill creation, deployment, and release safety with Claude Code.
## ⚠️ New Installation Method
@@ -308,6 +308,51 @@ Commands are immediately available in Claude Code after copying.
---
+### Deployment Commands
+
+#### `/deploy`
+
+**Purpose**: Automated commit, push, and deploy for Cloudflare Workers projects
+
+**Usage**: Type `/deploy` in a Cloudflare Workers project when ready to ship changes
+
+**What it does**:
+
+**Phase 1: Pre-flight Checks**
+1. Verifies wrangler.jsonc/toml exists (Cloudflare project)
+2. Runs `npm run build` (fails fast if build broken)
+3. Runs `npx tsc --noEmit` if TypeScript project
+
+**Phase 2: Commit & Push**
+4. Stages all changes
+5. Generates conventional commit message from diff
+6. Commits with Claude Code signature
+7. Pushes to remote
+
+**Phase 3: Deploy**
+8. Runs `npx wrangler deploy`
+9. Captures Worker URL from output
+
+**Phase 4: Report**
+10. Shows summary: commit hash, push destination, Worker URL
+11. Reports any warnings from wrangler
+
+**Time savings**: 2-3 minutes per deploy (manual steps → single command)
+
+**When to use**:
+- Ready to deploy Cloudflare Worker changes
+- Want automated commit message generation
+- Need consistent deploy workflow
+
+**When to skip**:
+- Non-Cloudflare projects (Vercel, Firebase, etc.)
+- Need manual control over commit message
+- Want to review changes before committing
+
+**Output**: Deploy summary with commit, push, and Worker URL
+
+---
+
## Requirements
**Planning Commands**:
@@ -428,19 +473,29 @@ Release project? → /release → [Safety checks + GitHub release]
- ✅ Auto-fix capabilities
- ✅ GitHub release creation (optional)
+**`/deploy`**:
+- ✅ Cloudflare Workers project detection
+- ✅ Pre-flight build and TypeScript checks
+- ✅ Automatic conventional commit message generation
+- ✅ Git stage, commit, and push
+- ✅ Wrangler deploy execution
+- ✅ Worker URL extraction and reporting
+- ✅ Comprehensive error handling
+
## Total Time Savings
-**40-70 minutes per project lifecycle**:
+**45-75 minutes per project lifecycle**:
- Exploration: 10-15 minutes (explore-idea)
- Planning: 5-7 minutes (plan-project)
- Feature additions: 7-10 minutes each (plan-feature)
- Session cycles: 3-5 minutes each (wrap + resume)
- Knowledge capture: 5-15 minutes per session (reflect)
+- Deployments: 2-3 minutes each (deploy)
- Release safety: 10-15 minutes (release)
- Workflow navigation: Instant (workflow)
---
-**Version**: 5.0.0
+**Version**: 5.1.0
**Last Updated**: 2025-12-12
**Author**: Jeremy Dawes | Jezweb
diff --git a/commands/deploy.md b/commands/deploy.md
new file mode 100644
index 00000000..879d7adc
--- /dev/null
+++ b/commands/deploy.md
@@ -0,0 +1,138 @@
+# Deploy
+
+Commit, push, and deploy Cloudflare Worker in one automated workflow.
+
+---
+
+## Your Task
+
+Execute the full deploy pipeline for a Cloudflare Workers project. Run all steps automatically and report results at the end.
+
+---
+
+## Phase 1: Pre-flight Checks
+
+**1a. Verify this is a Cloudflare project**
+
+```bash
+ls wrangler.jsonc wrangler.toml wrangler.json 2>/dev/null | head -1
+```
+
+If no wrangler config found:
+```
+❌ Not a Cloudflare Workers project (no wrangler.jsonc/toml/json found)
+```
+Stop here.
+
+**1b. Check for changes**
+
+```bash
+git status --porcelain
+```
+
+If no output (nothing to commit), skip to Phase 3 (deploy only).
+
+**1c. Build**
+
+```bash
+npm run build
+```
+
+If build fails, stop and report the error.
+
+**1d. TypeScript check (if applicable)**
+
+Only if `tsconfig.json` exists:
+
+```bash
+npx tsc --noEmit
+```
+
+If TypeScript check fails, stop and report the error.
+
+---
+
+## Phase 2: Commit & Push
+
+**2a. Stage all changes**
+
+```bash
+git add -A
+```
+
+**2b. Generate commit message**
+
+Analyze the changes with `git diff --cached --stat` and generate an appropriate conventional commit message:
+
+- `feat:` for new features
+- `fix:` for bug fixes
+- `refactor:` for code changes that don't add features or fix bugs
+- `docs:` for documentation
+- `chore:` for maintenance tasks
+
+**2c. Commit**
+
+```bash
+git commit -m "$(cat <<'EOF'
+[generated message]
+
+🤖 Generated with [Claude Code](https://claude.com/claude-code)
+
+Co-Authored-By: Claude Opus 4.5 <[email protected]>
+EOF
+)"
+```
+
+**2d. Push**
+
+```bash
+git push
+```
+
+If no remote configured, report error and stop.
+
+---
+
+## Phase 3: Deploy
+
+```bash
+npx wrangler deploy
+```
+
+Capture the output, especially the Worker URL.
+
+---
+
+## Phase 4: Report
+
+Present a summary:
+
+```
+✅ Deploy Complete
+
+📝 Commit: [hash] [message]
+📤 Pushed to: [remote/branch]
+🚀 Deployed: https://[worker-name].[account].workers.dev
+
+[Any warnings from wrangler output]
+```
+
+If any phase failed:
+
+```
+❌ Deploy Failed
+
+Phase: [which phase]
+Error: [error message]
+
+[Suggestions for fixing]
+```
+
+---
+
+## Edge Cases
+
+- **No changes to commit**: Skip Phase 2, just deploy
+- **Build script missing**: Skip build step, warn user
+- **No remote**: Report error, suggest `git remote add origin <url>`
+- **Wrangler not installed**: Report error, suggest `npm install -D wrangler`