Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions AGENT_ORIENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Project-side documents satisfy AIDE contracts.
| Code style rules | `{{CODING_GUIDELINES_DOC}}` |
| Test requirements | `{{TESTING_POLICY_DOC}}` |
| Workflow rules | `{{CONTRIBUTING_DOC}}` |
| System truth + binding invariants | `docs/specs/<system>.md` living specs (see `docs/core/DOCUMENT_TAXONOMY.md`) |

Documentation kernel: [docs/core/DOCUMENT_TAXONOMY.md](docs/core/DOCUMENT_TAXONOMY.md) (six homes, two flavors, creation rule) and [docs/core/DOCUMENTATION_PRINCIPLES.md](docs/core/DOCUMENTATION_PRINCIPLES.md). Projects instantiate policy files from templates — no stubs pointing into `.aide/`.

### Tier 2: Compact Reference (On-Demand)

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ Browse `docs/examples/` for your stack:
Copy relevant templates to your project:

```bash
# Core process docs (usually symlink these)
ln -s .aide/docs/core/DOCUMENTATION_POLICY.md docs/DOCUMENTATION_POLICY.md
ln -s .aide/docs/core/CONTRIBUTING.md docs/CONTRIBUTING.md
# Core process docs — COPY and customize, never symlink or stub-point into .aide/
# (AIDE defines shapes; your project owns instances. See docs/core/DOCUMENT_TAXONOMY.md)
cp .aide/docs/core/DOCUMENTATION_POLICY.md docs/DOCUMENTATION_POLICY.md
cp .aide/docs/core/CONTRIBUTING.md docs/CONTRIBUTING.md

# Tech-specific standards (copy and customize)
cp .aide/docs/examples/nodejs-typescript/TESTING_POLICY.md docs/TESTING_POLICY.md
Expand Down
12 changes: 7 additions & 5 deletions docs/core/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Contributing / Working Agreement
# Contributing / Working Agreement (Template)

> **Template — instantiate, don't point.** Copy into your project as `docs/CONTRIBUTING.md` and replace placeholders. Do not ship a stub that defers to this file.

Minimal, repeatable workflow to keep changes consistent and documented.

Expand Down Expand Up @@ -106,10 +108,10 @@ See [TESTING_POLICY.md](TESTING_POLICY.md) for complete testing requirements.
See [DOCUMENTATION_POLICY.md](DOCUMENTATION_POLICY.md) for complete documentation standards.

**Summary:**
- Update relevant docs when behavior changes (README, {{DEVELOPMENT_DOC}}, design docs)
- Update relevant docs when behavior changes (README, {{DEVELOPMENT_DOC}}, the system spec)
- Avoid duplicating information across files; use references
- Only create new spec files when explicitly requested
- System invariants live in {{CONTRACTS_DIRECTORY}} (if used); avoid restating them elsewhere
- System invariants live in the relevant `docs/specs/<system>.md` Invariants section; avoid restating them elsewhere. See [DOCUMENT_TAXONOMY.md](DOCUMENT_TAXONOMY.md)
- When executed work changes a system's invariants, updating that spec is part of the work

## Code Standards

Expand Down Expand Up @@ -145,5 +147,5 @@ Replace these placeholders:
- `{{LANGUAGE}}` -> `TypeScript`, `Python`, `Rust`, `GDScript`
- `{{FRAMEWORK}}` -> `React`, `Django`, `Actix`, `Godot`
- `{{DEVELOPMENT_DOC}}` -> `docs/DEVELOPMENT.md`, `docs/ARCHITECTURE.md`
- `{{CONTRACTS_DIRECTORY}}` -> `docs/contracts/`
- `{{DESIGN_DIRECTORY}}` -> `design/`, `docs/design/`
- `{{PROJECT_DESIGN_DOCS}}` -> `docs/design/`, `docs/architecture/`
115 changes: 29 additions & 86 deletions docs/core/DOCUMENTATION_POLICY.md
Original file line number Diff line number Diff line change
@@ -1,99 +1,42 @@
# Documentation Policy
# Documentation Policy (Template)

Keep docs lean, consistent, and authoritative.
> **Template — instantiate, don't point.** Copy this into your project as `docs/DOCUMENTATION_POLICY.md`, replace placeholders, and delete sections that don't apply. Do **not** ship a stub that defers to this file: the `.aide/` pin is not your project's source of truth. Kernel references: [DOCUMENT_TAXONOMY.md](DOCUMENT_TAXONOMY.md), [DOCUMENTATION_PRINCIPLES.md](DOCUMENTATION_PRINCIPLES.md).

## Sources of Truth
## Taxonomy (six homes, two flavors)

Define your project's documentation hierarchy:
| Home | Question answered | Flavor |
| --- | --- | --- |
| `{{DESIGN_DIRECTORY}}` | Why does this product exist and feel this way? | Living |
| `docs/specs/` | What is true of this system now, and what must remain true? | Living |
| `docs/decisions/` | What did we choose that is hard to reverse, and why? | Dated |
| GitHub epics/issues | How and when? | Executed and closed — these are the plans |
| `docs/evaluations/` | What did we learn? | Dated |
| Conventions ({{CODING_GUIDELINES_DOC}}, {{TESTING_POLICY_DOC}}, {{CONTRIBUTING_DOC}}) | How do we work? | Living |

- **README.md**: User/player-facing basics (install, run, key features)
- **GitHub Epics + child Issues**: Specs and implementation state
- **{{PROJECT_SUMMARY_DOC}}**: High-level project overview and current state
- **{{DEVELOPMENT_DOC}}**: Architecture and how to extend/debug
- **{{CONTRIBUTING_DOC}}**: Workflow, specs, testing, review process
- **{{CONTRACTS_DIRECTORY}}**: System invariants/contracts (project-level, optional)
**Living** docs claim to be current and are the only maintenance burden — keep the set small. **Dated** records are append-only and never edited after the fact (status lines only).

Customize this list to match your project's structure.
## Creation Rule

## Update Rules

- Update only the relevant sources; avoid duplicating the same details across multiple files
- When behavior changes, touch the single best place (README for users, {{DEVELOPMENT_DOC}} for developers)
- Do not remove or rewrite existing tests without explicit approval
- Confirm with the requester before initiating large refactors or cross-cutting doc reorganizations
- Align on intent and testing scope before commits/PRs (no surprise changes)

## Changelog Policy

During active development, git commits serve as the technical changelog. Commit messages should be descriptive and include what was tested.

A formal `CHANGELOG.md` is optional and should be added when preparing for public releases or when the project reaches a stable milestone. If created, changelog entries should include:
- Version number and date
- Summary of changes (new features, fixes, breaking changes)
- Tests run or manual verification performed

## Adding/Editing Docs

- Add a brief feature summary and implementation approach in GitHub issues/PRs before coding
- Prefer links/references to existing sections instead of copy/pasting content
- Note known gaps or future work where applicable

## Allowed Exceptions to No-Duplication Policy

In rare cases, duplication is permitted when there is a clear operational benefit that outweighs the maintenance cost:
> System truth → spec. Hard-to-reverse choice → ADR. Execution → issue.

### Token Optimization for Agents
- A **spec** (`docs/specs/<system>.md`) is the living description of a system, with status frontmatter and a binding **Invariants** section. Load it before modifying that system. When executed work changes invariants, updating the spec is part of the work.
- An **ADR** (`docs/decisions/YYYY-MM-DD-slug.md`) is written only when real alternatives existed, the choice constrains future work, and a newcomer could accidentally reverse it.
- **Plans are GitHub issues.** There is no plans folder. No contracts/reports/review/handoffs folders either — see the taxonomy doc for where that content lives.

**Exception:** Quick reference documents (e.g., `DESIGN_QUICK_REFERENCE.md`, `API_QUICK_REFERENCE.md`)

- **Purpose:** Condensed summaries for agent token efficiency
- **Justification:** Reading full docs (10,000+ tokens) vs quick reference (500 tokens) = 95%+ reduction
- **Requirements:**
- Must clearly state it is NOT authoritative
- Must link to authoritative sources
- Must be kept synchronized when source docs change
- Must cover ALL relevant topics (not selective)

**Agent Token Economy Best Practices:**

All agent-facing docs should prioritize token efficiency to maximize context budget for code analysis and implementation. See `.aide/docs/agents/TOKEN_ECONOMY.md` for comprehensive strategies.

- **Prefer concise directives over verbose explanations**
- **Use bullet points and checklists instead of paragraphs**
- **Reference authoritative docs instead of duplicating content**
- **Front-load critical information (most important rules first)**
- **Use quick reference documents when available**
- **Avoid redundant examples (one clear example > three similar ones)**

### ~~Implementation State Tracking~~ (DEPRECATED)

**Former Exception:** `IMPLEMENTATION_STATUS.md` (deprecated as of AIDE v1.1)

- **Replaced by:** GitHub Issues/PRs/Epics (query via `gh` CLI)
- **Rationale:** Static markdown files fall out of sync. GitHub is the actual canonical state and auto-updates on PR merge.
- **Migration:** Use GitHub CLI queries instead of reading stale markdown:
```bash
gh issue list --label "status:in-progress" --state open # Current work
gh pr list --state open # Active PRs
gh issue list --label "status:ready" --state open # Ready to implement
```
- **See:** [GITHUB_QUERIES.md](../agents/GITHUB_QUERIES.md) for comprehensive query reference
## Update Rules

**Recommendation:** Use GitHub as single source of truth for implementation state. Agents query current state dynamically rather than reading snapshot documents.
- Update only the relevant source; never duplicate the same fact across files — link instead.
- When behavior changes: README for users, {{DEVELOPMENT_DOC}} for developers, the system spec for invariants.
- Implementation state is queried from GitHub (`{{IMPLEMENTATION_STATUS_QUERY}}`), never tracked in markdown snapshots.
- Git commits serve as the changelog during active development; a formal `CHANGELOG.md` is optional until public release.

**When to add new exceptions:**
- Operational benefit must be significant and measurable
- Exception must be explicitly documented here
- Must include synchronization requirements
- Prefer references over duplication whenever possible
## Allowed Exception: Token-Efficient Summaries

## Customization for Your Project
Condensed agent summaries (e.g. `DESIGN_QUICK_REFERENCE.md`) may duplicate content when they clearly state they are non-authoritative, link the source, and are kept synchronized.

Replace these placeholders with your actual documentation structure:
## Placeholders

- `{{PROJECT_SUMMARY_DOC}}` -> `docs/PROJECT_SUMMARY.md` or `docs/OVERVIEW.md`
- `{{DEVELOPMENT_DOC}}` -> `docs/DEVELOPMENT.md` or `docs/ARCHITECTURE.md`
- `{{CONTRIBUTING_DOC}}` -> `docs/CONTRIBUTING.md` or `CONTRIBUTING.md`
- `{{CONTRACTS_DIRECTORY}}` -> `docs/contracts/`
- `{{IMPLEMENTATION_STATUS_QUERY}}` -> `gh issue list --label "status:in-progress"` (see [GITHUB_QUERIES.md](../agents/GITHUB_QUERIES.md))
- `{{PROJECT_DESIGN_DOCS}}` -> `docs/design/`, `docs/architecture/`
- `{{DESIGN_DIRECTORY}}` → `design/`, `docs/design/`
- `{{DEVELOPMENT_DOC}}` → `docs/DEVELOPMENT.md`, `docs/ARCHITECTURE.md`
- `{{CODING_GUIDELINES_DOC}}` / `{{TESTING_POLICY_DOC}}` / `{{CONTRIBUTING_DOC}}` → your convention docs
- `{{IMPLEMENTATION_STATUS_QUERY}}` → e.g. `gh issue list --label "status:in-progress"`
46 changes: 46 additions & 0 deletions docs/core/DOCUMENTATION_PRINCIPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Documentation Principles

Authoritative design principles for AIDE documentation. Adapted from [Build-A-Better-Business/docs-template](https://github.com/Build-A-Better-Business/docs-template); pairs with [DOCUMENT_TAXONOMY.md](DOCUMENT_TAXONOMY.md).

**Audience:** primarily AI coding agents, secondarily human contributors. Optimize for reliable agent execution while remaining easy for humans to read.

## Core Principles (priority order)

1. **Speed** — readers reach the canonical source in one or two hops. Put frequently needed content where the reader already is; move rare detail behind on-demand pointers.
2. **Context efficiency** — load only what the task needs. One fact, one home; pointers everywhere else.
3. **Token cost** — verbose reference material lives off the default reading path; pair it with token-efficient summaries when agents need it often.

When principles conflict: speed for common workflows > context efficiency for edge cases > canonical-source discipline over convenience.

## Document Patterns

- **Pointer docs** — link hubs, no normative content (e.g. `START_HERE.md`). Change when navigation changes.
- **Canonical docs** — single source of truth (specs, conventions). Duplicated nowhere, updated in one place.
- **On-demand guides** — workflow narratives off the default path; may repeat small snippets for readability but defer to canonicals for rules.
- **Token-efficient summaries** — condensed agent versions of verbose sources; must state they are non-authoritative, link the source, and stay synchronized.

## Anti-Patterns

- Duplicating facts across files
- **Stub files that defer to the `.aide/` submodule for their substance** — projects instantiate real files from templates instead
- Plan/status documents that duplicate the issue tracker
- Transient work artifacts (session handoffs, PR findings files) filed as documentation
- Living and dated content mixed in one folder — the living set must stay small and obvious
- Restating general engineering knowledge as repo-specific convention
- Orphaned docs with no path from a navigation doc

## Decision Framework

When adding documentation, ask:

1. Is this system truth (→ spec), a hard-to-reverse choice (→ ADR), execution detail (→ issue), or learning (→ evaluation)?
2. Is it already authoritative elsewhere? Link, don't copy.
3. Does it claim to be current? Then it joins the living set — keep that set small.
4. Would a competent agent already do this without being told? Then omit it.

## Preventing Drift

- One fact, one home; link instead of copy.
- Dated records never get content edits after the fact (status lines only).
- The closing step of work that changes invariants is updating the relevant living spec.
- Update navigation docs when files move.
66 changes: 66 additions & 0 deletions docs/core/DOCUMENT_TAXONOMY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Document Taxonomy

Canonical AIDE documentation kernel. Defined by ADR [2026-06-10-documentation-taxonomy-living-specs.md](../decisions/2026-06-10-documentation-taxonomy-living-specs.md), adapted from [Build-A-Better-Business/docs-template](https://github.com/Build-A-Better-Business/docs-template).

**AIDE defines shapes; projects own instances.** No project document may point into `.aide/` for its substance — projects instantiate real files from AIDE templates. The submodule pin must never be a project's source of truth.

## Six Homes, Two Flavors

The dividing line is **time**, not content. A document either *claims to be current* (living — the only maintenance burden) or *records a moment* (dated — append-only, cannot drift because it does not claim currency).

| Home | Question answered | Flavor |
| --- | --- | --- |
| `design/` (or project equivalent) | Why does this product exist and feel this way? | **Living** |
| `docs/specs/` | What is true of this system now, and what must remain true? | **Living** |
| `docs/decisions/` | What did we choose that is hard to reverse, and why? | Dated |
| GitHub epics/issues | How and when? | Executed and closed — these **are** the plans |
| `docs/evaluations/` | What did we learn? | Dated |
| Conventions (coding guidelines, testing policy, contributing) | How do we work? | **Living** |

Plus `docs/archive/` for superseded material retained as historical context.

## Creation Rule

> **System truth → spec. Hard-to-reverse choice → ADR. Execution → issue.**

ADR threshold: real alternatives existed, the choice constrains future work, and a newcomer could accidentally reverse it. Most features never need one.

## Specs Are Living System Documents

A spec is the canonical description of a **system** (not a feature increment): its model, its current shape, and an explicit **Invariants** section carrying binding "what must remain true" rules. Specs are updated as architecture matures — they are the load-before-you-touch layer for agents.

Frontmatter schema:

```yaml
---
title: <system name>
description: <one line>
status: draft | accepted | superseded
created: YYYY-MM-DD
last_updated: YYYY-MM-DD
---
```

Closing step of any executed epic or accepted decision that establishes new invariants: **update the relevant living spec.** This is how living docs stay current without a separate audit habit.

## Dated Records

- **Decisions (ADRs)** — slim records: Context, Decision, Rationale, Consequences. Status values: `Accepted (durable decision — current)`, `Executed (historical record)`, `Superseded by <file>`. Never edited after the fact except to update status.
- **Evaluations** — audits, reviews, research, retrospectives. Replaces `reports/` naming.

## Explicitly Rejected Categories

- **No `plans/` folder.** Execution detail lives in GitHub epics and issues. Plan documents duplicate the tracker and rot.
- **No `contracts/` folder.** Invariants live inside the relevant spec's Invariants section — on the load path, not in a separate archive.
- **No `reports/` / `review/` / `handoffs/` folders.** Evaluations are dated records in `docs/evaluations/`; PR reviews live on GitHub; session handoffs are transient (archive or delete).
- **No implementation-status snapshots.** Query GitHub (`gh`) for live state.

## Naming

- Dated records: `YYYY-MM-DD-slug.md` (preferred over `NNNN-slug` — no renumbering churn).
- Living specs: `slug.md`, named for the system, not the feature increment.

## See Also

- [DOCUMENTATION_PRINCIPLES.md](DOCUMENTATION_PRINCIPLES.md) — design principles, patterns, anti-patterns
- [DOCUMENTATION_POLICY.md](DOCUMENTATION_POLICY.md) — instantiable project policy template
Loading
Loading