Documentation Oriented Grammar (DOG) CLI Tool
Project description
DOG
Documentation Oriented Grammar — a typed, lintable concept graph of your project, written in plain Markdown.
DOG turns agent planning into persistent project knowledge. Instead of asking coding agents to repeatedly read the repo, write a disposable spec, write a disposable plan, and then implement, DOG keeps a small concept graph of actors, behaviors, components, and data that agents can query, diff, and lint.
The DOG docs diff is the plan.
Available on PyPI and as prebuilt binaries on Releases.
Install
Agent skill — recommended. Teaches Claude Code, Cursor, Codex, and similar agents to use DOG automatically:
npx skills add https://github.com/AirswitchAsa/dog/tree/main/skills/dog
CLI — prebuilt binary for macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/AirswitchAsa/dog/main/scripts/install.sh | sh
Or pip install dog-cli / uv add dog-cli. See the install guide for Windows, Intel macOS, and building from source.
A tiny example
A .dog.md file defines exactly one primitive — Actor, Behavior, Component, or Data — with a few required sections and typed cross-references:
# Behavior: Login
## Condition
A `@User` submits valid `&Credentials` to `#AuthService`.
## Description
Authenticates the user and starts a session.
## Outcome
A `&Session` is created and returned to the user.
## Notes
- Failed attempts are rate-limited.
Now an agent can navigate the project as a graph:
dog get "!Login" --depth 1 # read the spec with referenced primitives inlined
dog refs "#AuthService" # impact analysis: what depends on AuthService?
dog lint docs # validate structure and references
See the getting-started guide for the primitive types, sigils, and required sections, or the CLI reference for all commands.
The workflow
brainstorm change
→ update DOG concept docs
→ review the DOG docs diff
→ implement against that diff
The output of understanding is a durable map of the system, not a plan that gets thrown away after one task. See the agent workflow guide for how this works inside Claude Code, Cursor, and other agents.
How DOG relates to other specs
DOG does not replace your existing specs. It connects them.
| You already have | DOG's role |
|---|---|
| Gherkin / BDD scenarios | Describes the durable concept graph around those behavior examples. |
| OpenAPI / AsyncAPI contracts | Connects API and event contracts to actors, behaviors, and data. |
| C4 diagrams | Provides a queryable, lintable concept map instead of static visuals. |
| ADRs | ADRs explain why. DOG describes what the system currently means. |
| Spec Kit / Kiro feature specs | Concept diffs that survive implementation, instead of disposable plans. |
See comparisons for the full picture.
Does it actually work?
A controlled eval against the crates/warp_cli subsystem of warpdotdev/warp: same agent (claude-sonnet-4-6), 5 information-retrieval tasks, 3 trials per condition. Condition A gets warp source only; condition B adds an authored DOG docset and the dog skill.
| A (baseline) | B (with DOG) | |
|---|---|---|
| Concept recall (mean) | 0.957 | 0.991 |
| File recall (mean) | 0.733 | 0.967 |
| Hallucination rate | 0/15 | 0/15 |
| Tool calls per task (mean) | 19.7 | 12.7 |
B matches or beats A on concept recall on every task, doubles file recall on the two tasks where A struggled to cite the right file, and uses ~35% fewer tool calls on average. Zero hallucinations in either condition.
The DOG docs were authored in a separate Claude Code session with no shared context with the eval runner, and ground truth was sourced from the Rust code rather than from the docs — so B doesn't get credit for echoing its own docs back.
Full methodology, per-task analysis, raw transcripts, and limitations: AirswitchAsa/dog-eval-warp.
Docs
- Getting started — primitives, sigils, your first
.dog.md - Install guide — binaries, PyPI, building from source
- CLI reference — every command and flag
- Agent workflow — concept-diff workflow, skill install, system-prompt fallback
- Comparisons — DOG vs Gherkin, OpenAPI, C4, ADRs, Spec Kit, Kiro
- Evaluation — controlled eval on a real Rust codebase
- Philosophy — design principles
- Example docset — DOG dogfooding itself
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dog_cli-2026.5.1.tar.gz.
File metadata
- Download URL: dog_cli-2026.5.1.tar.gz
- Upload date:
- Size: 176.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
912994f815494f9f6fe10022e524fbf45111554740fa538676cbb9b005947fa2
|
|
| MD5 |
773fd979527cd363195eb0dc355530a1
|
|
| BLAKE2b-256 |
8bf78b6b3046905db91ec2f6e7d825a13b70895f8d4aaad1c2c9a701983f88c3
|
File details
Details for the file dog_cli-2026.5.1-py3-none-any.whl.
File metadata
- Download URL: dog_cli-2026.5.1-py3-none-any.whl
- Upload date:
- Size: 32.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e12e1f2a92f00b4601664ad27b06dda8b8a7c19257fa859b007073613bb7319c
|
|
| MD5 |
68df7236d71a166dbc8f897f4c47891d
|
|
| BLAKE2b-256 |
6b825b352f0e8c99f9a65d8a4861bf7e2809dbbca43b803673bd431fbce7ae2c
|