Give AI a Reading List
Assemble a bounded AI reading list from depends, context.load, ignore, and share — without dumping the repository into the prompt.
Give AI a Reading List
Overview
Most AI tooling fails docs the same way: it embeds the whole tree, or it greps until the window is full. ODS does the opposite. You name an entrypoint. The engine walks only the hard prerequisites, injects the fixtures you listed, and stops.
That walk is called bounded context. You already declared most of it:
depends— documents the agent must have readcontext.load— extra text files to injectresources— not injectedrelated— not injected unless you opt in
This page shows what comes out the other side.
Prerequisites
- A document with at least one
dependsedge (Link documents). - Optional attachments from Bind files and code.
- The
odsCLI if you want to print the bundle. You can follow the walk-through without it.
Steps
1. Start from the job, not from the repo root
The question is never “what is in docs/?” It is “what does an agent need to issue a refund?”
That entrypoint is docs/guides/refunds.md.
2. Read the refunds frontmatter as a reading list
ods:
profile: guide
status: draft
share: public
depends:
- ../auth/sessions.md
related:
- ../decisions/004-stripe.md
resources:
- path: ../diagrams/refund-flow.png
code:
- path: apps/billing/src/refund.ts
role: implementation
symbol: processRefund
context:
max-depth: 2
load:
- ../schemas/refund-request.json
ignore:
- archive/
| Field | Effect on the bundle |
|---|---|
depends |
Walk these documents, then their depends, up to max-depth. |
related |
Skip (unless you pass --include-related). |
resources |
Skip. The PNG stays on disk. |
context.load |
Inject these files at the entrypoint. |
context.max-depth |
Default 2. Raise only if a third hop is truly required. |
context.ignore |
Drop any path with this prefix, even if depends pointed at it. |
share: private |
Exclude from unprivileged / public exports. |
code |
Include only when the caller asks (--with-code). |
3. Walk the default bundle
Assume sessions.md depends on docs/crypto/tokens.md. Then:
ods context docs/guides/refunds.md
emits, deepest first:
docs/crypto/tokens.md— transitive prerequisite, depth 2docs/auth/sessions.md— direct prerequisite, depth 1schemas/refund-request.json—context.loaddocs/guides/refunds.md— the entrypoint
Not in the bundle: the PNG, the ADR, archive/**, and refund.ts (until --with-code).
That is the point. A few thousand tokens, reproducible, no binary surprise.
4. Follow three rules that keep the list small
- Do not repeat
dependstargets inload. The walk already includes them. - Do not put fixtures in
depends. JSON is not a document. Useload. - Do not raise
max-depthto “get everything.” If hop 3 matters, it should probably be a directdependson the entrypoint.
5. Hide what must not leave the building
ods:
share: private
Private documents are skipped when assembling public or unprivileged context. Use this for credentials runbooks, customer data, and anything you would not paste into an external model.
org means internal-ok. public (the default) means safe to export.
Troubleshooting
- “The bundle missed a file I care about.” It is probably
related, behindmax-depth, inignore, orshare: private. Promote it todependsorloadif it is truly required. - “The bundle is huge.” A
dependschain is wider than you think, or someone listed large files inload. Checkignoreand stop loading PDFs. - “Why not embeddings / RAG?” Similarity search is useful for exploration. It is not a substitute for “these three docs are required.” ODS makes the required set explicit. Details:
specs/context.md.
You can stop here if agents can already start from one doc and receive a tight bundle.
Next only if a team will lint, rename, and discover these files every day: 06 · Run the workspace.