deployment-pipeline-design
它能做什么
这个工具可以帮你设计一份跨不同环境(比如测试环境和生产环境)更新软件的计划。它会确保更新通过检查和审批来安全完成,从而避免出现问题。
适用场景
- ✓规划新软件的更新方式时。
- ✓在更新前设置安全检查时。
- ✓决定如何进行灰度更新(比如先面向少数用户发布)时。
技能链接
https://github.com/wshobson/agents/blob/main/plugins/cicd-automation/skills/deployment-pipeline-design/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想规划一个容器化 Web 应用更新到 Kubernetes 的方案,在上线生产环境前需要人工审批,并加入安全检查。”
每周 5 个新技能,1 分钟读完。
工作原理
你只需描述你的应用、它的运行位置,以及你希望的更新方式。工具会建议如何组织各个步骤、需要哪些检查,以及适合的更新策略,确保更新既安全又可靠。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Deployment Pipeline Design
Architecture patterns for multi-stage CI/CD pipelines with approval gates, deployment strategies, and environment promotion workflows.
Purpose
Design robust, secure deployment pipelines that balance speed with safety through proper stage organization, automated quality gates, and progressive delivery strategies. This skill covers both the structural design of pipeline architecture and the operational patterns for reliable production deployments.
Input / Output
What You Provide
- Application type: Language/runtime, containerized or bare-metal, monolith or microservices
- Deployment target: Kubernetes, ECS, VMs, serverless, or platform-as-a-service
- Environment topology: Number of environments (dev/staging/prod), region layout, air-gap requirements
- Rollout requirements: Acceptable downtime, rollback SLA, traffic splitting needs, canary vs blue-green preference
- Gate constraints: Approval teams, required test coverage thresholds, compliance scans (SAST, DAST, SCA)
- Monitoring stack: Prometheus, Datadog, CloudWatch, or other metrics sources used for automated promotion decisions
What This Skill Produces
- Pipeline configuration: Stage definitions, job dependencies, parallelism, and caching strategy
- Deployment strategy: Chosen rollout pattern with annotated configuration (canary weights, blue-green switchover, rolling parameters)
- Health check setup: Shallow vs deep readiness probes, post-deployment smoke test scripts
- Gate definitions: Automated metric thresholds and manual approval workflows
- Rollback plan: Automated rollback triggers and manual runbook steps
When to Use
- Design CI/CD architecture for a new service or platform migration
- Implement deployment gates between environments
- Configure multi-environment pipelines with mandatory security scanning
- Establish progressive delivery with canary or blue-green strategies
- Debug pipelines where stages succeed but production behavior is wrong
- Reduce mean time to recovery by automating rollback on metric degradation
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Troubleshooting
Health check passes in pipeline but service is unhealthy in production
The pipeline health check is hitting a shallow /ping endpoint that returns 200 even when the database is unreachable. Use a deep readiness check that verifies actual dependencies (see Health Checks section above).
Canary deployment never promotes to 100%
Argo Rollouts requires a valid AnalysisTemplate to auto-promote. If the Prometheus query returns no data (e.g., metric name changed), the analysis stays inconclusive and promotion stalls. Add inconclusiveLimit so the rollout fails fast rather than hanging:
spec:
metrics:
- name: error-rate
failureCondition: "result[0] > 0.05"
inconclusiveLimit: 2 # fail after 2 inconclusive results, not hang indefinitely
provider:
prometheus:
query: |
sum(rate(http_requests_total{status=~"5.."}[2m]))
/ sum(rate(http_requests_total[2m]))
Staging deploy succeeds but production job never starts
Check that production environment protection rules are configured — a missing reviewer assignment means the approval gate waits indefinitely with no notification. In GitHub Actions, ensure Required reviewers is set to an existing user or team in Settings → Environments → production.
Docker layer cache busted on every run causing slow builds
If COPY . . appears before dependency installation, any source file change invalidates the dependency layer. Reorder to copy dependency manifests first:
# Good: dependencies cached separately from source code
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
Rollback leaves database migrations applied to old code
A service rollback without a migration rollback causes schema/code mismatch errors. Always make migrations backward-compatible (additive only) for at least one release cycle, and keep undo scripts versioned alongside the migration:
# migrations/V20240315__add_nullable_column.sql (forward)
# migrations/V20240315__add_nullable_column.undo.sql (backward)
…
常见问题
更新已经通过了检查,为什么系统还是出现问题?
检查可能只是走个形式。请确保检查真正验证了系统是否正常工作,例如检查重要的依赖项,而不只是看系统有没有响应。
怎样避免更新速度太慢、导致延误?
把软件构建流程整理好,将经常变动的部分(代码)与很少变动的部分(依赖项)分开。这样流程中的部分环节就能被复用,速度也会更快。
如果更新失败,需要回滚到之前的版本怎么办?
一定要提前准备好回滚方案,数据库尤其如此。请确保数据库的变更可以撤销,或者能与旧版本的代码兼容。
详情
作者的原始描述
Design multi-stage CI/CD pipelines with approval gates, security checks, and deployment orchestration. Use this skill when designing zero-downtime deployment pipelines, implementing canary rollout strategies, setting up multi-environment promotion workflows, or debugging failed deployment gates in CI/CD.
repo: wshobson/agents
热度
- GitHub 星标
- 41k
- 排名
- #6653
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …