Skip to content

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

  1. Install ontrack and a track

    Terminal window
    npm i -D @trivoallan/ontrack

    The 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-engineering

    engineering@npm: is npm’s alias syntax: the package is installed under the name engineering, which becomes its namespace. The alias is the package name without its scope and without ontrack-. Use the ontrack-engineering track says how to check the package and take its later releases.

  2. See what importing would change

    Terminal window
    npx ontrack plan
    engineering: 26 new, 0 unchanged
    new ADR-0001-record-architecture-decisions
    new ADR-0002-localization
    new ADR-0003-architecture
    …
    new ADR-0026-agent-identity

    plan wrote nothing. It exited with 2, which means changes are pending. The catalogue of the track grows over time, so your count may differ.

  3. Import the ADRs

    Terminal window
    npx ontrack apply
    engineering: 26 imported
    imported ADR-0001-record-architecture-decisions
    imported ADR-0002-localization
    …
    imported ADR-0026-agent-identity
    AGENTS.md: instructions block created
    next: 25 proposed ADRs, ruled when you choose: the repository works as it is
    check 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/, and AGENTS.md has 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)
    ```yaml
    record-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.

  4. 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: proposed
    traits:
    commits:
    scopes:
    tool:

    Ask a coding agent to propose the ruling:

    Terminal window
    claude "$(npx ontrack review ADR-0006)"

    ontrack review prints 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: [] and tool: 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 in AGENTS.md. In the repository of ontrack itself, that instruction reads:

    ### Commits (engineering/ADR-0006-commits)
    ```yaml
    commits:
    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.