Skip to main content
Glama
marvkr

Better Design

Get Code Review Rules

get-review-rules
Read-onlyIdempotent

Retrieves accessibility, visual design, animation, content, comprehension, and AI-feature rules to self-review UI code and fix critical issues before presenting results.

Instructions

Retrieves accessibility (WCAG 2.1), visual design, animation, content, comprehension, and AI feature review rules for analyzing code.

You MUST call this after writing UI code to self-review your output, then fix every critical and serious issue BEFORE presenting the result.

It returns rules to check against. It approves nothing: a clean self-review against these rules is not visual approval, because the rules are read against source, not against what renders.

Match the requested change

Classify the request as repair, polish, or redesign: restore behavior, refine layout, or rebuild layout and components. Follow the user's scope, not analytics-only tool context. Do not downgrade redesign to polish, expand repair, or turn token export/source inspection into a redesign.

Keep the selected design system and assigned icon family/variant unless the user requests a change. Use exact returned icon names/source, never substitute packs, emoji, or invented SVGs. Inventory sections, components, states and responsive layouts; map requested patterns to real system components and record missing primitives.

Plan structural changes and component adoption before redesigning. Rebuild the requested hierarchy, layout and interactions; token swaps and unused imports do not count. Preserve unrelated behavior, accessibility and production/control boundaries.

Preserve all supplied paragraphs, reviews, offer details, links and disclosures, including collapsed answers and inactive tabs, unless the user requests cuts or rewrites. Require a source-to-render content comparison; investigate every omission, not just section counts. A shortened fixture is not a completed page. Label partial prototypes and never treat their checks as full-page evidence.

Compare before/after renders of the same content and states at the same desktop and mobile widths. Show which planned structural changes and component adoption are visible; verify the selected icons, spacing, hierarchy, and working interactions. Copy and accessibility fixes alone do not complete a redesign. Tool calls, generated files, or a source-only review are not visual evidence. If a baseline or rendered check is unavailable, name the missing evidence and report the redesign as unverified. Keep all existing build, accessibility, hover, comprehension, and review gates.

Explain design trade-offs

Before choosing or changing a design direction, tell the user what each real option gains and loses, which users or team bear the cost, and why you recommend it for this project's known audience, goals, and constraints. Use a short line per option: "Gain: ...; lose: ...; affects: ...; fits because: ...". Load get-ux-principle with topic "tradeoffs" when deeper guidance is needed.

Use the current conversation and project evidence. Label assumptions and predicted effects. Do not invent research, conversion gains, metrics, or project facts. If the user has already chosen, explain the accepted trade-off without reopening the choice. Keep minor edits brief; this adds no approval step and never excuses an accessibility or safety failure.

Put the explanation in the conversation or requested project handoff, not extra product UI copy. Before presenting the result, check that material gains and losses were communicated and report any changed trade-off.

Accessibility (WCAG 2.1):

  • Critical: Images without alt text, icon buttons without aria-labels, form inputs without labels

  • Serious: Focus outline removed, missing keyboard handlers, color-only information

Visual Design:

  • Layout & Spacing: Inconsistent spacing, overflow issues, z-index conflicts

  • Typography: Mixed fonts, line-height issues, missing fallbacks

  • Color & Contrast: Contrast below 4.5:1, missing hover/focus states

  • Component fidelity: Feature code that bypasses installed Sidebar and Table compositions

  • Dashboard hierarchy: Verify title → metrics → records → interpretation, preserve supplied overview copy, distinguish action and status colors, reject invented trends, and reject a stepper on a dashboard overview

  • Serious: Hover outside @media (hover: hover) and (pointer: fine), hover that moves controls, or hover that overrides selected/pressed styling

  • Serious: Dormant creation forms exposed on browse/manage pages instead of opening from a labeled CTA

Animation & Motion:

  • Critical: Reduced-motion paths that hide content or prevent completion

  • Serious: Motion that delays frequent tasks, breaks under repeated input, uses a disconnected origin, or misses frames under representative load

  • Moderate: Choreography that competes with hierarchy or drifts from the product's motion tokens

Content (generated-UI tells):

  • Apply these to every visible element, including the text inside a mock product screen, dashboard, table or chat panel shown on a sales page, deck or social image. Filler hides there most often

  • Walls of text, overwritten copy, filler adjectives, emoji used as icons

  • Ceremonial copy with no user job; run the deletion test before shipping visible text

  • Serious: A second visible page title or introduction that only repeats the page, tabs, or adjacent controls

  • Awkward headline or subtitle wraps that split complete phrases or leave orphaned words

  • Microcopy details: pluralization, improvised unit glyphs, empty states without a next action

  • Template layouts: gradient hero + eyebrow pill, left-border callout boxes

  • Reward feedback: confirm the outcome, surface proportional user value, and avoid decorative over-reward

  • Prose tells in shipped paragraphs (hero, about, pricing, changelog, docs): banned words (delve, leverage, robust, cutting-edge, elevate), binary contrasts ("It's not X, it's Y"), throat-clearing and faux-insight openers, colon reveals, puffery and unsourced "experts agree", fake-profound kickers and recap endings, synonym cycling, emoji headings and mid-sentence bold

Comprehension (would someone outside the team understand it?):

  • Mom test: insider vocabulary, unexplained acronyms, sentences too long to follow

  • 15 second test: word count, stacked concepts, competing actions

  • Screenshot test: missing title, actions that hide their outcome, icon-only controls

  • Run these against the real copy with check-comprehension once the screen exists

AI features (any surface that shows model output or sends user data to a model):

  • Critical: Output saved or sent without the user accepting it, silent failures, no manual path when AI is unavailable, user data read before consent, invented citations or unearned certainty

  • Serious: AI output with no visible marker, long runs with no sign or a Stop that deletes partial output, refusals that name no topic and offer no alternative, feedback controls with no destination

Every rule carries an ID (rule/…), a source and an exceptions line. Cite the ID in each finding. The coverage-gaps category lists the surfaces that have no rule yet.

Use maxTokens to limit rule content (recommended: 5000–10000). Required workflow guidance is always returned in full.

Input Schema

NameRequiredDescriptionDefault
contextNoOptional. One sentence on WHY you are calling this and what the user asked for (e.g. 'adding nav icons for the fintech dashboard'). Used only for usage analytics; does not change the result.
categoryNoFilter rules by category (defaults to 'all')
maxTokensNoMaximum tokens of rule content. Required workflow guidance is returned in full outside this budget. Recommended: 5000–10000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive, closed-world behavior, so the bar is lower. The description adds genuinely useful behavioral context beyond those hints: 'It approves nothing: a clean self-review against these rules is not visual approval, because the rules are read against source, not against what renders.' It also discloses return-shape details (rule IDs, source, exceptions line) and that required workflow guidance is returned outside the maxTokens budget.

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

Conciseness2/5

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

The description front-loads the purpose well, but then expands into a very long set of workflow mandates covering repair/polish/redesign classification, content preservation, before/after renders, and trade-off explanations. Much of this is agent instruction rather than tool selection guidance and duplicates obligations that likely belong in the returned rule content or a separate guide. The result is bloated and buries the actual tool behavior under unrelated procedural text.

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

Completeness4/5

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

There is no output schema, so the description must explain what comes back. It does so adequately: 'Every rule carries an ID (rule/…), a source and an exceptions line,' and it describes the coverage-gaps category as surfaces with no rule yet. It also explains the maxTokens budget behavior, which is important for a rule-retrieval tool, though more detail on result organization could help.

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 description coverage is 100%, so the schema already documents the context, category, and maxTokens parameters, making 3 the baseline. The description adds meaning beyond the schema by recommending 'Use maxTokens to limit rule content (recommended: 5000–10000)' and clarifying that 'Required workflow guidance is always returned in full' outside that budget, which directly affects how an agent should set the parameter.

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

Purpose4/5

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

The opening sentence gives a specific verb and resource: 'Retrieves accessibility (WCAG 2.1), visual design, animation, content, comprehension, and AI feature review rules for analyzing code.' It distinguishes the tool from review-ui-code by framing it as a rules source ('It approves nothing'), but it does not explicitly name or contrast review-ui-code or other sibling tools.

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

Usage Guidelines4/5

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

The description gives a clear imperative trigger: 'You MUST call this after writing UI code to self-review your output.' It also routes to a sibling when deeper guidance is needed: 'Load get-ux-principle with topic "tradeoffs" when deeper guidance is needed.' It stops short of stating when not to use this tool or how it differs from review-ui-code in selection terms.

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