# Refactoring Prioritizer — Find What To Fix First

> Rank codebase technical debt using churn and coupling data to identify what to fix first and what to leave alone.

Refactoring Prioritizer — Find What To Fix First is a paid AI agent skill on Agensi by Anton Nikonorov, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12 (one-time purchase)
- Creator: [Anton Nikonorov](https://www.agensi.io/creators/anton-nikonorov)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.1
- Last updated: 2026-10-20
- Security: scan passed (2026-10-20); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/refactoring-prioritizer-find-what-to-fix-first
- Tags: code-review, refactoring, git, static-analysis, technical-debt

## About this skill

Codebases accumulate technical debt faster than teams can fix it. The Refactoring Prioritizer solves the "where do we start?" problem by replacing gut feeling with a reproducible, data-driven ranking of your repository's modules. It identifies which code is volatile, which is a risky dependency hub, and which modules are stable foundations that should never be touched.

### What it does
- **Calculate priority scores** by measuring churn, coupling, value, and risk for every module in the repository.
- **Categorize technical debt** into actionable buckets: fix first, plan carefully, ignore, or do not touch.
- **Analyze dependency coupling** to identify risky hubs that lack a test safety net.
- **Correlate Git activity** with structural health to separate active feature work from frequent bug-fixing.
- **Detect structural defects** including import cycles and layering violations that compromise maintainability.

### How it works
1. **Repository scanning** using `git` and optional `agent-context` CLI to map dependencies and commit history.
2. **Signal gathering** to measure how often files change and how many other modules depend on them.
3. **Scoring and tagging** against a standardized model to label modules as `volatile`, `hub`, or `untested`.
4. **Strategic classification** to determine the single best first move for the next sprint.

### Frameworks & tools
This skill works with any Git-managed repository. It leverages the optional `ai-agent-context` CLI for deep dependency graph analysis and symbol indexing, but falls back to `git log` and `grep` for environments where node-based tools are unavailable.

### Why this beats prompting it yourself
Generic prompts often label complex code as "bad" without considering its business value or stability. This skill uses a formal scoring contract that prevents you from refactoring stable, load-bearing modules that don't actually need fixing.

### Use cases
- Planning a refactoring sprint for a legacy repository with high churn.
- Identifying high-risk dependency hubs that require better test coverage.
- Onboarding to a new codebase and finding the most volatile components.
- Justifying technical debt work to stakeholders with evidence-based rankings.

### Known limitations
Shallow Git clones limit churn analysis accuracy. Dependency mapping is most accurate when the `agent-context` CLI is available. The skill does not perform the actual refactors or edit code.

## Requires

- ai-agent-context
- Node.js
- agent-context
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Refactoring Prioritizer — Find What To Fix First skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill decide what to prioritize compared to a standard linter?

The skill analyzes the intersection of your Git history and dependency graph to distinguish between code that is complex but stable and code that is complex, frequently changing, and risky to your velocity.

### Will this skill automatically modify my code to fix the identified technical debt?

No, this skill is a diagnostic tool that provides a strategic roadmap; it identifies exactly where the problems are and why they matter, leaving the actual code modifications to you or your coding agent.

### What exactly is included in the purchase of this skill?

You receive the specialized skill definition, the scoring logic for churn and coupling analysis, and instructions for integrating it with the optional agent-context CLI for deeper dependency mapping.

### Are there any specific environment requirements to get the best results?

For the most accurate results, ensure you have a full Git history (avoid shallow clones) and that your agent has permission to run basic shell commands like `git log` and `grep`.

### Can I use the output of this skill to justify technical debt work to non-technical stakeholders?

By providing evidence-based rankings of 'high-churn' and 'risky hubs,' you can present stakeholders with data-driven justifications for refactoring tasks rather than relying on subjective developer intuition.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
