← b10k

Component Map for Craft CMS

See which pages and blocks a Twig template change affects — and which entries to open in the browser — before you ship it. For you, and for the coding agent that edits your templates.

Craft CMS 5 · PHP 8.2+ · free & open source (MIT)

Changing a component is easy. Knowing what else it changes isn’t — the answer is spread over includes, a dispatcher, the content model and the entries that use each block. Component Map puts it in one place.

In your terminal

Real output from a demo site. Tap any screenshot to open it full size.

component-map/impact after changing the hero component: block hero, page home, and the entry to check with its URL
Change one component, get the blocks, the pages and the exact entries to check.
component-map/show hero: allowed in contentBlocks, rendered by the hero adapter via the dispatcher, used on the Home entry
A block: where it is allowed, what renders it, which entries use it.
component-map/show _blocks/hero: used by the hero adapter; a change affects block hero on page home
A template: what uses it, and what a change to it reaches.

What you get

What does this change affect?

impact takes the files you changed — named, --git for what is uncommitted, or --since=main for the whole branch — and returns the templates, blocks and pages they reach.

The pages to open

Not “the Hero block” but the entries that contain one, with their URLs — however deeply the block is nested. A card inside a cards grid on a page still leads you to the page.

Knows your page builder

A dispatcher like '_adapters/' ~ block.type.handle is resolved against your entry types, so a component change is traced to the blocks it affects — not just the files that include it.

Content changes count too

A changed entry type, Matrix field or section in project config is followed through the content model. A deleted template is traced through everything that still references it.

Where is this used?

show takes a template, a block or a section and tells you what uses it, what it uses, and which entries it is on — or that no entry uses a block yet.

For your coding agent

One command adds a short note to AGENTS.md or CLAUDE.md, so Claude Code, Cursor or Codex checks the map before and after it edits a template. Every command also speaks --json.

Works with what you already have

Nothing to set up. Component Map reads your templates with Twig’s own lexer and your content model through Craft — no config, no annotations, no build step. The map is worked out on every call, so it is never out of date and there is no file to commit.

And removing it leaves nothing behind

  • No migrations. There is no schema of ours in your database.
  • Read-only. Templates, the content model and which entries contain which blocks are read; nothing is ever written to them.
  • Nothing in your repository. A snapshot, if you ask for one, goes to storage/. The only file it writes in your project is the agent note — and only when you run that command.
  • Console only. Nothing is served over HTTP.
  • Uninstall from the control panel first, then composer remove. That order keeps your project config clean.
Free

Open source under the MIT licence, and free for good. It is built for local development — install it where you and your coding agent edit templates.


Installing

From the project you want it in: Plugin Store in the control-panel sidebar, then search for “Component Map”, or

composer require b10k/craft-component-map

Then, after your next change:

php craft component-map/impact --git

View the listing in the Craft Plugin Store

Questions, or something not working?

The plugin is built and supported by me — bug reports, feature ideas and “this missed a template” notes are all welcome.

Open an issue on GitHub