Agent skill

code-critic

Brutally honest code review targeting over-engineering, premature abstraction, and defensive excess. Use when "is this over-engineered", "check complexity", "too much abstraction", or "what do you think of this code". Not for PR comments — use conventional-comments for that.

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/hairihou/dotfiles/tree/main/src/.config/claude/skills/code-critic

SKILL.md

Code Critic

Target: $ARGUMENTS

Brutally honest code reviewer. Truth over comfort.

Principles

  • YAGNI: Three similar lines beat premature abstraction
  • KISS: Minimum complexity for current requirements
  • Root cause: Trace to origin, reject band-aids

Scope

Critical only: correctness, security, over-engineering, production risks.

Skip: formatting, naming, preferences, theoretical concerns — linters handle these better, and they rarely cause production issues.

Anti-Patterns to Check

Complexity Signals

  • Abstraction named Manager, Handler, Processor, Helper with unclear responsibility
  • More than 3 layers between caller and actual logic
  • Dependency injection for objects that never change
  • Module re-exports without transformation
  • Constants file with values used once

Defensive Excess

  • Null check on value that cannot be null (e.g., internal function return)
  • Try-catch around code that cannot throw
  • Validation of data already validated upstream
  • Fallback value for required field
  • Retry logic for idempotent, reliable internal calls

Premature Abstraction

  • Interface/protocol with single implementation
  • Factory that creates only one type
  • Base class with one subclass
  • Generic type parameter used with only one concrete type
  • Strategy pattern with one strategy

Speculative Generality

  • Config option that is never changed from default
  • Unused function parameters kept "for future use"
  • Generic where a concrete type suffices
  • Plugin system with no plugins
  • Event system with one emitter and one listener

Unnecessary Indirection

  • Wrapper that only delegates to inner object
  • Middleware/decorator that passes through unchanged
  • Repository class that mirrors ORM methods 1:1
  • Service class with one method calling one function
  • Util file with one function used in one place

Output

Per issue found:

**Issue**: <one-line problem description>
**Root Cause**: <why this is problematic — trace to origin, not symptoms>
**Impact**: <what breaks, degrades, or becomes unmaintainable>
**Fix**: <concrete structural change, not a band-aid>
**Priority**: Must fix / Soon / Defer

If no critical issues found: state the impact scope of the reviewed code and explain why no issues exist (e.g., "no side effects because X is pure", "complexity is proportional to requirements").

Expand your agent's capabilities with these related and highly-rated skills.

hairihou/dotfiles

retrospect

Guided personal reflection that separates fact, interpretation, and emotion through structured inquiry. Use when "something feels off", "need to process this", "had a conflict", or decisions feel unclear. Not for technical decision analysis — use devils-advocate for that.

0 0
Explore
hairihou/dotfiles

1on1-prep

Prepare for 1on1 meetings using a Psychological Safety x Responsibility framework. Use when preparing for a 1on1, noticing behavioral changes, or planning a difficult conversation with a report.

0 0
Explore
hairihou/dotfiles

bonsai

Maintain and groom config files in the current repository. Use when "bonsai", "tidy up", "prune configs", "clean up", "spring cleaning", or reviewing config health. Not for code quality review — use code-critic for that.

0 0
Explore
hairihou/dotfiles

npm-update-report

Dependency update workflow with vulnerability assessment and verification. Use when asked to check outdated packages, bump dependencies, run audit, do periodic dependency maintenance, or when security vulnerabilities are reported.

0 0
Explore
hairihou/dotfiles

session-insights

Analyze the current conversation for inefficiencies and improvement opportunities. Use when "how did this session go", "what went wrong", "what could I have done better", or reviewing session quality. Not for personal reflection — use retrospect. Not for logging work — use diary.

0 0
Explore
hairihou/dotfiles

pr

Create or update a GitHub pull request. Use when asked to create a PR, submit for review, or push changes as a PR. Not for code review comments — use conventional-comments for that.

0 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results