What problem does it solve?
This Skill solves the problem of source files gradually growing into unmaintainable monoliths that are difficult for both AI agents and human developers to work with efficiently, preventing the gradual accumulation of technical debt from unreviewed small edits.
Core Features & Use Cases
- Deterministic size gating: Enforces a configurable line-count ceiling (default 800) for source files via pre-commit hooks, blocking edits that would push files over the limit or grow existing baselined over-ceiling files.
- Baseline management: Supports grandfathered baselines for existing over-ceiling files, with operator-controlled updates to track file size changes over time without requiring immediate large refactors.
- Plan-time guidance: Requires implementation tasks to declare their target files, forcing early identification of extraction needs for files approaching the size ceiling.
- Use Case: When an AI developer is tasked with adding a new password reset feature to a 780-line
auth.service.ts file, this skill directs them to extract the new logic into a dedicated password-reset.ts module along a clear responsibility seam, rather than bloating the existing file past the 800-line limit.
Quick Start
Use the module-size-discipline skill whenever you are planning or implementing changes to a source file that is approaching or exceeds the configured module size ceiling to get guidance on extracting code along responsibility seams or requesting an operator exemption.