Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.driftless.icu/llms.txt

Use this file to discover all available pages before exploring further.

What is a topic?

A topic is the atomic unit of context in Driftless. It connects a slice of your codebase to the team’s shared knowledge about it. A topic has:
FieldDescription
slugUnique name within the workspace (e.g., auth-flow, billing-webhook)
whatShort summary of what this code does
howTechnical detail: the mechanism, the pattern
decisionsWhy choices were made (architecture decisions)
gotchasTraps, edge cases, things that will break
invariantsRules that must always hold true
contentFull free-form body (Markdown). Can include diagrams, code snippets, references
anchorsPatterns, files, and repos that link this topic to code
tagsLabels for discovery (e.g., auth, security, billing)
relationsTyped links to other topics
classificationOrigin, status, and kind

Anchoring topics to code

Topics are connected to code through anchors. When anchored code changes, the topic goes stale.
# Anchor by glob pattern
driftless context add api-guards --pattern "src/auth/**"

# Multiple patterns for cross-cutting topics
driftless context update api-guards --add-pattern "src/common/guards/**"

# Anchor by exact file path
driftless context add auth-flow --where src/auth/guard.ts

# Anchor a document
driftless context add architecture-decisions --file docs/decisions/auth.md
Discipline: 5-40 components per topic is healthy. Less than 5 means you are 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:
driftless context update auth-flow --remove-pattern "src/old-auth/**"

Topic classification

Kinds

KindPurpose
code-contextHow a module/service/package works (default)
domain-mapOverview of a business domain and its boundaries
decisionArchitecture decision and rationale
roadmapPlanned changes or migration path
runbookOperational procedures, incident response
customer-insightWhy something exists because of a customer need
integration-noteHow a third-party integration works
docs-noteSupplementary documentation
operational-noteDeployment, monitoring, or infra details

Status

StatusMeaning
reviewedActively maintained, confirmed accurate
draftWritten but not yet reviewed
suggestedAuto-generated by scanner, needs human review
orphanedNo repo claims this topic anymore

Origin

OriginMeaning
autoGenerated by scanner
manualWritten by a human
docAnchored from a document file
agentWritten by a coding agent

Typed relations

Topics connect to each other through typed relations, building a semantic knowledge graph:
RelationMeaning
depends_onTopic A depends on B (e.g., auth-guard depends on jwt-service)
relates_toGeneral association
supersedesTopic B replaces A
blocksA cannot proceed until B is done
implementsA is the implementation of the pattern described in B
documentsA is documentation for B
risk_forA introduces risk for B
driftless context update auth-guard \
  --rel depends_on:jwt-service \
  --rel relates_to:role-decorator

driftless context update jwt-service \
  --rel risk_for:token-refresh
Use [[slug]] syntax inside any free-text field (what, how, decisions, gotchas, invariants, content). The API auto-parses these into forward and backward references in the graph.
driftless context update billing-webhook \
  --gotcha "Same idempotency race as [[stripe-webhook-ingest]]; deduplicate by event ID"
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. To explicitly link the current repo to a topic:
driftless context link auth-flow
To see which repos a topic spans:
driftless context get auth-flow --json | jq '.where_repos'

The knowledge graph

The topic graph is explorable from CLI and dashboard:
driftless context graph auth-flow    # BFS graph from a topic, terminal output
The dashboard renders the full interactive graph with React Flow. Nodes are topics, edges are typed relations. Click any node to see its full context, anchors, and coverage.