Repository Layout Refactor: Concept Ownership

    1

    Reorganize crowded repositories into clearly owned packages, with caller updates, cleanup, and behavior checks.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    Repository Layout Refactor: Concept Ownership

    Example session with this skill installed

    Refactor our Python app using the approved split: checkout.py owns pricing and receipts today. Move them into pricing and receipts packages. Keep POST /checkout unchanged.

    • Read your context and instructions
    • Compiled the repository layout refactor

    Implemented the approved pricing and receipts split. Updated checkout callers and tests; no commits were created.

    Refactor Result

    Scope and baseline: Changed checkout internals and related tests. The working tree was clean. All 18 checkout tests passed before editing.

    Ownership before: app/checkout.py contained price calculations and receipt formatting. app/routes.py owned the HTTP endpoint.

    Ownership after:

    app/
      routes.py              # POST /checkout, unchanged contract
      pricing/
        __init__.py
        totals.py            # Discounts, tax, final totals
      receipts/
        __init__.py
        formatting.py        # Receipt payload formatting
     tests/
      test_checkout.py       # Endpoint behavior
      test_pricing.py         # Pricing behavior
      test_receipts.py        # Receipt behavior
    

    Completed: Moved pricing and its tests, then receipt formatting and its tests. Updated route imports after each move. Removed app/checkout.py and its obsolete imports; no duplicate implementation remains.

    Preserved: Request fields, response fields, status codes, rounding, and receipt content for POST /checkout.

    Validation:

    • pytest tests/test_checkout.py tests/test_pricing.py tests/test_receipts.py -q: 31 passed.
    • pytest -q: 86 passed.
    • ruff check .: passed.

    Remaining risks: No configured type-check or packaging check was available. Consumers outside this repository were not inspected.

    Next steps

    • Review the diff for the package moves and route imports.
    • Confirm no external scripts import the removed internal module.

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

    About this skill

    When unrelated changes keep landing in the same large module, it becomes hard to tell where code belongs. This skill reorganizes an existing repository around clear responsibilities and checks that public behavior stays intact.

    What it does

    • Clarifies ownership: Maps responsibilities to named packages and modules.
    • Implements the move: Relocates code and tests, then updates callers, imports, and application wiring.
    • Removes leftovers: Cleans up replaced implementations, dead imports, and obsolete exports.
    • Checks behavior: Runs available tests and project checks, separating existing failures from new problems.
    • Reports the result: Summarizes changes, preserved contracts, validation results, and remaining risks.

    How it works

    1. Point it to your repository and describe the area to reorganize.
    2. Provide agreed ownership boundaries and any public interfaces that must stay unchanged.
    3. Request implementation, or ask for a plan without code edits.
    4. Review the working-tree changes and validation report.

    Works with

    Existing source repositories and their local test, lint, type-check, build, and packaging tools. The checks used depend on what the project provides.

    Why use this skill

    A file move can leave callers broken or duplicate implementations behind. This skill handles the consumer updates and cleanup alongside the move, giving reviewers a concrete diff and check results rather than just a proposed folder tree.

    Use cases

    • Separate pricing and invoicing responsibilities from a shared module.
    • Move tests closer to the capabilities they verify.
    • Replace a crowded edit hotspot with clearly owned packages.

    Known limitations

    Requires an existing behavior baseline and resolved ownership decisions. It is not intended for greenfield design or rewrites that change product behavior.

    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

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean 14 days ago

    • Free to download with an account

    Listed14 days ago

    What's inside

    Frequently Asked Questions