fitness-functions
Installation
SKILL.md
EventCatalog Fitness Functions
Fitness functions are architecture rules written as code. Each one is a TypeScript file that reads the catalog through a read-only SDK and returns the violations it finds. eventcatalog fitness check runs them all, prints the results, writes a JSON report and exits non-zero when a rule fails, so the rules can gate pull requests.
The team decides what a healthy architecture looks like; EventCatalog runs the rules and reports the results.
Fitness functions check the architecture the catalog documents, not the running systems. A rule is only as good as the catalog data it reads.
Requirements (check these FIRST)
- Version —
@eventcatalog/core5.3.0 or later (check the catalog'spackage.json). Alternatively@eventcatalog/cli1.4.0 or later runs the same check without core (npx @eventcatalog/cli fitness check). Node.js 20 or later. - Editor types (optional) — fitness functions run without installing anything else, but for types and autocomplete install
@eventcatalog/fitnessas a dev dependency. Catalogs created withcreate-eventcatalog4.5.0 or later already have it, plus two starter functions infitness/and annpm run fitnessscript.
Fitness function, linter or governance?
Pick the right tool before writing code: