gem-devops-guidelines
它能做什么
这个工具帮助你规划和审查一个计算机程序如何上线与更新。它涵盖从如何构建程序,到确保程序运行良好,以及出现问题时能够回滚等各个环节。
适用场景
- ✓规划一个新程序如何发布时。
- ✓决定如何在不中断服务的情况下更新现有程序时。
- ✓搭建自动化测试和部署流程时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/gem-devops-guidelines/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想用金丝雀发布的策略安全地发布一个新应用,该怎么做?”
每周 5 个新技能,1 分钟读完。
工作原理
该工具会分析部署步骤,例如逐步用新版本替换旧版本(滚动式),或复制一套环境(蓝绿式)。它还会检查一些重要配置,比如健康检查,以及出现问题时如何回退到之前的版本。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
DevOps Guidelines
Apply only sections relevant to workload/provider/environment/acceptance criteria. Skip Docker, Kubernetes, mobile, production, rollback, health, feature-flag, security checks when not applicable.
Deployment strategy
- Rolling (default): gradual, zero-downtime replacement.
- Blue-green: duplicate environments, atomic cutover, instant rollback, 2× infra.
- Canary: route small % first; requires traffic splitting.
Docker
- Pin base-image tags (
node:22-alpine); NEVER:latest. - Multi-stage builds + non-root user. Copy deps first for caching.
.dockerignore:node_modules,.git, tests. DefineHEALTHCHECK+ resource limits.
Kubernetes
Configure startup, readiness, liveness probes with workload-appropriate initial delays/thresholds.
CI/CD
- PR: lint -> typecheck -> unit -> integration -> preview.
- Main: build -> staging -> smoke -> production.
Health and shutdown
- Simple:
GET /health->{ "status": "ok" }. - Detailed: dependencies, uptime, version.
- Services MUST expose meaningful health + gracefully handle
SIGTERMwhen workload requires it.
Configuration
Use environment variables (Twelve-Factor), separated by environment. Validate at startup + fail fast. NEVER commit secrets or hard-code NODE_ENV=production.
Rollback
- Kubernetes:
kubectl rollout undo. - Vercel:
vercel rollback. - Docker: redeploy previous pinned image.
Feature Flags
- Lifecycle: create -> enable -> 5% -> 25% -> 50% -> 100% -> remove flag + dead code.
- Every flag MUST have owner, expiration, rollback trigger. Remove within two weeks.
Checklists
- Pre-deploy: passing tests, code review, env vars, migrations, rollback plan.
- Post-deploy: healthy, monitored, old pods terminated, outcome documented.
- Production: passing tests; no hardcoded secrets; JSON logs; meaningful health; pinned versions; validated env vars; resource limits; TLS; CVE scan; CORS; rate limiting; CSP/HSTS/X-Frame-Options; tested rollback; runbook; on-call.
- Apply security/CVE checks to executable or security-sensitive workloads.
Mobile Deployment
- EAS:
eas build:configure;eas build -p ios|android --profile preview;eas update --branch production;--auto-submit. - Fastlane: iOS
match/cert/sigh/pilot; Android Gradle/supply. - Credentials in env/secret storage, never Git. Automate iOS signing with
fastlane match; usekeytool+ Google Play App Signing for Android. - TestFlight: internal instant; external 90 days/100 testers. Google Play: internal/beta/production. Expect 1–7 days review.
- Rollback: EAS
eas update:rollback; native release -> revert build; store release -> reduce phased rollout.
常见问题
什么是“滚动部署”(rolling deployment)?
这是一种更新程序的方式,逐步用新版本替换旧版本,确保服务始终可用。
什么是“蓝绿部署”(blue-green deployment)?
这是一种技术,你有两套完全相同的环境。一套正在运行线上服务(蓝色),另一套准备好接收流量(绿色)。切换几乎是瞬间完成的,因此需要时可以快速回滚。
为什么不应该在 Docker 中使用 ':latest' 标签?
使用 ':latest' 容易造成混淆,也很难确定实际使用或回滚的是哪个版本。最好使用具体的标签,例如 'node:22-alpine'。
详情
作者的原始描述
Design or review infrastructure, deployment, CI/CD, Docker, Kubernetes, health checks, rollback, feature flags, production readiness, and mobile release workflows. Use for DevOps, platform, container, pipeline, or release tasks.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7216
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。