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
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.
- ai-agents Repository topic
- claude Repository topic
- claude-code Repository topic
- llm Repository topic
- machine-learning Repository topic
- prompt-engineering Repository topic
- skills Repository topic
- mcp Repository topic
- agent-harness Repository topic
- harness Repository topic
- engineering Derived category
- design Derived category
- legal Derived category
- writing Derived category
- data Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 7,183 bytesSKILL.mdcore · 7,183 bytesreferences/clean-code-original.mddoc · 19,306 bytesreferences/clean-code/code-smells.mddoc · 16,344 bytesreferences/clean-code/comments-formatting.mddoc · 12,797 bytesreferences/clean-code/error-handling.mddoc · 12,640 bytesreferences/clean-code/functions-and-methods.mddoc · 12,617 bytesreferences/clean-code/naming-conventions.mddoc · 11,258 bytesreferences/clean-code/testing-principles.mddoc · 12,946 bytesreferences/pragmatic-programmer-original.mddoc · 18,552 bytesreferences/pragmatic-programmer/broken-windows.mddoc · 11,791 bytesreferences/pragmatic-programmer/contracts-assertions.mddoc · 13,596 bytesreferences/pragmatic-programmer/dry-orthogonality.mddoc · 11,207 bytesreferences/pragmatic-programmer/estimation-portfolio.mddoc · 13,975 bytesreferences/pragmatic-programmer/reversibility.mddoc · 14,232 bytesreferences/pragmatic-programmer/tracer-bullets.mddoc · 12,129 bytesreferences/software-design-philosophy-original.mddoc · 21,349 bytesreferences/software-design-philosophy/comments-as-design.mddoc · 16,736 bytesreferences/software-design-philosophy/complexity-symptoms.mddoc · 11,995 bytesreferences/software-design-philosophy/deep-modules.mddoc · 13,635 bytesreferences/software-design-philosophy/general-vs-special.mddoc · 13,534 bytesreferences/software-design-philosophy/information-hiding.mddoc · 12,271 bytesreferences/software-design-philosophy/strategic-programming.mddoc · 13,681 bytes
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.