ship

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Ship

Ship

This skill takes finished work from the working tree to production. It commits in small pieces, pushes, merges, watches checks and confirms the result is live.
此 skill 将 working tree 中已完成的工作推进至生产环境。它会分批 commit、push、merge,监控各项检查,并确认结果已上线。

Push means push

Push 即表示执行完整流程

When the user says push, ship or merge, do every step to the end. Handing a command back to the user is a finding unless it needs their credentials or their approval. A secret in a commit is always
HIGH
.
Checking the change itself runs in
verify
before this skill starts.
当用户要求 push、ship 或 merge 时,必须执行所有步骤直至完成。除非某条命令需要用户的 credentials 或 approval,否则将命令交还给用户执行就构成一项 finding。提交中包含 secret 始终属于
HIGH
。
对变更本身的检查会在此 skill 启动前由
verify
执行。

1. Check the tree

1. 检查工作区

Run
git status
and read every changed file. Name any file you did not change in this task and ask before committing it. Committing a stray file is
ship-flag-stray-files
. Scan the diff for keys, tokens, passwords and
.env
files. A committed secret is
ship-no-secrets
.
运行
git status
并阅读每个已变更的文件。明确指出任何并非你在本任务中修改的文件,并在提交前询问用户。提交无关文件属于
ship-flag-stray-files
。扫描 diff 中的 keys、tokens、passwords 和
.env
文件。提交 secret 属于
ship-no-secrets
。

2. Commit per change

2. 每个变更单独提交

Make one commit per logical change. One commit for a feature, a fix and a rename is
ship-commit-per-change
. Write every message as a Conventional Commit:
type(scope): summary
in the imperative, lowercase and with no full stop. Use
feat
,
fix
,
docs
,
refactor
,
chore
or another standard type, and mark a breaking change with
!
after the type. A message like "Remove the archive." is
ship-conventional-commits
. In a package that publishes releases, add the changeset with the change. A release-bound change with no changeset is
ship-changeset-for-packages
.
每个逻辑变更创建一个 commit。将 feature、fix 和 rename 放在同一个 commit 中属于
ship-commit-per-change
。每条提交信息都应使用 Conventional Commit 格式:
type(scope): summary
,采用祈使语气、小写形式,且末尾不加句号。使用
feat
、
fix
、
docs
、
refactor
、
chore
或其他标准 type;如果存在 breaking change,在 type 后加
!
。类似“Remove the archive.”的信息属于
ship-conventional-commits
。对于会发布版本的 package,应将 changeset 与变更一同添加。与 release 相关的变更若未包含 changeset,则属于
ship-changeset-for-packages
。

3. Push, merge and tidy

3. Push、merge 并清理

Push the branch. When asked to merge, merge it, delete the branch and switch back to the default branch. A merged branch left behind is
ship-merge-and-tidy
. Open one pull request per bug or feature. A pull request bundling three fixes is
ship-one-pr-per-bug
. A pull request that changes UI carries a screenshot. That is
ship-screenshot-ui-prs
.
Push 该 branch。当用户要求 merge 时,执行合并、删除 branch,并切换回 default branch。合并后遗留 branch 属于
ship-merge-and-tidy
。每个 bug 或 feature 创建一个 pull request。将三个 fix 打包在同一个 pull request 中属于
ship-one-pr-per-bug
。更改 UI 的 pull request 必须附带 screenshot,缺少 screenshot 属于
ship-screenshot-ui-prs
。

4. Watch the checks

4. 监控检查结果

Wait for CI and fix what fails. Reporting "pushed" while checks are red or still running is
ship-watch-checks
.
等待 CI 完成,并修复失败项。在检查仍为红色或仍在运行时报告“pushed”,属于
ship-watch-checks
。

5. Close the loop

5. 完成闭环

When the change fixes an issue, link it, close it and reply where it was raised. A fixed bug with its issue left open is
ship-close-the-loop
. When the change deploys, open the live URL or the published version and check it. "Deployed" with no look at production is
ship-confirm-live
.
当变更修复某个 issue 时,关联该 issue,将其关闭,并在 issue 提出之处回复。修复 bug 后仍让 issue 保持打开,属于
ship-close-the-loop
。当变更完成 deploy 时,打开 live URL 或已发布版本并进行检查。报告“deployed”却未检查 production,属于
ship-confirm-live
。

6. Hand back only what needs the user

6. 只交还必须由用户处理的内容

Do every step you can run yourself. Ask only for a login, a two-factor code or an approval. Say exactly which. A list of commands for the user to run is
ship-do-the-steps
.
自行完成所有能够执行的步骤。只在需要 login、two-factor code 或 approval 时询问用户,并明确说明需要哪一项。将一组命令交给用户运行属于
ship-do-the-steps
。

The pair

成对检查

Every check is a pair. The broken line sits beside the line that replaces it.
RuleBrokenReplacement
ship-flag-stray-files
git add -A
with someone else's file in the tree
The file named, then a question
ship-no-secrets
.env.local
committed
.env.local
ignored, the secret flagged for rotation
ship-commit-per-change
One commit for a feature, a fix and a renameThree commits, one per change
ship-conventional-commits
Remove the archive.
chore: remove the archive
ship-changeset-for-packages
A package fix with no changesetThe changeset in the same commit
ship-merge-and-tidy
Merged, the branch still checked outMerged, deleted, back on
main
ship-one-pr-per-bug
One pull request for three bugsThree pull requests
ship-screenshot-ui-prs
A UI pull request with no imageA screenshot in the description
ship-watch-checks
"Pushed" while CI runs"Pushed, all checks pass"
ship-close-the-loop
The fix merged, the issue openThe issue linked, closed and answered
ship-confirm-live
"Deployed""Live at the production URL, checked"
ship-do-the-steps
"Run
npm publish
when ready"
Published, or "needs your two-factor code"
每项检查都是成对出现的:问题行与替代行并排展示。
规则错误示例替换方案
ship-flag-stray-files
working tree 中包含他人的文件,却执行了
git add -A
明确指出该文件,然后询问用户
ship-no-secrets
提交了
.env.local
忽略
.env.local
,并标记该 secret 需要轮换
ship-commit-per-change
一个 commit 包含 feature、fix 和 rename创建三个 commit,每个变更一个
ship-conventional-commits
Remove the archive.
chore: remove the archive
ship-changeset-for-packages
修复 package,但未包含 changeset在同一个 commit 中加入 changeset
ship-merge-and-tidy
已合并,但 branch 仍处于检出状态已合并、已删除,并切回
main
ship-one-pr-per-bug
一个 pull request 包含三个 bug创建三个 pull request
ship-screenshot-ui-prs
UI pull request 中没有图片在描述中添加 screenshot
ship-watch-checks
CI 仍在运行时便报告“pushed”报告“pushed,所有检查均通过”
ship-close-the-loop
fix 已合并,但 issue 仍为打开状态关联并关闭 issue,同时回复说明
ship-confirm-live
仅报告“deployed”报告“已在 production URL 上线,并已检查”
ship-do-the-steps
“准备好后运行
npm publish
”
直接发布,或说明“需要你的 two-factor code”

Reporting

报告

Severity.
HIGH
is a committed secret, a stray file committed or a release with failing checks.
MEDIUM
is a bundled commit or pull request, an open issue after the fix or steps handed back that could have run.
LOW
is a message that is not a Conventional Commit, a missing screenshot or a branch left after merge.
Format. One finding per root cause, citing the step when no file applies:
file:line - [rule-id] what is wrong
step 3 - [rule-id] what is wrong
Then a
Rule | Count | Severity
summary.
Block
when any
HIGH
remains,
Approve
otherwise. Mark every check you could not watch to the end as
Not verified
.
严重程度。
HIGH
表示提交了 secret、提交了无关文件,或发布时检查失败。
MEDIUM
表示将多个变更捆绑在同一个 commit 或 pull request 中、修复后 issue 仍保持打开,或将本可自行运行的步骤交还给用户。
LOW
表示提交信息不符合 Conventional Commit、缺少 screenshot,或 merge 后遗留 branch。
格式。 每个根本原因只报告一项 finding;若不涉及文件,则引用相应步骤:
file:line - [rule-id] what is wrong
step 3 - [rule-id] what is wrong
随后给出
Rule | Count | Severity
汇总。只要仍存在
HIGH
,就标记为
Block
;否则标记为
Approve
。每项未能监控至结束的检查,都应标记为
Not verified
。