fractal-architecture

Applies Mark Seemann's heuristics for sizing methods, classes, and modules within working-memory limits.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/vnovakovits/claude-skills --skill fractal-architecture-vnovakovits
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fractal-architecture
Source: https://github.com/vnovakovits/claude-skills/tree/main/plugins/engineering-practices/skills/fractal-architecture
Command: npx skills add https://github.com/vnovakovits/claude-skills --skill fractal-architecture-vnovakovits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases grow until individual methods, classes, and modules exceed what a reader can hold in working memory, making reasoning slow and error-prone. This Skill provides concrete heuristics from Mark Seemann's "Code That Fits in Your Head" to keep every unit of code comprehensible at every scale. ## Core Features & Use Cases - Fractal Architecture: Structures systems so each zoom level (system, module, class, method) contains roughly seven well-named chunks that summarize the level below. - Numeric Heuristics: Applies default ceilings such as cyclomatic complexity ≤ 7, methods ≤ 24 lines, lines ≤ 80 characters, and ≤ 3 parameters per method. - Encapsulation via Invariants: Enforces preconditions, postconditions, and invariants so objects cannot exist in invalid states, plus functional core / imperative shell separation. - Use Case: When reviewing a 60-line method with nested conditionals, use this Skill to decompose it into named chunks, enforce guard clauses, and verify each extracted method fits the 80x24 window. ## Quick Start Ask Claude to review this class against the fractal-architecture heuristics and suggest where it exceeds working-memory limits.

Frequently Asked Questions about fractal-architecture

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

FAQPage Schema
How do I reduce cyclomatic complexity in a long method?▼

Cyclomatic complexity above 7 signals a method exceeds working memory. Extract coherent chunks into named methods, replace conditionals with polymorphism where type-switches accumulate, and keep indentation depth at three levels or fewer.

What is fractal architecture in software design?▼

Fractal architecture means code is self-similar at every scale: each system, module, class, and method contains roughly seven well-named chunks that summarize the level below. Readers zoom in only where needed instead of holding the whole structure in mind.

How do I enforce encapsulation with invariants in C#?▼

Enforce invariants at every constructor and mutator so an object can never exist in an invalid state. Use guard clauses for preconditions, prefer value objects that validate on construction, and make illegal states unrepresentable in the type system.

When should I use functional core imperative shell?▼

Use it when decision-making code is tangled with I/O, databases, or network calls. Keep pure calculations and decisions in a testable functional core, and push all side effects into a thin imperative shell at the boundary.

What are the limits of the 80x24 method size rule?▼

The 80-character, 24-line rule is a heuristic default, not a law. Deviate when justified, but the burden of proof is on the deviation; code fitting one editor screen avoids scrolling and reduces cognitive load on every read.