cupertino-handbook-check
Use when the user wants to compare new or changed work against an existing domain handbook at .cupertino/DOMAIN-handbook.md (one file per domain) to find divergence. Trigger on 'does this comply with our handbook', 'audit these files against the code handbook', 'check this against the code handbook'. Requires a handbook previously produced by cupertino-handbook-draft. Not for repo-wide conventions written in CLAUDE.md or .claude/house-rules.md — use befund:befund-lint-audit for those. Read-only — never modifies target files. Zero findings is a valid, expected outcome, not something to work around.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- cupertino-handbook-check
- description
- Use when the user wants to compare new or changed work against an existing domain handbook at .cupertino/DOMAIN-handbook.md (one file per domain) to find divergence. Trigger on 'does this comply with our handbook', 'audit these files against the code handbook', 'check this against the code handbook'. Requires a handbook previously produced by cupertino-handbook-draft. Not for repo-wide conventions written in CLAUDE.md or .claude/house-rules.md — use befund:befund-lint-audit for those. Read-only — never modifies target files. Zero findings is a valid, expected outcome, not something to work around.
03 SKILL.md 正文
Check files against an existing handbook, one rule at a time, verifying every finding independently. Never touch the target files.
Steps
-
Parse the domain, confirm
.cupertino/<domain>-handbook.mdexists (if not, point the user tocupertino-handbook-draft). -
Determine target files: use the files the user named, or if they asked for a check but didn't say what changed, ask whether to run a full-project scan rather than silently picking a scope for them.
-
Mark the check as active so the write/no-mutation guarantees below are enforced at the tool-call layer, not just by convention:
python3 -B "${CLAUDE_PLUGIN_ROOT}/scripts/state.py" set handbook-check-active -
Read the handbook and extract its rule list (one
{dimension, rule, sourceMode}per handbook entry;sourceModeisanalyzedfor a convention the repo actually shows,scaffoldedfor an invented default). Also read.claude/cupertino.local.mdif it exists:enforceScaffoldedistrueonly when its frontmatter hashandbook:withenforceScaffolded: true; otherwisefalse. Never infer it. -
Run the check via the Workflow tool:
Workflow({ scriptPath: "${CLAUDE_PLUGIN_ROOT}/workflows/handbook-check.js", args: { rules: [...], targetFiles: [...], enforceScaffolded: false } })Only observed rules are enforced. Scaffolded rules are defaults nobody observed, so checking working code against them flags code that is fine; unless
enforceScaffoldedistruethe workflow skips them and returns how many asskippedScaffolded(a count, never findings). This dispatcheshandbook-drift-auditoronce per rule (never bundling rules), then independently re-verifies every individual finding at its exactfile:linebefore it counts — a PreToolUse hook backstops both the one-rule-per-dispatch and one-location-per-verify constraints regardless of what the workflow script does. Findings that don't survive re-verification are dropped, not reported. -
Clear the active flag when done — and immediately, before stopping, if step 4 or step 5 fails or is interrupted, rather than leaving it set:
python3 -B "${CLAUDE_PLUGIN_ROOT}/scripts/state.py" clear handbook-check-active -
Write the report at
.cupertino/HANDBOOK_CHECK-<domain>.md— a findings table with severity (High/Medium/Low), evidence (file:line), and whether each finding is mechanical (fixable without design judgment) or not, plus one line stating how many scaffolded rules were skipped — and the sidecar.cupertino/handbook_check_<domain>_summary.json, whose schema is validated on write by the same PreToolUse hook (a finding missing any field below is rejected outright, never defaulted). Both files live under.cupertino/, the plugin's one declared output directory — a PreToolUse hook denies either write if it targets anywhere else.The sidecar has one shape.
generatedAtis an ISO-8601 UTC timestamp,quotedLineis the offending line verbatim (the fix pass finds its target by that text, not byline),endLineis optional and only for a finding that spans lines, andskippedScaffoldedis the count the workflow returned. Validate it before writing:echo '<json>' | python3 -B "${CLAUDE_PLUGIN_ROOT}/scripts/validators.py" handbook-check-summary.Sidecar shape, populated:
{"domain": "design", "generatedAt": "2026-10-20T12:00:00Z", "skippedScaffolded": 2, "findings": [{"rule": "no-inline-styles", "file": "src/Card.tsx", "line": 42, "severity": "Medium", "title": "Inline style on card container", "evidence": "src/Card.tsx:42", "quotedLine": "<div style={{ padding: 8 }}>", "mechanical": true, "suggestedFix": "Replace the inline style with the .card-padding class", "verification": {"verdict": "confirmed"}}]}Sidecar shape, zero findings:
{"domain": "design", "generatedAt": "2026-10-20T12:00:00Z", "skippedScaffolded": 0, "findings": []} -
If there are zero findings, say so plainly and stop there. That is a valid, expected outcome. Never lower the severity bar or manufacture a marginal finding just to avoid reporting an empty result — an honest "no divergence found" is the correct output, not a failure to explain away.
Output format
Domain/handbook confirmation → target file scope (and how it was determined) → the findings table (or the explicit zero-findings statement) → confirmation both artifacts were written.
04 同仓库更多 Skills
toy-check
A skill that checks things in the repository and reports what it finds.
demo-check
Reports which generated files changed since the last generation run. Use when the user asks what drifted. Read-only; never edits a file.
demo-check
Reports which generated files changed since the last generation run. Use when the user asks what drifted. Read-only; never edits a file.
demo-check
Reports which generated files changed since the last generation run. Use when the user asks what drifted. Read-only; never edits a file.
demo-check
Reports which generated files changed since the last generation run. Use when the user asks what drifted. Read-only; never edits a file.
zirkel-verify-assumptions
Checks exactly ONE named assumption against real evidence in at most 3 steps and reports one outcome: confidence raised (>=90), reading changed, or still unresolved. Use to resolve a single load-bearing uncertainty — typically a blocking entry surfaced by zirkel-clarify-scope: "verify this one assumption", "is it actually true that X", "check this before we rely on it". For multiple uncertainties, invoke once per uncertainty — the step budget is never shared.