pre-ship-gate
它能做什么
在生产环境中,检查软件更新是否真正成功应用,而不是仅仅相信部署工具显示的成功信息。它确保用户实际使用的是正确的版本。
适用场景
- ✓在把新版本推送到生产环境之前。
- ✓当更新已经完成,但用户仍然反馈有问题的时候。
- ✓在部署之前,确认配置和依赖项是否正确的时候。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/pre-ship-gate/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请确认生产环境中正在运行的版本,就是我计划部署的那个版本。我想部署的版本来自提交 abc123。”
每周 5 个新技能,1 分钟读完。
工作原理
首先,它会检查安全部署所需的各项条件是否满足,比如数据库迁移是否准备好、功能开关是否已启用。部署完成后,它会直接向线上系统确认当前真正生效的是哪个版本。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Pre-Ship Gate
Overview
Most bad deploys do not fail loudly. The pipeline goes green, the CLI prints "deployed", and the old or broken version is still what users hit. This skill is the gate you run right before a production deploy and right after, so an agent stops trusting deploy output and starts confirming what is actually live. It exists because "the deploy command exited 0" and "the new version is serving traffic" are two different facts, and agents routinely confuse them.
When to Use This Skill
- Use before running any command that pushes to a production or staging environment.
- Use when an agent is about to report "shipped", "deployed", or "live".
- Use when a deploy reported success but users still see the old behavior.
- Use when a release involves database migrations, feature flags, or a staged rollout.
How It Works
The gate has three phases. Do not skip to phase 3.
Phase 1: Pre-flight (before the deploy runs)
Walk the silent failure catalog. These are the modes that let a deploy "succeed" while production stays broken. For each one, confirm it or flag it. Do not assume.
- Migrations: Are schema migrations part of this release, and will they run against the target before the new code serves traffic? A deploy that ships code expecting a column that does not exist yet fails silently for users, not for the pipeline.
- Feature flags: Is the flag that gates this change actually enabled in the target environment, not just in dev? Shipped code behind an off flag looks like a no-op deploy.
- Build cache / stale assets: Could a cached build or CDN layer serve the previous bundle after deploy? Confirm the artifact hash or asset fingerprint changed.
- Release pointer: Does the deploy update the symlink, active revision, or traffic pointer, or does it only upload the new build? Uploading is not releasing.
- Staged rollout / canary: If traffic is staged, is it stuck at 0 percent or waiting on a manual promote? A canary that never promotes is not a deploy.
- Env and secrets: Are the env vars and secrets the new code needs present in the target, not just locally? Missing config surfaces as runtime errors, not deploy errors.
Phase 2: Run the deploy
The human or the deploy tooling runs the actual command. This skill does not execute the production deploy itself. It gates it.
Phase 3: Verify live (before saying "shipped")
Confirm the running system, not the deploy log.
- Fetch the live version or revision identifier from the running service and compare it to the one you intended to ship.
- Hit a health or status endpoint and confirm it returns the expected version, not just HTTP 200.
- Tail production logs for the first errors after cutover.
- Only after the live revision matches the intended revision may you report "shipped". If it does not match, report the mismatch, not success.
Examples
Example 1: Verifying the live revision instead of trusting the deploy log
# You intended to ship this commit
INTENDED="$(git rev-parse --short HEAD)"
# Ask the running service what it is actually serving
LIVE="$(curl -fsS https://your-service.example.com/health | jq -r '.revision')"
if [ "$INTENDED" = "$LIVE" ]; then
echo "Live revision $LIVE matches intended $INTENDED: verified shipped."
else
echo "MISMATCH: intended $INTENDED but live is $LIVE. Do not report shipped."
fi
Example 2: Pre-flight verdict format an agent can emit
PRE-SHIP GATE, verdict: HOLD
- Migrations: 1 pending (add_users_status_col): NOT yet applied to prod. BLOCK.
- Feature flags: new_checkout flag is OFF in prod. Enabling required post-deploy.
- Build assets: new bundle hash confirmed (a1b2c3 != previous 9f8e7d). OK.
- Release pointer: deploy updates active symlink. OK.
- Rollout: canary at 10%, manual promote required. NOTE.
- Env/secrets: STRIPE_KEY present in prod. OK.
Reason for HOLD: run migration add_users_status_col before cutover, or the
new code will 500 on /orders.
Best Practices
- ✅ Treat "the command exited 0" and "the new version is live" as separate facts, and verify the second one.
- ✅ Emit an explicit verdict (SHIP / HOLD) with the failing item named, not a vague "looks good".
- ✅ Compare a live revision identifier against the intended one after every deploy.
- ✅ Name the specific silent failure mode you are worried about, so a human can override with context.
- ❌ Do not report "shipped" from deploy output alone.
…
常见问题
为什么不能只相信部署工具显示的“成功”信息?
因为部署工具可能显示已经成功完成,但用户看到的仍然可能是旧版本或有问题的版本。这个系统会检查线上真正运行的内容。
什么是“静默故障”?
指的是那些让部署看起来已经成功,但对用户来说软件仍然无法正常使用的问题。例如,新代码没有被功能开关激活,或者数据库迁移没有真正执行。
这个系统会替我执行部署吗?
不会。它不负责执行部署,而是在部署前后充当把关人,检查各个环节,确保部署顺利完成。
详情
作者的原始描述
A ship gate that runs before any production deploy: checks the silent failure modes that make a deploy 'succeed' while prod stays broken, then verifies the live revision instead of trusting deploy output.
热度
- GitHub 星标
- 48k
- 排名
- #5489
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。