Get started
In this tutorial you import a public track of conventions, each written as
an architecture decision record (ADR), into one repository, let a coding
agent propose a ruling on one of them, and read the resulting instruction in
AGENTS.md.
Time. On a fresh repository, steps 1 to 3 ran in 14 seconds. In step 4, the agent took about a minute to propose a ruling.
Before you start
- Node 22.18 or later.
- A git repository with a
package.json. Use an existing one: the agent draws its proposal from what the repository contains, and has little to say about an empty one. - A coding agent on the command line. The examples use
claude.
Steps
-
Install ontrack and a track
Terminal window npm i -D @trivoallan/ontrackThe package is scoped; the command it installs is
ontrack.A track is an npm dependency that ships ADRs. Its npm alias is its namespace. trivoallan/ontrack-engineering is a public one, published as
@trivoallan/ontrack-engineering:Terminal window npm i -D engineering@npm:@trivoallan/ontrack-engineeringengineering@npm:is npm’s alias syntax: the package is installed under the nameengineering, which becomes its namespace. The alias is the package name without its scope and withoutontrack-. Use the ontrack-engineering track says how to check the package and take its later releases. -
See what importing would change
Terminal window npx ontrack planengineering: 26 new, 0 unchangednew ADR-0001-record-architecture-decisionsnew ADR-0002-localizationnew ADR-0003-architecture…new ADR-0026-agent-identityplanwrote nothing. It exited with2, which means changes are pending. The catalogue of the track grows over time, so your count may differ. -
Import the ADRs
Terminal window npx ontrack applyengineering: 26 importedimported ADR-0001-record-architecture-decisionsimported ADR-0002-localization…imported ADR-0026-agent-identityAGENTS.md: instructions block creatednext: 25 proposed ADRs, ruled when you choose: the repository works as it ischeck runs only the decided ADRs. Start with a few:from a shell: claude "$(npx ontrack review)"as a prompt: Run `npx ontrack review` and follow its output.The last four lines name the next step. Step 4 takes it for one convention.
The ADRs are now in
docs/adr/engineering/, andAGENTS.mdhas a block that belongs to ontrack:- AGENTS.md the instructions block, created
Directorydocs/
Directoryadr/
Directoryengineering/
- ADR-0001-record-architecture-decisions.md
- ADR-0002-localization.md
- …
- ADR-0026-agent-identity.md
- package.json
<!-- ontrack:begin -->## Project instructions (ontrack)When asked to review, rule on or supersede an ADR, run `npx ontrack review [adr]` and follow its output. When asked to record a new decision, run `npx ontrack decide` and follow its output.### Record architecture decisions (engineering/ADR-0001-record-architecture-decisions)```yamlrecord-architecture-decisions:format: nygard```### Not yet decided- Localization (engineering/ADR-0002-localization)- Software architecture (engineering/ADR-0003-architecture)- …- Agent identity (engineering/ADR-0026-agent-identity)<!-- ontrack:end -->One ADR came already decided by its track. The others are conventions your repository has not ruled on yet.
-
Rule on one convention
Open
docs/adr/engineering/ADR-0006-commits.md. It is the convention on commit scopes and the tool that enforces them, and it leaves two keys empty:status: proposedtraits:commits:scopes:tool:Ask a coding agent to propose the ruling:
Terminal window claude "$(npx ontrack review ADR-0006)"ontrack reviewprints a prompt and the agent follows it: it reads the ADR, looks in your repository for evidence, proposes a status and a value for each key, then stops and asks for your agreement.In the empty repository this tutorial was tested on, there was nothing to draw from, and the agent proposed accepted with
scopes: []andtool: none. In a repository with a history, expect the scopes you already use.Agree, or change a value. The agent then fills the keys, sets the status and runs
npx ontrack apply, which moves the ADR from “Not yet decided” to an instruction of its own inAGENTS.md. In the repository of ontrack itself, that instruction reads:### Commits (engineering/ADR-0006-commits)```yamlcommits:scopes: [apply, check, cli, governance, instructions, openspec, plan, review, revision, tracks]tool: commitlint```Your repository now holds a decision it took for itself, in a file coding agents read.
Where to go next
Rule on more conventions when you choose, with
claude "$(npx ontrack review)". The agent starts with those your history
already answers, and you can skip one or stop at any time.
Then record the decisions your repository took on its own, which no track
ships, with claude "$(npx ontrack suggest)". The agent proposes at most
five, with their evidence, and writes only those you agree to. A decision
you take later goes through npx ontrack decide, which AGENTS.md points
your agent to.
