본문으로 건너뛰기
Skillpedia
일반 코딩10k · #12017

simplify

하는 일

이 스킬은 동작을 바꾸지 않으면서 작동하는 코드를 더 명확하고 단순하게 만듭니다. 다른 사람이 읽고 바꾸기 쉬운 코드를 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓기능은 작동하고 테스트도 통과하지만 코드가 필요 이상으로 무거울 때.
  • ✓함수가 길거나 깊게 중첩되어 있거나 이름이 불분명할 때.
  • ✓코드 리뷰에서 가독성이나 복잡성 문제가 지적될 때.

스킬 링크

https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/simplify/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/simplify/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 함수는 작동하지만 따라가기 어렵습니다. 동작은 그대로 두고 단순하게 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 먼저 동작을 이해했는지 확인한 뒤, 입력, 출력, 오류 처리를 그대로 유지하는 변경을 합니다. 이미 명확한 코드는 건너뜁니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Code Simplification

Overview

Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines - it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"

When to Use

  • After a feature is working and tests pass, but the implementation feels heavier than it needs to be
  • During code review when readability or complexity issues are flagged
  • When you encounter deeply nested logic, long functions, or unclear names
  • When refactoring code written under time pressure
  • When consolidating related logic scattered across files
  • After merging changes that introduced duplication or inconsistency

When NOT to use:

  • Code is already clean and readable - don't simplify for the sake of it
  • You don't understand what the code does yet - comprehend before you simplify
  • The code is performance-critical and the "simpler" version would be measurably slower
  • You're about to rewrite the module entirely - simplifying throwaway code wastes effort

The Five Principles

1. Preserve Behavior Exactly

Don't change what the code does - only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.

Before every change, ask:

  • Does this produce the same output for every input?
  • Does this maintain the same error behavior?
  • Does this preserve the same side effects and ordering?
  • What proportionate final-state verification will reveal a behavior change?

2. Follow Project Conventions

Simplification means making code more consistent with the codebase, not imposing external preferences.

Before simplifying:

  1. Read AGENTS.md / project conventions
  2. Study how neighboring code handles similar patterns
  3. Match the project's style for imports, naming, function style, error handling, and type annotations

Simplification that breaks project consistency is not simplification - it's churn.

3. Prefer Clarity Over Cleverness

Explicit code is better than compact code when the compact version requires a mental pause to parse.

  • Replace nested ternaries with readable control flow
  • Replace dense inline transforms with named intermediate steps when they clarify intent
  • Keep helpful names even if they cost a few extra lines

4. Maintain Balance

Watch for over-simplification:

  • Don't inline away names that carry meaning
  • Don't merge unrelated logic into one larger function
  • Don't remove abstractions that serve testability or extensibility
  • Don't optimize for line count over comprehension

5. Scope to What Changed

Default to simplifying recently modified code. Avoid unrelated drive-by refactors unless explicitly asked.

Process

Step 1: Understand Before Touching

Before changing or removing anything, understand why it exists.

Answer:

  • What is this code's responsibility?
  • What calls it? What does it call?
  • What are the edge cases and error paths?
  • Are there tests that define expected behavior?
  • Why might it have been written this way?

If you can't answer these, read more context first.

Step 2: Look for Simplification Opportunities

Signals:

  • Deep nesting
  • Long functions with mixed responsibilities
  • Nested ternaries
  • Boolean flag arguments
  • Repeated conditionals
  • Generic or misleading names
  • Duplicated logic
  • Dead code
  • Wrappers or abstractions that add no value

Step 3: Apply Changes Incrementally

Make one simplification at a time.

For each simplification:

  1. Make the change
  2. Use the proportionate final-state verification plan to check preservation
  3. Keep it only when the evidence supports preservation

Separate refactoring from feature work whenever possible.

Step 4: Verify the Result

After simplifying, confirm:

  • The code is genuinely easier to understand
  • The diff is clean and reviewable
  • Project conventions still match
  • No behavior, error handling, or side effects changed

Guidance for This Repository

  • Prefer straightforward TypeScript over clever compression
  • Preserve existing runtime behavior, tests, and hooks
  • Favor explicit names and smaller focused helpers when they improve readability
  • Keep refactors tightly scoped to the task or review feedback

Final-state verification

Use a proportionate final-state verification plan for the final diff. Run checks required by r

자주 묻는 질문

코드 동작이 바뀌나요?

동작은 정확히 같아야 한다고 스킬은 설명하며, 확실하지 않은 변경은 피합니다.

줄 수를 줄이는 것이 목표인가요?

아니요. 목표는 읽고, 이해하고, 바꾸기 쉬운 코드입니다.

언제 건너뛰어야 하나요?

코드가 이미 깔끔하거나, 성능이 중요한 코드라서 단순한 버전이 측정 가능하게 느려질 때입니다.

상세 정보

작성자의 원본 설명

Simplifies code for clarity without changing behavior. Use for readability, maintainability, and complexity reduction after behavior is understood.

repo: alvinunreal/oh-my-opencode-slim

인기도

GitHub 스타
10k
순위
#12017
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬