- Home
- Skills
- Code Quality & Review
- Repository Layout Refactor: Concept Ownership
Repository Layout Refactor: Concept Ownership
Reorganize crowded repositories into clearly owned packages, with caller updates, cleanup, and behavior checks.
Free
Works with the AI Agents you already use
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
- Point it to your repository and describe the area to reorganize.
- Provide agreed ownership boundaries and any public interfaces that must stay unchanged.
- Request implementation, or ask for a plan without code edits.
- 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.
Needs an existing repository, a behavior baseline, and resolved ownership decisions. Not for greenfield design or behavior-changing rewrites. Validation depends on available project checks.
How to use
- 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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Permissions
Reads source, tests, imports, and repository instructions; edits scoped files for an authorized layout migration and runs validation commands. Read-only planning is possible when requested. No network or secrets are inherently needed.