archdoc.dev

module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0

README

ArchDoc

A CLI that manages a specification repository: a directory of Markdown documents with YAML front matter, a fixed lifecycle, and cross-references the tool derives rather than asks you to maintain.

There are five types of document, and a glossary of terms. An RFC proposes how something should work and gets a spec page once it is built. An ADR records a decision that constrains designs without being a thing the spec describes. The spec describes how the project works right now and is always current. A ref holds research and background, and is never normative. A group, optional, lists the documents that belong together, such as those concerning one application in a repository describing several.

RFCs and ADRs are frozen once they reach a terminal status. To change what an accepted document says you write a new one that updates or obsoletes it, and the tool enforces that: twenty-three lint rules, four more for pull requests, a generated index of every derived relationship, and a CI workflow it scaffolds for you.

Installing

With Homebrew, on macOS or Linux:

brew install archdochq/tap/archdoc

With the install script, on Linux or macOS, which checks the download against the release's checksums.txt:

curl -fsSL https://github.com/archdochq/archdoc/releases/latest/download/install.sh | sh

Or download a binary for your platform from the releases page, or with Go:

go install archdoc.dev/cmd/archdoc@latest

go install puts it in $(go env GOPATH)/bin, which is often not on PATH. If the command is not found afterwards, that is why.

ArchDoc needs git on PATH, because whether a document is frozen is read from the configured branch.

ArchDoc is pre-1.0 and currently alpha. The document format and the process are settled; the command surface may still move.

Getting started

mkdir myproject-spec && cd myproject-spec && git init
archdoc init
archdoc new rfc "The first design"
archdoc lint

archdoc init scaffolds the repository, writes PROCESS.md describing the process it enforces, and generates a GitHub workflow that runs archdoc lint, archdoc index --check and archdoc glossary --check on every push. On a pull request into the configured branch it runs archdoc lint --merge, which also checks what the pull request changes in the record against that branch, and summarises those changes with archdoc changes.

Checking before you commit

The same checks run before each commit with pre-commit. Add this to .pre-commit-config.yaml:

repos:
  - repo: https://github.com/archdochq/archdoc
    rev: v0.6.0
    hooks:
      - id: archdoc-lint
      - id: archdoc-index
      - id: archdoc-glossary

archdoc-index and archdoc-glossary regenerate INDEX.md and GLOSSARY.md rather than only checking them. When either changes, the commit stops: add the regenerated file and commit again.

The hooks build archdoc from source at rev, so they are pinned as the workflow is. Keep the two versions in step. If archdoc.json is not at the root of the repository, add args: [-C, <directory>] to each hook.

Commands

init Scaffold a repository. --agents adds guidance for coding agents
new rfc|adr|ref "Title" Create the next-numbered document, in draft
propose, accept, reject, withdraw Move a document through its lifecycle
lint [--merge] Check every rule. --merge also judges a pull request against its branch
changes [--json] List what the working tree changes in the record against the branch
index [--check] Regenerate INDEX.md, or verify it is current
glossary [--check] Regenerate GLOSSARY.md from term/, or verify it is current
link [--suggest] Resolve [[...]] links, or offer new ones
term add|rename|remove|list|show Maintain the glossary
renumber <id|path> [new-id] Change a document's number, following every reference to it but not the text of a link
export [--out <dir>] Write the repository as JSON
agents Install or refresh the guides for coding agents
update Refresh what ArchDoc generates, after upgrading it

-C <dir> runs against another directory, which a specification repository sitting beside the code it documents needs.

Using the data elsewhere

archdoc export writes the repository as JSON: every document with its front matter, its parsed sections, its resolved links, and the relationships ArchDoc derives. --schema prints the JSON Schema the output conforms to.

That exists so a site rendering your specification does not reimplement the front matter schema, the identifier rules or the reverse-relationship graph. Bodies are raw Markdown; ArchDoc has no renderer and is not acquiring one.

Working with coding agents

archdoc init --agents writes AGENTS.md and a set of guides into the repository, covering classification, authoring, backfilling, lint triage and contributing by pull request. archdoc agents installs or refreshes them later.

The same guides are published as skills from archdochq/skills, which each stable release writes, for Claude Code, Copilot CLI, Codex, Cursor, Gemini CLI and any agent npx skills supports. In Claude Code:

/plugin marketplace add archdochq/skills
/plugin install archdoc@archdoc

Its README has the install line for each of the others. An installed copy holds the guides of the release that wrote it, the same files that release's binary writes.

Documents

  • spec/ is ArchDoc's own specification, written with ArchDoc. spec/spec/ describes what the tool does, and the RFCs and ADRs beside it record why.
  • internal/template/PROCESS.md specifies the process it enforces, and is authoritative where the two disagree. It is also the copy shipped inside the binary and written by archdoc init.
  • docs/DECISIONS.md records why the tool works the way it does, grouped by subject, including the alternatives that were tried and rejected.
  • docs/TESTING.md covers how the suite is built and how to run it.
  • docs/EXPORT.md describes the JSON archdoc export produces.

Licence

GNU AGPLv3. The full text is in LICENSE.

Use it however you like, including inside a company and including commercially. The obligation only lands if you redistribute a modified archdoc, or run one as a network service: then you must publish your source under the same licence. Running it on your own documents creates no obligation at all.

archdoc init --license=mit scaffolds an MIT licence for the spec repository you are creating. That covers your documents and is unrelated to ArchDoc's own licence.

Directories

Path Synopsis
cmd
archdoc command
Command archdoc manages a spec repository.
Command archdoc manages a spec repository.
internal
changes
Package changes compares the record in the working tree with the record on the configured branch: what `archdoc changes` lists, and what the rules lint runs on a pull request judge.
Package changes compares the record in the working tree with the record on the configured branch: what `archdoc changes` lists, and what the rules lint runs on a pull request judge.
config
Package config loads and validates archdoc.json.
Package config loads and validates archdoc.json.
export
Package export renders a repository as JSON for consumers that want the documents and the relationships ArchDoc derives, without reimplementing the front matter schema, the identifier rules or the reverse-relationship graph.
Package export renders a repository as JSON for consumers that want the documents and the relationships ArchDoc derives, without reimplementing the front matter schema, the identifier rules or the reverse-relationship graph.
git
Package git exposes the few git operations archdoc needs, behind an interface so that callers can be tested without a repository.
Package git exposes the few git operations archdoc needs, behind an interface so that callers can be tested without a repository.
glossary
Package glossary writes the term files under term/ and generates GLOSSARY.md from them.
Package glossary writes the term files under term/ and generates GLOSSARY.md from them.
index
Package index generates INDEX.md, the published view of every derived relationship.
Package index generates INDEX.md, the published view of every derived relationship.
lifecycle
Package lifecycle moves a document through its statuses and rewrites the file.
Package lifecycle moves a document through its statuses and rewrites the file.
link
Package link resolves wiki links and suggests new ones.
Package link resolves wiki links and suggests new ones.
lint
Package lint checks a spec repository against the rules in PROCESS.md.
Package lint checks a spec repository against the rules in PROCESS.md.
markdown
Package markdown reads a document's body into an outline: the tree of its blocks and inline pieces as goldmark parses them, each holding its position in the body as written.
Package markdown reads a document's body into an outline: the tree of its blocks and inline pieces as goldmark parses them, each holding its position in the body as written.
reference
Package reference describes ArchDoc itself as data: its commands, its lint rules, the front matter of each type, its configuration, its exit codes and the export schema, so a site documenting a release can be generated from the release rather than written again by hand.
Package reference describes ArchDoc itself as data: its commands, its lint rules, the front matter of each type, its configuration, its exit codes and the export schema, so a site documenting a release can be generated from the release rather than written again by hand.
repo
Package repo discovers, parses and relates the documents of a spec repository.
Package repo discovers, parses and relates the documents of a spec repository.
repotest
Package repotest builds spec repositories for tests.
Package repotest builds spec repositories for tests.
template
Package template holds the files archdoc writes: the document templates, the process description, and the scaffolding init produces.
Package template holds the files archdoc writes: the document templates, the process description, and the scaffolding init produces.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL