docs: surface undocumented MCP design capabilities in agent instructions - #482
Merged
Conversation
The design guide sent to agents omitted several properties the schema and class mapper already support (mixBlendMode, filter, backdropFilter, raw backgroundImage values), so agents assumed blend-mode overlays required custom code. Also documents that htmlEmbed renders as a sandboxed iframe on published sites and the custom_attributes style escape hatch for CSS with no design field (e.g. pointer-events).
ysamcode
requested review from
liamwalder,
lunenas and
tristan-mouchet
as code owners
July 30, 2026 15:49
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
While building a real site over MCP (film-grain textures, tinted scrims and gradient overlays layered over a native Slider), the agent-facing design guide steered us wrong in ways the codebase didn't deserve — the capabilities were already there, just undocumented:
effects.mixBlendMode,effects.filter,effects.backdropFilterare supported by the tool schema (lib/mcp/tools/shared-schemas.ts) and the class mapper (lib/tailwind-class-mapper.ts), but the Design Properties guide inlib/mcp/instructions.tsnever mentions them. Agents reading the guide conclude blend modes are impossible natively and fall back to custom code or HTML embeds.backgrounds.backgroundImageaccepts any CSS value including inline SVG data URIs (great for noise/grain textures), but the guide only documentsbackgroundColor,backgroundClip, and gradients.htmlEmbedsandboxing — embeds render as sandboxed auto-resizing iframes on published sites (components/LayerRendererPublic.tsx), soposition: absolute/fixedoverlays and parent-DOM scripts silently fail. Nothing warns agents about this; it cost us the most debugging time of anything in the build. Added a note on the element bullet and on thehtml_embed_codeschema description.custom_attributesas an escape hatch — CSS with no design field (e.g.pointer-events: nonefor decorative overlays) can be set via astylecustom attribute. Now mentioned alongside the design property docs.With these few lines of guidance the same agent built all overlays as native layers on the first attempt — no embeds, no page custom code.
Changes
lib/mcp/instructions.ts— documentmixBlendMode/filter/backdropFilter,backgroundImage(+ size/position/repeat), htmlEmbed iframe sandboxing with recommended alternatives, and thecustom_attributesstyle escape hatchlib/mcp/tools/layers.ts— extend thehtml_embed_codedescription with the sandbox caveatTest plan
tsc --noEmitandeslint --fixpass (pre-commit hooks)Made with Cursor