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_authoring_guide(topic), or archidocs guide <topic> without MCP.
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,owner,tags,links.- Service adds
type(appby default,datastore,broker),technology,external. System addsexternal. Component addstechnology. - An External System or Service runs outside the organisation 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.