module-size-discipline

Enforce configurable line-count limits on source code files during implementation.

6|Updated May 29, 2026
One-click install
npx skills add https://github.com/fusebase-dev/fusebase-flow --skill module-size-discipline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: module-size-discipline
Source: https://github.com/fusebase-dev/fusebase-flow/tree/main/flow-skills/module-size-discipline
Command: npx skills add https://github.com/fusebase-dev/fusebase-flow --skill module-size-discipline

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about module-size-discipline

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

FAQPage Schema
How do I prevent source files from growing into unmaintainable monoliths?

Preventing source file monoliths requires deterministic pre-commit size gating that enforces a configurable line-count ceiling on your files. This blocks edits pushing files over the limit and guides developers to extract code along semantic responsibility seams instead of mechanical splits.

Can I use pre-commit hooks to block file edits that exceed a line-count limit?

Yes, pre-commit hooks can block file edits exceeding a line-count limit by applying deterministic size gating. Edits that push files over the configured ceiling or grow existing baselined over-ceiling files are automatically blocked from being committed.

How do I manage legacy files that already exceed the size ceiling?

Managing legacy files exceeding the size ceiling uses baseline tracking to grandfather them without requiring immediate refactors. Operators can control baseline updates to monitor file size changes over time while preventing further unreviewed growth.

What is the best way to split large code files during AI-assisted development?

The best way to split large code files is extracting code along semantic responsibility seams rather than making mechanical splits. This guided extraction approach maintains clear module boundaries while keeping both AI agents and human developers productive.

Does module size gating work with implementation planning before writing code?

Module size gating works with implementation planning by requiring tasks to declare target files beforehand. This forces early identification of extraction needs for files approaching the size ceiling before any code is actually written.

Why should I enforce code extraction seams instead of allowing mechanical file splits?

Enforcing code extraction seams prevents the gradual accumulation of technical debt that mechanical splits cause. It ensures new logic is extracted into dedicated modules along clear responsibility boundaries, keeping source code maintainable for AI and human development.