소스 정보
- 저장소
- andrem-sec/psc-comet
- 최근 소스 활동
- 2026년 4월 1일 00:39
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/andrem-sec/psc-comet --skill refactor명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | refactor |
| description | Safe refactoring protocol — behavior-preserving restructuring with test coverage gate |
| version | 0.1.0 |
| level | 2 |
| triggers | ["refactor","clean this up","restructure","extract this","simplify this"] |
| context_files | ["context/project.md"] |
| steps | [{"name":"Coverage Gate","description":"Confirm test coverage exists before touching anything. If coverage is below 80%, write tests first."},{"name":"Define Behavior Contract","description":"State what the code currently does — its observable behavior, not its structure. This is what must be preserved."},{"name":"Scope","description":"What is being refactored? One concern at a time."},{"name":"One Change","description":"Make one structural change. Run tests. Green. Move to next change."},{"name":"No Behavior Changes","description":"If a test breaks, the refactor changed behavior — stop and reassess."},{"name":"Verify","description":"Full test suite passes. Coverage did not regress. Behavior contract preserved."}] |
Behavior-preserving restructuring. The goal is a different structure that produces identical observable behavior.
Without refactor discipline, "refactoring" becomes a mix of restructuring, behavior changes, and new features in one pass. When something breaks, there is no way to know which change caused it. Tests that fail mid-refactor mean the scope was too large, but without the discipline to go one change at a time, the error is impossible to isolate.
Before touching any code, state what it currently does in terms of observable behavior — inputs, outputs, side effects. This is the contract.
If the refactor changes any of these, it is not a refactor — it is a feature change or a bug fix. Handle those separately.
One structural change at a time:
Run tests after each. If they pass, continue. If they fail, the change broke something — revert it and understand why before proceeding.
Do not batch. Do not "while I'm in here" add improvements. Do not rename AND restructure in one change.
Refactoring without tests is rearranging furniture in the dark. Before the first structural change:
This is not optional. Skipping it means the refactor cannot be verified.
| Operation | When to Use |
|---|---|
| Extract function | Block of code used in 2+ places, or a block that has a single clear responsibility |
| Rename | Name does not reflect current purpose (this happens after behavior is understood, not before) |
| Remove duplication | Same logic in 3+ places — but only if the logic is genuinely identical, not just similar |
| Flatten nesting | More than 3 levels of nesting in a single function |
| Extract class | A function or module has grown to handle 2+ distinct concerns |
| Inline | An abstraction that adds complexity without clarity — sometimes the direct version is better |
Do not refactor code you do not understand. Read it until you can state its behavior contract before touching it.
Do not refactor and fix bugs in the same pass. Fix first, then refactor.
Do not refactor code with no tests. Write tests first.
Do not "improve" variable names speculatively — rename only when you understand the current name is wrong.