/safe-deploy
Deploy with safety checks and automatic testing
$ npx -y skills add huangjia2019/claude-code-engineering --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/safe-deploy
Context preview
What this command does when you run it.
Deploy with safety checks and automatic testing
Command definition
safe-deploy.mddescription: Deploy with safety checks and automatic testing
argument-hint: [environment: staging | production]
allowed-tools: Bash(npm:*), Bash(git:*), Read
hooks:
- event: PreToolUse
matcher: Bash
command: |
if [[ "$TOOL_INPUT" == *"production"* ]] && [[ "$TOOL_INPUT" == *"deploy"* ]]; then
echo "⚠️ Production deployment detected - extra verification required"
fi
- event: PostToolUse
matcher: Bash
command: echo "✓ Step completed at $(date +%H:%M:%S)"
once: trueDeploy 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]
Read more
description: Deploy with safety checks and automatic testing
argument-hint: [environment: staging | production]
allowed-tools: Bash(npm:*), Bash(git:*), Read
hooks:
- event: PreToolUse
matcher: Bash
command: |
if [[ "$TOOL_INPUT" == *"production"* ]] && [[ "$TOOL_INPUT" == *"deploy"* ]]; then
echo "⚠️ Production deployment detected - extra verification required"
fi
- event: PostToolUse
matcher: Bash
command: echo "✓ Step completed at $(date +%H:%M:%S)"
once: trueDeploy 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]
This repository demonstrates how to use Claude Code to do real engineering work, not just writing code. 本项目是极客时间专栏 《Claude Code 工程化实战》 的官方配套示例仓库,目标就是: 👉 把 Claude Code 从“对话式编码工具”,变成 可设计、可复用、可治理的工程系统。
Other commands on claude-code-engineering.
- /commit
Quick git commit with auto-generated or specified message
Open command - /explain
Explain code in simple, beginner-friendly terms
Open command - /log
Show recent git history with summary
Open command - /status
Show git status with helpful context
Open command - /review
对代码进行全面审查,输出结构化报告
Open command - /todo
Add a TODO comment to code with optional priority and assignee
Open command

