Skip to main content

What is a topic?

A topic is the atomic unit of context in Driftless. It connects a slice of your system to the team’s shared knowledge about it. The slice can be TypeScript, Python, Rust, Go, docs, config, infrastructure, or a workflow that spans repos. A topic has: Topics are content-first: the markdown content body IS the topic. The structured fields (gotcha / decision / invariant / check) are optional highlights layered on top. Add one only when you want that specific thing surfaced to a future agent’s brief. Use tags to label and group topics.

Create your first topic

Start with the smallest useful topic: a durable note that explains one area well enough for a future human or agent to work there.
Then enrich it as reality becomes clear:

Anchoring topics to code

Topics are connected to code through glob patterns and file paths. This is language-agnostic: Driftless matches paths, not ASTs. When anchored code changes, the topic drifts.
The CLI validates every pattern against your local checkout at write time:
  • ✓ pattern "src/auth/**" matches 12 files: healthy anchor
  • ⚠ over-broad anchor: pattern matches over 100 files; consider splitting
  • ✗ pattern "src/nonexistent/**" matches 0 files: blocked; fix the glob
Discipline: 5-40 matched files per topic is healthy. Fewer than 5 means you’re fragmenting. More than 100 is a catch-all trap that nobody will maintain. If a topic covers too much, split it; if it covers too little, merge it. Remove anchors when they no longer make sense:

Topic classification

A topic is content-first: the markdown content body IS the topic. Use tags to label and group topics. The only trust axis is status.

Status: governance lifecycle

A note becomes Knowledge once it’s merged in: draft → proposed → reviewed → archived. reviewed is Knowledge; the read response carries governance.authoritative. Agents propose; merging is an owner/admin act (an agent runs it only when explicitly asked). See Governance.

Visibility

A topic lives in the workspace and is visible to all its members. The exception is a private Note (a draft with is_private set), visible only to its creator until put up for review or un-marked. Need isolation between groups? Use a separate workspace.

Typed relations

Topics connect to each other through typed relations, building a semantic graph:
Use [[slug]] syntax inside any free-text field (what, how, decisions, gotchas, invariants, content). The API auto-parses these into forward and backward references.
Both billing-webhook and stripe-webhook-ingest will show each other in their references when fetched.

Cross-repo context

A topic can span multiple repositories. When you run driftless context update <slug> from any repo, that repo is added to the topic’s where_repos list. Topics accumulate repos organically without manual wiring. Use one cross-repo topic when the same concept truly spans repos, for example billing-contracts across an API repo, worker repo, and frontend repo. Use separate topics plus relations when each repo has its own implementation details, for example billing-api depends_on:billing-worker. To explicitly link the current repo to a topic:

The topic graph

The topic graph is explorable from CLI and dashboard:
The dashboard renders the full interactive graph. Nodes are topics, edges are typed relations. Click any node to see its full context and anchors.