بنقرة واحدة
analyze-code-quality
Run all tests and linters, check for anti-patterns, generate a quality report
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Run all tests and linters, check for anti-patterns, generate a quality report
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Read the Hot Sheet worklist and work through the current priority items
Run as a distributed worker — continuously claim, work, and release Up Next tickets
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
| name | analyze-code-quality |
| description | Run all tests and linters, check for anti-patterns, generate a quality report |
| allowed-tools | Read, Grep, Glob, Bash, Agent |
Analyze the overall quality of the source code by running all available checks and looking for known anti-patterns. Generate a comprehensive quality report.
Run these commands and capture the results:
# Unit tests with coverage
npm test 2>&1
# Linter
npm run lint 2>&1
# TypeScript type checking
npm run typecheck 2>&1
# E2E tests (if server not already running)
npm run test:e2e 2>&1
# Smoke tests — run the BUILT dist/cli.js, so they catch ESM-bundle-only
# runtime failures the tsx-based e2e suite can't (e.g. a bundled CJS dep
# calling require()). Requires a prior `npm run build`.
npm run test:smoke 2>&1
Read the coverage output from step 1. Identify:
Then explicitly state the limit of what this number proves. Line/branch coverage shows every line ran — it does not show that every behavior or every sequence of behaviors is asserted. A stateful module can sit at 100% line/branch/function/statement coverage and still ship basic bugs, because each individual operation was tested from a clean initial state while the transitions between internal states were never exercised. So do not treat a high coverage number as a stopping point: a module at 100% coverage is exactly where the behavioral / state-transition audit (step 3) earns its keep. Use the coverage report to trigger that audit, not to skip it.
Line coverage is structurally blind to a whole class of bugs: a missing behavior, or a valid sequence of operations that was never run together. This step finds them.
Identify the stateful modules. Scan the source for modules that carry internal state across calls or branch on an internal mode/flag/phase. Heuristics — any module that:
mode / type / status / phase / kind field (e.g. the review-mode branches in src/git/diff.ts, image-comparison modes, sort modes, the settings-dialog / completion-modal stage signals);src/ai/list-models.ts, the Apple-FM availability cache + secondary-fallback-model retry in runAnalysisBatch, re-anchoring of review notes);src/client/stores/index.ts), or drives DOM that must survive re-renders (data-morph-* regions);For each stateful module, enumerate its states and the transitions between them, then check the tests for transition coverage — not just single-operation-from-clean-state. For every transition edge that matters, ask: is there a test that drives the module through this sequence and asserts the result? Concretely, look for tests that exercise:
Flag any stateful module whose tests only cover each operation from a clean initial state. For each flagged module, recommend an adversarial transition-matrix test: name the states, and list the specific out-of-order / interleaved / repeated / empty-then-refill sequences that should be added. A module at 100% line coverage with no transition tests is a finding, not a pass.
Read CLAUDE.md and the requirements docs (docs/*.md) for documented conventions and anti-patterns. Then scan the codebase for violations:
document.createElement() usage — Should use toElement() with JSX instead (per CLAUDE.md).js extension in imports — ESM requires .js extensionsbody: JSON.stringify(...) in api() calls — The api() helper auto-serializes; passing pre-stringified body causes double-encodingPresent findings in this structure:
A per-stateful-module table: module → states → transition-test coverage (yes / partial / none) → recommended sequences to add. List every stateful module found in step 3, and mark as a finding any that is well-covered by line count but has untested transitions. This section must be able to flag a module sitting at 100% line/branch coverage whose transitions are untested — that is the whole point of the audit.
For each violation found:
Present the report directly to the user. Be concise — group similar issues rather than listing every instance.