Docs/Overview

Overview

What Dewey does and how its docs loop works

Dewey keeps a project's docs usable by people and by coding agents, and checks that they still match the code. From one folder of Markdown it writes a front door for agents (AGENTS.md), an agent index (llms.txt) and a static docs site.

The loop

dewey init     # once: front door, draft maps and guide, skills, first site builddewey build    # site in .dewey/site, llms.txt, .md copies, llms-full.txtdewey check    # maps, reviews, references, front door, site links, freshness

init sets the project up. After that, you edit Markdown, run build, and run check. When covered code changes, check asks for a review; you reread the doc, fix it, and run dewey review <doc>.

What init creates

PathPurpose
AGENTS.mdFront door: purpose, hard rules, and a marked region Dewey keeps up to date (scripts, source areas, maps)
docs/quickstart.mdDraft task guide
docs/<area>.agent.mdDraft map for each source area, such as docs/src.agent.md
SKILL.mdFor agents using the project from outside
.agents/skills/dewey-author/SKILL.mdFor agents maintaining the docs
.dewey/project.jsonProject name, purpose, rules and site settings
.dewey/site/, llms.txtThe first build

Drafts carry draft: true. The site builds from them right away, but check fails until you finish them and remove that line.

Kinds of doc

Every doc declares a kind in its frontmatter.

KindAudienceOn the siteNotes
guidePeople and agentsYesTask-shaped: how to do something
referencePeople and agentsYesAPI, CLI and config contracts
mapAgentsNoDeclares covers, the source files it describes
historyRecordNoPlans, decisions, reports

A map covers part of the source tree:

---kind: mapcovers: [src/sync/**]title: Sync implementation---

Each source file belongs to exactly one map. dewey uncovered lists files no map covers, and dewey which <path> finds the docs that cover a file.

What check verifies

dewey check exits 1 and lists issues when:

  • a doc is still a draft or has invalid frontmatter
  • a source file has no map, or two maps cover the same file
  • covered code changed since the doc was last reviewed
  • AGENTS.md, SKILL.md or a host pointer file is missing, or the front door is over 150 lines or about 2,000 tokens
  • a cited path, package script, shell command or path#symbol does not exist
  • a local link or anchor is broken, or a human page is missing from navigation
  • llms.txt or the site is out of date

Each issue has a code, a file, a line when there is one, and a fix. A pass means references, coverage, reviews and outputs agree. It does not prove the prose is true.

Agent outputs

build writes, next to each HTML page, a .md copy. It also writes .dewey/site/llms.txt (one line per page, with its size), .dewey/site/llms-full.txt (every guide and reference in one file), .dewey/site/nav.json, and the marked index region of the root llms.txt.

The docs site

The site works with JavaScript off. One small script adds search, dark mode, the phone menu and the Copy page menu. By default it looks like deweydocs.com. A skin or a site block in .dewey/project.json changes the theme, accent, fonts, logo, CSS and header links. See CLI Reference.

Frozen commands

The 0.4 commands audit, generate, agent, create, update and eject still run, print a warning, and will be removed. See Frozen commands.

Package extras

The @deweydocs/dewey package also exports React components for rendering docs inside an existing app (Integrate into an existing site), theme CSS, and prompt templates (Skills).