Skip to content

Authoring guide for agents

The Model is YAML in a Workspace: workspace.yaml defines Teams and Environments, and each Project folder (marked by project.yaml) declares its Elements, Relationships, Deployment Targets, Deployments and Saved Views. You need two things: code you can read, and a writable Workspace checkout served by archidocs mcp --workspace <path>.

Load the topic for the task before you write: get_guide("authoring", topic), or archidocs guide <topic> without MCP.

The CLI commands in this guide, such as archidocs check, assume a global install. When there is none, run them the way the repo’s AGENTS.md says, such as npx archidocs check.

  • Elements: Person, System, Service, Component. Nesting is strict: System › Service › Component; a Service may sit outside any System; Persons are top-level. Every Element has name, and optionally description (Markdown), owner, tags, links, metadata (a free-form key: value map for facts the Model has no field for, such as tier: 1).
    • Service adds type (app by default, datastore, broker), technology, external, repository. System adds external, repository. Component adds technology, repository. repository is the source code URL; use it rather than a Repository link.
    • An External System or Service runs outside the organization and has no declared Components.
  • Relationships sit under their consumer and point to the provider it depends on. Edges between higher-level Elements are derived, never declared.
  • Ownership: one Owner Team per Element, defaulting to the Project’s owner. Set owner only when it differs.
  • Deployment Targets nest to any depth, have a kind, and are not Elements. A Deployment is one Service in one Environment on one Target, and carries the url and endpoints. URLs live only on Deployments.
  • Ids are lowercase slugs, unique per Project across Elements and Targets. Within a Project write bare ids; name another Project’s Element as project:id. Teams and Environments are always bare.

Every flow runs this loop:

  1. Read with the read tools: search_elements to resolve names, URLs and hosts to project:id; get_element, list_teams, list_environments, list_views.
  2. Write through the MCP write tools only: create_project, upsert_element, upsert_relationship, upsert_target, upsert_deployment, upsert_team, upsert_environment, upsert_view, propose_adr, and the remove_* tools. Each keeps comments and formatting and returns a unified diff. dry_run: true returns the diff and writes nothing.
  3. Refusal: a write that would add a check error returns validation_failed with issues (file:line, rule, message); a removal still referenced returns its references. Fix the input or ask the user, then write again. The rule ids are explained in the rules topic. Resolve a refusal through the tools, so the Model stays valid at every step.
  4. Show the user the returned diff after each single-change write.
  5. Finish with check, then suggest a branch name, a PR title and a PR body. Leave committing to the user.

Without an MCP server, edit the YAML with your file tools and run archidocs check after each edit; the same rules apply.

Code tells you what runs and what it calls. Ask the user for what code can’t tell: the System grouping, External flags, business descriptions, and Owners other than the Project’s.

  • bootstrap: Declare an existing codebase’s Services, Relationships and Deployments in one pass, from an approved inventory.
  • add-service: Add one Service with its Components, Relationships and Deployments.
  • relationships: Declare a dependency, including async ones through a broker (via, channel) and cross-Project ones.
  • deployments: Add Deployment Targets and Deployments, with their URLs, per Environment.
  • dynamic-view: Draft a scenario as Steps over existing Relationships, adding missing ones.
  • saved-view: Save a structural or Deployment View with selectors and a Lens.
  • propose-adr: Propose an ADR linked to the Elements and Views it affects.
  • change: Rename, move or remove, working through refused removals by their references.
  • rules: Every check rule id: what it means, a failing example and the fix.

Skills of their own that build on authoring, each loaded with get_guide(skill) or archidocs guide --skill <id>.

  • consult: Check the Archidocs architecture Model before and after changing code. Use when changing a public API, event or schema, adding or removing a dependency on another Service, datastore or broker, renaming or retiring a Service, changing deployment config, or answering who calls, owns or deploys something.
  • fill-gaps: Find and fill what the Archidocs Model leaves empty, by interviewing the user with values proposed from evidence in the code. Use when asked what’s missing or undocumented in the architecture, to audit or complete the Model, or to prepare a Team’s documentation backlog.
  • describe: Build the Archidocs Model from the user’s own explanation of their architecture, iteratively, with no code needed. Use when the user describes how their systems fit together in prose, wants to talk through or sketch an architecture, or is documenting something whose code isn’t available.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.