Steal these. Seriously.
AI prompts, code snippets, checklists and tools I actually use. Curated as I find them, free to grab.
Client discovery interview prompt
Paste this into your AI of choice before a client call. It turns rough project ideas into a structured brief with goals, constraints and red flags.
You are a senior product strategist. Interview me about my project idea one question at a time. After 8 questions, produce: goals, audience, scope, risks, and a one-line brief.
Brand voice extractor
Feed it three pieces of your existing copy and it returns a reusable voice guide: tone, vocabulary, sentence rhythm and words to avoid.
Analyze the three writing samples below. Output a brand voice guide: tone in 3 adjectives, vocabulary rules, sentence rhythm, and 10 words this brand would never use.
GSAP scroll reveal, the polite way
The reveal pattern used on this site: transform and opacity only, plays once, and fully respects reduced motion.
if (!matchMedia('(prefers-reduced-motion: reduce)').matches) { gsap.utils.toArray('[data-reveal]').forEach(el => gsap.from(el, { y: 28, opacity: 0, duration: .7, ease: 'power3.out', scrollTrigger: { trigger: el, start: 'top 86%', once: true } })); }avoid-ai-design: audit your site for the AI-made look
I run this skill in detect mode on client builds before handoff so nothing ships with purple gradients, Inter everywhere or cream and terracotta defaults. Free and MIT, it flags 67 AI design tells by severity and also works in Cursor and Codex.
Prompt: a DESIGN.md your AI agents will actually follow
I paste this with my site URL or CSS and get a DESIGN.md that Claude Code, Stitch and Cursor actually follow. It names colors by role and writes rules you can test, which helps now that every tool reads Markdown rulebooks.
You are a design systems lead. Write a DESIGN.md file for my brand using Google's open DESIGN.md format (alpha spec: github.com/google-labs-code/design.md). AI coding and design agents will read it, so it has to tell them exactly how to use my brand and leave nothing to guess.
SOURCE
[Paste one: a live URL, a repo or folder you can read, or my CSS / Tailwind config / token file / screenshots. Brand notes are optional.]
STEP 1: INSPECT
Use only real values from the source: colors, font families, sizes, weights, line heights, spacing steps, radii, shadows, breakpoints, and how buttons, inputs, cards, nav and links look in each state. For every color, note where it is used, not just its hex. Merge near-duplicates (for example 14 slightly different grays) into one token and keep a record of what you merged. If something is missing or contradicts itself, add it to "Open questions". Do not make up a value.
STEP 2: WRITE THE FILE
Output one file, DESIGN.md, in a single code block.
YAML front matter (between --- lines):
- version: alpha, name, description (one line).
- colors: name tokens by role, never by hue. primary is required. Suggested roles: primary, on-primary, secondary, accent, surface, surface-muted, on-surface, on-surface-muted, border, error, success. Use #RRGGBB hex.
- typography: name styles by role (display, headline-lg, headline-md, body-lg, body-md, label-md, caption). Give fontFamily, fontSize, fontWeight as a number, lineHeight as a unitless multiplier, and letterSpacing.
- spacing and rounded: scales keyed xs, sm, md, lg, xl (add full to rounded). Units are px, em or rem only.
- components: button-primary, button-primary-hover, button-secondary, input, card, link, plus any others the source actually has. Use only these properties: backgroundColor, textColor, typography, rounded, padding, size, height, width. Reference tokens with paths like {colors.primary} or {typography.label-md}. No raw values here.
- omitted: list any section you leave out, with a reason.
Markdown body: use these ## headings in this exact order, each one only once:
## Overview: 2 to 4 sentences on personality, voice and who the product is for.
## Colors: one line per token saying what it is for and what it must never be used for. List the contrast ratio of every text and background pair agents should use.
## Typography: when to use each style, max line length, heading hierarchy rules.
## Layout: grid, max widths, breakpoints, and which spacing steps go inside components versus between sections.
## Elevation & Depth: shadow or border approach, and when nothing should be elevated.
## Shapes: radius rules per component type.
## Components: anatomy, states (default, hover, focus, active, disabled, loading) and usage rules for each component token.
## Do's and Don'ts: 6 to 10 short rules, one line each, starting with Do or Don't.
Accessibility limits (write them into Colors, Components and Do's and Don'ts):
- Body text at least 4.5:1 contrast. Large text and UI parts at least 3:1 (WCAG 2.2 AA).
- A visible focus ring on every interactive element. Never remove it.
- Touch targets at least 24x24 CSS px, 44x44 preferred.
- Respect prefers-reduced-motion. Never use color as the only way to show meaning.
If an existing brand pair fails, say so and suggest the closest value that passes.
RULES
- Roles over raw values: in the prose, call tokens by name (accent, on-surface), not by hex.
- Every rule has to be checkable. Write "One button-primary per view", not "keep it clean".
- Every {reference} must point to a token defined in this file.
- Keep the file under about 300 lines.
STEP 3: AFTER THE FILE
Below the code block, list: my open questions, the tokens you merged and why, and this command to validate the file: npx @google/design.md lint DESIGN.mdTransparent brand colors with CSS alpha() (and a fallback that works)
I keep one --brand token now and set the opacity where I use it with alpha(), instead of keeping --brand-50 and --brand-20 around. Heads up: it needs the from keyword, and with var() a stacked fallback line won't work, so I put it behind @supports.
:root {
--brand: #3b5bfd;
/* Delete the old pile: --brand-50, --brand-20, --brand-10... */
}
/* Fallback for older browsers. color-mix() is Baseline since 2023 */
.badge {
background: color-mix(in srgb, var(--brand) 20%, transparent);
border: 1px solid color-mix(in srgb, var(--brand) 50%, transparent);
}
/* Why not just stack two lines? Any value with var() passes parsing,
so an old browser keeps the alpha() line, fails it at computed time
and falls back to transparent instead of your first line. */
@supports (color: alpha(from red / 50%)) {
.badge {
background: alpha(from var(--brand) / 20%);
border-color: alpha(from var(--brand) / 50%);
}
}
/* Bonus: scale the origin color's own alpha */
.badge:hover {
background: color-mix(in srgb, var(--brand) 30%, transparent);
}
@supports (color: alpha(from red / 50%)) {
.badge:hover {
background: alpha(from var(--brand) / calc(alpha * 0.3));
}
}Prompt: make your coding agent debug CSS with Chrome DevTools MCP
My agents used to guess at broken CSS and keep adding !important until something moved. This prompt makes them read the real cascade with get_css_styles first, so I get the one-line fix and the reason it works.
You have the Chrome DevTools MCP server connected. Debug a CSS problem by reading what the browser actually applied. Do not guess from the source code. Page: [URL, e.g. http://localhost:3000/checkout] Element: [describe it, e.g. "the Pay now button in the checkout dialog"] Expected: [e.g. background is our brand blue #2563eb] Actual: [e.g. background stays gray] Viewport / state: [e.g. 390x844, dark mode, hover. Leave blank if it doesn't matter] Follow these steps in order: 1. Open the page with new_page (or navigate_page if it's already open). If I gave a viewport or state, apply it with resize_page or emulate first. 2. Run take_snapshot and find the uid of the element I described. If more than one element matches, tell me which one you picked and why. 3. Run get_css_styles on that uid. If the results are paginated, keep going with pageIdx until you have every rule that touches the property in question. 4. Before you suggest anything, report: - The winning declaration: property, value, selector, file and line. - Every overridden declaration for the same property (marked [overloaded]): selector, file and line. - Why the winner wins: specificity, source order, @layer, @media, @container, @scope, inline style or inheritance. Name the exact reason. - If the value is inherited or comes from a custom property, trace where it's set. 5. Only then propose ONE fix, ideally a one-line change in the source file. Prefer fixing the actual conflict (adjusting a selector, moving a rule into the right layer, setting the right custom property) over adding more weight. - No !important. - No new wrapper classes or extra-specific selectors unless you explain why nothing simpler works. - Show the change as a before/after diff with the file path. 6. After I apply it (or you apply it, if you're allowed to edit files), reload with navigate_page, take a new snapshot, run get_css_styles again and confirm the declaration you wanted is now the winner. Then take a screenshot of the element as proof. If the element is inside a shadow root, double-check which ancestor the inherited styles come from before you trust the result. If get_css_styles shows the CSS is right but the element still looks wrong, say so and check layout, stacking, or a script changing styles instead. Don't invent a CSS fix.
Random card tilt with CSS random() and an @supports fallback
I use this to give badges and cards a slight hand-placed tilt with no JS, now that Chrome 156 and Safari support random(). Firefox doesn't have it yet, so it falls back to a few fixed nth-child tilts that still look loose.
/* Fallback for browsers without random() (Firefox for now) */
.tilt { transition: rotate 200ms ease; }
.tilt:nth-child(3n + 1) { rotate: -1.5deg; }
.tilt:nth-child(3n + 2) { rotate: 1deg; }
.tilt:nth-child(3n) { rotate: -0.5deg; }
.blob { inline-size: 4rem; block-size: 4rem; }
/* Real randomness in Chrome 156+ and Safari */
@supports (rotate: random(-2deg, 2deg)) {
/* :nth-child(n) matches the fallback's specificity so this wins */
.tilt:nth-child(n) { rotate: random(-2.5deg, 2.5deg, 0.5deg); }
/* Shared key + element-scoped: width and height match on each blob,
but every blob gets its own size. A bare --blob key would make
every blob identical. */
.blob {
inline-size: random(--blob element-scoped, 3rem, 6rem);
block-size: random(--blob element-scoped, 3rem, 6rem);
}
}
/* Straighten on hover or focus */
.tilt:hover,
.tilt:focus-visible { rotate: 0deg; }
/* Reduced motion: no hover animation, no tilt.
Delete the rotate line to keep the static tilt. */
@media (prefers-reduced-motion: reduce) {
.tilt,
.tilt:nth-child(n) { rotate: none; transition: none; }
}Sticky header shadow with CSS scroll-state queries (no JS observer)
I used this to replace my IntersectionObserver sentinel hack: the shadow appears only once the header is actually stuck, and there's no JS. It only works in Chrome and Edge so far, so Firefox and Safari get a plain hairline border and nothing breaks.
<!-- The sticky element is the container; style its child, not itself -->
<header class="site-header">
<div class="site-header__inner">Logo / nav</div>
</header>
<style>
.site-header {
position: sticky;
top: 0;
z-index: 10;
container-type: scroll-state;
}
/* Fallback everyone gets: a quiet border, always on */
.site-header__inner {
background: #fff;
border-bottom: 1px solid rgb(0 0 0 / 0.08);
transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
/* Chrome/Edge: border and shadow only while stuck */
@supports (container-type: scroll-state) {
.site-header__inner { border-bottom-color: transparent; }
@container scroll-state(stuck: top) {
.site-header__inner {
border-bottom-color: rgb(0 0 0 / 0.08);
box-shadow: 0 4px 16px rgb(0 0 0 / 0.08);
}
}
}
@media (prefers-reduced-motion: reduce) {
.site-header__inner { transition: none; }
}
</style>pen.dev: agentic design canvas that exports HTML, CSS or Tailwind
I use pen.dev to lay out pages with agents, pull in a live webpage or Figma frames, and export HTML/CSS or Tailwind. The files are open .pen JSON and I run it with my own Claude Code or Codex over MCP, but the free plan caps agent days, so check pricing.
Fluid sizing without clamp() math using CSS progress()
I used to work out clamp() slopes and intercepts by hand for every fluid token. Now progress() turns viewport width into a 0 to 1 number I multiply into padding, type, opacity or scale, and the old clamp() line stays in as the fallback.
/* 0 at 320px wide, 1 at 1200px wide, clamped to 0..1.
Swap 100vw for 100cqi to follow a container instead. */
:root {
--vp: progress(100vw, 320px, 1200px);
}
/* Fallback: the clamp() math I used to do by hand */
.hero {
padding: clamp(1rem, 0.2727rem + 3.636vw, 3rem);
font-size: clamp(2rem, 1.5455rem + 2.2727vw, 3.25rem);
}
@supports (padding: calc(1rem * progress(1, 0, 2))) {
/* min + (max - min) * progress */
.hero {
padding: calc(1rem + 2rem * var(--vp));
font-size: calc(2rem + 1.25rem * var(--vp));
}
.hero__glow {
opacity: calc(0.4 + 0.6 * var(--vp));
scale: calc(0.9 + 0.1 * var(--vp));
}
}
/* no-clamp: the value keeps going below 0 and above 1,
so the title keeps growing past 1200px until the min() cap.
Newer than progress() itself (Firefox 155, Safari 27), so test for it. */
@supports (scale: progress(no-clamp 2, 0, 1)) {
.hero__title {
font-size: min(4.5rem, calc(2rem + 1.25rem * progress(no-clamp 100vw, 320px, 1200px)));
}
}Responsive iframes that fit their content, with an @supports fallback
I'm testing this to drop iframe-resizer scripts and hardcoded heights on client widgets, with a fixed height everywhere else. It's experimental, behind a flag in Chrome and Edge, and the embed loads late, so keep it below the fold to avoid layout shift.
<!-- 1. Host page: fixed height everywhere, content height where supported -->
<style>
.embed {
width: 100%;
height: 600px; /* fallback */
border: 0;
}
@supports (frame-sizing: content-height) {
.embed {
height: auto; /* an explicit height would win over the content size */
frame-sizing: content-height;
}
}
</style>
<iframe class="embed" src="https://widget.example/book" title="Booking form"></iframe>
<!-- 2. Embedded page: opt in from the <head> in the served HTML.
Adding this tag with JS after load does nothing. -->
<meta name="responsive-embedded-sizing" content="allow-origins=https://client-site.example">
<!-- 3. Embedded page: the browser doesn't watch for layout changes,
so ask for a resize after the DOM changes (next form step, more items, etc.) -->
<script>
function fitFrame() {
if ("requestResize" in window) window.requestResize();
}
// e.g. after rendering the next step:
// renderStep(2); fitFrame();
</script>Auto black or white button text with contrast-color()
I set one --btn-bg per client theme and contrast-color() picks black or white text for it, so I don't write per-brand overrides. Mid-tone brand colors can fail with both, so I check those and set --btn-text by hand when they do.
/* One variable per theme drives the button text color.
contrast-color() returns black or white, whichever contrasts more
(Baseline 2026, newly available). */
:root {
--btn-bg: #0f172a;
/* Mid-tones like #2277d3 get black text that fails for small text.
Run those through a contrast checker and set this when they fail: */
/* --btn-text: #fff; */
}
.btn {
--btn-bg-hover: color-mix(in oklch, var(--btn-bg), black 15%);
background: var(--btn-bg);
color: var(--btn-text, #fff); /* older browsers get a fixed color */
border: 0;
padding: 0.75em 1.25em;
border-radius: 0.5em;
}
.btn:hover {
background: var(--btn-bg-hover);
}
/* Kept in @supports: an unsupported function inside var() would make
the whole declaration invalid, and the text would fall back to inherit. */
@supports (color: contrast-color(red)) {
.btn {
color: var(--btn-text, contrast-color(var(--btn-bg)));
}
.btn:hover {
color: var(--btn-text, contrast-color(var(--btn-bg-hover)));
}
}
/* Per theme: <div style="--btn-bg: #facc15"><button class="btn">Buy</button></div> */Design Details: real site designs with a DESIGN.md per site
I go here for hero and footer references before a build, since I can filter by section and see each site's type and colors next to motion recordings. The DESIGN.md download goes straight to my AI agent, and pricing isn't listed, so check the site.
Balanced headings and tidy paragraphs with text-wrap balance, pretty
I got rid of every manual <br> and narrow max-width I'd used to stop headlines ending on one lonely word, and these few lines replaced them. text-wrap: balance turns Baseline Widely available on 13 November, so I put it on headings with no fallback.
/* Headings and short text: lines come out roughly equal.
Chromium balances blocks up to 6 lines, Firefox up to 10.
Anything longer wraps normally, so it's safe on any heading. */
h1, h2, h3, h4,
figcaption,
blockquote,
.card-title {
text-wrap: balance;
}
/* Body copy: pretty avoids a single word on the last line.
It costs more than default wrapping, so use it on paragraphs
and list items, not on everything.
Chrome/Edge 117+ and Safari 26+. Firefox ignores it and
wraps as usual, so nothing breaks. */
p,
li,
dd {
text-wrap: pretty;
}
/* Long text that re-renders a lot (chat logs, live feeds)
can go back to the fastest wrapping. */
.chat-log p {
text-wrap: auto;
}
/* Then delete the old hacks: manual <br> tags in headings
and max-width values you only added to force a wrap.
Balance doesn't shrink the box, so a heading on a colored
background will still be full width with space on the right. */designlang: pull the design system out of any live website
When a client hands me a site with no design system, I run npx designlang on the live URL and get Tailwind config, CSS variables and Figma variables back. The CLI is free with no account, and its MCP mode lets Claude Code read the tokens.
Trim the extra space above and below text with text-box
I use this to cut the line-height space above caps and below the baseline, so a button with equal padding looks centred and I stop nudging it with odd numbers. It's Baseline since Firefox shipped it in August, and older browsers skip it via @supports.
/* Trim the space line-height adds above and below text,
so equal padding looks equal. Older browsers ignore it. */
@supports (text-box: trim-both cap alphabetic) {
h1, h2, h3, h4, h5, h6,
button,
.btn,
.badge,
.card-title {
/* trim to the top of capitals and the baseline */
text-box: trim-both cap alphabetic;
}
/* text-box only works on block containers and inline boxes.
A display: flex or grid button isn't one, so trim its label. */
.btn-flex > span {
text-box: trim-both cap alphabetic;
}
}
/* Same padding top and bottom now looks the same */
.btn,
.badge {
display: inline-block;
padding: 0.75em 1.25em;
line-height: 1.5;
}
.badge {
padding: 0.4em 0.7em;
}