Code shows that a module makes an HTTP request. It does not show which service that request reaches, because the URL arrives at runtime from config, an environment variable or dependency injection.
Code also does not say why a basket page depends on a draft-cart service it has no logic for, or which team owns that service, or what happens to checkout if the shared product state changes.
That missing layer is architecture. People keep it in diagrams that drift, in wikis nobody opens, and in the heads of a few engineers. An AI agent working in the repository has none of it: it sees files, not boundaries.
I built a small toolkit to put that layer next to the code. This is an overview of the idea, what exists today, and where I want to take it.
Repository: github.com/MaximusFT/arch-manifest-prototype
Start from what already exists
I did not want to invent another format. Backstage already has a good vocabulary: Component, API, Resource, System, owners, lifecycle, dependsOn, providesApis, consumesApis. Many companies already use it, and tools already read it.
So the output of the toolkit is a Backstage-compatible YAML stream. Native fields keep their native meaning. What I add lives in a separate extension block on each entity, spec.architecture, and carries the things Backstage cannot say precisely:
-
Typed relations:
calls,reads,writes,shares-state,publishes,subscribes,hosts,uses. PlaindependsOncollapses all of these into one untyped edge. - Relation descriptions: why the edge exists, in a sentence.
- Provenance and source location: every fact says that it was declared, and where in the code.
- Runtime composition (a shell hosts a microfrontend) kept separate from logical containment (a module is part of a page).
Declare it next to the module
Developers write short @arch tags in the comment of a business module's entry point, one tag per line:
/**
* @arch component basket-adapter module -- Basket snapshot adapter
* @arch partOf checkout-mfe
* @arch sharesState resource:product-store -- Shares the basket snapshot owned by Catalog
*/
/**
* @arch component checkout-api-client api-client -- Checkout contract client
* @arch partOf checkout-mfe
* @arch calls api:cart/checkout-api -- Create order, confirm payment
*/
A few rules keep this from turning into noise:
- Declare an element once, at the module entry point, not in every file.
- Defaults such as system, owner, lifecycle and namespace come from a repository config, so a typical block is two to five lines.
- Primitive UI elements are out of scope. The unit is a business module, service, page, microfrontend or API client.
- Descriptions are data, never instructions. The text after
--is not executed or obeyed by anything.
The consumer never points at the service directly. Both sides point at an API entity. The provider declares it in its own config with a real definition; the consumer only references it. When the catalogs are merged, the two sides join through that contract, and a missing provider stays visibly unresolved instead of being guessed.
Generate, commit, check
arch extract # annotations + config -> arch.catalog.yaml
arch check # fails when the committed catalog is stale
arch diff before.yaml after.yaml
arch merge repo-a.yaml repo-b.yaml --output combined.yaml
arch graph combined.yaml > architecture.mmd
The catalog is deterministic, so it can be committed like a lockfile and checked in CI. A pull request that adds a new call or dependency shows up as a reviewable diff of the architecture, not only of the code. extract never executes the application or its build; it reads source text.
Languages without a comment adapter use the same model through native entities in configuration. TypeScript and JavaScript get comment markup.
What it does not claim
This part matters, so I will be plain about it.
- Declarations describe intended relationships, not observed runtime behavior.
checkproves the generated file is fresh, not that the annotations still match what the application does. - Nothing is inferred statically. If it is not declared, it is not in the catalog.
- Unknown targets are reported as questions, not written down as facts.
- It is a prototype, not a published npm package. It is built and installed from a local tarball, and the code is being moved into its own repository.
I think this is the right trade. A smaller set of facts that people stand behind is worth more than a large graph that an analyzer guessed.
One monorepo, several applications
The case I care about most is a monorepo with several applications inside it. Each application declares its own modules and the APIs it provides or consumes. Because names resolve to full references (kind:namespace/name), the same mechanism works across repositories as well: each source owns exactly one declaration of an entity, duplicates fail loudly, and the merge is independent of input order.
The result answers questions that are hard to answer from code alone:
- Which application calls which API, and through which client module?
- Which module shares state with another team's store, and is that a contract or a coupling?
- What reads and what writes a given resource?
- Where does a deployment boundary get crossed?
Why this matters more for agents
For a person, a diagram is a convenience. For an agent, it is context that otherwise does not exist.
An agent asked to change checkout can read the manifest first and learn the boundaries before it explores code: which modules belong to the page, which API it calls, which store it shares with Catalog. When it changes code, it updates the annotations of the affected module and regenerates the catalog. When it reviews a pull request, it can flag a new call without a declaration, or a declaration whose code was removed.
The agent never has to invent a relation. It reads declared ones, and asks when something is missing. A reusable skill for exactly this workflow ships with the toolkit.
What it looks like when you can see it
The catalog is data. People still need to look at it. I have been building Nivra, an architecture workspace where a human and an agent work on the same model, and it is a good place to show what a declared model can feel like.
The screenshots below are from Nivra's demo workspace. This is a demo architecture snapshot of a commerce platform, not output generated from a real company's repositories. Wiring the extractor's catalogs into this view is the next step, not something I am claiming is finished.
Start from the high-level design: applications, microfrontends, services, the API, a datastore, with typed edges between them.
Select any element and the panel shows its context: owner, deployment unit, description, and what it depends on. From here you can drill into the element's internals.
The low-level view opens the selected module. Here the same Checkout MFE is a page, a domain module, and several modules behind it. Two kinds of edges are separated on purpose: an explicit REST API, and shared state, which is runtime coupling that no contract protects.
You can also select a relation itself. For the shared-state edge, the panel states the protocol (in-process runtime), that there is no explicit contract, and that it crosses a deployment boundary. This is the kind of finding that never appears in a dependency graph of imports.
Where this goes
The notation is deliberately small today. The direction I want to push it:
- Richer contracts. Describe which methods an API exposes and what each call carries, so that the relation says not only "calls" but what is exchanged.
- Visualization. A viewer for the generated catalogs, for people first and agents second. Nivra is the first step in that direction.
- Architecture rules. Forbidden dependencies and boundary checks as a separate rules file, not mixed into the entities.
Try it on your product
The invitation is simple. Take the prototype, pick one application or one slice of a monorepo, annotate its business modules, run extract, and look at the catalog and the graph. See which questions the result answers and which it cannot, and where the notation is too small for what you need. That feedback is what will shape the next version.





Top comments (0)