Skip to main content
Glama

Generate build-contract bundle

designesy_guardrails
Read-onlyIdempotent

Generate a frozen build-contract bundle from any design system URL: DTCG tokens, Stylelint config, AGENTS.md rules, component contracts, anti-patterns, and DESIGN.md for AI coding agents.

Instructions

Generate a frozen build-contract bundle for AI coding agents from any design system URL (the product layer). Ingests a site, extracts its :root tokens, and emits 6 outputs: (1) DTCG-format token file, (2) Stylelint config generated from token values, (3) AGENTS.md-format rules with token allowlist, (4) component contract with allowed prop patterns, (5) anti-pattern documentation, (6) DESIGN.md file (Google open spec, google-labs-code/design.md), the de-facto AI-readable design-context standard: YAML front matter plus a markdown body. Use this when you need to turn a design system into the file AI agents read and the lint that enforces it. When NOT to use: for design-contract scoring, use designesy_score; for token-file validation, use designesy_tokens_score; for drift detection, use designesy_drift_score. Executable: fetches the URL, extracts CSS + :root custom properties, generates the bundle. No browser needed. The full bundle grows with the number of tokens a site declares: about 7 KB to about 530 KB of JSON on the 26 sites measured (about 110 KB for designesy.org). To trim it, pass parts, a list of bundle file names such as ["designMd"] or ["tokens", "lintConfig"]: the result keeps score, grade, counts and checks, and its bundle holds only those files, in the order asked. Valid parts: tokens, lintConfig, agentRules, componentContract, antiPatterns, designMd. A single part can still be large on a site with many tokens. An unknown name returns an error that lists the valid parts. Returns JSON: { ok, url, score (0-100, emission completeness), grade, pass, warn, fail, total, tokensExtracted, bundle: { tokens, lintConfig, agentRules, componentContract, antiPatterns, designMd }, checks[{id, item, category, status, detail}] }; with parts it adds parts, and bundle holds only the named files. Results cached ~24h per URL.

Input Schema

NameRequiredDescriptionDefault
urlNoURL to generate guardrails for. Defaults to https://www.designesy.org/ if not provided.
partsNoOptional: the bundle files to return, by name. Omit for the whole bundle. Valid parts: tokens, lintConfig, agentRules, componentContract, antiPatterns, designMd.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.13.8

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only/idempotent/non-destructive, and the description adds substantial context beyond them: it fetches the URL and extracts CSS/:root tokens without a browser, caches results ~24h per URL, reports realistic bundle size ranges (~7 KB to ~530 KB), and specifies that an unknown part name errors with the valid list. No claim conflicts with readOnlyHint=true — generation is local, not a remote mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, outputs, and exclusions before the operational detail, which is good ordering. It loses a point for redundancy — the valid parts list (tokens, lintConfig, agentRules, componentContract, antiPatterns, designMd) is repeated verbatim twice, and the response-shape sentence is restated with a 'with parts' addendum.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates fully by spelling out the return shape ({ ok, url, score, grade, pass, warn, fail, total, tokensExtracted, bundle, checks[] }) and the parts-modified variant. Combined with caching, size expectations, and error behavior, nothing an agent needs to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real semantics: parts is order-preserving, the response still keeps score/grade/counts/checks while bundle holds only the named files, and omitting parts returns everything. The url default is already in the schema, so this is additive rather than merely restated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Generate a frozen build-contract bundle') and enumerates the six concrete artifacts emitted, so an agent knows exactly what comes back. It also explicitly names the siblings it is not (designesy_score, designesy_tokens_score, designesy_drift_score), making it easy to distinguish from the other 16 designesy tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Contains an explicit 'Use this when...' clause plus a dedicated 'When NOT to use' section that routes to three named alternative tools by purpose. It also explains how to narrow output via parts, which is usage guidance for invocation as well.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.