Individual skill

code-complexity

Keep each unit comprehensible while the code grows: deep modules over shallow ones, information hiding, honest names, small functions with one job, error handling that does not lose the error, DRY and orthogonality, design by contract, and not leaving broken windows. Merges module-complexity management with naming/function/error-handling discipline and the pragmatic meta-rules. Use when writing or reviewing a function, class or module; when an interface feels wide, a class feels shallow, or a change in one place forces edits in three; when the user says "this is hard to follow", "clean this up", "review this code", "is this a good abstraction", "too many parameters", "pass-through method", "duplicated logic", or asks about naming, comments, error handling or unit tests. Do NOT use to decide where a new module LIVES or which modules exist (use architecture-first), to plan capacity or storage (use system-and-data-design), to execute a named transformation on a file that is already too large (use refactoring-safely), or to strip over-engineering on request (use lean-code). This makes a unit comprehensible; it does not draw the system's boundaries.

skills/development/code-complexity/SKILL.md

Read pinned source

Source commit 849719987d9c0d6ed973bdbce8ed37b266d3b1f3

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Network or broad shell
Last checked
Nov 7, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
214
Repository last updated
Nov 5, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Code complexity — keeping a unit comprehensible

Complexity is not how clever the code is. It is how much you must hold in your head to
change one line safely. It accumulates by increments that each look acceptable, which is
why it is never one bad commit's fault and always everyone's problem.

## The two symptoms worth memorising

**Change amplification** — one decision, many edits. If changing a timeout means editing
five files, that decision was not encapsulated anywhere.

**Cognitive load** — how much you must know to be safe. A function that is correct only
if you know that the caller already took a lock has exported its complexity to everyone
who reads it.