# Design Library: how an agent uses it

Adam keeps a library of website styles he likes, each with screenshots and a brief. You are building or redesigning a client's website: propose **5 distinct design directions** (or 3 when styles are named) as switchable previews, so Adam can pick one. Take a reference's feel, composition, type character, rhythm and motion; never copy the site, brand or assets.

Files: `~/Desktop/claude/manyads/design-library/library/`
- `INDEX.md`: one row per style, about 270 KB (70 000 tokens or more). Read it whole only for a broad scan; otherwise search.
- `UIUX.md` and `uiux/<pattern>.md`: UI/UX patterns from Mobbin (navigation, pricing, contact form, booking, FAQ, footer, product page, checkout…): how the premium version works, what to avoid, examples.
- `entries/<slug>/brief.md`: full brief of one style. `entries/<slug>/shots/`: `hero.jpg` (first screen), `mobile.jpg`, `full.jpg` and `section-NN.jpg` when present; the brief's "Screenshots" list shows which exist. Look at them.
- Over HTTP while the app runs: `http://localhost:4100/index.md`, `http://localhost:4100/s/<slug>.md`.

Axes are 1–5: C calm→energetic, M minimal→rich, W warm→cool, X classic→experimental, P serious→playful.

## Quick route: the user names a site or sends a library link
For an Ottery link (`.../s/<slug>`, `.../s/<slug>.md`) or "this style from the library", do **not** read the INDEX:
1. Fetch `GET /api/v1/styles/<slug>.md` (MCP `get_style`). That brief is the reference: palette, type, layout, motion, take and avoid, screenshot URLs. Look at `hero.jpg` and the section shots.
2. "More like this": `GET /api/v1/styles/<slug>/similar?limit=8` (MCP `similar_styles`). Best first, each row has a short `why` (same family, axes distance, shared tags). Read the briefs of 2 or 3.
3. Apply the feel to the client's own brand and content.

## Finding styles
Search 2-3 times from different angles (industry, feel words, axes), shortlist about 10 from the rows, then read only the best 3-5 briefs. `GET /api/v1/search?q=<words>` (MCP `search_styles`):
- `q`: words split on spaces; case and accents are ignored (`pekarna` finds `pekárna`). Per word a hit in title, slug or URL scores highest, then tags, then personality, fits and family, then summary. One word is enough; styles matching every word come first; `match=all` requires every word. Use English tags and Czech `fits` words ("bakery", "pekárna", "brutalist", "editorial"). Without `q` the best-graded styles come first.
- Filters (all must match): `family=`, `industry=`, `motion=none|subtle|rich|immersive`, axes `C M W X P` as `3` or `2-4` (`C=1-2&X=4`).
- Each row has `slug, title, url, family, axes, summary, fits, motion, grade, best, personality, industry, palette` (5 hexes), `fonts` (3), `brief`, `hero`. That is enough to build a shortlist without opening briefs. `hero: null` means no screenshot: such styles rank lower, and you cannot look at them.
- Nothing found: the reply has a `hint` (drop `match=all`, loosen filters, or try a synonym or Czech word). A bad `family`, `motion`, axis value or `match` gives HTTP 400 `{error, valid}` listing the valid values; an MCP call fails with the same message.
- Paging: `limit` 1-100 (default 20), `offset` from 0. The reply is `{count, returned, offset, styles}`; `count` is all matches. If `count` > `returned`, raise `offset`. An offset past the end adds a `hint`.
- Over the rate limit (429) wait `Retry-After` seconds.
- Other MCP tools: `get_family`, `get_uiux { pattern? }` (no pattern: overview; unknown pattern lists the valid ones), `get_best`, `get_agent_guide`.
- A style group answers "what feel": `families/<group>.md` lists its sites and what they share.

## Which group for which job (use the group as the direction, then pick sites inside it)
- `minimal-clean`: lots of white space, restrained palette, neutral grotesk; calm, professional, no effects.
- `swiss-grid`: strict grid, type carries the page, numbers, rules, table structure; rational, precise.
- `brutalist-raw`: hard edges, no rounding or soft shadows, visible structure, blunt big type, flat colour blocks.
- `editorial-serif`: magazine layouts, serif display, photo and text rhythm, long reading.
- `luxury-cinematic`: full-screen photo and video, slow scroll, small UI, premium brands.
- `warm-organic`: earthy warm colours, nature photos, craft, soft shapes and textures; bakeries, cafés, farms, wellness, hotels.
- `playful-illustrated`: illustration, mascots, hand-drawn elements, wit and playful motion.
- `bold-colorful`: saturated colour blocks, big loud type, energy, contrast.
- `retro-vintage`: nostalgia, 60s to 90s, Y2K, grain, retro type, old print and packaging.
- `collage-maximal`: collage, cut-outs, stickers, layers, scrapbook, a lot at once on purpose.
- `kinetic-type`: type as the main visual, moving and experimental text, unusual navigation and layout.
- `immersive-3d`: a WebGL / Three.js scene is the main experience, interactive 3D objects and spaces.
- `dark-tech`: dark UI, product demos, gradients and glow; SaaS, AI, crypto, developer tools.
- `corporate-trust`: clear structure, credibility; B2B, health, finance, construction.
- `photo-fullscreen`: full-bleed photography carries the page, UI only on top; travel, sport, architecture, nature.
- `product-shop`: the product in the lead role: e-shops, product pages, packshots, product grids.
- `soft-pastel`: soft pastel colours, rounded shapes, calm and care; wellness, cosmetics, kids, health.
- `black-white`: only black and white (maybe one colour), high contrast, graphic power.
Match on how the site should *feel*, not on the client's industry: a bakery can be brutalist-raw.

## Using the briefs well
Each brief has: the summary and description, Style profile (family, axes, personality, palette mood, type character), Tags, Motion (level, techniques, libraries), Design (fonts, palette, stack; the heading says whether it was measured on the live site), For the agent (Take / Avoid / Fits / Brief), Page sections (when the entry has them) and Screenshots. Use `Take` for what to borrow and `Avoid` for known weak spots; `Brief` is the one-paragraph recipe. Measured fonts and hexes are facts, so reuse them as a starting point only when the client has no brand of its own.

## 0. Which mode
Adam's request decides how much you choose yourself. Typical request (Czech, informal):

> Máme web pekaře z Boleslavi, chci mu udělat moderní trošku brutalistický web jako je v naší design library, líbí se mi například Henrietta Said, dále barvy by měly být hnědá s krémovou a jednou kontrastní accent barvou. Dál se mi líbí styl Baztan Race a Carnilove.

- **Named references** (like above): find each named style with `search?q=<name>` (case and accents do not matter: „henrietta said“ finds `henrietta-said`), or in `INDEX.md` by its `title`. These are the material, not suggestions. Skip step 2 and build **3 directions, each a different blend** of the named styles (e.g. one led by Henrietta Said's mascot and loud type, one by Baztan Race's illustrated storytelling, one by Carnilove's raw scrapbook product feel), all under Adam's constraints. If a name matches nothing, say so in one line and go on with the rest.
- **Style group** („chci styl Brutalist & Raw“, „ve stylu retro“, or a pasted `families/<group>.md`): the 18 style groups are listed in `INDEX.md`; each has `families/<group>.md` with what its sites share and every site in it. Build **3 directions inside that group**, each led by a different site from it (pick the ones whose industry and axes fit the client best).
- **Style words** („brutalistický“, „minimalistický“, „hravý“): first match them to a style group (brutalistický → `brutalist-raw`, minimalistický → `minimal-clean`, hravý → `playful-illustrated`…) and use that group's brief, then `style tags` and personality. If nothing carries the word, apply the usual meaning yourself (brutalist: raw grid, hard edges, no rounded corners or soft shadows, big blunt type, visible structure, system or grotesk fonts, flat colour blocks) and say which styles you leaned on.
- **Constraints Adam states win over everything in the briefs**: colours („hnědá s krémovou a jednou kontrastní accent barvou“ → you pick the exact hexes, show them), fonts, tone. Where a reference's `agent.avoid` conflicts with Adam's request, Adam wins.
- **Nothing named** („udělej mu 5 směrů z library“): do steps 1–2 as written.

The client's real content comes first: if there is an existing site, read it (name, services, products, opening hours, location, photos) and use that copy in the previews.

## 1. Read the brand
From what Adam gives you (logo, colours, photos, brand manual, existing site, copy), write 5 lines and show them to Adam:
1. What the business is, for whom, and the one main action of the site.
2. The 5 axes for the brand (C M W X P, 1–5), one short reason each.
3. 3 personality words.
4. Brand assets to keep: colours (hex), fonts, logo rules, photo quality (good / weak / none).
5. Constraints: budget for motion and 3D, mobile share, languages, accessibility.

## 2. Pick 5 directions
- Shortlist with search (see "Finding styles"); `similar` fills gaps around a good pick. Judge each style on the 5 axes, personality, and `fits` / industry. Photo-heavy styles only if the client has good photos.
- Choose 5 that are **clearly different from each other**: about 2 safe (close match), 2 bolder (one or two axes pushed), 1 contrast (a deliberate other reading of the brand).
- Each direction = one main reference style, plus at most 2 others used only for specific page sections (`pageSections`).
- The 10/10 shelf (★ in INDEX.md, list in `BEST.md`) is the best of the library: when one of those fits the brand, make it a main reference of at least one direction.
- Read the `brief.md` of every chosen style and look at its `shots/`. Respect each `agent.avoid`.

## 3. Build the selector in the client project
- One route per direction: `/preview/1` … `/preview/5` (or `/preview/1–3` with named references). Same real content, different styling: its own tokens (colours, fonts, radius, spacing scale), hero, navigation and 2–3 key sections. Not the whole site five times.
- The client's colours and fonts win. From the reference take composition, type character, rhythm, imagery treatment and motion.
- A fixed bar at the bottom of every preview, dev only:
  - one button per direction and ←/→ keys to switch
  - the direction name and one sentence on why it suits this brand
  - links to the reference entries (`http://localhost:4100/s/<slug>`)
- Exclude `/preview/*` and the bar from production builds.
- Motion respects `prefers-reduced-motion`. Everything works at 390 px wide.

## 4. Hand over
List the directions (name, references, why, what is bold about it) with the dev server URL, then wait for Adam's choice. Don't continue building until Adam picks.

## 5. After the choice
Make the chosen direction the real site. For every functional part you build (navigation, forms, booking, pricing, shop pages, checkout), read its `uiux/<pattern>.md` first and follow its rules: the style decides how it looks, the pattern how it works. With the Mobbin MCP connected, look up the listed examples (or search the pattern) to see them; never copy their images into the project. Delete the other previews and the bar. Write `DESIGN.md` in the client project: the direction, its tokens, and the library entries it came from.
