بنقرة واحدة
deploy
Environment-aware deployment with pre/post checks
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Environment-aware deployment with pre/post checks
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Finish feature with tests, commit, and session closure
Start feature with branch and session tracking
Interactive wizard to configure the project
System-wide code audit with 8 modules
Methodical codebase exploration and understanding
Bug fix workflow with 3-hypothesis debugging protocol
استنادا إلى تصنيف SOC المهني
| name | deploy |
| description | Environment-aware deployment with pre/post checks |
| argument-hint | ["staging|production|custom"] |
| disable-model-invocation | true |
| allowed-tools | Bash(npm:*), Bash(yarn:*), Bash(pnpm:*), Bash(bun:*), Bash(git:*), Read |
Read .claude/project.config.json to get project configuration.
Variables to use:
{packageManager} = config.commands.packageManager (default: npm){testCmd} = config.commands.test (default: npm test){buildCmd} = config.commands.build (default: npm run build){mainBranch} = config.git.mainBranch (default: main)Environment detection from $ARGUMENTS:
staging / stg → staging environmentproduction / prod → production environmentDeploy command resolution (in order of precedence):
config.commands.deploy:{env} if defined (e.g., commands.deploy:staging){packageManager} run deploy:{env} (e.g., npm run deploy:staging){packageManager} run deploy (generic, if environment-specific not found)git status --porcelain
git branch --show-current
Branch rules by environment:
| Environment | Allowed Branches | Action if Wrong |
|---|---|---|
| production | {mainBranch} only | STOP — "Production deploys must be from {mainBranch}" |
| staging | {mainBranch}, develop, feature branches | WARN — "Deploying from non-main branch: {branch}" |
| custom | Any | INFO — "Deploying from branch: {branch}" |
git fetch origin {currentBranch} 2>/dev/null
git log HEAD..origin/{currentBranch} --oneline 2>/dev/null
Check for active sessions in context/tmp/session-*.md:
{testCmd}
{buildCmd}
Before deploying, present summary:
### Deploy Confirmation
- **Environment**: {env}
- **Branch**: {current branch}
- **Last commit**: {short hash} - {message}
- **Tests**: PASSED
- **Build**: SUCCESS
- **Deploy command**: {resolved deploy command}
Proceed with deployment? (yes/no)
{resolved deploy command}
Report deployment output.
Present checklist for the user to verify:
### Post-deploy Checklist
- [ ] Application is accessible at {env} URL
- [ ] Health check endpoint responds (if applicable)
- [ ] Critical user flows work (login, main actions)
- [ ] No new errors in application logs
- [ ] Database migrations ran successfully (if applicable)
- [ ] Static assets loading correctly
- [ ] Environment variables set correctly
If deployment fails or post-deploy checks reveal issues:
### Rollback Options
**Option A: Redeploy previous version**
git log --oneline -5 # Find the previous good commit
git checkout {previous-commit}
{deploy command}
**Option B: Revert commit**
git revert HEAD
git push origin {branch}
{deploy command}
**Option C: Package manager rollback** (if supported)
{packageManager} run rollback:{env}
| Problem | Recovery |
|---|---|
| Deploy command not found | Check package.json scripts for deploy variants; ask user for the correct command |
| Permission denied | Check credentials/tokens for the target environment |
| Build succeeds but deploy fails | Check deploy target configuration (URLs, keys, regions) |
| Partial deploy (some services up, some down) | Check deploy logs for the failing service; may need manual intervention |
| DNS/SSL issues after deploy | These often need time to propagate; wait 5-10 minutes before escalating |
| Database migration failure | Do NOT retry blindly; check migration status and fix the specific migration |
## Deploy Summary
- **Environment**: {env}
- **Branch**: {branch} ({commit hash})
- **Tests**: PASSED
- **Build**: SUCCESS
- **Deploy**: SUCCESS | FAILED
- **Command used**: {deploy command}
- **Timestamp**: {date and time}
- **Post-deploy**: {checklist status}