Skip to content
Development
Command

/safe-deploy

Deploy with safety checks and automatic testing

From plugin
claude-code-engineering
1.1k11 skills16 agents11 commands
Install
$ npx -y skills add huangjia2019/claude-code-engineering --agent claude-code

How 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.md
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: true

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]
Read more
Ships withclaude-code-engineering

This repository demonstrates how to use Claude Code to do real engineering work, not just writing code. 本项目是极客时间专栏 《Claude Code 工程化实战》 的官方配套示例仓库,目标就是: 👉 把 Claude Code 从“对话式编码工具”,变成 可设计、可复用、可治理的工程系统。

Get the whole plugin, auto-invoked
Stats
1,050
Stars
0
Views
373
Forks
Active
Maintenance
JavaScript
Language
16d ago
Last commit
6mo ago
Created

Repo: huangjia2019/claude-code-engineering