fitness-functionslisted
Install: claude install-skill andreibesleaga/GABBE
# Fitness Functions
## Goal
Make architecture an executable, enforced thing rather than a diagram that rots. A *fitness
function* is an objective, measurable test of an architectural characteristic — the
evolutionary-architecture mechanism for governing the "-ilities" the same way unit tests
govern logic. Where a unit test asserts a feature works, a fitness function asserts a
*structural property* holds: cyclomatic complexity stays under a limit, the domain layer never
imports infrastructure, p99 latency stays inside its budget, afferent/efferent coupling stays
bounded. Wired into CI, fitness functions turn architectural intent into automated governance
that fails the build the moment the system drifts away from its target characteristics.
## Steps
1. **Name the architectural characteristic to protect.** Pick one measurable "-ility" the
architecture must preserve (maintainability, performance, modularity, security boundary,
scalability). Vague goals cannot be governed — "should be maintainable" is not a fitness
function; "no module may have efferent coupling above 20" is.
2. **Define the objective, measurable test.** Translate the characteristic into a pass/fail
check with a concrete threshold and a clear unit of measure. Examples:
- *Maintainability*: cyclomatic complexity per method below a limit; max file/function length.
- *Modularity / layering*: dependency rules ("`domain` must not depend on `infrastructure`"),
no cyclic dependencies between pac