repo-native-refactor
यह क्या करती है
यह टूल कोड की समीक्षा और साफ-सफाई सुरक्षित तरीके से करने में मदद करता है। यह errors की जाँच करता है, सुनिश्चित करता है कि कोड पहले की तरह काम करता रहे, और उसके मूल व्यवहार को बदले बिना छोटे सुधार करता है।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि AI कोड की समीक्षा करे, पर उसे बदले नहीं।
- ✓जब आप पहले से चल रहे कोड में छोटे सुधार करना चाहते हैं।
- ✓जब आप कोड के दोहराए गए हिस्सों को व्यवस्थित या सरल बनाना चाहते हैं।
Skill का लिंक
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 में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस कोड की समीक्षा करो और देखो कि कोई ज़रूरी चीज़ न टूटे, और क्या कोई आसान सुधार हो सकता है।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI कोड को सुरक्षा, काम करने के तरीके और व्यवस्था से जुड़े नियमों से मिलाकर उसका विश्लेषण करता है। यह पहले errors ठीक करने और जो पहले से काम कर रहा है उसे बनाए रखने को प्राथमिकता देता है, और सिर्फ ज़रूरी और सुरक्षित बदलाव करता है।
तकनीकी सामग्री (मूल 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:
- 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:
…
अक्सर पूछे जाने वाले सवाल
क्या AI कोड को पूरी तरह बदल सकता है?
नहीं, इसका मुख्य काम समीक्षा और छोटी साफ-सफाई है। बड़े बदलाव या नए सिरे से डिज़ाइन करना इसका मुख्य लक्ष्य नहीं है।
'preserving authorized contracts' का क्या मतलब है?
इसका मतलब है कि नियम और वह तरीका जिससे कोड के दूसरे हिस्से उससे बात करते हैं (उसके 'public interfaces') वैसे ही रहने चाहिए, जब तक साफ तौर पर बदलने की अनुमति न दी गई हो।
क्या AI बिना इस्तेमाल वाला कोड हटा देगा?
हाँ, अगर यह सुरक्षित है और समझ में आता है, तो टूल कोड को सरल बनाने के लिए बेकार कोड हटा सकता है।
जानकारी
लेखक का मूल विवरण
Review diffs without editing, or perform evidence-based cleanup while preserving authorized behavior, public contracts, and domain ownership.
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #5617
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।