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.
| Type | Default output | What it covers |
|---|---|---|
| AGENTS.md | AGENTS.md | Agent orientation: what the project is, how to build, test, and navigate it |
| Codemap | docs/CODEMAP.md | Modules, entry points, and dependencies |
| Conventions | docs/CONVENTIONS.md | Observed code patterns with cited examples |
| README | README.md | Project overview, features, installation, usage, contributing |
| API Reference | docs/api.md | Functions, endpoints, parameters, return types, code examples |
| Architecture | docs/architecture.md | System design, module breakdown, data flow, dependencies |
| Changelog | CHANGELOG.md | Version 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.
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.