Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Refactoring Prioritizer — Find What To Fix First

    1

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

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Refactoring Prioritizer — Find What To Fix First

    Refactoring Prioritizer — Find What To Fix First

    Example session with this skill installed

    I'm taking over this repo and it's a mess. Where should I start refactoring to get the most impact with the least risk? Give me a prioritized backlog.

    • Read your context and instructions
    • Compiled the refactoring prioritizer

    I have analyzed the repository using Git history and the dependency graph. The churn signal is verified via 428 recent commits.

    Refactoring Backlog

    ModuleValueRiskCategoryTagWhy
    src/auth/session.ts123Fix Firstvolatile-hub15 commits in 30 days; 80% are bug fixes.
    src/api/gateway.ts107Plan Carefullyuntested-hubHigh coupling (12 dependents) with 0% test coverage.
    src/utils/logger.ts21Do Not TouchstableLoad-bearing foundation; zero churn in 6 months.
    src/ui/legacy-button.ts42IgnorevolatileHigh churn but low coupling; impact is localized.

    Start Here: src/auth/session.ts
    This is your highest impact move. It is a volatile hub that changes frequently due to bugs rather than features. Extract the token validation logic into a standalone utility to reduce the module's complexity. Risk is acceptable because the module already has 85% test coverage.

    Do Not Touch: src/utils/logger.ts
    Despite being imported by every module in the system, it has not changed in 180 days. Refactoring this now provides zero value and risks breaking the entire logging pipeline.

    Next steps

    1. Review the src/auth/session.ts public API to identify extraction candidates.
    2. Draft a test suite for src/api/gateway.ts before attempting any structural changes.
    3. Run agent-context explain src/api/gateway.ts for a full transitive impact map.

    Connects securely to your tools. The creator never sees your data.

    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.

    Shallow Git clones prevent accurate churn ranking. Transitive coupling analysis is limited when CLI tools are unavailable. Analysis is planning-only and does not edit source files.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    Requires

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

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Listed28 days ago

    What's inside

    Frequently Asked Questions

    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.

    It works with any Git-managed repository and is optimized for use with agents that have file system access, such as Claude Dev, Roo Code, or AutoGPT.

    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.

    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.

    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`.

    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.

    New in Code Quality & Review