Rename, move or remove
Rename, move or remove an Element, a Person, System, Service or Component, without leaving a reference to it behind.
Before you start
Section titled “Before you start”- You can run
archidocs checkin 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.
1. Find what refers to it
Section titled “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. Add the new id or parent
Section titled “2. Add the new id or parent”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.
3. Repoint every reference
Section titled “3. Repoint every reference”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.
4. Remove the old one
Section titled “4. Remove the old one”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.
Check it worked
Section titled “Check it worked”archidocs check0 errors, 0 warningsThen compare with the base branch. Here Big Bank’s payments-db was renamed payments-ledger:
archidocs diff mainChanges 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-prodA 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.
If it didn’t
Section titled “If it didn’t”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/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.
With an agent
Section titled “With an agent”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.
Related
Section titled “Related”Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.