/engineering-discipline:simplifyfrom engineering-discipline
Reviews changed code through three parallel agents (reuse, quality, efficiency) and fixes issues found. Useful after implementation or when asked to simplify or review changes.
Ships in engineering-discipline. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reviews all changed files through three parallel agents — reuse, quality, and efficiency — then fixes any issues found.
Changed code is the only review target. Each review dimension runs independently, sees the full diff, and reports findings without knowledge of the other agents' results. The main agent aggregates and applies fixes.
git diff (or git diff HEAD if there are staged changes) first. Never review without knowing what changed.review-work instead)git diff to see unstaged changesgit diff HEAD to check staged changesCapture the full diff output — this is the input for all three agents.
Dispatch all three agents concurrently via the Agent tool in a single message. Each agent receives the full diff and its review prompt below.
What to provide to each agent:
What NOT to provide:
Provide this prompt to the agent:
You are reviewing a code diff for reuse opportunities. Your job is to find new code that duplicates functionality already in the codebase.
For each change in the diff:
- Search for existing utilities and helpers that could replace newly written code. Search utility directories (
utils/,helpers/,lib/,common/,shared/), files adjacent to the changed ones, and files imported by the changed files.- Flag any new function that duplicates existing functionality. Report the new function, the existing function, and where the existing one lives.
- Flag inline logic that could use an existing utility. Common candidates: hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, manual array/object transformations, date/time formatting done inline.
- Flag reimplemented standard library features. Check if the change reimplements something available in the language's standard library or in already-installed dependencies.
For each finding, report:
- Reuse opportunity: [brief description]
- New code: [file:line] — [what was written]
- Existing: [file:line] — [what already exists]
- Suggestion: [how to replace]
If no reuse issues are found, report: "No reuse issues found."
Provide this prompt to the agent:
You are reviewing a code diff for quality issues. Your job is to find hacky patterns, unnecessary complexity, and abstraction boundary violations.
Check for these patterns:
- Redundant state: new variables that are always derived from another variable, caches that store what could be computed on access, event listeners or observers that could be direct function calls.
- Parameter sprawl: functions that gained a new boolean flag parameter, functions with more than 4 parameters after the change, multiple parameters that are always passed together and should be a single object.
- Copy-paste with slight variation: two or more blocks that differ by only 1-2 lines, repeated conditional structures with different field names, similar error handling blocks across multiple locations.
- Leaky abstractions: accessing private fields or internal state from outside the module, passing implementation details across module boundaries, changes that make one module depend on another's internal structure.
- Stringly-typed code: new string comparisons against values already defined as constants, new string literals matching existing enum or union type values, magic strings appearing in multiple places without a shared constant.
- Unnecessary comments: comments explaining WHAT the code does, narrating the change, or referencing a task. Delete these. Keep only comments that explain non-obvious WHY — hidden constraints, subtle invariants, workarounds. Example to delete:
// increment counterabovecounter++. Example to keep:// Redis returns nil for both "key missing" and "value is empty" — we must distinguish.For each finding, report:
- Quality issue: [category]
- Location: [file:line]
- Problem: [what is wrong]
- Suggestion: [how to fix]
If no quality issues are found, report: "No quality issues found."
Provide this prompt to the agent:
You are reviewing a code diff for efficiency issues. Your job is to find unnecessary work, missed concurrency, and resource management problems. Do not optimize prematurely — flag only what is clearly unnecessary or clearly mismanaged.
Check for these patterns:
- Unnecessary work: the same value computed multiple times in a loop, the same file read more than once, the same API call made repeatedly when the result could be cached or batched, database queries inside loops that could be a single query with WHERE IN.
- Missed concurrency: multiple
awaitcalls in sequence where the operations are independent, sequential file reads that could be parallelized, independent API calls executed one after another.- Hot-path bloat: synchronous file I/O added to a request handler, new computation in a render function that could be memoized, new initialization logic added to module load time.
- Recurring no-op updates: state setters called on every interval tick without checking if the value changed, store dispatches firing on every event without a change-detection guard, wrapper functions that take updater callbacks but do not honor "no change" returns — add a change-detection guard so downstream consumers are not notified when nothing changed.
- Unnecessary existence checks (TOCTOU):
if (existsSync(path)) { readFileSync(path) }— operate directly and handle the error instead.- Memory issues: collections that grow without bound, event listeners registered without corresponding removal, subscriptions without cleanup in dispose/destroy handlers, large objects held in closure scope longer than needed.
- Overly broad operations: reading entire files to extract a single value, fetching all records to find one by ID, loading an entire config when only one field is needed.
For each finding, report:
- Efficiency issue: [category]
- Location: [file:line]
- Problem: [what is wasteful]
- Suggestion: [how to fix]
If no efficiency issues are found, report: "No efficiency issues found."
systematic-debugging| Anti-Pattern | Why It Fails |
|---|---|
| Reviewing without running git diff first | Reviews code that may not have changed, wastes time on irrelevant findings |
| Running agents sequentially | Unnecessary delay; violates Hard Gate #2 |
| Giving each agent only part of the diff | Agent misses cross-cutting issues that span multiple files |
| Reporting findings without fixing them | Defeats the purpose of the skill; user must do manual work |
| Arguing with or explaining skipped findings | Wastes context and time; skip and move on |
| Reviewing unchanged code "while we're here" | Scope creep; violates Hard Gate #6 |
| Fixing issues without running tests afterward | May introduce regressions silently |
| Bundling "while I'm here" improvements into fixes | Mixes review fixes with unrelated changes; muddles the diff |
After simplification is complete:
review-work for independent plan verificationsimplify again to verify the fixes are cleansystematic-debuggingThis skill itself does not invoke the next skill. It reports results and lets the user decide the next step.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-review, code-quality, refactoring, parallel-review, diff-review
npx claudepluginhub tmdgusya/engineering-discipline --plugin engineering-discipline11 skills in this plugin
/clarificationUse when a user's request is vague, ambiguous, or underspecified. Explores the codebase first, then runs an iterative Q&A loop grounded in the findings until ambiguity is gone. Outputs a clear, well-scoped context brief so the user can plan sharply. Triggers on "I want to...", "I need...", "let's build...", "can you help me...", "we should...", or any request where the full scope isn't immediately clear./clean-ai-slopCorrective cleanup of AI-generated code — removes LLM-specific patterns while preserving behavior. Use when the user says "deslop", "slop", "clean AI code", "remove AI patterns", or when you spot LLM-generated code smells after any generation session. For general post-change review and fixes ("clean up", "simplify"), use the simplify skill instead./karpathyBehavioral guardrails to prevent common LLM coding mistakes — enforces surgical changes, assumption verification, and scope discipline before and during implementation. Use when implementing features, modifying code, or when you notice yourself about to make changes without reading the existing code first./long-runOrchestrates multi-day execution of complex tasks through milestones. Each milestone goes through plan-crafting, run-plan (worker-validator), and review-work phases with checkpoint/recovery. Runs autonomously end-to-end — no per-milestone approval gates; escalates to the user only on failures. Triggers when the user says "long run", "start long run", "execute milestones", or "run all milestones"./milestone-planningDecomposes complex, multi-day tasks into optimized milestones (ultraplan). Broad parallel exploration grounds a draft milestone DAG, then independent adversarial critics attack the draft in rounds until no blocking findings remain. Triggers when the user says "plan milestones", "break this into milestones", "ultraplan", or when long-run harness needs milestone generation./plan-craftingUse when a task's scope is clear and multi-step implementation is needed, before touching code. Triggered after clarification is complete, or when the user explicitly requests plan creation with a clear prompt.Other plugins' skills for the same job