Skip to content

File Structure Standards

Maximum File Length

RULE: No file exceeds 300 lines. Split at 250 lines proactively. RATIONALE: LLMs process files more accurately when they fit in focused context. Long files cause missed edits and context confusion. EXCEPTION: Auto-generated files, migration files, and config schemas may exceed 300 lines.

Single Responsibility

RULE: Each file has one clear purpose. One component, one service, one utility domain. RATIONALE: Prevents the "changed function X, accidentally broke function Y in the same file" failure mode.

Import Organization

RULE: Imports in this order, separated by blank lines: 1. External packages (node_modules / pip packages) 2. Internal packages (ge_agent/, ge_engine/) 3. Relative imports (./utils, ../shared) RATIONALE: Consistent, scannable, makes dependency relationships visible.

Export Discipline

RULE: Every exported function must have at least one call site in the codebase (Principle 2: Integration Before Expansion). RATIONALE: Orphaned exports are dead code. They indicate scaffolding without integration. ENFORCEMENT: Code review (Koen/Eric) rejects PRs with uncalled exports.

ENFORCEMENT: Linter rules for file length. Code review for single responsibility and export discipline.