Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/arbazkhan971/godmode --skill refactor명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | refactor |
| description | Large-scale code refactoring and transformation. |
/godmode:refactor, "refactor this", "clean up"find . -name "*.ts" -o -name "*.js" -o -name "*.py" \
| xargs wc -l | sort -rn | head -20
grep -rn "<pattern>" --include="*.ts" --include="*.js"
Target: <file or module>
Lines: <N> | Complexity: <cyclomatic> | Coverage: <N%>
Dependents: <N files> | Risk: LOW|MEDIUM|HIGH|CRITICAL
Risk levels:
IF coverage < 60%: write characterization tests first. IF dependents > 30: use strangler pattern migration.
Extract (Function, Class, Interface, Module, Variable, Parameter), Inline (Function, Variable), Move (Function, Field), Rename (Symbol, File), Simplify (Conditional, Loop, Guard Clause), Replace (Inheritance with Composition, Conditional with Polymorphism).
grep -rl "<symbol>" --include="*.ts" --include="*.js"
Map directly affected (modified), indirectly affected (imports changed), and not affected files.
npm test 2>&1 | tail -10
npx jest --testPathPattern="<target>" 2>&1
IF coverage < 60%: STOP, write characterization tests, commit them separately, then proceed.
One transformation per commit. For each step:
"refactor: <pattern> -- <desc>"IF tests fail after transformation: revert first, then diagnose. Never debug forward.
Strangler pattern: create new alongside old, migrate dependents one at a time, each migration = separate commit, remove old code only after zero references.
IF >5 dependents: phase the migration over multiple PRs.
npm test
Compare: test count same or higher, coverage same or higher, no behavior change. Report pattern used, commits, files modified/created/deleted.
Cyclomatic: <= 10/function (eslint, radon, gocyclo)
Cognitive: <= 15/function (SonarQube, eslint sonarjs)
LOC: <= 50/function (wc -l)
Append .godmode/refactor.tsv:
timestamp target pattern tests_before tests_after coverage_before coverage_after status
KEEP if: tests pass AND complexity reduced
AND coverage maintained or increased.
DISCARD if: tests fail OR complexity unchanged
OR coverage dropped.
STOP when FIRST of:
- All targets below thresholds
(cyclomatic <= 10, cognitive <= 15)
- Test count and coverage same or higher
- Zero dead code detected
On failure: git reset --hard HEAD~1. Never pause.
| Failure | Action |
|---|---|
| Tests fail after transform | Revert, plan smaller step |
| Coverage decreases | Write tests before continuing |
| Circular dependency | Extract shared into new module |