소스 정보
- 저장소
- devdotfast/skills
- 최근 소스 활동
- 2026년 10월 4일 06:14
- 감지된 SKILL.md 언어
- 영어
- 스타
- 5
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
파일 탐색기
2 개 파일SKILL.md 표시 중
SKILL.md
소스 지침 · 읽기 전용 미리보기- name
- deslop-code
- description
- clean up code layering and unnecessary abstractions in drive-by fixes
- disable-model-invocation
- true
There are a few great levers when cleaning up code:
1. Cleaning up dead code. Analyze every line of the commit. Your reviewer will nitpick. Ask yourself: did this HAVE to change? If not, revert it.
2. Creating a drive-by fix PR or commit in the code to make it read better overall. Improves code quality and makes it easier to reason about.
## Part 1: Cleaning up dead code
Be aggressive when deleting code; question the user if things are ok to delete but perhaps aren't covered in E2E tests or (formal) specifications (may be a missing edge case). Consult git history, trace storage, issue tracking, slack, etc. to autonomously come to a conclusion autonomously if you can; only refer to the human if you can't be sure.
## Part 2: Improving Codebase Quality
Think in terms of John Ousterhout's "A Philosophy of Software Design"; specifically, in optimizing for deep modules over shallow ones. You want narrow interfaces which provide deep functionality.
These sort of changes work best as no-op cleanup commits or PRs. Do not mix behavior changes with them if at all possible. You are trying to set up some "drive-by fixes" that leave the code better than you found it.
It's best to write code like this from the start, but often coding changes leave room for consolidation; imagine a callstack that looks like:
```
handle_checkout() # A
-> create_order() # B'
-> insert_order() # C
```
where, in the process of feature work, B' has been modified.
This is a great opportunity to look at A & C and consider whether those abstractions are shallow. Some rules of thumb:
- Consider only the production code from the perspective of a new reader. How many hops do they need to "jump" in a codebase on this callstack to get to the "meat" of the functionality? You are trying to minimize the number of those hops for that person.
- Ignore unit tests when thinking about this. Typically unit tests are fragile and tied to implementation.
- Small, tiny functions which just call out to each other, unnecessary interfaces to provide "abstraction" are typically smells of this. i.e. it is very painful to read code that requires >1 jump to understand what an abstraction actually *does*.
Once you refactor, you can repeat this process recursively (collapsing adjacent shallow layers of abstraction to form deeper modules).
Example of a great diff:
```diff
def run(args):
- return f(args)
-
-def f(args):
a, b = unpack(args)
return g(a, b)
def g(a, b):
# do something
```
GitHub에서 보기