본문으로 건너뛰기
cccskills
무료GitHub에 공개

refactor

Use when code quality needs improvement after implementation, without changing behavior

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Trevoke/org-gtd.el스타 486(GitHub 486 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md2.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

/refactor — Code Quality Pass

Overview

Improve code structure without changing behavior. Propose changes, get approval, make one change at a time with tests between each.

Core principle: Never change behavior. Tests must stay green after every change.

When to Use

  • After implementation and QA pass
  • User requests a quality check on recent work
  • You notice structural issues while working

The Process

1. Establish Baseline

Run the test suite first. Actually run it.

~/bin/eldev etest -r dot

Record the result. This is your safety net. If tests aren't green before you start, fix that first.

2. Identify What Changed

git diff main...HEAD    # if on a branch
git log --oneline -N    # user specifies range

Read all changed files in full — not just the diff. Context matters.

3. Find Issues

Look for:

IssueSignal
DRY violationsSame logic in two places
SRP violationsFunction hard to name (doing too much)
NamingNames don't match what the code does
Unnecessary complexityAbstraction not earning its keep
Dead codeUnreachable branches, unused functions

Don't look for:

  • Style preferences (tab vs space, quote style)
  • Missing documentation on unchanged code
  • "Improvements" to code you didn't change

4. Propose Changes — Get Approval

Present refactorings ordered by highest impact, lowest risk first:

### 1. [Title] — Impact: High, Risk: Low

**What**: [what to change]
**Why**: [why it improves the code]
**Risk**: [what could go wrong]

Ask the user which to do. Don't start changing code without approval.

5. Make Changes — One at a Time

For each approved refactoring:

  1. Run tests — confirm green before starting
  2. Make one change — a single, atomic refactoring
  3. Run tests — confirm still green
  4. Commit — describe the refactoring, not the code

If tests fail after a change: revert immediately. You introduced a bug.

6. Final Verification

~/bin/eldev etest -r dot

All tests must pass. Report the final state.

Common Mistakes

MistakeFix
Changing behavior ("while I'm here")Refactoring changes structure ONLY. If tests break, revert.
Not running tests before startingRun tests FIRST. No green baseline = no refactoring.
Making changes without user approvalPropose, get approval, then act.
Multiple changes at onceOne change, one test run, one commit. Atomic.
Renaming public APIThat's a breaking change, not a refactoring.
Proposing 10+ changesFocus on 3-5 highest-impact items. Less is more.
Describing changes without making themActually edit the files. Actually run the tests.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

architect

무료

Use when requirements exist and a technical design is needed before implementation begins

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Trevoke/org-gtd.el4862026년 8월 7일 업데이트

define

무료

Use when a new feature request, bug report, or work request needs requirements defined before implementation

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Trevoke/org-gtd.el4862026년 8월 7일 업데이트

implement

무료

Use when a design exists and it's time to break it into tasks and execute with subagent dispatch and review

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Trevoke/org-gtd.el4862026년 8월 7일 업데이트

qa

무료

Use when implementation is complete and you want to verify quality through adversarial testing that writes code and provides evidence

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Trevoke/org-gtd.el4862026년 8월 7일 업데이트

test

무료

Use EVERY TIME you need to run tests, verify tests pass, or check for regressions. ALWAYS use this instead of running eldev directly.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Trevoke/org-gtd.el4862026년 8월 7일 업데이트

Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Trevoke/org-gtd.el4862026년 8월 7일 업데이트

Trevoke의 스킬 모두 보기

이 스킬의 문제 신고