repo-native-refactor
Allows your agent to review changes without editing or intelligently clean up code. It maintains correct behavior and public contracts.
What it does
This tool helps review and clean up programming code safely. It checks for errors, ensures the code continues to work as expected, and makes small improvements without changing its core behavior.
When to use it
- ✓When you want the AI to review code without changing it.
- ✓When you want to make small fixes to already working code.
- ✓When you want to organize or simplify repeated parts of the code.
Example of what to ask your AI
“Review this code to ensure it doesn't break anything important and see if there's anything simple to improve.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The AI analyzes the code by comparing it against rules for security, functionality, and organization. It prioritizes fixing errors and maintaining what's already working, making only necessary and safe changes.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill repo-native-refactorOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/repo-native-refactor/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from 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:
- Correctness and security: prevent regressions, avoid new security vulnerabilities, handle boundary conditions.
- Semantic integrity: preserve existing invariants, state transitions, validation, and error boundaries.
- 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. - Repository conformity: match surrounding naming, domain conventions, and architectural precedents.
- 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:
- User requirements and explicitly authorized scope.
- Documented architecture and repository guidelines.
- Observable public contracts and persisted schemas.
- Healthy sibling code within the same domain and runtime boundary.
- Relevant tests, schemas, callers, and dependencies.
- Dominant local conventions.
- Language and runtime idioms.
- 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:
…
FAQ
Can the AI completely change the code?
No, the focus is on reviews and minor cleanups. Large changes or redesigns are not the main goal.
What does 'preserving authorized contracts' mean?
It means the rules and how the code communicates with other parts (its 'public interfaces') should stay the same, unless explicitly authorized to change.
Will the AI delete unused code?
Yes, if it's safe and makes sense, the tool can remove unnecessary code to simplify it.
Details
Original description by the author
Review diffs without editing, or perform evidence-based cleanup while preserving authorized behavior, public contracts, and domain ownership.
Popularity
- GitHub stars
- 48k
- Ranking position
- #4003
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
api-connector-builder
Has your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
affaan-m/ECC
api-design
Helps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
affaan-m/ECC
backend-patterns
Helps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.
affaan-m/ECC