For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom Rules

Understand how to customize Kerno with custom rules, how to create them, and how they apply to the tests it generates.

Every codebase has rules that are obvious to your team and invisible in the source. Custom rules put those in your repository, so Kerno applies them on every run without you restating them.

Rules are guidance to the planner, not enforced constraints. Kerno weighs them against your source code, so a rule that contradicts verified behaviour never overrides it.

Where rules live

Rules live in two files. Kerno merges them, with your local config.yaml taking precedence.

File
Committed
Purpose

.kerno/default.config.yaml

yes

Team-wide rules, reviewed in pull requests like any other code

.kerno/config.yaml

no, gitignored

Your local overrides and credentials

Put shared conventions in default.config.yaml. That way a teammate who clones the repository inherits them, and changing a rule is a reviewable diff.

How rules are applied

Rules apply from broadest to most specific, and everything that matches is included, so a specific rule adds to the general ones.

For POST /api/v1/payments on the payments-api application, all four apply, in that order. For GET /api/v1/invoices, only the error-envelope and tenant rules apply; the payments-api rules do not.

Matching endpoints

Pattern
Matches

*

Every endpoint

/api/users

That exact path, any method

GET /api/users

That path and method only

/api/v1/*

One path segment, e.g. /api/v1/users

/api/v1/**

Any depth, e.g. /api/v1/users/42/roles

regex:^/api/v[0-9]+/users/.+$

Anything the expression matches

Last updated