theway
Commands

/theway:document

Write architecture docs for the project in docs/architecture/

Three documents come from the templates in <home>/templates/; others are added as the project needs them.

Usage

/theway:document

Example

On my-api:

/theway:document
Documented my-api in docs/architecture/:
- coding-standards.md: ESM, no dependencies, JSON error bodies, node --test with injected clocks.
- source-tree.md: src/app.js (routes, rate-limit guard), src/rate-limit.js, test/.
- tech-stack.md: Node, node:http, no framework, single instance with no proxy.

Steps

  1. Reads the standards that theway context document lists: the enabled standards, shipped opt-in or yours; each applies to every phase unless its applies_to narrows it (see Configuration).

  2. Generates each document from its template, following the template's frontmatter instructions. An existing file is overwritten.

    <home> is the folder theway path prints, ~/.theway by default.

    TemplateOutput
    <home>/templates/coding-standards-template.mdcoding-standards.md
    <home>/templates/source-tree-template.mdsource-tree.md
    <home>/templates/tech-stack-template.mdtech-stack.md
  3. Adds other documentation as needed: system overviews, backend design and API contracts, frontend patterns, infrastructure and deployment, and architecture decision records.

The documents stay short and favor code examples over explanations.

Output

docs/architecture/
├── coding-standards.md     # project coding conventions
├── source-tree.md          # repository structure
└── tech-stack.md           # technology choices

/theway:workflow reads docs/architecture/coding-standards.md when it exists.

On this page