AGENTS.md — Docs Master Index
Technical documentation routing index for humans and AI agents.
Architectural Enforcement
- Modular Architecture: Following a major refactor in April 2026, the 12 large monolithic Markdown files previously occupying this root directory (e.g.
ARCHITECTURE.mdandSPEC.md) were decoupled and modularized into corresponding subdirectories (e.g.,architecture/,reference/). - Locating Content: Agents searching for API guides must drill into
api/. Agents looking for architectural narratives must drill intoarchitecture/. Dated R&D logs and empirical reports live underevaluation/. - Modification Pattern: Do not reconstruct monolithic files. Any new topical tutorials or references must either be integrated directly into their existing module directories as cohesive
.mdfragments, or added to a new module directory.
MkDocs site root
The published home page is index.md. Do not add a second root README.md beside index.md under docs/ — MkDocs treats both as competing home pages and mkdocs build --strict will warn or fail. From a nested docs/<module>/README.md, point the “hub” link at the site home using the relative path ../index.md (not ../README.md).
Deliberately-shared documentation patterns
Two documentation patterns intentionally diverge from "every folder has its own AGENTS.md + README.md" — agents auditing folder coverage should treat these as features, not gaps:
cogant/docs/itself has noREADME.md.index.mdis the MkDocs home page, and an extradocs/README.mdwould shadow it (see "MkDocs site root" above). AREADME.mdhere will failmkdocs build --strict.cogant/evaluation/eval_repos/ships a single sharedAGENTS.md+README.mdat the parent level only. The 12 entries below it are git submodules pinned to upstream commits (manifest at/.gitmodules, one level above thiscogant/package); their internal contents are read-only third-party code and must not receive COGANT-authored AGENTS files. Per-submodule documentation lives upstream.
Module README indexes
The hub listing all module areas is reference/documentation_modules.md. Each docs/<module>/README.md is the table of contents for that module. Link labels should be human-readable titles (for example Overview), not pasted heading markers (avoid leading ## in the link text). If split_docs.py is used on a new monolith, empty headings (such as JSON { / } lines) must not become a filename .md or orphan TOC rows; merge those lines into a surrounding section or give them an explicit slug.
Tooling
fix_links.py— rewrites monolith filenames to../<module>/README.md.DOCS_DIRisPath(__file__).resolve().parent. If a module folder lacksAGENTS.md, the script writes a small generated module note; replace that generated note with a real module index the first time you edit that directory.split_docs.py— splits a monolithic guide into section files; empty heading slugs become_unnamed_section_<n>.md(never.mdalone). Lives next tofix_links.pyin this directory when present in the checkout; it is not part of the MkDocs-published page set.verify_doc_links.py— checks relative links from Markdown underdocs/against the package root (parent ofdocs/). Run after editing cross-links topy/,specs/, orexamples/(same directory asfix_links.pywhen checked in).verify_manuscript_links.py— resolvesmanuscript/asparent(package_root)/manuscript(e.g. template:…/projects/working/cogant/manuscriptnext to innercogant/). Standalone clones that only contain the installable package tree with no siblingmanuscript/will get “directory not found” — expected, not a tool bug. Links beginning with../../../are skipped (parent template checkout). Run from the package root:uv run python docs/verify_manuscript_links.py.- Manuscript pandoc-crossref audit (template render path) — when your checkout includes the Research Template tree
projects/working/cogant/, runuv run python tools/audit_manuscript_crossrefs.pyfrom that project root (siblingtools/directory) after editing{#sec:…}/@sec:identifiers so orphan references fail CI locally before PDF builds. - Changelog —
changelog.mdis copied fromCHANGELOG.mdat the package root (same directory aspy/,docs/,mkdocs.yml). After editing the root file:cp CHANGELOG.md docs/changelog.md.roadmap/changelog.mdis a compatibility stub, not a second mirror. MkDocs nav exposes a single Changelog page (changelog.md). - Invoking fix/verify scripts — from the package root:
uv run python docs/fix_links.py,uv run python docs/verify_doc_links.py. From a monorepo root one level above, if your tree is…/cogant/(inner package):uv run python cogant/docs/fix_links.py(adjust the prefix to match your checkout).