ワンクリックで
check-code-hygiene
Check code for standardization, readability, maintenance complexity, and defensive coding practices
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Check code for standardization, readability, maintenance complexity, and defensive coding practices
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Create a new bug ticket in Hot Sheet
Create a new feature ticket in Hot Sheet
Create a new investigation ticket in Hot Sheet
Create a new issue ticket in Hot Sheet
Create a new req change ticket in Hot Sheet
Create a new task ticket in Hot Sheet
| name | check-code-hygiene |
| description | Check code for standardization, readability, maintenance complexity, and defensive coding practices |
| allowed-tools | Read, Grep, Glob, Bash, Agent |
Analyze the kerf codebase for code hygiene issues. Generate a report highlighting problems with standardization, human readability, maintenance complexity, and defensive coding.
Scope: src/ and (where relevant) tests/. Skip examples/ unless something there bleeds into the published package.
src/ uses kebab-case / lowercase (mount.ts, jsx-runtime.ts) by default. camelCase is allowed when the filename matches the primary function / class / value exported from that file — e.g. toElement.ts exports toElement, escapeHtml.ts exports escapeHtml. The principle is "filename = primary export"; that mirroring is more useful than a global casing rule. Flag a casing only if the filename matches neither convention nor its primary export.delegate.ts (Tier 1 + Tier 2 paired), escapeHtml.ts (paired escapers), jsx-runtime.ts (the JSX runtime contract). Anything else with multiple unrelated exports is a finding..js extension (CLAUDE.md). eslint-plugin-simple-import-sort enforces order — if lint passes, import order is fine. The .js extension check is your responsibility.'JSX: unsupported child of type X. Common mistakes: ...'). New errors should follow that pattern; flag terse throw new Error('failed')-style throws.src/ should stay under ~200 LOC". Use wc -l. Flag any file over 200 lines.excerpt(html)'s 100-char limit in toElement.ts); flag them.fromEl / toEl in mount.ts are morphdom convention — leave those alone.Symbol.for brand block in jsx-runtime.ts) is a feature; a comment that paraphrases the next line is noise. Flag both: missing-when-needed AND noise-when-not-needed.mount ↔ jsx-runtime (via isSafeHtml) and store ↔ reactive (via signal) are the only legitimate cross-module imports. Flag anything else.store.ts:REGISTRY, by design. Flag any new addition.renderChildren in jsx-runtime.ts has a chain of if/else-if for type discrimination — that's appropriate. Flag any chain > 6 branches without a lookup-table refactor.grep to spot-check.delegate / delegateCapture: assertValidSelector throws on bad selectors at registration.jsx / Fragment: renderChildren and renderAttr throw on unsupported child / attribute value types.mount: relies on TS types — flag if the runtime should be defensive against null rootEl.toElement: throws on empty input, parse errors, zero-element results.mount.ts:preserveTextEntryState wraps setSelectionRange in try/catch (some input types reject the API); that is the kind of selective catch we want. Flag any blanket try { ... } catch { /* swallow */ } without a reason.strict: true in tsconfig, the compiler usually catches this. Flag any ! non-null assertion in src/ (tests get a pass).any types used where specific types would be safer? Grep src/ for : any\b, as any\b, <any>. The pattern in kerf is unknown plus a type guard (isSafeHtml). Flag any any.escapeHtml and escapeAttr should cover &, <, >, ", and (for attrs) '. Verify the escapers haven't drifted.For each finding:
End with a prioritized summary of the top 10 most impactful improvements (or fewer — kerf is small, expect 0–5 in a healthy state). Suggest filing Hot Sheet tickets (hs-task for cleanups, hs-bug for real defects) for any non-trivial finding.