refactor-repo

refactor-repo is a skill for Claude Code, Codex from existential-birds/beagle. It costs 15 tokens per session (2,546 once invoked), scanned A, original, Apache-2.0.

A repository analysis workflow that finds evidence-backed refactoring problems and turns worthwhile ones into scoped GitHub issues. It proposes changes but does not edit production code or implement the issues.

In plain words
What is it for?
Use it to inspect a large repository, including a monorepo (one repository containing multiple projects), identify architecture and maintainability hotspots, and draft or publish GitHub issues for selected refactorings.
Why use it?
It replaces a broad, subjective search for maintainability problems with a documented list of specific work items. This helps teams build a refactoring backlog without changing the code during the review.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect a large repository, including a monorepo (one repository containing multiple projects), identify architecture and maintainability hotspots, and draft or publish GitHub issues for selected refactorings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/existential-birds/beagle/refactor-repo
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add existential-birds/beagle --skill refactor-repo
Clone the repo
git clone --depth 1 https://github.com/existential-birds/beagle

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refactor-repo

README.md
[![agentmods](https://agentmods.dev/badge/skills/existential-birds/beagle/refactor-repo/github.svg)](https://agentmods.dev/skills/existential-birds/beagle/refactor-repo)
Your own site
<a href="https://agentmods.dev/skills/existential-birds/beagle/refactor-repo"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/refactor-repo/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactor-repo

Your own site · 80×15
<a href="https://agentmods.dev/skills/existential-birds/beagle/refactor-repo"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/refactor-repo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,546 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.02546
Opus 5.5 $0.00006 $0.01018
Sonnet 5.5 $0.00003 $0.00509
Haiku 4.5 $0.00002 $0.00255

Measured 4d ago against content hash f8973b4a01a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactor-repo scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/repo_refactor.py, scripts/test_repo_refactor.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/refactor-repo/SKILL.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on 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 gh on PATH; check through terminal with python --version, git --version, and gh --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-refactoring knowledge 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.md when 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-repo on /path/to/repo, create GitHub issues for OWNER/REPO
  • refactor-repo on /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.

Read the full file on GitHub · 99 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 99 lines · 15 tokens per session scan A f8973b4a01a3

Subscribe to this mod's changes

refactor-repo is a skill published in the GitHub repository existential-birds/beagle (91 stars, last pushed 4d ago), licensed Apache-2.0. It adds 15 tokens to every session and 2,546 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-26.

Related

refactor-repo compared with skills from other repositories

refactor-repo next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactor-repoexistential-birds/beagleSkill914d agoApache-2.0A15Claude Code, Codex
autoreviewopenclaw/clawhubSkill9.6kyesterdayMITA17Claude Code, Codex
omh-code-reviewrlaope/oh-my-hermesSkill6.2ktodayMITA18Claude Code
agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skillsSkill2.2k8d agoMITA115Claude Code, Codex
asplos-writing-stylebrycewang-stanford/Awesome-Journal-SkillsSkill1.5k2d agoMITA65Claude Code
revdiff-planumputun/revdiffSkill9742d agoMITA84Claude Code
re0-mergeLilMGenius/paperthinSkill1.5k5d agoMITA51Claude Code, Codex