Which template renders the Hero block? What breaks if I change _components/button.twig? Which pages do I check before I open a pull request?
In a Craft project the answer is spread over Twig includes, a dispatcher that picks a template by block.type.handle, the content model in the control panel, and the entries that use each block. Component Map puts it together:
php craft component-map/impact --since=main
tells you which blocks and pages your branch affects — and lists the entries to open in the browser, with their URLs.
What it knows
- Every template reference, read with Twig's own lexer:
include,embed,extends,import,from,use,include(),source()— including dynamic ones like'_adapters/' ~ block.type.handle ~ '.twig'. - The content model: sections and their templates, entry types, Matrix fields and the blocks they allow.
- The link between them. A Hero block is rendered by
_adapters/hero.twig, via your dispatcher — so the map knows which blocks a component change affects, not just which files include it. - Where each block is used, at any depth of nesting — a Card inside a Cards Grid on a page.
Commands
component-map/show <template|block|section>— where it is used, what it uses, which entries it is on.component-map/impact <files> | --git | --since=main— what a change affects: templates, blocks, pages, and the entries to check. Changes to project config (entry types, Matrix fields, sections) count too; deleted templates count through whatever still references them.component-map/unused— blocks no entry uses, templates nothing reaches (whole dead chains included), entry types and Matrix fields attached nowhere. Candidates for a tidy-up, not a delete list.component-map/build --stdout— the whole map as Markdown.component-map/agents --file=AGENTS.md— tells your coding agent (Claude Code, Cursor, Codex…) to check the map before and after it edits a template.
Every command also speaks --json.
On Craft's MCP server (Craft 5.12+)
An agent connected to your site gets the same answers as tools — component-map.overview, component-map.show, component-map.impact and component-map.unused. Craft's own tools do not see templates; these do. info.get tells the agent this project's dispatchers and which tool to use when, and content-model.audit gains two checks: templates that include one that does not exist, and blocks a dispatcher has no template for.
All read only, for control-panel users. Entries a user may not view are counted, not listed.
For local development and staging
Component Map runs where you and your coding agent edit templates. Nothing is generated into your repository, and the map is built from your templates as they are, on every call — there is nothing to keep up to date. The MCP tools appear only where allowAdminChanges is on, so they are off on production by themselves.
Works on its own; with Component Check installed, test --changed and watch check only the blocks your template changes reach, in a real browser.
To install this plugin, copy the command above to your terminal.
This plugin doesn't have any reviews.


