Deploy
Purpose
Deploy services to target environments via CI/CD workflow. Handles environment selection, deployment locking to prevent concurrent deploys, and triggers deployment with appropriate options.
When to Use
- •Deploying changes to staging or production
- •Releasing new features after PR merge
- •Hotfix deployments
- •Rollback to previous version
Quick Reference
- •Setup:
/deploy configure(run once during framework setup) - •Usage:
/deploy(uses saved config) - •Update:
/deploy learn(re-analyze deployment setup) - •Config:
.claude/skills/deploy.yaml
Modes
| Mode | Trigger | Purpose |
|---|---|---|
| configure | /deploy configure | Auto-detect deployment commands, environments |
| learn | /deploy learn | Update config from recent deployments |
| deploy | /deploy | Deploy to environment (default) |
Deployment Flow
┌─────────────────────────────────────────────────────────────────────┐ │ 1. SELECT ENV → 2. CHECK LOCK → 3. DEPLOY → 4. VERIFY │ └─────────────────────────────────────────────────────────────────────┘
Step 1: Select Environment
Ask the user which environment to deploy to (configured via configure).
Step 2: Check Deployment Lock
Before deploying, check if another deployment is in progress:
# Example: GitHub Actions gh run list --workflow=deploy.yaml --status=in_progress --json databaseId,status # Example: Check for queued gh run list --workflow=deploy.yaml --status=queued --json databaseId,status
Lock Rules:
- •If deployment is
in_progress→ STOP, wait for completion - •If deployment is
queued→ STOP, wait or cancel - •If no active deployments → PROCEED
Step 3: Trigger Deployment
Use the configured DEPLOY_COMMAND from .claude/skills/deploy.yaml:
# Examples based on platform: # GitHub Actions gh workflow run deploy.yaml -f environment=staging # Kubernetes kubectl apply -f k8s/staging/ # Task runner task deploy:staging # npm script npm run deploy -- --env staging
Step 4: Monitor and Verify
# Watch workflow (GitHub Actions) gh run watch # Check status gh run list --workflow=deploy.yaml --limit=1 # After completion, verify deployment # (Use deploy-verify skill)
Configuration
Config Location
Config path depends on how the plugin was installed:
| Plugin Scope | Config File | Git |
|---|---|---|
| project | .claude/skills/deploy.yaml | Committed (shared) |
| local | .claude/skills/deploy.local.yaml | Ignored (personal) |
| user | .claude/skills/deploy.local.yaml | Ignored (personal) |
Precedence when reading (first found wins):
- •
.claude/skills/deploy.local.yaml - •
.claude/skills/deploy.yaml - •Skill defaults
Config Fields
Configured via wizard during /deploy configure:
| Variable | Description | Example |
|---|---|---|
DEPLOY_COMMAND | Command to deploy | gh workflow run deploy.yaml |
ENVIRONMENTS | Available environments | staging,production |
DEPLOY_BRANCH | Branch for production | main |
Deployment Scenarios
Standard Deployment (Most Common)
# Using configured command
${DEPLOY_COMMAND} -f environment=staging
Force Rebuild
When you need to rebuild (e.g., dependency updates):
${DEPLOY_COMMAND} -f environment=staging -f force_build=true
Deploy Specific Version
Rollback or deploy specific commit:
${DEPLOY_COMMAND} -f environment=staging -f version=<commit-sha>
Lock Management
Check Lock Status
# GitHub Actions example IN_PROGRESS=$(gh run list --workflow=deploy.yaml --status=in_progress --json databaseId | jq length) QUEUED=$(gh run list --workflow=deploy.yaml --status=queued --json databaseId | jq length) if [ "$IN_PROGRESS" -gt 0 ] || [ "$QUEUED" -gt 0 ]; then echo "Deployment locked: $IN_PROGRESS in progress, $QUEUED queued" else echo "No active deployments - safe to deploy" fi
Cancel Stuck Deployment
If a deployment is stuck (use with caution):
# Get the run ID gh run list --workflow=deploy.yaml --status=in_progress --json databaseId # Cancel the run gh run cancel <run-id>
Post-Deployment
After deployment completes:
- •Verify with deploy-verify skill:
/deploy-verify - •Check service health
- •Monitor logs for errors
Automation
See skill.yaml for the full deployment procedure.
See sharp-edges.yaml for common deployment pitfalls.
Related Skills
| Skill | Relationship |
|---|---|
deploy-verify | Verify deployment success after this skill runs |
debugger | Debug if deployment has issues |