fitness-functions
Skill3 starsChanged 4 months agoMITView on GitHub
Author architectural fitness functions and wire them into a target project's CI as gatekeepers. Use for "add a fitness function", "wire an arch test as a CI gate", "enforce layering in CI", "fail the build when the dependency rule is violated". Per-stack tool selection (NetArchTest, import-linter, cargo-deny, Conftest). Do NOT use to run an existing test suite -- that is tdd. Do NOT use to analyze coupling for insight without gating -- that is dependency-mapper.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- event-catalog/skillstheir own version, first seen Nov 1, 2026
- fabiandistler/agentstheir own version, first seen Nov 1, 2026
- mmondora/claude-skillstheir own version, first seen Feb 14, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- event-catalog/skills★ 16same name
- fabiandistler/agents★ 2same name
- mmondora/claude-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository86 other files it gives its agents.
- AGENTS.mdAGENTS.md
- project-templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- project-templates/CLAUDE.mdCLAUDE.md
- alembic-migration-managerSkill
- architecture-journalSkill
- architecture-reviewSkill
- automated-code-reviewSkill
- axum-scaffolderSkill
- capture-consolidateSkill
- cargo-package-scaffoldSkill
- code-review-coachSkill
- confluence-guide-writerSkill
- dependency-mapperSkill
- doc-syncSkill
- dotnet-architecture-checklistSkill
- dotnet-controller-api-scaffolderSkill
- dotnet-security-reviewSkill
- dotnet-vertical-sliceSkill
- ef-migration-managerSkill
- email-captureSkill
- environment-healthSkill
- evaluate-testsSkill
- fastapi-scaffolderSkill
- jira-comment-writerSkill
- legacy-migration-analyzerSkill
- minimal-api-scaffolderSkill
- nuget-package-scaffoldSkill
- oss-vettingSkill
- pattern-tradeoff-analyzerSkill
- php-api-scaffolderSkill
- php-architecture-checklistSkill
- php-feature-sliceSkill
- php-migration-managerSkill
- php-package-scaffoldSkill
- php-security-reviewSkill
- pr-feedback-writerSkill
- pypi-package-scaffoldSkill
- python-architecture-checklistSkill
- python-feature-sliceSkill
- python-modernization-analyzerSkill
- python-security-reviewSkill
- qraspi-architectureSkill
- qraspi-graduateSkill
- qraspi-implementSkill
- qraspi-planSkill
- qraspi-questionsSkill
- qraspi-researchSkill
- qraspi-skeletonSkill
- qrspi-implementSkill
- qrspi-planSkill
- qrspi-questionsSkill
- qrspi-researchSkill
- qrspi-specSkill
- react-app-scaffolderSkill
- react-architecture-checklistSkill
- react-component-scaffolderSkill
- react-feature-sliceSkill
- react-modernization-analyzerSkill
- react-security-reviewSkill
- The first 60 shown.
The file
Files
Fitness Functions
"An architectural fitness function provides an objective integrity assessment of some architectural characteristic(s)." -- Neal Ford, Rebecca Parsons & Patrick Kua, Building Evolutionary Architectures
Core Philosophy
A fitness function turns an architectural intention into an automated, objective check that the CI pipeline enforces on every push. It is the executable memory of an ADR: the ADR records why a boundary exists; the fitness function makes crossing that boundary fail the build. Without the gate, architectural decisions decay silently between reviews. The mechanism is uniform across stacks -- a check wired into CI as a gatekeeper -- but the tool is per-stack.
Non-Negotiable Constraints:
- A fitness function is a GATE, not a report -- it exits non-zero and fails CI on violation; a check that only prints is not a fitness function
- TRACEABLE -- every fitness function names the ADR or measurable quality attribute it enforces; no orphan checks
- PROVE it gates -- pass against today's code AND fail against a deliberate violation before you declare it done; an untested gate is assumed broken
- PER-STACK tool, uniform mechanism -- load
references/<stack>.md; never hardcode a stack's tooling into the gate-wiring logic - CONTEXT BUDGET: keep utilization under 40%. At 60%, write progress to the target's
architecture.mdfitness section and tell the user to start a fresh session.
Workflow
PRE-FLIGHT
[ ] Identify the target stack (dotnet|python|rust|policy) from architecture.md/the ADRs, or ASK
[ ] Locate the CI workflow file (.github/workflows/*, .gitlab-ci.yml, etc.)
[ ] Identify the ADR or quality attribute each fitness function will enforce
SELECT
Load references/<stack>.md and choose the tool for the rule category (layering/dependency
direction · coupling · dependency policy · coverage · package rules). For coupling-as-metric,
reference dependency-mapper (Martin Ca/Ce/I/A/D) rather than re-deriving the math.
AUTHOR
Write the check as an executable artifact in the target repo (a test, a contract, a policy
file). It must read the real source/build graph and exit non-zero on violation.
WIRE
Add the check to the CI workflow as a required step/job that blocks merge on failure.
Comment the step with the ADR id / quality attribute it gates.
VERIFY
1. Run it against current code -- must PASS (green)
2. Introduce a deliberate violation -- must FAIL (non-zero) -- then revert. Observe both.
REPORT
Each fitness function · the ADR/attribute it gates · CI step location · the violation proof.Exit criteria: >= 1 fitness function authored in the target repo; wired into CI as a merge-blocking gate; verified GREEN today and verified to FAIL on a deliberate violation; each gate traces to a named ADR or quality attribute.
State Block
<fitness-functions-state>
phase: PRE-FLIGHT | SELECT | AUTHOR | WIRE | VERIFY | REPORT | COMPLETE
target_stack: dotnet | python | rust | policy
ci_workflow: [path to the CI file the gate is wired into]
fitness_functions: [count]
gates_on: [ADR ids / quality attributes enforced]
wired_as_ci_gate: true | false # MUST be true to COMPLETE
verified_fails_on_violation: true | false # MUST be true to COMPLETE
context_budget: under-40 | approaching-60 | checkpoint-now
status: in_progress | complete
</fitness-functions-state>Output Template
See references/<stack>.md for the per-stack tool, a minimal check, the CI-wiring snippet, and the
deliberate-violation proof: dotnet.md (NetArchTest), python.md (import-linter), rust.md
(cargo-deny + dependency-direction test), policy.md (Conftest/OPA Rego).
Integration with Other Skills
| Skill | Relationship |
qraspi-architecture | Specifies which fitness functions each ADR requires; this skill authors them. |
qraspi-skeleton | Lands these fitness functions as CI gates when the walking skeleton stands up. |
dependency-mapper | The ready-made coupling fitness function -- Martin Ca/Ce/I/A/D metrics. Reference it for coupling rules rather than re-deriving the math. |
tdd-loop | Different layer: tdd gates behavior (does the code do the right thing); a fitness function gates architecture (is the structure still legal). Do not conflate. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

