-
Notifications
You must be signed in to change notification settings - Fork 8
Facts File Format
A .facts file is both valid Markdown and valid YAML (per section). It is deliberately simple so it can be read in its entirety in under a minute and edited by both users and AI agents.
- The project root is the directory containing the nearest
.gitfolder. - All
*.factsfiles in the project root (and optionally subdirectories when explicitly targeted) are discovered. -
.factsis the default/main sheet. Use semantic names likeapi.facts,auth.facts, orcli.factsfor additional sheets.
# section-name
- a plain string fact @tag1 @tag2
- label: a fact with extra data
command: cargo test --quiet
tags: [core, mvp]
id: xyz # optional explicit ID
-
#creates a top-level section -
##,###, etc. create nested sections addressable by path (api/auth/login) - Sections are created implicitly when you
facts add --section "foo/bar" - Empty sections are automatically cleaned up when their last fact is removed
Every fact is a YAML sequence item (-).
Two forms are supported:
-
Plain string (most common for simple truths)
- users can sign up with email and password @mvp -
Mapping (when you need a command, explicit ID, or structured tags)
- label: the login endpoint returns a JWT on success command: curl -s -X POST ... | jq -e '.token' tags: [api, auth]
Allowed mapping keys: label (required), command, tags, id.
Tags are free-form tokens for filtering and categorization.
- Inline:
- some fact @core @security - Structured:
tags: [core, security] - Both can be combined; the tool normalizes them.
- Use boolean expressions on the CLI:
--tags "core and not blocked"or--tags "mvp or v1"
Three special lifecycle tags drive agent workflows:
@draft@spec@implemented
Every fact receives a short, stable ID (usually 3 characters) derived from a hash of its label (tags stripped).
- IDs appear in
facts list,facts get <id>, and when adding. - You can override with
--idor--new-idon edit. - IDs are stable as long as the label text does not change.
Any fact with a command key is automatically verified by facts check.
- Commands run in the project root via
$SHELL(orsh). - Exit code 0 = the fact holds.
- Non-zero = failure (stderr is shown).
- No caching — every check is fresh.
- Timeouts are supported per-command via
--timeout.
Facts without a command are manual facts. An agent or user must read the relevant code and explicitly state PASS or FAIL with a one-line reason.
- Describe behavior, not file layout or library choices.
- Keep facts stable (avoid "there are currently 47 tests").
- Make commands fast and idempotent (
test -f,grep -q, small scripts). - One fact = one truth.
See the full Facts CLI Reference and the embedded facts skill for more examples and the official grammar.
The format is intentionally minimal — no frontmatter, no complex nesting, no custom directives. This is what makes it work so well with agents.
Core Concepts
The Format & Tool
For AI Agents
Project
Fact-driven development for users and AI coding agents.