Your repo is the source of truth

Lorenzo Wynberg6 min readEngineering
The headline "Your repo is the source of truth." beside a file tree of a repo holding AGENTS.md, docs, skills, hooks, DESIGN.md and a lockfile

Where something lives decides who can review it, version it and trust it.

A file in your repo gets a pull request, a diff, a blame line and a revert for free. A copy in a database next to the repo gets none of that, and needs a sync layer, an approval flow and a drift check to fake it.

Trinity takes a side. A project's docs, skills, hooks, design and stack live in the project's repo. They change the way every other change does: in a story's pull request, reviewed by a person, versioned by git.

One story, one pull request

What it can carry into your repo

Docs

M.trinity/docs/index.mdCommitted with the code it describes
MAGENTS.mdRoutes to the docs; one sentence per skill and hook

Skills and hooks

A.agents/skills/release-notes/SKILL.mdThe skill body, written once
A.claude/skills/release-notes/SKILL.mdA one-line pointer to it
A.agents/hooks/block-secrets.mjsOne script, reviewed like code
M.claude/settings.jsonThe hook, wired for this harness
M.codex/hooks.jsonThe same hook, wired for this one

Design

MDESIGN.mdThe design revision the story applies

Stack

Mpackage.jsonThe dependency and its configuration
Mpnpm-lock.yamlThe lockfile records the stack

A person reads every line as a diff, and git keeps the history.

Docs live next to the code they describe

Agents write each package's documentation into <package-dir>/.trinity/docs/, in the repo, and commit it with the code it describes. An AGENTS.md routes to it:

Each package in this repo carries its own `AGENTS.md`, and its documentation starts at:
 
- `.trinity/docs/index.md`

That settles the questions a separate knowledge base has to answer. Which page is current? The one on your branch. What was true at a point in time? git log. Which version does an agent read for a story? The one in the story's worktree, because the worktree is a checkout of the repo.

A docs check confirms every page is reachable from the package's index, so the docs stay navigable as they grow. The execution docs cover where the documenter sits in the story pipeline.

Skills and hooks arrive through a pull request

A project's skills and hooks sit in the repo, under .agents/, and reach it the way any change does: through a story and its PR. The people and agents who work in that repo outside Trinity get them too, in whichever coding agent they use.

Here is the mechanism for a story that asks for a skill and a hook.

  1. A story asks for a skill and a hook

    The implementer loads trinity-app-agent-config, a playbook that tells it to call get_agent_harnesses first and take every path and command from the answer. It writes the skill body once, at .agents/skills/release-notes/SKILL.md. For a harness that reads a stub instead (Claude Code reads .claude/skills/), it writes a one-line pointer to the same file, never a second copy.

  2. The hook is one script, wired per harness

    The hook is a single Node script under .agents/hooks/, named for what it does. The implementer wires it into .claude/settings.json and .codex/hooks.json using the command and event the tool returned. A hook that must stop a commit goes under .husky/.

  3. Each gets one sentence in the repo's AGENTS.md

    The pointer says when, never how. The skill and the hook hold the how. The documenter keeps the sentence afterwards, and removes it when the skill or hook goes.

The two lines it leaves in the repo's AGENTS.md look like this:

## Skills and hooks
 
Use `release-notes` when a story changes anything a user would read in a changelog.
The `block-secrets` hook runs before every commit and refuses a staged secret.

Two details keep this honest. A Trinity run loads none of a repo's skills or hooks: Trinity's own skills and its shipped hook come from the story's checkout. A later story's agent follows release-notes because a sentence in AGENTS.md told it to read a file, which is how any agent in any harness finds it.

And where an agent can write is fenced. It may write under .agents, .claude, .codex and .husky inside a repo. It may not write them in the story directory above the repo, and it never writes .git/hooks.

Because a hook is code in a pull request, you review it like code. That is the same advice we gave for hooks in the Runtime post, and now the review is the delivery path.

A design revision is part of a story

A story carries the design revision it applies. Its state is the story's state: pending until the story merges, live after. Its order is the story dependency tree.

The repo holds what shipped. The implementer writes the theme layer and DESIGN.md into the story's PR, and Trinity writes nothing into the repo on its own. A hand edit in the repo is live and stays unless a revision changes that value. When a later story applies a revision, the difference shows in its diff for a reviewer to read, so the implementer reconciles with what is there instead of overwriting it.

The stack is what your manifests say

A story carries the stack revision it applies, and its PR writes the dependency and its configuration: the manifest and the lockfile change, and so does any config the item needs.

The manifests and lockfiles are the record. A story's implementer is told to build with what they list instead of installing a second HTTP client or ORM, and the package's AGENTS.md names those files as the record of the stack, so every later story reads the stack from the repo.

Why we removed our own copies

These used to live in Trinity's own state. We removed that, and removed it completely: the knowledge base (about 38,000 lines deleted), the Runtime (about 20,600) and the design-system lifecycle (about 24,800). The stack lifecycle went the same way.

The decision is simple. If a repo already holds a fact, a second copy in Trinity can only drift from it. A story already is pending, in flight, merged or reverted; a commit already is a version; a manifest already is the stack.

What still lives in Trinity, and why

A system earns its own state when it holds what a repo cannot.

  • Machine facts. Which machine has which tool, and what an agent found missing mid-run.
  • Secrets and sign-ins. The keys and sign-in flows setup captures belong to a person's account, not to a commit.
  • Cross-project data. Anything that spans more than one repo.
  • Things that exist before there is code. The Architect plans a project's design and stack before any repo holds them, saving pick cards, specimens, rationale and pricing. That planning is Trinity's state until a story writes it into the repo.

The repo

What belongs there

DocsSkillsHooksManifestsTheme files

Who reviews it: A pull request, with git for history

The story

What belongs there

PendingIn flightMergedThe order between stories

Who reviews it: The pipeline, from the dependency tree

Trinity’s own state

What belongs there

Machine factsSecretsCross-project dataThings that exist before the repo

Who reviews it: The person whose machine or account it is

Anything else is a file and a pointer, and any status is the story's.

Start with a repo

See it on a new project in new project setup, or bring a codebase you already have with import an existing project.

For the backstory of how we got here, read the founder's essay, Overthinking systems.