Creates, edits, extracts, or removes Bricks components including properties, variants, slots, and nested instances. Guides MCP workflow for component operations.
Ships in bricks. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A component is a reusable element tree stored globally. Instances reference the main component through "cid": "..." on the host element; editing the main component updates every instance.
If a
bricks/*ability is not available as a direct tool: first check whether it is outside the fast path and call it throughmcp-adapter-execute-abilitywithability_name: "bricks/<name>". If the dispatcher also rejects it, callbricks-list-ability-statusto check whether a site admin disabled it under Bricks > AI.
An edit to a component definition affects its instances; an instance property edits that instance. Infer the level from the user's request and inspect existing bindings. Ask only if the intended scope is ambiguous. Preserve unaffected instance values, slots and nested definitions. A single use does not make a component defective.
For a remote library, discover the installed remote-component surface and source configuration before importing; do not assume remote-template abilities return component definitions. If no supported remote import is available, explain that boundary and use an available native import workflow rather than inventing an API. For Gutenberg use, identify which properties should be exposed to content editors and verify the installed components-as-blocks configuration and supported property types. A Bricks frontend preview alone does not certify editing/saving the block.
A valid component record has:
id: same id as the root element.elements: flat Bricks element rows. The root element has parent: 0 and the component label on label.properties: array of property definitions. Empty array is valid.variants: array of { id, name }. Variant ids start with variant-._created, _user_id, _version: builder metadata. If _version is missing, the builder treats the component as an old beta component and shows: Components highlighted in red were created in Bricks 1.12-beta and are no longer supported. Please delete all of them.category, desc, propertyGroups, blockEditor, blockCategory, blockIcon, blockPreviewImage.Do not hand-write global option records unless you are repairing data. Use component abilities so ids, property connections, parent-property references, validation, and metadata are handled consistently.
For MCP work, use this order:
bricks/list-components, bricks/get-component, or bricks/get-design-context.designSystemVersion and the complete componentDigest from the
same current component read. The digest covers hidden and opaque component fields;
do not synthesize it from the visible tree.bricks/update-component, pass expectedDesignSystemVersion and
expectedComponentDigest. If either precondition changed, re-read and merge your
edit into the newest component.bricks/delete-component, pass expectedDesignSystemVersion,
expectedComponentDigest, the freshly reviewed expectedUsageCount, and literal
allowOrphans: true. Deletion always requires that acknowledgement, even at zero
discovered usages, so do not delete unless the user explicitly accepted that
usage discovery is bounded and missing instances could remain.bricks/get-component after create/update/extract. Confirm _version, properties, property groups, slots, nested component props, and slotChildren.Treat elements on bricks/update-component as a full replacement tree. To edit
one element, read the component, change only that element in the returned tree, then
send the whole modified tree back with both current preconditions. For a known
single existing component, prefer the self-described bricks/resolve-agent-file →
bricks/commit-agent-file path when available. It binds the same authoritative
digest and avoids both repository discovery and rebuilding a large component payload
by hand.
To change only categories on Bricks 2.5+, use bricks/assign-component-category instead of rewriting each component with update-component.
Slot IDs matter because instance slot content is keyed by slot element id. When replacing a component tree, preserve existing slot ids if you can. Any removed existing slot requires explicit allowSlotOrphans: true, even when the fresh bounded usage scan finds no content. Review the returned slot-removal evidence first; it is audit evidence, not proof that every instance was found.
bricks/list-components returns component summaries with label, desc, properties, variants, slot count, and element count. bricks-get-design-context with responseFormat: "summary" also includes component summaries.
When building a page, section, card, CTA, listing item, testimonial, team member, or other repeated pattern, check the existing component labels/descriptions before creating a new component or raw element tree. If one clearly fits, inspect it with bricks/get-component and use a component instance ({ "cid": "componentId" }) with properties and slotChildren as needed.
Reuse components whose structure and properties fit the requested design.
The builder's source-of-truth UI is Save as component on an element except Template or Filter. It prompts for:
Prefer bricks/extract-component-from-elements over manual copy-paste. The extraction rewrites element ids cleanly, swaps the source subtree to an instance in one write, and snapshots a revision. Manual copy leaves duplicate ids and breaks future extraction.
When creating a component, or editing one with an empty desc, write a concise useful description. Describe what the component is for and the main customization surface, for example: "Reusable listing card with image, price, address, meta, and optional featured badge." Avoid marketing copy, implementation trivia, and long prose.
When creating from scratch with the ability, pass either nested element objects or flat Bricks rows. The ability regenerates ids, so property connections may reference the ids in your input and will be remapped in the saved component.
{
"ability_name": "bricks/create-component",
"parameters": {
"label": "Metric card",
"category": "marketing",
"desc": "Small stat card with eyebrow, value, and supporting copy.",
"elements": [
{
"id": "metric",
"name": "div",
"parent": 0,
"children": ["eyebrw", "valtxt", "bodytx"],
"settings": { "_cssGlobalClasses": ["card-shell"] }
},
{
"id": "eyebrw",
"name": "text-basic",
"parent": "metric",
"settings": { "text": "Listings sold" }
},
{
"id": "valtxt",
"name": "heading",
"parent": "metric",
"settings": { "text": "128" }
},
{
"id": "bodytx",
"name": "text",
"parent": "metric",
"settings": { "text": "Across the last twelve months." }
}
],
"properties": [
{
"id": "eyebrow",
"label": "Eyebrow",
"type": "text",
"connections": { "eyebrw": ["text"] },
"default": "Listings sold"
},
{
"id": "value",
"label": "Value",
"type": "text",
"connections": { "valtxt": ["text"] },
"default": "128"
}
]
}
}
Component labels must be unique across all components. Attempting to create a duplicate returns bricks_conflict_duplicate_component_name. Read list-components before creating.
Properties are the only way to customize an instance without editing the main. Unconnected properties are dead weight.
| Type | Binds to |
|---|---|
| Text | Text / textarea controls |
| Rich text | Rich text control |
| Icon | Icon / Icon Box controls |
| Image | Image control |
| Image gallery | Gallery / Carousel controls |
| Link | Link controls (Button, Heading link, etc.) |
| Select | Text or Select controls |
| Toggle | Toggle controls (most commonly "Hide element") |
Query loop (query) | Query loop control on layout elements |
Global classes (class) | Global classes control (Bricks 2.0+) |
The stored type usually follows the connected control type. The builder also allows compatible matches such as text properties on textarea controls, select properties on text/textarea/editor controls, and toggle properties on checkbox controls (ControlProperty.vue).
name (required), description, group, default.+ icon next to the target control: pick the property.A property that's defined but not connected to any control shows a broken-link icon and a warning. Fix by connecting or delete the property.
Ability shape:
{
"id": "title",
"label": "Title",
"type": "text",
"desc": "Main visible heading.",
"group": "content",
"connections": {
"abc123": ["text"]
},
"default": "Featured listing"
}
Supported property definition fields are id, label, type, connections, default, desc, group, options, multiple, and replace. Supported type values are text, editor, icon, image, image-gallery, link, select, toggle, query, and class. Bricks 2.5 adds repeater.
Repeater properties (Bricks 2.5+): a repeater property has recursive typed fields (stable id, label, type; field types text, editor, image, link, select, toggle, repeater) and rows keyed by field ID. An omitted instance value inherits the default; [] means zero rows. Use a fresh field ID when recreating a deleted field or changing its type incompatibly. Loop fields connect through fieldConnections, and native repeater controls such as Testimonials items through repeaterMappings. Before writing either shape, read bricks/get-builder-guide { topic: "components" } on the target site; it documents the exact current contract.
connections is keyed by element id inside the component. Each value is an array of setting/control keys on that element. For a global-class property, connect to _cssGlobalClasses.
For type: "class" specifically:
multiple is explicit. Omit it or set false for a single-select instance picker. Set true for multi-select.options is omitted, the instance picker lists all current global classes.options is present, each option is a named preset. The option value should be an array of global class IDs, and the instance stores the option id, not the raw class-id array. The component abilities auto-generate missing option ids on create/update so the stored data stays builder-compatible.replace: true replaces the element's existing global classes with the resolved property classes. Omit it to merge with the element's existing classes.On the bound control, hover the property chip -> click the unlink icon. The control returns to its raw value.
On Bricks 2.5+, through abilities, keep the property definition and remove its connections map in one guarded update-component call that also sends the full elements tree. In the same call, remove matching parent:cid_{componentId}:prop_{propertyId} values from nested instances in this component and replace inline {prop.key} references with the property's default source. Do not touch page instance overrides or other component definitions. Ask the user when a reference cannot be resolved.
To hide an element when a property is empty, add an ordinary _conditions row { "id": "<row id>", "key": "dynamic_data", "compare": "empty_not" } and connect the property to _conditions|<row id>|dynamic_data through its connections. Append the row to every existing OR group so they keep working.
Instead of baking styling variants into the component, add a Global classes property and bind it to the Classes control on the styled element. Without custom options, each instance picks from all global classes. With custom options, each instance picks one preset by default, or multiple presets only when multiple: true.
For true component variants such as <Button variant="primary" | "secondary">, use named class presets and usually replace: true, otherwise the property classes merge with the element's existing classes and can stack conflicting variants.
Multiple global-class properties can bind to the same element: useful for orthogonal dimensions (size + color + emphasis).
A Toggle property connected to the "Hide element" control removes the element from the DOM at render time (not display: none). Use this for optional sub-sections that should be absent from the rendered page.
A component's element tree can contain instances of other components. That's how you compose (Card uses Button, PostGrid uses Card).
When creating an instance through an ability, { "cid": "componentId" } is enough. The ability resolves the host element name from the referenced component root unless you intentionally pass a specific host name.
Caveats the builder won't stop you from:
src/vue/store/actions/elements.js:88-95), but that is not a save-time design validator and other recursive component paths still traverse nested instances. Always check: does this component's tree, directly or transitively, instance the component you're currently editing?.button) and variables (var(--space-m)) referenced inside a component persist across instances. When sending a component to another site, those globals must exist there too or rendering breaks silently.Use the nested component instance's properties map and a parent-property reference:
{
"id": "button",
"name": "div",
"parent": "card01",
"cid": "cta123",
"properties": {
"label": "parent:cid_card01:prop_ctaText"
}
}
The referenced component id is the current component root id, and the referenced property id is the outer component property. If the component is created through bricks/create-component, the ability remaps parent:cid_<oldRoot>:prop_<property> to the regenerated root id.
Bricks components have a real Slot element (includes/elements/slot.php, registered since 2.2). Use it when an instance needs to provide arbitrary child elements inside the component.
How it works:
slotChildren, keyed by the slot element id.Use slots for arbitrary child content. Use Text or Rich text properties for simple strings. bricks/list-components exposes slotCount; bricks/get-component returns the full component element tree, so count elements whose name is slot when you need the detailed shape.
Ability shape for an instance with slotted children:
{
"id": "card01",
"name": "div",
"parent": 0,
"cid": "cardcmp",
"slotChildren": {
"slotid": ["head01", "body01"]
}
}
The slotChildren key is the id of a slot element inside the referenced component cardcmp. The child ids must exist in the same post/component element tree and should use the component instance id as their parent.
For ability input, slot children may also be nested objects:
{
"name": "div",
"cid": "cardcmp",
"slotChildren": {
"slotid": [
{ "name": "heading", "settings": { "text": "Custom headline" } },
{ "name": "text", "settings": { "text": "Custom body." } }
]
}
}
cid (unlinkComponent() in src/vue/components/common/TheContextMenu.vue).Deleting a component while instances exist leaves orphans. In the builder, each orphan instance renders as a "missing component" placeholder. The "cid" on the host element is still there; it just points to nothing.
Before deleting:
bricks/get-component for the complete current componentDigest, then call
bricks/get-design-context with includeUsage: true for the component's
usedOnPosts list. The list can include posts/templates and component definitions
that nest this component. On Bricks 2.4.1+, post/template rows are limited to
pages the caller can edit in Builder; an empty list does not prove the component
is unused.designSystemVersion, componentDigest, and the current usage count
(count(usedOnPosts) for the target component) from current reads. Treat that
count as caller-visible usage, not proof of complete site-wide coverage.delete-component without explicit confirmation. Pass
expectedDesignSystemVersion, expectedComponentDigest,
expectedUsageCount, and allowOrphans: true; if any current precondition or
usage count changed, re-read before deleting. Deletion checks a fresh unfiltered
usage scan: component_usage_count_mismatch can mean hidden references, not
merely stale data. Do not copy actualUsageCount into a retry automatically.
Review the additional impact within authorized scope; if the caller cannot
review it, hand off to someone with sufficient access before proceeding.Source: includes/abilities/design.php, get_component_usage_cached() and
delete_component() (Bricks 2.4.1).
To clean up orphans after the fact: scan element trees for "cid": "..." referencing deleted ids (bricks/audit-design-system covers this), then use update-element or set-page-elements to strip the stale cid.
extract-component-from-elements (
postId: 123,
rootElementId: "abc123",
label: "Card",
category: "cards",
desc: "Reusable card component."
)
Returns the new component id + the revision snapshot. The subtree on the source post is replaced with an instance. Component extraction creates the component with empty properties and variants arrays: convert literals to properties by editing the main component afterward.
There is no "retype" operation. The workflow is:
Before retyping a property, identify affected instances and include their updates in the change.
Labels are editable on the main component. The cid doesn't change, so all instances still resolve correctly. Include the old and new names when reporting the change.
{post_title} deep inside a component behaves differently on a single post vs. a standalone page. Verify the component's dynamic-data assumptions before extracting.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/bricks:bricks-componentsfrom bricks
npx claudepluginhub codeerhq/bricks-skills --plugin bricks46 skills in this plugin
/bricks-agent-repositoryHandle complex existing-site Bricks edits through advertised repository/workspace workflows when focused abilities cannot express the change./bricks-ai-tabDiagnose Bricks AI connection setup, ability toggles, dispatcher availability and disabled actions. Use for connection/availability problems./bricks-audit-design-systemAudit Bricks classes, variables, palettes and components, or carry out requested cleanup. Report-only audits do not authorize fixes.Other plugins' skills for the same job