본문으로 건너뛰기
cccskills
무료GitHub에 공개

code-simplification

Simplify code that works — remove speculative abstraction, dead flexibility, and needless indirection while keeping behaviour identical and verified. Use when a feature has just landed ('now simplify it'), when AI-generated code arrives over-engineered, when a file has grown hard to follow, or as the cleanup pass before review. Produces a smaller, flatter version with identical behaviour, plus a ledger of what was removed and why it was safe. For finding bugs use code-review-checklist / ai-code-review — this skill assumes it works and makes it simple.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Code Simplification Skill

Code accretes defensive complexity: abstractions for futures that never came, options nobody passes, indirection that once had a reason. AI-generated code arrives pre-accreted — interfaces with one implementer, config objects with nine unused knobs. Simplification is its own pass with its own rule: behaviour identical, verified; complexity removed, listed.

What This Skill Produces

  • The simplified code — smaller, flatter, same behaviour
  • A removal ledger: each simplification, why it was safe, and what future it forecloses (honestly)
  • Verification evidence that behaviour held

Required Inputs

Ask for these if not provided:

  • The code — what works today and should keep working
  • The pressure — what made it feel complex: onboarding, a bug, a review comment
  • What must not change — the public API, behaviour, or performance envelope
  • Test coverage — whether there are tests to prove the simplification is safe

Working from a brief

Given a description of the code instead of the code itself, deliver the simplification anyway: the target shape in code, each removal with the reason and the test that proves behaviour is unchanged, and the order to do them in. Say which steps need a look at the real code before they are applied.

What to Hunt (in order of payoff)

  1. Speculative generality — the interface with one implementation, the parameter always called with the same value, the config option no caller sets, the "pluggable" thing nothing plugs into. Rule: the future that justified it must be on a roadmap, not in an imagination. YAGNI is a removal warrant.
  2. Indirection without insulation — layers that only forward: the wrapper that calls one function, the factory returning one type, the event fired for one listener sitting next door. Each hop costs a reader a jump; collapse hops that don't isolate change.
  3. Dead and duplicate paths — unreachable branches, handled-nowhere flags, the local re-implementation of a utility that exists (grep before believing anything is unique).
  4. Cleverness taxing readers — the nested ternary, the reduce that should be a loop, the regex doing four jobs. Rewrite for the next reader; "fewer characters" is not "simpler".
  5. Flatten control flow — guard clauses over nested ifs; early returns over else-pyramids; splitting the function that needs a comment per section into functions named by those comments.

The Safety Discipline (what makes this different from vandalism)

  • Behaviour-preserving means verified, not asserted: run the full relevant suite before AND after; if coverage is thin over the code being simplified, add the pinning test first — simplifying untested code is refactoring blind.
  • One hunt-class per pass where the code is load-bearing (remove speculation, verify; collapse indirection, verify) — mirrors incremental-implementation's rule.
  • Chesterton's fence check on anything weird: git log/blame the strange bit before deleting it. Some "needless" complexity is a bug fix wearing an odd shape — if the history shows a fix, keep it and comment WHY it's shaped that way instead.
  • Public surface needs a wider net: simplifying exported/shared code means checking callers across the codebase, not just the local file.

Output Format

Simplification: [target]

Verification: [suite/build run before → after: identical] · pinning tests added: [n or none-needed because…]

Removal ledger

What was removed/flattenedClassWhy safeFuture foreclosed (honest)

Kept deliberately: [the weird-but-load-bearing bits, with their Chesterton evidence] Size: [LOC/complexity before → after]

Quality Checks

  • Full verification ran before and after — identical behaviour, evidenced
  • Thinly-tested code got pinning tests before simplification
  • Every removal states the future it forecloses — "none" must be argued, not assumed
  • Strange code was history-checked before deletion (Chesterton's fence)
  • The result is simpler for a READER, not just shorter

Anti-Patterns

  • Do not simplify and change behaviour in one pass — the moment behaviour shifts, this became a rewrite without a spec
  • Do not delete weirdness without checking why it's weird — some of it is a production incident's scar tissue
  • Do not confuse terse with simple — code golf raises the reading tax this skill exists to cut
  • Do not remove flexibility that's actually on the roadmap — YAGNI applies to imagined futures, not planned ones
  • Do not skip the ledger — invisible simplification is indistinguishable from unexplained deletion in review

Example Trigger Phrases

  • "Now simplify it."
  • "This AI-generated code is over-engineered: simplify it."
  • "Remove the dead abstraction in this file."
  • "Make this simpler without changing behaviour."

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Design a 360-degree feedback survey or write a structured 360 feedback report. Use when asked to build a 360 feedback process, write 360 feedback for a colleague, design a feedback survey, or produce a feedback report. Produces either a complete survey instrument with rating scales and open-ended questions, or a structured narrative feedback report with themes, strengths, and development areas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mohitagw15856/pm-claude-skills1.5천2026년 10월 19일 업데이트

Decode a 401k or workplace retirement plan — the real cost of its funds, the match's fine print, vesting math, and the plan features worth using or avoiding. Use when someone asks 'is my 401k any good', 'decode my 401k plan', 'which funds should I look at', or 'what fees am I paying'. Produces a fee decode in dollars-over-time, match and vesting math, a fund-lineup triage by cost, and the questions for HR or the plan administrator.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mohitagw15856/pm-claude-skills1.5천2026년 10월 19일 업데이트

Design statistically rigorous A/B tests for product features, UI changes, onboarding flows, and pricing experiments. Use when asked to set up an experiment, design an A/B test, calculate sample size, or interpret test results. Produces a complete test plan with hypothesis, variant definitions, sample size, duration estimate, guardrail metrics, and a results interpretation guide.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mohitagw15856/pm-claude-skills1.5천2026년 10월 19일 업데이트

Analyse a finished A/B test and write the readout — the result, whether it's statistically and practically significant, what it means, and the ship/no-ship call. Use when asked to analyse experiment results, write an A/B test readout, interpret test data, or decide whether to ship a variant. Produces a clear verdict with the lift and confidence, segment cuts, the risks (peeking, novelty, sample), and a recommendation. Distinct from planning a test — this reads results.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mohitagw15856/pm-claude-skills1.5천2026년 10월 19일 업데이트

Build or tailor an academic CV for faculty, postdoc, research or fellowship applications: publications, grants, teaching, supervision and service in the order the field expects, with consistent citations. Use when asked to write my academic CV, update my CV for a lectureship, tenure-track or postdoc application, format my publications list, or adapt my academic CV for an industry research role. Produces the full academic CV, a field-appropriate section order, a clean publications list in one citation style, and a two-page summary version when asked.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mohitagw15856/pm-claude-skills1.5천2026년 10월 19일 업데이트

Generate a WCAG 2.2 accessibility audit checklist and remediation suggestions for any UI or design. Use when asked to audit for accessibility, check WCAG compliance, review a design for a11y issues, or create an accessibility remediation plan. Produces a prioritised checklist with pass/fail assessments and specific fixes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

mohitagw15856/pm-claude-skills1.5천2026년 10월 19일 업데이트

mohitagw15856의 스킬 모두 보기

이 스킬의 문제 신고