Status: Proposed Author: Simon Massey Context: Hybrid Human/Agent Repositories
This Request for Comments (RFC) defines a strict, normative standard for repository documentation architecture. It addresses the "documentation problem" of staleness, duplication, and high cognitive load for autonomous agents. The architecture mandates a single source of truth, explicit linking (no orphans), and a flat directory structure optimized for discoverability via ls, utilizing naming conventions over directory nesting.
- Single Source of Truth (DRY): Information must exist in exactly one place. All other references must be signposts (links), not copies.
- Discoverability: The architecture assumes agents discover content by listing directories (
ls), not by recursive searching. - Self-Documentation: Executable tools document themselves via
--help. Static documentation must not duplicate this. - Context Efficiency: Documentation structure must minimize the tokens an agent needs to read to understand the repository layout.
- Strict Separation: User documentation (
README.md) and Agent instructions (AGENTS.md) are distinct and non-overlapping.
The repository root MUST contain the following files:
- Purpose: The canonical entry point for users.
- Content:
- MUST link to the
docs/folder (Architecture). - MUST link to the
bin/folder (Tools). - MUST link to
CONVENTIONS.md. - MUST contain a table of contents indexing any Architectural Submodules or Extensions (e.g.,
specs/,tests/).
- MUST link to the
- Constraints:
- MUST NOT contain agent-specific instructions.
- MUST NOT duplicate command-line argument explanations (refer to tool
--help). - MUST NOT describe internal architectural details (refer to
docs/).
- Purpose: Instructions strictly for autonomous agents regarding navigation and behavior.
- Content:
- MUST instruct the agent to read
README.mdfor project context. - MUST describe the directory map (e.g., "There is a
bin/folder..."). - MUST instruct agents to use
lsto discover content in specific folders (bin/,docs/) and avoid recursive searches unless necessary. - MUST outline behavioral rules (e.g., "No destructive writes," "Do not push").
- MUST instruct the agent to read
- Constraints:
- MUST NOT duplicate user documentation found in
README.md.
- MUST NOT duplicate user documentation found in
- Purpose: The single source of truth for coding standards, style guides, and linting rules.
- Linking:
- MUST be linked from
README.md. - MUST be linked from
AGENTS.md.
- MUST be linked from
- Purpose: Holds all architectural, design, and technical reports.
- Content:
- MUST contain at least one document describing the Project Architecture, Layout, and Build Structure.
- Format: Preferred Markdown (
.md) or LaTeX. PDF versions MAY be included but source is preferred.
- Purpose: Contains all executable scripts and tools.
- Primary Source: The tool itself. Every tool in
bin/MUST provide a comprehensive--helpor-houtput. - No Duplication:
README.md,AGENTS.md, and architectural docs MUST NOT explain tool arguments or usage examples. They MUST only signpost the tool (e.g., "Runbin/my_tool --help").
- Location: If a tool requires complex documentation beyond
--help, a manual file (e.g.,toolname.1.md) MUST reside indocs/. - Signposting: The tool's
--helpoutput MUST refer the user to the manual indocs/(e.g., "Seedocs/toolname.1.mdfor details"). It MUST NOT imply the help text is the manual.
- Documentation: Use SHOUTING_SNAKE_CASE (e.g.,
README.md,DESIGN_INGESTION.md,AGENTS.md) to distinguish prose from code. - Tools/Scripts: Use snake_case (e.g.,
test_deployment.sh,run_server.py).
- Rule: Do NOT use subfolders to categorize files by type (e.g., do not create a
scripts/ormisc/folder). - Solution: Use Prefix Naming in top-level folders.
- Example: Test scripts go in
bin/prefixed withtest_(e.g.,bin/test_regression.sh).
- Example: Test scripts go in
- Reasoning: Flat structures allow agents to discover all available capabilities via a single
lscommand, reducing context switching and hidden files.
- Definition: Subfolders are reserved ONLY for independently deployable subsystems or architecturally significant modules (Monorepo pattern).
- Depth: Nesting SHOULD be limited to one level deep.
- Requirements:
- Top-level
README.mdMUST index these submodules. - Each submodule MUST have a corresponding
DESIGN_<MODULE>.mdindocs/. - Design Doc Rule: The design doc MUST point to the specific file defining the Client API. This allows an agent to understand the module by reading one doc, without scanning the module's source code.
- Top-level
Extensions are "plugins" to the repo structure. When added, they MUST be introduced in AGENTS.md with instructions to ls the new folder.
- Purpose: For SpecKit, Cairo, or similar generated specifications.
- Indexing: Top-level
README.mdMUST have a table linking to the top-level folders/files withinspecs/.
- Purpose: For manual, deployment, regression, or "slow" integration test specifications.
- Constraint: MUST NOT contain unit tests (JUnit, etc.), which belong with the code.
- Content:
- Modular specifications prefixed by suite (e.g.,
suite1_deployment.md). - MUST reference tools in
bin/(e.g.,bin/test_setup_env) by name. - MUST NOT repeat tool usage instructions.
- Modular specifications prefixed by suite (e.g.,
- Problem: Some AI tools ignore
AGENTS.mdand look forclaude.md,gemini.md, orcord.md. - Rule:
AGENTS.mdis the authoritative file. All tool-specific names MUST be symlinks pointing toAGENTS.md. - Scope: This applies at the root and within any subfolder containing agent instructions.
A repository is compliant only if:
- Root contains
README.md,AGENTS.md,docs/,bin/. -
README.mdlinks to all top-level folders andCONVENTIONS.md. - No content in
AGENTS.mdoverlaps withREADME.md. -
docs/contains an architectural overview. - Tools in
bin/support--help. - No documentation explains how to use a tool (except to say "use --help").
- No subfolders exist purely for categorization (prefixes used instead).
- Any
claude.mdor similar is a symlink toAGENTS.md.