/design-system:bug-fix-rhythmfrom design-system
Enforces a batch-end-verify rhythm for multi-fix sessions with numbered rules. Replaces per-fix verify cycles with a MUST-ALL checklist workflow.
Ships in design-system. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This canonical workflow contains a committed inventory of legacy assumptions. Resolve them exactly as follows; an unavailable resolution or inventory drift is ADAPTER-BLOCKED:
provider-identity: Treat historical provider names as provenance labels, never as the current runtime identity.provider-surface-path: Resolve legacy repository paths through generated views while treating ds-canonical as the semantic owner.目的:當 session 有 ≥ 2 fixes(常見 visual bug session / user 列 N 條 numbered 規則),走 batch-end-verify rhythm,而非 per-fix verify cycle waste。M32 split 後 (c)(d)(h1)(h2) 的 home。
對齊:
packages/design-system/ds-canonical/rules/meta-patterns.md M14「對話結論 AUTO integrate」強制 auto-chain:
手動 invoke:user 明言「批 fix」「一次做完」「跑完再驗」「列規則」
多代理批次工作(多包分給不同代理同時實作):流程照 packages/design-system/ds-canonical/rules/work-process.md;多代理同時動工才會撞到的原則與對照組做法見 references/multi-agent-orchestration.md。
不 invoke(對齊 current provider best practice 小修 skip):
/design-system-audit)/scan-similar-bugs(那是 fix 後 root-pattern scan;本 skill 是 fix-過程 rhythm)讀 user message:
If user 列 numbered rules(「規則 1: X / 規則 2: Y / ...」/「Q1 / Q2 / ...」/ image 標號 / bulleted list)→ 抽出 MUST-ALL checklist:
## MUST-ALL checklist(per-rule 不可下放)
- [ ] 規則 1: <verbatim user wording> — 對應 fix: <target>
- [ ] 規則 2: <verbatim user wording> — 對應 fix: <target>
- ...
- [ ] 規則 N: <verbatim user wording> — 對應 fix: <target>
禁止:
Sweep-first, edit-second(2026-07-07 治理進化軌道 2 codify):任一 fix 屬「跨切面決策」 (改名 / 詞彙統一 / 規則性改動,可寫成 grep 謂詞者)→ 先跑謂詞產出「sweep manifest」 (grep 指令 + 全庫命中清單,artifact 化),照清單做完、驗證清單歸零,才算該 fix 完成。 禁「先改直覺想到的檔、稽核抓漏再補」(anchor:2026-07-07 meta 詞彙統一三波 11→16→9 檔, 規則在散文裡 → 三輪才收斂;寫成謂詞後一個 grep 掃平)。
Read / Grep / Glob 多檔需求 → single message multi-tool-call:
✓ Good: 1 message with [Read A, Read B, Read C, Grep D, Grep E] (~2s)
✗ Bad : 5 messages sequential (~10s)
Heuristic:任何 tool call 之間無 dependency(後一個不需前一個結果) → 必 parallel。
對齊 provider-neutral best practice:「在依賴關係允許時並行執行」。
每 fix 用 Edit(不 Write,降風險)。禁止 per-fix tsc / audit cycle:
✓ Good: [Edit A] [Edit B] [Edit C] [Edit D] → final tsc + audit + visual (once)
✗ Bad : [Edit A → tsc → audit → visual] [Edit B → tsc → audit → visual] ... (5× waste)
例外:某 fix 確實依賴前一 fix 的 type 結果 → sequential 必要時可,但 verify cycle 仍 batch-end-only。
每 fix 落地前 inline 判斷:
混合 batch:surgical + P2E 一起自主完成;P2H 保持 proposal-only。禁止:把 P2H 偷渡進 engineering batch,也禁止把 P2E 轉交 user 做工程選擇。
全 fix 完成後一次性驗證:
npm run build:lib # type(tsc -b 在本 repo 不檢查 DS 原始碼)
npm run hooks:test # invariant
node scripts/visual-audit.mjs --scope=changed # pixel-quantified per M32 主句(或 --scope=component:<X>)
MUST-ALL re-check(per Phase 0 checklist):
## MUST-ALL verify report
- [x] 規則 1: ✓ verified via <tsc | audit script | pixel measurement | playwright>
- [x] 規則 2: ✓ verified via ...
- ...
- [x] 規則 N: ✓ verified via ...
禁止(原 M32(h2) claim runtime verify):
若某條無法 runtime verify → 明撤回 「規則 K:未驗證,推論而已,user 真機 verify needed」,不可假宣告。
對齊 M20 claim-verify gap(M20 是 stop-hook 機制;本 skill Phase 3 是 active workflow side)。
若 MUST-ALL N 條有 K 條無 verify trace → STOP report,先補 verify 再報 user。
若 Phase 0 抽 checklist 時改了 user wording → STOP,重抓 verbatim。
| Tool | Scope | 跟本 skill 關係 |
|---|---|---|
/scan-similar-bugs | fix 後 DS-wide root-pattern scan | 本 skill batch-end-verify 後才 chain /scan-similar-bugs |
/visual-audit | 單次視覺對齊 | Phase 3 sub-step,本 skill 包它 |
/component-quality-gate | stakeholder gate | 不重疊(stakeholder vs daily bug fix) |
stop_self_audit.sh(hook) | claim-verify gap 攔 | 本 skill Phase 3 是 active side;hook 是 passive trip-wire |
post_edit_contract_dispatcher.sh(hook,lib _pixel_quantified_audit.sh) | M32 主句:audit script(scripts/visual-audit*.mjs,canonical = visual-audit.mjs)必 pixel,寫入當下擋 | 本 skill Phase 3 跑該 audit |
3 層 防線:
bazel test //...:全 target 並行 + final report,而非 per-target sequential每次 invoke 完寫:
回填本 SKILL.md 或 references/。
2026-05-12 4 prior failures absorbed by M32 → split 後本 skill 承接 (c)(d)(h1)(h2):
具體 M32 主句(pixel-quantified)rule 仍在 meta-patterns.md,本 skill 是其 workflow side。
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
27 skills in this plugin
/canonical-reviewerReview governance changes in an isolated read-only context with explicit author identity, complete canonical evidence, and mutation detection./code-quality-auditClean code 量化稽核 — `any` 使用 / dead export / file size / long function / circular dep / magic number。補 `/design-system-audit` 只管「design canonical」的缺口。Invoke via /code-quality-audit scope=all(release / 季度)OR scope=changed(daily)OR scope=component:X(focused)。Auto-chain by `/design-system-audit --deep` Dim 27 + `/component-quality-gate` Ship phase + `/new-component` Phase 4.5。/codex-collabCoordinate an evidence-complete primary analysis with a genuinely independent peer provider, then verify and synthesize both results./codify-correctionsProcess $GOVERNANCE_STATE_DIR/user-corrections.jsonl — the Stop-hook-harvested signals of user corrections ("不是" / "不對" / "應該" / "糾正" etc.). Dedup by session + keyword, cluster by topic, and apply edits to the canonical owner(ds-canonical rule / repository memory / canonical skill reference / spec.md rationale) under the shared authority classifier. After codification archive processed entries in the same Git-owned runtime state root. Invoke when user-corrections.jsonl exceeds 40 entries(session_start hard blocker; there is no soft reminder), when the user asks, OR quarterly./codify-principleUser 提出新設計原則 → auto 5-layer artifact generation pipeline。將原則文字自動轉化為 SSOT canonical text + hook scaffold + audit dim + scaffold update + memory entry,依 rule-placement Level 1–9 taxonomy 放入正確 home。對齊 M14 + M19。Invoke when user says「我想加一條設計原則 X」「新原則 Y」「ensure X always」OR auto-recognize trigger phrase。本 skill 把 reactive markdown rule 升級成 proactive principle-to-artifact generator。/component-quality-gatePre-merge quality gate for new or significantly refactored design-system components. Walks through Spec / Code / Stories / Ship checklist (35 items) to ensure world-class discipline before a component enters `packages/design-system/src/components/`. Invoke when user says「元件做完了」「這元件可以收工了嗎」「元件 ready 嗎」「check 這個 element」「要 merge 進 DS 了」or before closing a component PR.npx claudepluginhub ajenchen/design-system --plugin design-system