audit-code-quality
Detect and fix repo-wide anti-patterns and consistency drift (naming, organisation, repeated smells).
Skill by kensaurus
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/kensaurus-audit-code-quality
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/audit-code-quality
What's inside
- Skill name
audit-code-quality- Description
- 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.
- License
- MIT
- Instructions
- 313 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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 restyle
> or rename pass the report did not list is a different session. Edit
> surgically — the offending hook, key, or import — rather than rewriting
> whole files. Pre-existing bugs met on the way go in the report as
> follow-ups. Add or change tests only where the task asks or the repo
> already keeps them for that surface; one-off greps and scratch scripts stay
> out 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
1. **Observe** — quote the smell (`file:line`) and whether `git blame` / CONTRIBUTING marks it intentional
2. **Interpret** — bug/perf risk, or style-only drift?
3. **Classify** — anti-pattern / naming / organisation / pattern-split / intentional
4. **Severity** — runtime bug or data-fetch `useEffect` = High; naming-only = Low
## Worked example
> **Observe:** `components/PaymentForm.tsx` has `'use server'` and a
> `useEffect` that fetches invoices; four sortable lists use `key={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 to `features/*/server/`;
> replace fetch effect with TanStack Query
## Before any change [LOW freedom — run exactly]
```bash
cat CONTRIBUTING.md .cursor/rules/*.md 2>/dev/null | head -100 # existing conventions
git log --oneline -20 | grep -i "convention\|pattern\|style" # recent decisions
```
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
```tsx
// Bad: prop drilled through 5+ levels
<Layout user={user}><Sidebar user={user}><UserMenu user={user}><Avatar user={user} />
// Fix: context for global state
const UserContext = createContext<User | null>(null)
const useUser = () => useContext(UserContext)
// Fix: composition for UI concerns
<Layout><Layout.Sidebar><UserMenu /></Layout.Sidebar></Layout>
```
#### Derived state in `useState` → `useMemo`
```tsx
// Bad
const [items, setItems] = useState([])
const [filtered, setFiltered] = useState([])
useEffect(() => { setFiltered(items.filter(i => i.active)) }, [items])
// Fix
const filtered = useMemo(() => items.filter(i => i.active), [items])
```
#### `useEffect` for data fetching → Server Components or TanStack Query
```tsx
// Fix (Next.js 16 Server Component)
async function DataDisplay() {
const data = await db.getData()
return <div>{data.name}</div>
}
// Fix (client with TanStack Query)
const { data, isLoading } = useQuery({ queryKey: ['data'], queryFn: fetchData })
```
#### Object/array in dependency array → memoize or destructure
```tsx
// Bad: new object every render → infinite loop
useEffect(() => { doSomething(options) }, [options])
// Fix
const options = useMemo(() => ({ page, limit }), [page, limit])
useEffect(() => { doSomething(options) }, [options])
```
#### Index as key in dynamic lists → stable IDs
```tsx
// Bad
{items.map((item, i) => <Item key={i} />)}
// Fix
{items.map(item => <Item key={item.id} />)}
```
#### Giant component → composition
```tsx
// Split by responsibility
export function UserDashboard() {
const user = useUser()
return (
<DashboardLayout>From kensaurus/skills, MIT.
More from kensaurus/skills
- 0.633score
create-skill
kensaurus
Guide users through creating effective Agent Skills for Cursor.
SkillAFreshness: A★ 9Claude Code +9 - 0.633score
audit-agent-speed
kensaurus
Measure and fix a slow coding-agent setup: status line, hooks, instruction bloat, effort, worktree pile-up, antivirus and indexer scans.
SkillAFreshness: A★ 9Claude Code +9 - 0.629score
audit-backend-architecture
kensaurus
Read-only backend-architecture audit and pattern advisor, gated by stack.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-analytics
kensaurus
Read-only audit of product-analytics events (PostHog, Amplitude, Mixpanel, GA4): taxonomy, funnels, consent-gated firing, dead or duplicate events.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
create-rule
kensaurus
Create Cursor rules for persistent AI guidance.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
split-to-prs
kensaurus
Split current work into small reviewable PRs.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
update-cursor-settings
kensaurus
Modify Cursor/VSCode user settings in settings.json.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-accessibility
kensaurus
WCAG 2.2 AA audit via playwright-cli: axe-core, keyboard, contrast, target size, focus, ARIA.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-auth-flows
kensaurus
Read-only audit of app-layer auth: route×gate matrix, session lifecycle, OAuth, provider traps (getSession vs getUser, middleware-only gates, CVE-2025-29927).
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-bundle-size
kensaurus
Analyse and shrink a web app's JavaScript bundle.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-cicd
kensaurus
Audit GitHub Actions CI/CD for cost, speed, and safety.
SkillAFreshness: A★ 9Claude Code +9 - 0.625score
create-hook
kensaurus
Create Cursor hooks.
SkillAFreshness: A★ 9Claude Code +9
Signals
- Stars
- 9
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Oct 19, 2026 (10 days ago)
- Last release
- Oct 19, 2026 (10 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/kensaurus/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from kensaurus
- 0.633score
audit-agent-speed
kensaurus
Measure and fix a slow coding-agent setup: status line, hooks, instruction bloat, effort, worktree pile-up, antivirus and indexer scans.
SkillAFreshness: A★ 9Claude Code +9 - 0.633score
create-skill
kensaurus
Guide users through creating effective Agent Skills for Cursor.
SkillAFreshness: A★ 9Claude Code +9 - 0.629score
audit-backend-architecture
kensaurus
Read-only backend-architecture audit and pattern advisor, gated by stack.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
create-rule
kensaurus
Create Cursor rules for persistent AI guidance.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
split-to-prs
kensaurus
Split current work into small reviewable PRs.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-analytics
kensaurus
Read-only audit of product-analytics events (PostHog, Amplitude, Mixpanel, GA4): taxonomy, funnels, consent-gated firing, dead or duplicate events.
SkillAFreshness: A★ 9Claude Code +9
Cite this page
audit-code-quality skill. Agent Mart. https://agentmart.dev/skills/kensaurus-audit-code-quality (last updated 2026-10-24)