بنقرة واحدة
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 المهني
Prep the repo for a major release — refresh README.md to stay compelling and accurate, then review/revise the demo modes and flag which screenshots to recapture
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
| 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.
npm test 2>&1 # unit tests with coverage
npm run test:e2e 2>&1 # two-version round-trip
npm run lint 2>&1 # eslint src/ tests/
npm run typecheck 2>&1 # tsc --noEmit
Read the coverage output. Identify files with <50% line coverage, files with 0% coverage, and logic that has unit coverage but no e2e assertion (or vice versa). Per the testing philosophy (CLAUDE.md), pure logic should have focused unit tests and anything touching a real cluster should be proven in the e2e round-trip.
Coverage is a floor, not a ceiling. 100% line/branch/function/statement coverage means every line ran during the suite — it does not mean every behavior is asserted, nor that the sequences between states were exercised. A stateful module can sit at 100% coverage while a critical transition bug ships, because each operation was tested once from a clean initial state and the transitions between states never were. Treat full coverage as the trigger for the behavioral audit in step 3, not as a stopping point. Report the coverage numbers, but never conclude "well tested" from coverage alone.
Line coverage cannot see a missing behavior or a missing transition. This step audits behavior directly.
Identify the stateful modules. Scan src/ for modules that carry internal state or branch on it — heuristics:
onExisting re-run modes in migrate.ts, COPY-text-first with the per-table INSERT fallback and the cyclic-subset path in transfer.ts);swap.ts; backup → migrate → validate → swap orchestration);loader.ts);For each stateful module, enumerate its states and the transitions between them, then check whether the test suite exercises the transitions — multi-step sequences that cross state boundaries — rather than only each operation from a clean initial state.
Flag any stateful module whose tests only cover single-operation-from-clean-state, and recommend an adversarial transition-matrix test. Concrete sequences worth trying:
.new left by a prior run);onExisting);Report, per stateful module, a transition-coverage assessment: the states, which transitions the suite already exercises, and which are untested. This assessment must flag a module whose transitions are untested even when its line/branch coverage is 100%.
Read CLAUDE.md and the requirements docs (docs/*.md) for conventions, then scan for violations:
@electric-sql/pglite import in src/ (outside type-only usage) — the core must depend only on the PGliteLike structural interfaceas casts on catalog/network data — type with an interface and read fields; the only sanctioned cast is bridging a concrete PGlite to PGliteLike in testssrc/ident.ts quoting helpers.js extension in relative imports (ESM requirement)pglite-old/pglite-new e2e aliases into one import — the two-engine shape is the property under testPresent:
Be concise; group similar issues rather than listing every instance.