kensaurus/cursor-kenji/audit-code-quality
Claude Code and agent skill by kensaurus/cursor-kenji
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Detect and fix repo-wide anti-patterns and consistency drift (naming, organisation, repeated smells). Use when "code smell", "anti-pattern", "technical debt", or "standardize the codebase". This PR/diff review → audit-code-review.
Install
npx vskill@latest install kensaurus/cursor-kenji/audit-code-qualitySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as kensaurus/cursor-kenji/audit-code-quality.
Code Quality Audit
Degree of freedom: MIXED — Parts 1–2 judgment [HIGH freedom]; convention greps and Validation [LOW freedom — run exactly].
Audit-and-fix exception. Detect and then fix. Not present-then-stop.Fix the findings you reported, in the files you named; a repo-wide restyleor rename pass the report did not list is a different session. Editsurgically — the offending hook, key, or import — rather than rewritingwhole files. Pre-existing bugs met on the way go in the report asfollow-ups. Add or change tests only where the task asks or the repoalready keeps them for that surface; one-off greps and scratch scripts stayout of the commit.
Repo-wide React/TypeScript anti-patterns plus naming, organisation, and pattern consistency. A named PR/diff → audit-code-review.
This skill vs neighbors
| Skill | Owns | |
|---|---|---|
| audit-code-quality (this) | Repo-wide anti-patterns and consistency drift, detected and fixed | |
audit-code-review | Review one PR or diff for correctness, security, maintainability | |
workflow-refactor | Scoped, behavior-preserving refactor with affected tests run |
How to reason
- Observe — quote the smell (
file:line) and whethergit blame/ CONTRIBUTING marks it intentional - Interpret — bug/perf risk, or style-only drift?
- Classify — anti-pattern / naming / organisation / pattern-split / intentional
- Severity — runtime bug or data-fetch
useEffect= High; naming-only = Low
Worked example
Observe:components/PaymentForm.tsxhas'use server'and auseEffectthat fetches invoices; four sortable lists usekey={i}.Interpret: server action lives in UI; fetch refires on remount; reorder remounts rows.Classify: organisation +useEffect-for-data + index-as-key.Severity: High (actions-in-components); Medium (keys).Finding:PaymentForm.tsx| High | move action tofeatures/*/server/;replace fetch effect with TanStack Query
Before any change [LOW freedom — run exactly]
Verify the "inconsistency" isn't intentional. Check git blame before touching working code.
Part 1 — Anti-patterns [HIGH freedom]
React
Props drilling → Context or composition
Derived state in useState → useMemo
useEffect for data fetching → Server Components or TanStack Query
Object/array in dependency array → memoize or destructure
Index as key in dynamic lists → stable IDs
Giant component → composition
TypeScript
State management
Architecture
Part 2 — Consistency audit [HIGH freedom; greps LOW]
Naming conventions
| Element | Expected | Check | |
|---|---|---|---|
| Components | PascalCase | userCard vs UserCard | |
| Hooks | use prefix | fetchData vs useFetchData | |
| Utils | camelCase | format_date vs formatDate | |
| Constants | SCREAMING_SNAKE | apiUrl vs API_URL | |
| Files | kebab-case | UserCard.tsx vs user-card.tsx | |
| Boolean props | is/has/should | loading vs isLoading |
File organisation (feature-sliced)
Red flags:
- Components in
/libor/utils - Server actions in component files
- Types scattered across component files
- Zod schemas inline in components
Pattern consistency
| Concern | Check | |
|---|---|---|
| Server state | All TanStack Query, or mixed with useEffect? | |
| Forms | All React Hook Form, or controlled inputs too? | |
| Error handling | Consistent ActionResult shape? | |
| Styling | cn() used everywhere? Dark mode via CSS vars? | |
| Tests | *.test.ts vs __tests__/? Consistent mocking? |
Coherency report template
Anti-pattern detection checklist
React checks
- [ ] No
useEffectfor derived state - [ ] No index keys in dynamic lists
- [ ] No objects/arrays in dependency arrays
- [ ] Components under 300 lines
- [ ] No prop drilling beyond 2 levels
TypeScript checks
- [ ] No
any(useunknown+ validation) - [ ] No unsafe type assertions
- [ ] Exhaustive switch statements
- [ ] Zod schemas for all external data
Architecture checks
- [ ] No circular dependencies
- [ ] Business logic separated from UI
- [ ] Files under 400 lines
- [ ] Clear module boundaries
Self-critique before applying fixes [LOW freedom — do not skip]
- Evidenced —
file:lineor rg hit, not "the codebase feels messy" - Reproducible — the convention grep still finds it
- Severity justified — High = bug/perf, not naming taste
- Right owner — this PR/diff →
audit-code-review - No-false-safety —
git blamechecked; working intentional code left alone
Validation [LOW freedom — run exactly]
- Typecheck with the repo's own script (
package.json→typecheck, elsetsc --noEmit) - Lint with the repo's own script — not a generic
eslint src/ - Run the repo's test script and confirm no new failures
- Document any enforced standard in
CONTRIBUTING.mdor.cursor/rules/
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/audit-code-quality/SKILL.md
Popularity
- Repository stars
- 9
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kensaurus/cursor-kenji/audit-code-quality)