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.
Remove something
Section titled “Remove something”- Find what refers to it. In the viewer, the Element panel lists its Relationships in and its Deployments; over MCP,
get_elementlists those and the Dynamic Views and ADRs that use it. - 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.
- 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:
services: web: name: Web relationships: - to: api description: Places orders through api: name: API relationships: - to: legacy-db description: Stores orders inarchidocs 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.
Rename an id
Section titled “Rename an id”A rename is add, repoint, remove:
- Add the Element again under the new id, with the same fields and parent.
- Move its Components, Relationships and Deployments to the new id, and change every reference to the old one.
- Remove the old id.
archidocs checknames anything that still points at it.
Changing only the display name is a one-line edit: nothing refers to names.
Move something
Section titled “Move something”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.
Check and review
Section titled “Check and review”archidocs checkarchidocs diff mainarchidocs 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.
With an agent
Section titled “With an agent”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.