Skip to content

Rename, move or remove

Ids are referenced across files and Projects, by Relationships, Deployments, Views and ADRs, so changing one is never a single edit. archidocs check finds every reference you miss.

  1. Find what refers to it. In the viewer, the Element panel lists its Relationships in and its Deployments; over MCP, get_element lists those and the Dynamic Views and ADRs that use it.
  2. Deal with each reference: remove the Relationships and Deployments, point them elsewhere, or drop the Element from the Views that name it. A reference from another Project belongs to that Project’s Team: tell them first.
  3. Remove it. Removing an Element removes what is declared under it: its children and its outbound Relationships.

A reference left behind fails the check. Here legacy-db was removed, but a Relationship still points at it:

shop/model.yaml · fails check: unknown-element
services:
web:
name: Web
relationships:
- to: api
description: Places orders through
api:
name: API
relationships:
- to: legacy-db
description: Stores orders in

archidocs check reports unknown-element at the line that still names it.

ADRs are history: an accepted ADR that links a removed Element is better left alone and followed by a new ADR than edited.

A rename is add, repoint, remove:

  1. Add the Element again under the new id, with the same fields and parent.
  2. Move its Components, Relationships and Deployments to the new id, and change every reference to the old one.
  3. Remove the old id. archidocs check names anything that still points at it.

Changing only the display name is a one-line edit: nothing refers to names.

Moving an Element to another parent, or a Deployment Target into another, is a rename in disguise: add it under the new parent, repoint the references, then remove the old one. The id can stay the same only once the old one is gone, so remove it first if nothing refers to it, or use a temporary id.

Terminal window
archidocs check
Terminal window
archidocs diff main

archidocs diff against the base branch shows the rename as a removal and an addition, which is what reviewers will see in the pull request. See Review changes with diff.

The remove_* tools, such as remove_element, never cascade: a removal still referenced is refused, with each reference’s file and line, so the agent works through the list.