verify-gate
GitHub执行 KiwiDesk 验证门禁,包括构建、测试和代码检查。根据变更文件类型智能选择完整或简化流程,支持文档变更跳过本地重负载步骤,确保提交前质量。
Trigger Scenarios
Install
npx skills add KiwiCanopy/KiwiDesk --skill verify-gate -g -y
SKILL.md
Frontmatter
{
"name": "verify-gate",
"description": "Run KiwiDesk's full verification gate — debug build, tests, and lint (AGENTS.md §3, the Verify step), plus the release build when the change touches concurrency. Use before any commit or PR.",
"argument-hint": "[optional: file\/dir to scope the lint]"
}
Run KiwiDesk's verification gate — the Verify step AGENTS.md §3 delegates here — in order, and report the result of each step. Stop and surface the failure the moment a step fails; do not continue to later steps.
Which gate the change earns
Default to the full gate below. Two narrow exceptions:
- Read
.github/ci-ignore.txt. Never restate that list here — it is the one authority, shared with thechangesjob inci.yml, andCiPathFilterTestsis what keeps it honest. - If
git diff --name-onlyagainst the base is entirely inside that list, the Swift gate cannot be affected: nothing the build, the lint or the suite reads is in it. Skip steps 1–3. - A change entirely inside
docs/takes CI as its gate (owner, 2026-10-16): push, open the PR and arm auto-merge without a localswift testor site build. CI runs the same checks —Build, Lint & Testreadsdocs/becauseRuleCitationTestsandInstructionPinTestsresolve the paths rule files pin there, andBuild sitebuilds the pages — and a red PR cannot merge, so the local run only finds the failure a few minutes sooner while holding the machine-wide gate slot other sessions wait on. Fix a red and push again. Still runscripts/unreleased-strip --checklocally: it takes a second. - Anything else runs the full gate.
AGENTS.md,.claude/rules/**,.claude/agents/**and this skill tree are instructions every session reasons from, and a prose-only edit to them has already shipped a dangling citation; code, tests andsite/need it besides. - Additionally, when a gated change touches
site/— ordocs/beside code — run the site build:npm ci && npm run buildinsite/. It is a separate gate, not a substitute: a missing Starlight frontmatter block breaks the site and no Swift test can see it.
Say in the report which gate you ran and why.
Fast inner loop
Heavy steps queue machine-wide: scripts/gate-hook runs every
swift build / swift test whole under scripts/gate-lock,
one at a time across all worktrees, so parallel sessions stop
throttling the machine. Queue wait plus the suite can pass the
Bash tool's 10-minute cap — run the test step with
run_in_background. A step that says "gate busy" is waiting,
not hung; don't kill it or run around it.
swift buildswift test -q(one command — the old two-command split died with the #494 tail-hang fix; history and the rest of the test conventions live in.claude/rules/tests.md.-qdrops the ~20k per-test progress lines a green full run prints (#1140); failure issues and the run summary still print, and a red run is re-run--filtered for detail)scripts/lint.sh $ARGUMENTS(omit the argument to lint the repo)
scripts/lint.sh prints warnings that are not failures — only
its exit code decides.
A compiler warning reds CI even though step 1 passes (#1594,
#1596). ci.yml's Build and Test steps ratchet
(-warnings-as-errors, deprecations excepted) and step 1 above
does not, so a new warning — in Sources/ or Tests/ — is a
red PR after a green local gate.
Worse, SwiftPM re-emits nothing for a module it did not
recompile, so a warm tree hides it from a re-run. Before pushing,
check the warning the ratchet would see:
scripts/warning-gate swift build --build-tests \
-Xswiftc -warnings-as-errors \
-Xswiftc -Wwarning -Xswiftc DeprecatedDeclaration
scripts/warning-gate fails on a warning -warnings-as-errors
cannot promote — an isolation inherited from an SDK class
(#1780) — as CI's steps do.
Step 1 keeps its bare command deliberately: VerifyGateParityTests
scrapes it and requires the identical line in scripts/release.sh
and release.yml's verify job, both of which the ratchet
deliberately exempts.
Release build — conditional
swift build -c release
The release build enables the optimizer and stricter concurrency
diagnostics (e.g. non-Sendable captures in @Sendable closures)
that the debug build silently misses. CI runs it as a parallel
job on every PR (#532), and that job is a required status
check on main — scripts/protect-main.sh's CONTEXTS is
the one copy of which checks are (#487) — so a red release build
cannot merge. It is therefore not a mandatory local step.
Run it locally when the change touches concurrency, @Sendable
boundaries, or Sendable conformances — there the ~2min buys
back a PR round-trip. Otherwise skip it and let CI catch it, and
say in the report that it was skipped and why. Run it locally
anyway for anything landing without a PR, where no check gates
the push.
Report
End with a one-line PASS/FAIL summary per step, marking step 4 PASS, FAIL, or SKIPPED (with the reason). On any failure, show the relevant compiler/test/lint output and stop — the gate has not passed.
Version History
-
fdd0acb
Current 2026-10-18 15:58
新增规则:若变更完全位于 docs/ 目录,则仅使用 CI 作为验证门禁,跳过本地 Swift 测试和站点构建,以节省资源并避免占用全局锁。
- cfa7caf 2026-09-27 10:25


