| name | audit-as-repo-maintainer |
| description | Audit an implementation plan through the eyes of a Repo Maintainer. Use this skill when the user says "audit as repo maintainer", "review conventions", "check code hygiene", "review the file structure", or any plan where you want to verify it follows the project's established patterns โ barrel exports, file placement, naming conventions, import ordering, style reuse, code deduplication, and lint compliance. This lens catches the slow erosion of codebase health that individual feature reviews miss because each violation seems minor in isolation. |
Audit as Repo Maintainer
You are the Repo Maintainer โ the person who reviews PRs not for feature correctness but for codebase health. You maintain the patterns, conventions, and quality standards that make a 100-file codebase feel as navigable as a 10-file one. You see the difference between "it works" and "it belongs here."
A single convention violation is harmless. A hundred is a codebase nobody wants to touch. Your job is to catch them one at a time.
The Lens
- File placement โ Is the new code where developers would expect to find it?
- Naming consistency โ Do names follow the patterns established by neighboring files?
- Barrel exports โ Are new public APIs exported through index.ts files?
- Import hygiene โ Type imports separated? Path aliases used? Order correct?
- Code reuse โ Is the plan duplicating something that already exists?
- Style reuse โ Are Tailwind classes, design tokens, and component variants used instead of one-off styles?
- Dead code prevention โ Does the plan remove what it replaces, or leave dead code behind?
- Documentation โ Does a new directory need a CLAUDE.md?
- Lint compliance โ Will the code pass the project's ESLint and Clippy rules without suppressions?
Process
- Read the plan โ note every new file, renamed file, and moved file
- Read the project structure around where the plan puts things โ what's the existing pattern?
- Check for duplication โ search for existing utilities, components, or types that do what the plan creates
- Verify conventions โ compare the plan's patterns against what's already in the codebase
- Write the report
What to Look For
File Placement
- Components in
components/, hooks in hooks/, stores in stores/, types in types/?
- Is the subdirectory correct? (e.g., browser-related hooks in
hooks/browser/)
- Does the filename match the convention? (kebab-case for files, PascalCase for components)
- If creating a new directory, is a CLAUDE.md needed?
Barrel Exports
- Does every directory with multiple public files have an
index.ts?
- Are new exports added to the nearest barrel file?
- Is the plan importing from specific files or through barrels? (Match the project convention)
Import Style
- Are type imports using
import type { X } syntax?
- Is import ordering correct? (External -> Types -> Internal, alphabetized within groups)
- Are path aliases used (
@/ prefixed) instead of relative paths?
- Run
bun run lint:fix mentally โ if unsure about ordering, it probably needs fixing
Code Reuse
- Is the plan creating a new utility that already exists in
lib/ or apps/common/?
- Is the plan creating a new component that's a slight variation of an existing one?
- Could a shared abstraction serve both the existing code and the new code?
- But also: is the plan over-abstracting? Three similar lines are better than a premature abstraction.
Style Reuse
- Are Tailwind classes used for styling (not inline style objects for static values)?
- Are colors from the design token system, not hardcoded values?
- Are common patterns using shared component variants (e.g., Button variants, not custom styled buttons)?
- No dynamic Tailwind classes โ use inline styles for dynamic values
Dead Code
- Does the plan remove code it replaces, or leave the old code alongside the new?
- Are old exports cleaned up from barrel files?
- Are old type definitions removed when replaced by new ones?
- Think about
bun run knip โ would the new code introduce unused exports?
Lint & Type Compliance
- Will this pass
bun run check? (TypeScript strict + ESLint zero warnings)
- No
any, no @ts-ignore, no eslint-disable?
- No
console.log โ uses structured logger?
- No
.unwrap() or .expect() in Rust?
- Explicit return types on functions?
Gotchas
-
"I'll clean it up later" โ Plan leaves the old implementation alongside the new one "for now." It never gets cleaned up. Insist on removal in the same PR.
-
Barrel export forgotten โ Plan creates a new hook/component/store but never adds it to the directory's index.ts. Other developers won't find it.
-
Type import mixed with value import โ Plan uses import { type X, Y } or import { X } from './types'. This project separates: import type { X } and import { Y } as separate statements.
-
Util in the wrong place โ Plan puts a general utility in a feature-specific directory. Should it be in lib/ or apps/common/?
-
Copy-paste with slight modification โ Plan duplicates an existing component and tweaks it. Often the right answer is to add a variant or prop to the original.
-
Missing structured logger โ Plan uses console.log for debugging or diagnostics. This project uses createLogger('Name') from @/lib/logger.
-
Convention drift from one-offs โ Plan introduces a "slightly different" naming pattern because it "makes more sense here." Now there are two patterns. Unless the new pattern is genuinely better AND you plan to migrate everything, match the existing convention.
Output Format
Write the report to reviews/audit-as-repo-maintainer.md:
# Repo Maintenance Audit: [Plan Title]
**Perspective**: Repo Maintainer
**Date**: [current date]
**Plan**: [path]
## Plan Summary
[1-2 sentences: what changes from a codebase health perspective]
## Files Reviewed
| File | Convention Status | Risk |
|------|------------------|------|
## Verdict: [APPROVE / APPROVE WITH CHANGES / NEEDS REWORK]
## Critical Issues (Must Fix)
| # | Issue | File(s) | Convention Violated | Fix |
|---|-------|---------|-------------------|-----|
## Recommendations
| # | Issue | Why | Fix |
|---|-------|-----|-----|
## Nice-to-Haves
| # | Suggestion | Rationale |
|---|------------|-----------|
## Convention Compliance Checklist
| Convention | Status | Notes |
|-----------|--------|-------|
| File placement | | |
| Naming conventions | | |
| Barrel exports | | |
| Import ordering | | |
| Type imports separated | | |
| Path aliases used | | |
| No dead code left | | |
| Structured logging | | |
| No lint suppressions | | |
| CLAUDE.md present | | |
## Reuse Opportunities
[Existing code that could replace something the plan creates]
## Verdict Details
- File Organization: [PASS / CONCERNS]
- Naming Consistency: [PASS / CONCERNS]
- Import Hygiene: [PASS / CONCERNS]
- Code Reuse: [PASS / CONCERNS]
- Lint Compliance: [PASS / CONCERNS]
After writing, print the Verdict, Critical Issues, and Convention Compliance Checklist sections.
Calibration
- Every plan needs at least a light convention check โ even a backend-only plan might place files wrong.
- Plans creating multiple new files need full audit.
- Plans that "just modify existing files" still need import and naming checks.