Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 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.

    How to use

    Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed 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 scanned

    Verified clean today

    • Passed all security checks, Safe to install

    Requires

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

    Listedtoday

    What's inside

    Frequently Asked Questions