옵션
집 Skill 코드 검토 code-simplify

이 스킬은 사용자가 “코드를 단순화해 주세요”, “코드를 정리해 주세요”, “명확성을 위해 리팩토링해 주세요”, “복잡성을 줄여 주세요”, “가독성을 높여 주세요”, “유지보수를 더 쉽게 만들어 달라”는 요청을 하거나, 최근에 수정된 코드를 단순화해 달라고 요청할 때 사용해야 합니다.

...모든 것을 확장하십시오
71
업데이트 된 시간 2026년 7월 2일

소개 code-simplify

code-simplify 스킬은 기존 코드의 런타임 동작, 공개 인터페이스, 부수 효과 및 운영 의도를 유지하면서 코드를 단순화하도록 설계되었습니다. 이 스킬은 개발자가 기능적 변경을 도입하지 않고도 복잡성을 줄이고, 가독성을 높이며, 코드 유지보수를 용이하게 할 수 있도록 돕습니다. 이 기능은 광범위한 재작성보다는 안전하고 목표 지향적인 리팩토링에 중점을 두어, 입력, 출력, 오류 처리 방식 및 외부에서 의존하는 계약이 안정적으로 유지되도록 보장합니다. 이 기능은 코드가 이해하기 어려워졌거나, 지나치게 중첩되었거나, 중복되었거나, 불필요하게 복잡해진 상황에 사용하도록 의도되었습니다.

이 스킬은 사용자가 지정한 대상, 최근 수정된 파일 또는 리포지토리 변경 사항을 기반으로 적절한 범위를 결정합니다. 변경을 수행하기 전에 주변 컨텍스트를 분석하여 동작의 기준선을 설정합니다. 단순화는 제어 흐름 평탄화, 명명 규칙 명확화, 중복 제거, 밀집된 데이터 변환을 더 명확한 단계로 재구성, 그리고 적절한 경우 유형이나 계약의 명확성 개선 등을 포함하는 체계적인 프로세스를 통해 수행됩니다. 이 워크플로는 소규모의 되돌릴 수 있는 수정을 강조하며, 기존 프로젝트 규칙, 린터, 포맷터 및 테스트를 따릅니다. 안전 규칙은 명시적인 지시 없이 동기식 API를 비동기식으로 변환하거나, 운영상의 안전 장치를 제거하거나, 외부 인터페이스를 변경하는 등 동작을 변경하는 수정을 방지합니다.

이 기술은 기능을 변경하지 않으면서 코드 품질을 향상시키고자 하는, 지속적으로 발전하는 코드베이스를 다루는 개발자, 유지보수 담당자 및 팀에게 유용합니다. 일반적인 사용 사례로는 최근 수정된 코드 정리, 가독성을 위한 리팩토링, 복잡한 함수에서 인지 부하 감소, 중첩된 논리 단순화, 장기적인 유지보수를 위한 코드 준비 등이 있습니다. 이 기술은 검증과 동작 안정성이 중요한 요구 사항인 리포지토리 기반 개발 워크플로우에서 특히 유용합니다.

자주 묻는 질문

이 스킬은 언제 사용해야 하나요?

코드를 단순화하거나, 가독성을 높이거나, 복잡성을 줄이거나, 최근에 수정된 코드를 정리하거나, 코드의 동작을 변경하지 않고 유지보수를 용이하게 하고 싶을 때 이 스킬을 사용하세요.

이 스킬이 애플리케이션의 동작이나 공개 API를 변경하나요?

아니요. 이 스킬은 런타임 동작, 공개 계약, 부수 효과, 입력, 출력 및 외부에서 의존하는 오류 의미론을 보존하도록 설계되었습니다.

이 스킬을 사용하려면 Git 저장소가 필요한가요?

네. 워크플로는 리포지토리 컨텍스트를 확인하는 것으로 시작됩니다. 현재 디렉터리가 Git 리포지토리가 아닌 경우, 프로세스가 중단되고 리포지토리에서 실행할 것을 요청합니다.

스킬은 어떤 파일을 수정할지 어떻게 결정하나요?

사용자가 지정한 대상이 있는 경우 이를 사용합니다. 그렇지 않은 경우, 세션에서 수정된 파일에 우선순위를 두며, 세션에서 수정된 파일이 없는 경우에는 커밋되지 않은 추적 대상 파일 및 추적되지 않은 파일로 대체할 수 있습니다.

수행되는 리팩토링 유형에 제한이 있나요?

네. 이 스킬은 동작을 변경하는 수정, 광범위한 재작성, 불필요한 추상화, 동기식 대 비동기식 API 간의 변경, 그리고 로깅, 텔레메트리, 가드, 재시도 또는 기타 운영상 중요한 코드의 제거를 피합니다.

GitHub에서 보기

Code Simplify

Objective

Simplify code while preserving behavior, public contracts, and side effects. Favor explicit code and local clarity over clever or compressed constructs.

Arguments

  • Paths, patterns, a commit/range, or a scope phrase: used in Scope Resolution step 2.
  • --no-report: Skip the full user-facing report and return terse working notes for the caller.
  • --no-verify: Skip verification because a parent orchestrator will verify the final result separately.
  • Default: verify touched behavior and present the full report.

Scope Resolution

Resolve scope once, then treat the result as fixed for the rest of the run.

  1. Verify repository context: git rev-parse --git-dir. If this fails, stop and tell the user to run from a git repository.
  2. If the request names targets — file paths/patterns, a commit/range, a natural-language subset (e.g. "the parser changes"), or a resolved-scope fenced block with one repo-relative path per line — scope is exactly those targets. Map natural-language subsets to concrete paths before continuing.
  3. Otherwise, scope is only session-modified files: files created or edited earlier in this session. Do not include other uncommitted changes.
  4. If there are no session-modified files, or earlier conversation history is not visible in this context, fall back to all uncommitted files, running each command once:
    • tracked: git diff --name-only --diff-filter=ACMR
    • untracked: git ls-files --others --exclude-standard
    • combine both lists and de-duplicate.
  5. Exclude generated/low-signal files unless explicitly requested: lockfiles, minified bundles, build outputs, vendored code.
  6. If scope resolves to zero files, report that and stop.
  7. Emit the scope as a fenced code block tagged resolved-scope, one repo-relative path per line. The block is authoritative: do not re-run scope commands or revisit exclusions afterward.

Operating Rules

  • Preserve runtime behavior exactly. Keep inputs, outputs, side effects, and error behavior stable.
  • Prefer project conventions over personal preferences. Infer conventions from existing code, linters, formatters, and tests.
  • Make small, reversible edits. Avoid broad rewrites when targeted simplifications solve the problem.
  • Call out uncertainty immediately when behavior may change.

Workflow

1) Determine Scope

  • Apply the Scope Resolution section.

2) Build a Behavior Baseline

  • Read surrounding context, not only changed lines.
  • Identify invariants that must not change:
    • function signatures and exported APIs
    • state transitions and side effects
    • persistence/network behavior
    • user-facing messages and error semantics where externally relied on
  • Note available verification commands (lint, tests, typecheck).

3) Apply Simplification Passes (in this order)

  1. Control flow:
    • Flatten deep nesting with guard clauses and early returns.
    • Replace nested ternaries with clearer conditionals.
  2. Naming and intent:
    • Rename ambiguous identifiers when local context supports safe renaming.
    • Separate mixed concerns into small helpers with intent-revealing names.
  3. Duplication:
    • Remove obvious duplication.
    • Abstract only when at least two real call sites benefit and the abstraction reduces cognitive load.
  4. Data shaping:
    • Break dense transform chains into named intermediate steps when readability improves.
    • Keep hot-path performance characteristics stable unless improvement is explicit and measured.
  5. Type and contract clarity:
    • Add or tighten type annotations when they improve readability and safety without forcing broad churn.
    • Preserve external interfaces unless asked to change them.

4) Enforce Safety Constraints

  • Do not convert sync APIs to async (or reverse) unless explicitly requested.
  • Do not alter error propagation strategy unless behavior remains equivalent and verified.
  • Do not remove logging, telemetry, guards, or retries that encode operational intent.
  • Do not collapse domain-specific steps into generic helpers that hide intent.

5) Verify

Skip when --no-verify is set. Otherwise verify per the Verification section below.

6) Report

Produce the Report section below.

Simplification Heuristics

  • Prefer explicit local variables over nested inline expressions when it reduces cognitive load.
  • Prefer one clear branch per condition over compact but ambiguous condition trees.
  • Keep function length manageable, but do not split purely for line count.
  • Keep comments that explain intent, invariants, or non-obvious constraints.
  • Remove comments that restate obvious code behavior.
  • Optimize for the next maintainer's comprehension time, not minimum character count.

Anti-Patterns

  • Do not perform speculative architecture rewrites.
  • Do not introduce framework-wide patterns while simplifying a small local change.
  • Do not replace understandable duplication with opaque utility layers.
  • Do not bundle unrelated cleanups into one patch.

Verification

Run the narrowest checks that validate touched behavior:

  • formatter/lint on touched files
  • targeted tests for touched modules
  • typecheck when relevant

Run broader checks only when risk warrants it. Name every skipped check and why.

Report

Skip when --no-report is set; return terse working notes instead: touched scope, key simplifications, residual risks.

Use these section headings, in this order. Omit sections that do not apply — do not number them and do not leave gaps or placeholders.

Scope

Files and regions changed.

Simplifications

One sentence per meaningful change, focused on the readability or maintainability gain. Confirm behavior-preservation assumptions explicitly.

Verification

Commands run and outcomes, including skipped checks.

Residual Risks

One line per risk: Assumed <assumption>; if wrong, <what breaks>; check via <command or inspection>. Plain language — expand or gloss domain-specific terms. Include questions that need a user decision, phrased directly. Write None. when there are none.

Stop Conditions

Stop and ask for direction when:

  • simplification requires changing public API/contracts.
  • behavior parity cannot be confidently verified.
  • the code appears intentionally complex due to domain constraints.
  • the requested scope implies a larger redesign rather than simplification.

모든 파일

1개 파일

code-simplify 설치

스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.

ZIP 다운로드

저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.

git clone https://github.com/PaulRBerg/agent-skills/blob/main/skills/code-simplify/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

복사 복사
빠른 설정: skill 폴더를 .claude/skills/로 복사하면 Claude가 해당 스킬을 자동으로 감지하여 사용합니다.

관련 스킬

requesting-code-review
업데이트 된 시간 2026년 6월 29일
Git Commit Helper
업데이트 된 시간 2026년 6월 29일
commit-standards
업데이트 된 시간 2026년 6월 29일
fetch-pr-review-comments
업데이트 된 시간 2026년 6월 29일
OR