refactor-large-file

Splits oversized Axentra source files into focused modules without changing behavior.

Updated Sep 16, 2026
One-click install
npx skills add https://github.com/PT-Perkasa-Pilar-Utama/axentra --skill refactor-large-file-pt-perkasa-pilar-utama
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-large-file
Source: https://github.com/PT-Perkasa-Pilar-Utama/axentra/tree/main/.claude/skills/refactor-large-file
Command: npx skills add https://github.com/PT-Perkasa-Pilar-Utama/axentra --skill refactor-large-file-pt-perkasa-pilar-utama

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Oversized source files in the Axentra codebase become hard to review, test, and maintain. This Skill guides a safe, behavior-preserving split of large files into focused modules while respecting the project's approved architecture boundaries. ## Core Features & Use Cases - Behavior-Preserving Extraction: Records current behavior and runs existing tests before and after the refactor to catch regressions. - Architecture-Aware Placement: Keeps API routes in apps/api/src/modules, UI feature code in apps/web/src/features, and shared contracts in packages/shared/src. - Guardrails Against Scope Creep: Prevents refactoring Foundation infrastructure into unapproved domain modules and flags accidental business-scope changes in the diff. - Use Case: A 1,500-line API module mixing route handlers, schemas, and repository logic can be split into focused files, with imports and tests updated together and verified via bun run complete-check. ## Quick Start Ask the AI to refactor the oversized file at a given path into smaller modules while preserving its public contract and running the existing tests.

Frequently Asked Questions about refactor-large-file

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a large TypeScript file without breaking behavior?▼

Record current behavior and run existing tests first, then extract pure helpers, schemas, repositories, or view components before touching control flow. Update imports and tests together, and review the final diff for accidental changes.

Where should extracted modules go in a monorepo?▼

In Axentra, API routes belong in apps/api/src/modules, UI feature code in apps/web/src/features, and shared contracts in packages/shared/src. Do not move files solely to mimic another project's layout.

How do I verify a file refactor did not change behavior?▼

Run the existing test suite before and after extraction, then run bun run complete-check and review the diff. Any business-scope change appearing in the diff signals the refactor went beyond its intended scope.

When should I not refactor a large file?▼

Avoid refactoring before confirming the file's responsibility and dependency graph, and never refactor Foundation infrastructure into unapproved domain modules. Refactoring without a clear extraction target creates churn without benefit.