ワンクリックで
analyze-code-quality
Run all available tests and linters, check for anti-patterns, and generate a comprehensive code quality report
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Run all available tests and linters, check for anti-patterns, and generate a comprehensive code quality report
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 | analyze-code-quality |
| description | Run all available tests and linters, check for anti-patterns, and generate a comprehensive code quality report |
| allowed-tools | Read, Grep, Glob, Bash, Agent |
Analyze the overall quality of the kerf source code. Generate a comprehensive report.
Run unit + integration tests with coverage (against src/)
npm test
Report: total tests, pass/fail count, coverage percentage by file. CLAUDE.md mandates 100% lines/branches/functions/statements; flag any file under that bar.
Coverage is a floor, not a ceiling. 100% line/branch coverage proves every line executed — not that every behavior or every sequence of behaviors is asserted. Line coverage is structurally blind to a missing state transition (KF-125: two critical reconciler bugs shipped under 100% coverage). Do NOT treat a green coverage report as proof of correctness — treat it as the trigger for the behavioral / state-transition audit in step 7 below.
Run targeted dist regression suite (against dist/)
npm run test:dist
Report: total tests, pass/fail count. These tests pin known bundling failure modes (KF-14 SafeHtml class duplication, KF-15 store registry sharing). A failure here means the published artefact is broken even if src/ is clean.
Run full unit + integration suite remapped onto dist (KF-16)
npm run test:dist:full
Report: total tests, pass/fail count. A failure here that doesn't reproduce in npm test indicates new bundling drift.
Run linter
npm run lint
Report: total errors / warnings, categorized by rule.
Run typecheck
npm run typecheck
Report any type errors.
Check for anti-patterns documented in CLAUDE.md and the design docs
Read CLAUDE.md, docs/8-api-reference.md, and docs/ai/usage-guide.md. Look for violations in src/ of documented conventions:
src/ should stay under ~200 LOC." Use wc -l src/**/*.ts..js extension on relative imports. CLAUDE.md says: "Import paths use .js extension (TypeScript convention for ESM resolution)." Grep src/ and tests/ for relative imports without .js.delegate.ts exports the paired delegate + delegateCapture; escapeHtml.ts exports paired escapers; jsx-runtime.ts exports the JSX-spec-required cluster jsx/jsxs/jsxDEV/Fragment). Anything else with multiple unrelated exports is a violation.any type leaks. Grep src/ for : any\b, as any\b, <any>. Permitted only behind a type guard (we use unknown and isSafeHtml(...) pattern).@preact/signals-core." (The former morphdom dependency was removed — kerf's reconciler is now src/morph.ts.) Open package.json and verify the dependencies block has only @preact/signals-core. Anything else is a violation; flag it.addEventListener calls in test/example code on morph-managed nodes. Symptom of skipping delegate() / delegateCapture(). Grep examples/ and tests/ for addEventListener outside data-morph-skip regions and flag for review.DOMParser + parsererror blocks (already a known pattern in src/toElement.ts), repeated try/catch idioms across modules, or any source-line matched ≥3× by grep -c.Behavioral / state-transition audit (the step line/branch coverage can't do for you)
100% line coverage says every line ran; it does NOT say every behavior or sequence is asserted. This step audits the thing coverage is blind to: untested transitions in stateful modules. Two critical KF-125 bugs (select-after-delete, append-after-clear) shipped under 100% coverage because the reconciler's state transitions were never walked.
src/each.ts, src/list-reconcile*.ts — states: first-render ↔ granular ↔ snapshot ↔ empty-binding ↔ drift-recovery), src/morph.ts, and src/store.ts. Confirm the current set with ls src/ rather than trusting this list.cacheKey).create → select → delete → select; clear → append → select; empty-via-remove → insert). Flag any stateful module whose tests only exercise single-operation-from-clean-state — that is the exact gap that hides transition bugs behind a green report.tests/unit/array-signal.test.ts › "reconciler transition matrix (adversarial)" as the template, and listing concrete sequences to add (out-of-order / interleaved / repeated / empty-then-refill).Check the dist build shape
npm run build && ls dist/
Verify (confirm the exact entry list against tsup.config.ts — it drives what ships):
dist/index.js, dist/jsx-runtime.js, dist/testing.js, dist/array-signal.js (the four entry points).dist/chunk-*.js (proof that splitting: true is in effect — a regression here resurrects KF-14/KF-15)..d.ts for each entry point (index, jsx-runtime, testing, array-signal).npm pack --dry-run for the published file list (skip if it errors due to local npm cache permissions; the CI run is authoritative).
Generate a structured report with:
npm test / npm run test:dist / npm run test:dist:full.hs-task / hs-bug.