refactor-repo
БесплатноЗапускает вложенные скриптыНе проверенAnalyze repos and file evidence-backed refactoring issues.
от existential-birds★ 92 звезды на GitHubОб этом скилле
Repository Refactoring Proposals
Analyze a large repository and turn verified changeability problems into scoped GitHub issues using Fowler's refactorings and applicable framework-review guidance. This workflow proposes work; it does not edit production code, implement issues, delete artifacts, or start a PR pipeline, and its helper uses Python's standard library plus Git and authenticated GitHub CLI.
When to Use
- "Analyze this repo and create issues for worthwhile refactors."
- "Find architecture and maintainability hotspots across this monorepo."
- "Build a Fowler-based refactoring backlog."
- "Audit this repository for refactoring opportunities, drafts only."
- "Resume the refactoring survey and publish the accepted proposals."
Prerequisites
- Python 3.10+, Git, and
ghon PATH; check throughterminalwithpython --version,git --version, andgh --version. - Authenticate GitHub CLI through its normal setup; use
gh auth status, never read credential files or print tokens. - Explicit local repository and GitHub
OWNER/REPO, verified against the intended remote before publishing. - Load the
fowler-refactoringknowledge base from this repository (see Supporting files); load relevant Fowler chapters before choosing mechanics. - Discover framework reference skills from this repository's skill catalog and read their
SKILL.mdwhen a stack matches. Missing optional framework skills are a recorded limitation, not permission to invent them. - Use a durable campaign workspace outside the inspected source tree. No additional Python dependencies, environment variables, or original PDF are required.
How to Run
Examples of user invocation (invoke by skill name through your agent's skill mechanism):
refactor-repoon/path/to/repo, create GitHub issues forOWNER/REPOrefactor-repoon/path/to/repo, drafts only; focus on services and shared domain code
Tool names in this and related files (terminal, read_file, search_files, patch, write_file) denote capabilities — shell execution, file reading, content search, scoped edits, and file writing — and map to the host agent's native equivalents; they are not a required product.
Creating this skill is not an instruction to execute a survey or publish issues. A survey request without publication wording defaults to drafts; an explicit request to create/file issues authorizes publication of accepted, in-scope proposals without another blanket confirmation.
Resolve this skill's directory from the loaded skill location; all paths below are relative to it. Invoke scripts/repo_refactor.py through terminal; paths are placeholders to substitute, not literal repository defaults. Use write_file for the campaign's proposals and coverage JSON, and read_file to inspect saved artifacts.
Quick Reference
python <skill-dir>/scripts/repo_refactor.py snapshot --repo OWNER/REPO --out <campaign>/github.jsonpython <skill-dir>/scripts/repo_refactor.py inventory --root <repo> --ref <snapshot-sha> --out <campaign>/inventory.jsonpython <skill-dir>/scripts/repo_refactor.py prepare --inventory <campaign>/inventory.json --snapshot <campaign>/github.json --proposals <campaign>/proposals.json --coverage <campaign>/coverage.json --out <campaign>/draftspython <skill-dir>/scripts/repo_refactor.py publish --draft <campaign>/drafts/<id>.json --confirm-repo OWNER/REPOpython <skill-dir>/scripts/test_repo_refactor.py
Procedure
- Resolve scope and pin the source. Verify the GitHub target, repository instructions, and requested exclusions. The snapshot defaults to GitHub's current default branch;
snapshot --ref <branch>is available only for an explicitly chosen branch. Inventory that exact commit with--ref <snapshot-sha>. If it is absent locally, arrange an authorized fetch or alternate checkout; do not substitute an unrelated HEAD. Read pinned files viagit show <sha>:<path>throughterminalwhen the working tree differs, otherwise useread_file. Never mix dirty worktree lines with commit permalinks. - Inventory before judgment. The helper enumerates tracked blobs without reading contents, excluding credential-like paths, dependency/build output, common generated files, symlinks, submodules, and large/non-text candidates. Review the exclusion summary and add explicit
--exclude <glob>arguments when needed. Inventory is metadata, not semantic review. Read manifests, package boundaries, architecture decisions, tests, and canonical generated-code sources. Metrics identify where to look; they never prove a refactoring is justified. - Plan bounded analysis shards. Partition the included file list by actual package/service ownership, not arbitrary line chunks. Give every primary path one shard owner; keep a separate cross-cutting pass for shared contracts and dependency direction. For a durable large scan, split analysis into shards with one adjudicator and one publisher u
Установить refactor-repo в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл refactor-repo?
Analyze repos and file evidence-backed refactoring issues.
Как установить скилл refactor-repo?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл refactor-repo запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic