models/ directory (or whatever you configure as model-path in colin.toml). When you run colin run, Colin discovers all .md files in this directory and compiles them based on their dependencies.
File Structure
Every document consists of two parts: optional YAML frontmatter followed by the document body.models/company.md
Frontmatter
Frontmatter is optional. When present, it’s YAML wrapped in--- markers at the top of the file:
name - A human-readable identifier for the document. When omitted, Colin derives the name from the filename.
description - Explains what this document contains. This metadata travels with the document when referenced, helping LLMs understand context.
Documents without frontmatter work fine—Colin infers the name from the filename and leaves other metadata empty. This is useful for simple content files or when you’re referencing non-Markdown sources.
Project-level configuration (paths, MCP servers) belongs in colin.toml. See Configuration for details.
Document Settings
Thecolin: block in frontmatter controls document-specific compilation behavior:
Output Configuration
Theoutput block controls how documents are transformed and where they’re written:
format — The renderer to use for transforming content:
| Format | Output | Description |
|---|---|---|
markdown | .md | Default passthrough (no transformation) |
json | .json | Convert markdown structure to JSON |
yaml | .yaml | Convert markdown structure to YAML |
path — Custom output location relative to output/. Supports subdirectories:
models/report.md → output/report.json).
publish — Whether to copy the compiled artifact to output/. Defaults to true. Set false to keep the file in .colin/compiled/ only—useful for helper templates that other documents reference but shouldn’t appear in final output.
Private Files
Files can be excluded fromoutput/ in two ways:
Naming convention: Prefix the filename or any parent directory with _. These files compile normally but don’t publish:
publish: false to make any file private, or publish: true to override the underscore convention:
ref().content—you can include their content in other documents. However, ref().path raises an error because linking to files that won’t exist in output/ is a bug.
Cache Policy
The cache policy controls when a document gets recompiled:| Policy | Behavior | Rebuilds when |
|---|---|---|
auto | Smart caching (default) | Source or refs change, or time expires |
always | Aggressive caching | Source changes, time expires, or --no-cache |
never | No caching | Every run |
never for documents that incorporate live data or timestamps. Use always for expensive operations where the output doesn’t change.
For shorthand, you can specify just the policy value:
Expiration Threshold
Theexpires setting defines when a document becomes stale based on time elapsed since last compilation:
| Format | Meaning | Example |
|---|---|---|
Nm | N minutes | 30m |
Nh | N hours | 24h |
Nd | N days | 7d |
Nw | N weeks | 2w |
NM | N calendar months | 1M, 3M |
NQ | N calendar quarters | 1Q |
1M after January 31st is February 28th (or 29th), not “30 days later.”
Calendar-Aligned Expiration
For expiration based on calendar boundaries rather than elapsed time, use thec prefix:
| Format | Meaning | Boundary | Valid N |
|---|---|---|---|
Ncm | Every N minutes | :00, :15, :30, :45 etc. | Divides 60 |
Nch | Every N hours | 00:00, 06:00, 12:00 etc. | Divides 24 |
1cd | New calendar day | Midnight | 1 only |
1cw | New calendar week | Monday midnight (ISO) | 1 only |
NcM | Every N months | 1st of month | Divides 12 |
NcQ | Every N quarters | Start of quarter | Divides 4 |
30cm creates boundaries at :00 and :30, while 15cm creates boundaries at :00, :15, :30, and :45. Use 2cM for bimonthly updates or 2cQ for semiannual updates.
A document compiled on January 31st with expires: 1cM expires on February 1st at midnight—when the calendar month changes—regardless of how much time has passed. With expires: 1cQ, a document compiled any time in Q1 (Jan-Mar) expires at the start of April 1st.
Cache Invalidation
A document is considered stale and recompiles if any of these conditions are true:- The source file changed
- Any referenced document was updated more recently
- The expiration threshold (if set) has been exceeded
Document URIs
Every document has a URI derived from its path relative tomodels/, without the .md extension:
| File | URI |
|---|---|
models/company.md | company |
models/products/main.md | products/main |
models/team/engineering/overview.md | team/engineering/overview |
ref():
ref() function and dependency tracking.