Skip to content

Rename, move or remove

Rename, move or remove an Element, a Person, System, Service or Component, without leaving a reference to it behind.

  • You can run archidocs check in the Workspace. See the Quick start.
  • References from another Project belong to that Project’s Team. Tell them before you change what they point at.

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.

Skip this step for a removal. To rename, add the Element again under the new id, with the same fields and parent. To move, add it under the new parent. Changing only the display name needs no other step, because nothing refers to names.

Move its Components, Relationships and Deployments to the new id, and change every reference to the old one. For a removal, remove or repoint the Relationships and Deployments, and drop the Element from the Views that name it.

Remove the old id. Removing an Element removes what is declared under it: its children and its outbound Relationships. To keep the same id when moving, remove the old one before adding the new one, or use a temporary id.

Terminal window
archidocs check
0 errors, 0 warnings

Then compare with the base branch. Here Big Bank’s payments-db was renamed payments-ledger:

Terminal window
archidocs diff main
Changes from main (83d7816) to working tree: 3 added, 3 removed, 0 changed
- Element payments:payments-db
+ Element payments:payments-ledger
- Relationship payments:payments-service -> payments:payments-db
+ Relationship payments:payments-service -> payments:payments-ledger
- Deployment payments:payments-db in prod on platform:eks-prod
+ Deployment payments:payments-ledger in prod on platform:eks-prod

A rename shows as a removal and an addition, for the Element and for each reference to it. This is what reviewers see in the pull request. See Review changes with diff.

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/shop/model.yaml:10:13 error unknown-element Unknown Element "legacy-db" in Project "shop"
1 error, 0 warnings
Rule docs:
unknown-element https://archidocs.dev/docs/reference/rules/unknown-element/

That is unknown-element. Repoint or remove the reference at the line it names.

An accepted ADR that links a removed Element is history. Leave it, and follow it with a new ADR. See Decisions.

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

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