skills/forge-deploy/SKILL.md
[writes] Trigger deployment to staging, production, or preview environments. Use when a PR is merged and ready to deploy, when you need to check deployment status, or when rolling back a broken deployment. Supports ArgoCD, Helm, kubectl, docker-compose.
npx skillsauth add quantumbitcz/dev-pipeline forge-deployInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You manage deployments to staging, production, and preview environments. You read deployment configuration from the project's forge.local.md and execute the appropriate deployment method.
See shared/skill-contract.md for the standard exit-code table.
Before any action, verify:
git rev-parse --show-toplevel 2>/dev/null. If fails: report "Not a git repository. Navigate to a project directory." and STOP..claude/forge.local.md exists. If not: report "Forge not initialized. Run /forge-init first." and STOP..claude/forge.local.md contains a deploy section. If not: display the helpful configuration template (see Instructions section) and STOP.The user's argument (everything after /forge-deploy) determines the action:
| Command | Action |
|---------|--------|
| /forge-deploy staging | Deploy to staging environment |
| /forge-deploy production | Deploy to production (requires confirmation) |
| /forge-deploy preview | Deploy preview environment for current PR |
| /forge-deploy rollback | Rollback to previous version |
| /forge-deploy status | Check deployment status |
| /forge-deploy --dry-run staging | Show what would happen without executing |
| /forge-deploy (no args) | Show deployment config and available environments |
If --dry-run is present in the arguments, execute in dry-run mode: resolve all variables, display the full command that would be executed, show the confirmation prompt (if applicable), but do NOT execute the command. Safety guards (Section 5) still apply in dry-run mode — display any warnings that would be shown during a real deploy. Display: "DRY RUN — no changes made." If --dry-run is used without specifying an environment, treat it as /forge-deploy (show configuration).
Read deployment config from .claude/forge.local.md under the deploy key:
deploy:
method: argocd # argocd | helm | kubectl | compose
staging:
command: "gh workflow dispatch deploy.yml -f environment=staging"
post_deploy_check: "curl -sf https://staging.example.com/health"
production:
command: "gh workflow dispatch deploy.yml -f environment=production"
require_confirmation: true
post_deploy_check: "curl -sf https://app.example.com/health"
preview:
command: "gh workflow dispatch deploy.yml -f environment=preview -f pr={pr_number}"
rollback:
command: "gh workflow dispatch rollback.yml -f environment={environment}"
status:
command: "gh run list --workflow=deploy.yml --limit=5"
If no deploy config is found, display a helpful message:
No deployment configuration found.
To enable /forge-deploy, add a `deploy` section to your `.claude/forge.local.md`:
deploy:
method: argocd
staging:
command: "gh workflow dispatch deploy.yml -f environment=staging"
production:
command: "gh workflow dispatch deploy.yml -f environment=production"
require_confirmation: true
preview:
command: "gh workflow dispatch deploy.yml -f environment=preview -f pr={pr_number}"
rollback:
command: "gh workflow dispatch rollback.yml -f environment={environment}"
status:
command: "gh run list --workflow=deploy.yml --limit=5"
/forge-deploy stagingdeploy.staging.command from configpost_deploy_check is configured, wait 10 seconds then run the health check (retry up to 3 times with 10s intervals)/forge-deploy productiondeploy.production from configrequire_confirmation: true (default for production), display a confirmation prompt to the user:
PRODUCTION DEPLOYMENT
Version: {version/commit}
Branch: {current branch}
Last staging deploy: {if known from status}
Type "yes" to confirm production deployment.
Do NOT proceed until the user explicitly confirms with "yes". Any other response aborts.post_deploy_check is configured, wait 15 seconds then run the health check (retry up to 5 times with 15s intervals)/forge-deploy previewdeploy.preview.command from configgh pr view --json number -q .number to get the PR number for the current branch{pr_number} in the command with the actual PR number/forge-deploy rollbackdeploy.rollback.command from config{environment} in the command with the target environment/forge-deploy statusdeploy.status.command from configRecent Deployments:
| # | Environment | Status | Version | Time |
|---|-------------|--------|---------|------|
| 1 | staging | success | abc123 | 2h ago |
| 2 | production | success | def456 | 1d ago |
If deploy.method is specified, adjust behavior accordingly:
argocd app sync or GitHub workflow dispatch. After deploy, check sync status with argocd app get <app> -o json if argocd CLI is available.helm upgrade --install. Verify release status with helm status <release> after deploy.kubectl apply or kubectl set image. Verify rollout with kubectl rollout status.docker compose up -d. Verify with docker compose ps.git status --porcelain first. If there are uncommitted changes, warn the user and suggest committing first.Replace these placeholders in commands before execution:
| Placeholder | Value |
|-------------|-------|
| {pr_number} | Current PR number from gh pr view |
| {environment} | Target environment name |
| {version} | Current git tag or short SHA |
| {branch} | Current git branch name |
| {commit} | Full commit SHA |
| Condition | Action |
|-----------|--------|
| Prerequisites fail | Report specific error message and STOP |
| Deploy command fails | Report the error output and suggest troubleshooting steps |
| Health check fails | Report the failure but do not automatically rollback (user decides) |
| Missing gh CLI | Suggest installing GitHub CLI if commands use gh |
| Missing config key | Report which config key is missing and show the expected format |
| Production deploy without confirmation | Never proceed -- abort if confirmation is not "yes" |
| Dirty working tree | Warn user and suggest committing or stashing first |
| Deploy from feature branch to production | Warn that code is not on the default branch |
/forge-recover rollback -- Rollback a deployment or pipeline changes/forge-run -- Full pipeline that may include deployment at the SHIPPING stage/forge-verify -- Quick build + lint + test check before deploying/forge-docs-generate -- Generate documentation before or alongside deploymentdevelopment
[writes] Build, fix, deploy, review, or modify code in this project. Universal entry for the forge pipeline. Auto-bootstraps on first run; brainstorms before planning when given a feature description. Use when you want to take any productive action: implementing features, fixing bugs, reviewing branches, deploying, committing, running migrations.
tools
[writes] Manage forge state and configuration: recovery, abort, config edits, session handoff, automations, playbooks, output compression, knowledge graph maintenance. Use when you need to recover from broken pipeline state, edit settings, or manage long-lived state.
development
[writes] Create, list, show, resume, or search forge session handoffs. Use when context is getting heavy and you want to transfer a forge run or conversation into a fresh Claude Code session, or to resume from a prior handoff artefact. Subcommands - no args (write), list, show, resume, search.
development
[writes] Manage the Neo4j knowledge graph. Subcommands: init, rebuild (writes); status, query <cypher>, debug (read-only). Requires Docker. No default — an explicit subcommand is required. Use when setting up the graph for the first time, rebuilding after major refactors, checking graph health, or running ad-hoc Cypher diagnostics.