Skip to content

Templates

Control the structure, tone, and format of generated context artifacts and doc views.

A template is a Markdown document that tells a Kontrua agent what to produce. It describes what sections to include, what level of detail to aim for, and what tone to use. Agents use your template as a blueprint and fill in content from the codebase diff.

Artifact types

Templates exist for the context artifacts and for the doc views. Architecture facts are deterministic JSON and are not template-driven.

TypeDefault outputWhat it covers
AGENTS.mdAGENTS.mdAgent orientation: what the project is, how to build, test, and navigate it
Codemapdocs/CODEMAP.mdModules, entry points, and dependencies
Conventionsdocs/CONVENTIONS.mdObserved code patterns with cited examples
READMEREADME.mdProject overview, features, installation, usage, contributing
API Referencedocs/api.mdFunctions, endpoints, parameters, return types, code examples
Architecturedocs/architecture.mdSystem design, module breakdown, data flow, dependencies
ChangelogCHANGELOG.mdVersion history, breaking changes, notable additions

Built-in templates

Kontrua ships an example template for each artifact type. These work out of the box and produce sensible output for most projects. You can clone a built-in template as a starting point for a custom one.

Custom templates

Custom templates are available on Pro and Max plans. Go to Dashboard - Templates - New template, choose an artifact type, and write your template in the editor.

Templates are scoped to your organisation and can be assigned to any number of repositories. Each repository can use a different template per artifact type.

Deleting a template that is assigned to one or more repositories is blocked. Reassign those repositories first.
CLI users can use custom templates by setting template: .kontrua/templates/readme.md.hbs (path relative to repo root) in .kontrua.yml.

Assigning a template to a repo

Open the repository in the dashboard, go to the Config tab, and choose a template from the dropdown for each artifact. Changes take effect on the next run.

Ready to keep your repo's context current?

Connect your first repository and Kontrua opens a reviewed PR with AGENTS.md, a codemap, and your conventions.