simplify
하는 일
이 스킬은 동작을 바꾸지 않으면서 작동하는 코드를 더 명확하고 단순하게 만듭니다. 다른 사람이 읽고 바꾸기 쉬운 코드를 원하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓기능은 작동하고 테스트도 통과하지만 코드가 필요 이상으로 무거울 때.
- ✓함수가 길거나 깊게 중첩되어 있거나 이름이 불분명할 때.
- ✓코드 리뷰에서 가독성이나 복잡성 문제가 지적될 때.
스킬 링크
https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/simplify/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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:
- Read
AGENTS.md/ project conventions - Study how neighboring code handles similar patterns
- 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:
- Make the change
- Use the proportionate final-state verification plan to check preservation
- 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.
인기도
- GitHub 스타
- 10k
- 순위
- #12017
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
cli-review
10k에이전트가 풀 리퀘스트를 열기 전에 현재 브랜치에서 Greptile 코드 리뷰를 실행하고, 결과를 쉬운 말로 요약하도록 돕습니다.
ai-estimates
10k에이전트가 사람이 AI와 함께 일할 때 작업 시간을 추정하도록 돕습니다. 빠른 AI 작업과 사람 또는 외부의 지연을 나눠 계산합니다.
clonedeps
10k에이전트가 프로젝트의 핵심 의존성 소스 코드를 로컬 폴더에 복사해, 그 라이브러리가 내부에서 어떻게 작동하는지 읽을 수 있게 합니다.
codemap
10k낯선 코드 프로젝트의 구조화된 지도를 만들어, 에이전트가 주요 부분을 빠르게 찾도록 돕습니다. 코드베이스 지도를 요청할 때 가장 잘 쓰입니다.