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.
The Model
Section titled “The Model”- 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 optionallydescription(Markdown),owner,tags,links,metadata(a free-formkey: valuemap for facts the Model has no field for, such astier: 1).- Service adds
type(appby default,datastore,broker),technology,external,repository. System addsexternal,repository. Component addstechnology,repository.repositoryis the source code URL; use it rather than aRepositorylink. - An External System or Service runs outside the organization and has no declared Components.
- Service adds
- Relationships sit under their consumer and point
tothe 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. Setowneronly 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 theurlandendpoints. 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.
Edit loop
Section titled “Edit loop”Every flow runs this loop:
- Read with the read tools:
search_elementsto resolve names, URLs and hosts toproject:id;get_element,list_teams,list_environments,list_views. - 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 theremove_*tools. Each keeps comments and formatting and returns a unified diff.dry_run: truereturns the diff and writes nothing. - Refusal: a write that would add a check error returns
validation_failedwithissues(file:line, rule, message); a removal still referenced returns itsreferences. Fix the input or ask the user, then write again. The rule ids are explained in therulestopic. Resolve a refusal through the tools, so the Model stays valid at every step. - Show the user the returned diff after each single-change write.
- 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.
Asking the user
Section titled “Asking the user”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.
Topics
Section titled “Topics”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: Everycheckrule id: what it means, a failing example and the fix.
Other skills
Section titled “Other skills”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.