Design audit

From benthamite/dotfiles · View interactive version

Design audit is an AI agent skill from the GitHub repository benthamite/dotfiles. Audit code architecture and maintainability for unnecessary complexity, premature or missing abstractions, duplication, unclear boundaries, and refactoring opportunities. Not for bug, security, or readability-only reviews.

How to use this skill

Skill file

Design audit

Review the scope in the user's request or actual invocation arguments for architectural quality. Use $ARGUMENTS only when the active runtime expands it, never as a literal path. Look for structure that imposes concrete maintenance costs; do not assume the code is correct merely because this audit focuses on design.

This is a review skill first. Edit only when the user explicitly asks for refactoring, including in plain language, or supplies --accept as an actual invocation option. Examples and quoted text are not activation flags.

When refactoring is authorized, audit first, then implement high-confidence, behavior-preserving high-impact findings within scope without redundant confirmation. A specifically requested smaller refactor remains in scope; general acceptance does not authorize speculative medium- or low-impact cleanup. Broad redesigns, risky migrations or product choices require direction when the request does not already settle them. Preserve public interfaces, serialized data, ordering, error/cancellation behavior and side effects unless changes are explicitly authorized.

Use subagents to explore independent areas of the codebase in parallel where appropriate. Read actual code and call sites; don't guess from file names.

Workflow

  1. Identify explicit files, directories, diff/PR or subsystem first; default to the current project only without a supplied scope. Read project instructions and inspect the working tree and index. Record the reviewed revision and re-check affected code before applying recommendations. Preserve unrelated edits and staged work.
  2. Map the relevant structure: entry points, module boundaries, data flow, shared helpers, and repeated implementation patterns.
  3. Read representative code and enough callers, tests and history to verify candidate issues. Consider language idioms and documented compatibility/ownership constraints. Route incidental bugs or readability-only observations separately without silently starting another audit or mixing them into design findings.
  4. Prioritize by demonstrated maintenance impact and confidence. Explain a concrete change that is harder today and how the proposed structure reduces that cost. Compare the smallest refactor with leaving the code alone; include migration risk and coupling introduced by consolidation. The checklist below supplies investigation prompts, not automatic findings.
  5. For review-only requests, report paths without source/snapshot edits or external actions. When authorized in plain language or by --accept, implement selected in-scope refactors in logical increments. Establish relevant behavior before changes, then check the same observable contracts afterward with focused characterization/regression checks and the project's actual build/test commands. Byte-compilation is relevant for Elisp, not a universal requirement. Inspect test commands for live writes, installs and other side effects before running them.
  6. Inspect the final diff for semantic changes and check analogous affected callers/modes. Commit each logical owned change according to project policy, preserving unrelated staging. Compiler/linter success alone does not demonstrate behavior preservation; report material untested boundaries, partial outcomes and unresolved decisions. Do not push or publish as an implicit refactoring step.

What to look for

Abstraction problems

Complexity

Structural issues

Interface design

Duplication

What NOT to flag

Output format

Use the required host/project review schema when present. Otherwise keep the report proportional to inspected scope, omit empty categories, and use:

  1. Overall assessment: a brief, evidence-backed assessment of the inspected scope, not unreviewed codebase-wide health
  2. High impact: structural problems that actively make the codebase harder to maintain or extend, with clear refactoring paths
  3. Medium impact: issues worth addressing when working in the area, but not urgent
  4. Low impact: evidenced structural costs too small to justify a dedicated refactoring effort, not style or speculative cleanup
  5. Good design, only when useful: specific existing patterns worth preserving during the proposed changes, not obligatory praise

For each finding, include:

If there are no meaningful design issues, say so clearly and mention any residual uncertainty from areas you did not inspect.

For review-only requests, end with high-impact recommendations. For authorized refactoring, whether requested in plain language or with --accept, report changes, relevant verification, commit hash and unresolved issues. Never describe sampled coverage as exhaustive.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.