Skip to content
cccskills
FreePublished on GitHub

mk:simplify

Post-implementation simplification pass. Reduces complexity without changing behavior. Use after Phase 3 (Build GREEN) and before Phase 4 (Review). Catches dead code, unnecessary abstractions, over-engineering, and redundant patterns. Triggers on "simplify", "clean up", "reduce complexity", "too complex". NOT for style/convention enforcement (see mk:clean-code); NOT for reviewing diffs or PRs (see mk:review).

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Code Simplification

Runs after implementation, before review. Reduces complexity while preserving behavior.

For ad-hoc quality review outside the current implementation diff, use mk:clean-code. mk:simplify is behavior-preserving and scoped to the current diff only.

Iron Rule

Behavior must not change. Every simplification must pass the exact same tests as before. If tests fail after simplification, the simplification was wrong — revert it.

What to Look For

Remove

  • Dead code — functions never called, variables never read, unreachable branches, import never used
  • Commented-out code — if it's in git history, delete it from source
  • Unnecessary abstractions — wrapper that adds no value, interface with one implementation
  • Redundant null checks — checking null after a guard that already prevents null

Simplify

  • Deep nesting — 3+ levels of if/else → extract early returns or guard clauses
  • God functions — >50 lines → extract focused helpers
  • Duplicate logic — same pattern in 3+ places → extract shared utility
  • Complex conditions — if (a && !b || (c && d)) → extract to named boolean or function

Don't Touch

  • Working code that's "not how I'd write it" — style is not complexity
  • Performance-optimized code — it looks complex for a reason
  • Code outside the current diff — scope discipline, even for simplification

Process

  1. Identify — scan changed files for complexity signals
  2. Propose — list each simplification with before/after preview
  3. Apply — make changes one at a time
  4. Verify — run full test suite after each change (not batched)
  5. Report — list what was simplified and why

Gotchas

  • "Just one more cleanup" — scope creep is the #1 risk. Only simplify code from the current diff
  • Removing "dead" code that's used via reflection/dynamic import — grep for string references, not just static imports
  • Extracting too early — 2 copies is not enough to justify a shared utility. Wait for 3
  • Breaking public API — simplifying internals is fine; changing exported signatures is a breaking change
  • Test-only code — don't simplify test helpers/fixtures; they prioritize readability over DRY

Pipeline Position

Phase 2 (Test — RED if `--tdd`) → Phase 3 (Build) → [mk:simplify] → Phase 4 (Review)

Simplification happens AFTER tests pass but BEFORE review. Reviewer sees the simplified code.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use this skill to generate well-branded interfaces and assets for MeowKit (AI Agent Toolkit for Claude Code), either for production or throwaway prototypes/mocks/etc. Contains essential design guidelines, colors, type, fonts, assets, and UI kit components for prototyping.

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Turn a raw idea into ONE honest recommendation: interview one question at a time until confirmed, then give a verdict with trade-offs and a checklist. Not for options or debate.

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Browser automation CLI for agents: navigate, click/fill, screenshot, extract data, test apps, Electron/Slack, cloud browsers. NOT for the user's real Chrome profile/cookies (mk:chrome-profile).

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Detects the right agent and complexity tier at Phase 0 orient; runs first in every workflow. NOT for runtime agent routing inside a single skill.

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Angular v20+ patterns: components, signals, services, forms, routing, HTTP, testing, SSR. Auto-activates on .ts files in Angular projects (angular.json detected).

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

Design and review durable REST, GraphQL, RPC, or event API contracts: shape, compatibility, pagination, error semantics. Discovers existing consumers first. Not implementation, schema, or release.

The English summary is being prepared. Showing the original description.

ngocsangyem/MeowKit15Updated Jul 28, 2026

See all skills by ngocsangyem

Report a problem with this skill