From jhostalek-skills
Use when the goal is to reduce code size, remove unnecessary complexity, or simplify a module without removing user-facing behavior.
How this skill is triggered — by the user, by Claude, or both
Slash command
/jhostalek-skills:audit-complexityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
!`cat "${CLAUDE_SKILL_DIR}/../audit-workflow.md"`
!cat "${CLAUDE_SKILL_DIR}/../audit-workflow.md"
Run as the complexity dimension. Exists because LOC and abstraction count compound silently — each addition seems reasonable; the total becomes unnavigable. Lens:
Maximize net LOC reduction while readability holds or improves. Metric: git diff --stat delta. Hard constraint: behavior-preservation. Default = DELETE — every line justifies itself or goes. Auto-fix = anything behavior-preserving: file merges, abstraction collapses, internal API changes, test rewrites. Sign-off required only for user-facing capability removal (endpoints, tools, CLI commands, features) where usage can't be verified.
Pretraining biases toward keeping abstractions: ABCs, factories, service layers, config objects read as "professional." Wrong here — most abstractions in real code serve exactly one call site. Professional = minimal; ceremony = amateur. Rationalizations that all mean DELETE: "separation of concerns" / "common pattern" (common ≠ necessary — name the concrete benefit or cut), "someone might need this flexibility" (they won't, and the pre-built abstraction won't fit when they do), "only a few extra lines" (multiply by every instance), "tests cover it" (covering useless code doesn't make it useful), "already here and working" (sunk cost — wouldn't add it today → delete it today). Expect ≥15% removal from a genuinely bloated file; less signals early stopping.
Distillation depth, in typical yield order:
# noqa:, single-use intermediates, in-place-obvious constants, multi-line literals that fit on fewer lines.types.py/schemas.py/exceptions.py into adjacent modules; any non-__init__.py file under ~30 lines: question whether it should exist. Abstraction collapse across modules. Heavy library where stdlib suffices; stateful class where a function would do. Config knobs set to the same value in every environment. Grep every reference and fix all imports in one pass.audit-tests; you own the scaffolding around them.Never cut: logging lines, type annotations, user-facing schema descriptions, error messages carrying domain context, tests encoding business rules or integration contracts, framework-registered symbols (decorators, route handlers, model classes). ~3+ lines saved required to justify any readability cost. No fighting the formatter; no breaking encapsulation for LOC.
npx claudepluginhub jhostalek/dotclaude --plugin jhostalek-skillsGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Resolves in-progress git merge or rebase conflicts by analyzing history, understanding intent, and preserving both changes where possible. Runs automated checks after resolution.