Community코딩 & 개발github.com

안전한 리팩터링

동작을 유지하면서 코드 구조를 변경합니다. 추출, 통합, 소유권 이동 또는 정리에 사용되며, 검증이 구조적 편집을 감싸야 합니다.

안전한 리팩터링란 무엇인가요?

이 스킬은 코드의 동작을 변경하지 않으면서 구조를 안전하게 재구성하는 방법을 제공합니다. 특히 추출(extraction), 통합(consolidation), 소유권 이동(ownership moves), 또는 정리(cleanup) 작업에 적합하며, 모든 구조적 변경 전후에 동작 보존 경계를 정의하고 검증을 수행합니다. 주요 원칙으로는 리팩터링 범위 내에서 기능 변경을 배제하고, 한 번에 하나의 소유권 경계만 이동하며, 공용 인터페이스와 실패 동작, 순서, 호환성을 유지하는 것을 강조합니다. 중간 상태도 항상 빌드 가능하고 테스트 가능해야 하며, 종속성이나 설정을 부당하게 늘리지 않습니다. 변경 후 동일한 증명(proof)을 실행하여 동작이 일치하고 요청된 구조가 달성될 때까지 반복합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/JuliusBrussee/caveman/tree/main/skills/safe-refactor

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

안전한 리팩터링은(는) 무엇을 하나요?

동작 보존 경계를 정의하고 구조적 편집 전에 검증을 수립합니다.

  • 기능 변경은 리팩터링 범위 밖에서 수행하세요.
  • 한 번에 하나의 소유권 경계만 이동하세요.
  • 명시적으로 범위를 지정하지 않는 한 공용 인터페이스, 실패 동작, 순서, 호환성을 유지하세요.
  • 중간 상태를 빌드 가능하고 테스트 가능하게 유지하세요.
  • 정확성 필요 없이 종속성이나 설정이 늘어나지 않도록 하세요.

변경 후 동일한 증명을 실행하세요. 동작이 일치하고 요청된 구조가 달성될 때까지 중단하지 마세요.

Individual skills in this repo

This repo contains 12 individual skills — each has its own dedicated page.

JuliusBrussee/caveman-discover

Find and label every LLM workflow in the repository so Caveman Cloud groups spend by workflow instead of one bucket. Use for "discover workflows" or breaking LLM spend down by workflow.

JuliusBrussee/caveman-evidence-review

Read-only review of Caveman Cloud evidence: cost, Cave Score, workflows, traces, latency, errors, routing, savings. Use when asked what Caveman found or where LLM spend goes.

JuliusBrussee/caveman-explore

Read-only repository explorer for cold-start orientation, broad cross-file localization, or when a direct search failed. Skip it when the exact file or symbol is already named. Returns path:line citations only; its reads stay out of main context.

JuliusBrussee/caveman-learn

Act on a Caveman learn report - review the ranked token sinks, apply cost-lowering fixes with per-edit consent, and report what those fixes returned. Use when asked to lower an agent's token cost, what caveman has saved, to trim a heavy CLAUDE.md, or to offload re-pasted context into cavemem.

JuliusBrussee/caveman-manage

Inspect Caveman Cloud's experiment lifecycle and block unsafe execution. Use when asked to start, approve, cancel, promote or roll back a Caveman experiment.

JuliusBrussee/caveman-optimize

Turn a Caveman optimization observation into an operator-chosen candidate with a paired baseline evaluation. Use when asked to inspect or evaluate a Caveman optimization report. Needs explicit approval.

JuliusBrussee/caveman-setup

Wire a repository through the Caveman Cloud gateway so every LLM request is measured, with no behavior change. Use for "set up caveman" or adding LLM spend observability.

JuliusBrussee/investigate-first

Diagnose ambiguous failures before editing. Use for unknown causes, intermittent behavior, performance regressions, or investigations needing evidence-ranked hypotheses.

JuliusBrussee/lean-build

Build feature work with high overbuilding risk. Use for new behavior, product slices, or integrations where repository reuse, strict scope, and an explicit stop condition matter.

JuliusBrussee/migration

Implement reversible compatibility-safe transitions. Use for schema, data, API, protocol, configuration, or dependency migrations requiring rollback and preservation proof.

JuliusBrussee/surgical-patch

Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests matter.

JuliusBrussee/verify-and-stop

Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.

관련 스킬