Skip to main content
ClaudeWave
Slash Command828 estrellas del repoactualizado 13d ago

safe-deploy

The safe-deploy command automates application deployment with mandatory safety validations including test execution, uncommitted change verification, and branch confirmation. Use this to deploy to staging or production environments while preventing unsafe deployments, such as pushing production changes from non-main branches or skipping test requirements. The command enforces pre-deployment checks and provides detailed deployment status reporting.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/huangjia2019/claude-code-engineering/HEAD/05-Commands/projects/02-advanced-commands/.claude/commands/safe-deploy.md -o ~/.claude/commands/safe-deploy.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

safe-deploy.md

Deploy the application to: $ARGUMENTS

## Pre-deployment Checks

Before deploying, verify:
1. All tests pass (`npm test`)
2. No uncommitted changes (`git status`)
3. On correct branch (main/master for production)

## Deployment Steps

### For Staging ($ARGUMENTS = "staging")
1. Run tests
2. Build the application
3. Deploy to staging environment
4. Verify deployment health

### For Production ($ARGUMENTS = "production")
1. Run full test suite
2. Check that staging is healthy
3. Create a git tag for the release
4. Build and deploy
5. Verify production health
6. Notify team

## Safety Rules

- NEVER deploy to production from a non-main branch
- ALWAYS run tests before deploying
- If tests fail, STOP and report

## Output

```
## Deployment Report

Environment: [staging/production]
Status: [success/failed]
Time: [duration]

### Steps Completed
✓ Tests passed
✓ Build successful
✓ Deployed
✓ Health check passed

### Next Steps
[Any follow-up actions needed]
```