본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)48k · #5617

repo-native-refactor

하는 일

이 도구는 프로그래밍 코드를 안전하게 검토하고 정리하는 데 도움을 줍니다. 오류를 확인하고, 코드가 기대대로 계속 작동하는지 확인하며, 핵심 동작을 바꾸지 않고 작은 개선을 합니다.

사용하는 경우

  • ✓AI가 코드를 바꾸지 않고 검토하기를 원할 때.
  • ✓이미 작동하는 코드에 작은 수정을 하고 싶을 때.
  • ✓반복되는 코드 부분을 정리하거나 단순하게 만들고 싶을 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/repo-native-refactor/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/repo-native-refactor/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 코드가 중요한 것을 깨뜨리지 않는지 검토하고, 간단히 개선할 수 있는 것이 있는지 봐 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 보안, 기능, 구성에 대한 규칙과 코드를 비교해 분석합니다. 오류 수정과 이미 작동하는 것의 유지를 우선하며, 꼭 필요하고 안전한 변경만 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Repo-native refactor

When to Use

  • Use when the user asks to review a diff, branch, or PR for correctness, contract breaks, or operational risk.
  • Use when the user authorizes bounded cleanup before opening a PR or asks to consolidate duplicated policy with shared ownership.
  • Use for repository rehabilitation only when the user explicitly requests work across multiple domains.
  • Establish review-only, edit, or combined authority before choosing the operating mode.

Produce the smallest coherent change that belongs naturally in the target repository.

Prioritize in order:

  1. Correctness and security: prevent regressions, avoid new security vulnerabilities, handle boundary conditions.
  2. Semantic integrity: preserve existing invariants, state transitions, validation, and error boundaries.
  3. Contracts stay as declared: the rule lives in references/shared-contracts.md §1. Preserve the authorized target contract; otherwise keep exact declared types. Internal helpers are fine when exposed contracts stay exact.
  4. Repository conformity: match surrounding naming, domain conventions, and architectural precedents.
  5. Economy and simplicity: minimal intervention. Delete dead weight, avoid premature abstractions.

This is a post-implementation audit and small cleanup skill. It is not permission to redesign the repository. Establish a concrete consequence such as inconsistent behavior, duplicated policy that must change together, unclear ownership, avoidable resource cost, or a demonstrated maintenance obstacle. Leave healthy code unchanged when the benefit is speculative.


Minimal intervention and evidence gate

  • Evidence-based intervention: refactor only with concrete evidence of divergence, defect, or operational risk. If greenfield code or an additive diff is already minimal, idiomatic, and passing, leave it. A pattern you recognize is a candidate finding, not a reason to change anything.
  • Semantic DRY (Cost-benefit consolidation): merge duplicated logic only when the copies share an owner, an invariant, and a reason to change, and only if merging saves more than it costs. Leave similar-looking checks in separate domains alone, and keep small local duplication when merging would obscure ownership.
  • Contract boundary protection: preserve public interfaces, parameter names, and return types, except where the task clearly authorizes the change. During cleanup, keep the authorized target contract; don't revert to the old one.

Operating modes

  • Review vs. Refactor Authority: first establish the outcome: findings, edits, or both. Review-only means inspection and verification, no source edits. Authorized cleanup allows bounded corrections; don't ask approval again for routine choices.
  • Change-set cleanup: for a working tree, branch, commit range, feature, or bounded checkpoint. Work diff-first; read surrounding code only to understand ownership, contracts, and precedent.
  • Repository rehabilitation: only when explicitly requested across multiple domains. Read repository rehabilitation, build a short profile, and work in batches you can verify independently.

Evidence hierarchy

Use the evidence hierarchy to guide investigation, not to resolve material contradictions automatically. Reconcile conflicting requirements, documentation, callers, and tests before changing the affected contract. When repository patterns conflict, resolve in order:

  1. User requirements and explicitly authorized scope.
  2. Documented architecture and repository guidelines.
  3. Observable public contracts and persisted schemas.
  4. Healthy sibling code within the same domain and runtime boundary.
  5. Relevant tests, schemas, callers, and dependencies.
  6. Dominant local conventions.
  7. Language and runtime idioms.
  8. Conservative, idiomatic defaults.

Never treat a temporary workaround, buggy sibling, or accidental pattern as precedent.


Workflow

1. Establish scope and baseline

Before mutating code, identify:

  • Comparison base and working-tree state.
  • In-scope files vs. untouched user modifications.
  • Existing verification commands and their current pass/fail status.

Differentiate pre-existing failures from regressions introduced by this pass. Never claim a check ran when it did not.

2. Establish intent, ownership, and preservation

Refactoring is behavior-preserving by default. Protect:

…

자주 묻는 질문

AI가 코드를 완전히 바꿀 수 있나요?

아니요, 초점은 검토와 작은 정리에 있습니다. 큰 변경이나 재설계는 주된 목표가 아닙니다.

'허가된 계약을 보존한다'는 무엇을 뜻하나요?

명시적으로 허락받지 않는 한, 규칙과 코드가 다른 부분과 통신하는 방식('공개 인터페이스')은 그대로 유지되어야 한다는 뜻입니다.

AI가 쓰지 않는 코드를 삭제하나요?

네, 안전하고 타당하다면 도구가 불필요한 코드를 제거해 단순하게 만들 수 있습니다.

상세 정보

작성자의 원본 설명

Review diffs without editing, or perform evidence-based cleanup while preserving authorized behavior, public contracts, and domain ownership.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5617
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬