diff --git a/.github/workflows/regression-gate.yml b/.github/workflows/regression-gate.yml index b836747..55eb274 100644 --- a/.github/workflows/regression-gate.yml +++ b/.github/workflows/regression-gate.yml @@ -15,6 +15,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Validate SKILL.md frontmatter run: | head -1 SKILL.md | grep -q '^---$' || { echo "SKILL.md must start with YAML frontmatter"; exit 1; } @@ -39,3 +44,9 @@ jobs: echo "$code $url" [ "$code" = "200" ] || { echo "FAIL: $url returned $code"; exit 1; } done + + - name: Test scripts/fetch-style.py + run: | + python3 scripts/fetch-style.py glassmorphism --tokens | grep -q "TOKENS" || { echo "fetch-style.py failed"; exit 1; } + python3 scripts/fetch-style.py neo-brutalist --recipes | grep -q "STYLE:" || { echo "fetch-style.py --recipes failed"; exit 1; } + python3 scripts/fetch-style.py --search cyberpunk | grep -q "vaporwave" || { echo "fetch-style.py --search failed"; exit 1; } diff --git a/README.md b/README.md deleted file mode 100644 index 856525a..0000000 --- a/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# StyleKit Agent Skill - -Give Cursor, Claude Code, Windsurf, or any Agent-Skills-compatible coding agent built-in knowledge of [StyleKit](https://www.stylekit.top) — how to browse its 146 curated visual styles and apply them with correct tokens and rules. - -## Install - -```bash -npx skills add AnxForever/stylekit-skill -``` - -Your agent can then apply any of the 146 styles on request ("make it look like Stripe", "cyberpunk dashboard", "cozy cottagecore blog") using the style's exact design tokens, component recipes, and AI rules. - -## What it does - -- Picks the right style slug from the catalog for the user's request -- Fetches the full machine-readable spec (tokens, recipes, do/don't rules) from the StyleKit API -- Optionally installs the theme into a shadcn/ui project via the registry -- Generates components that honor the style's constraints instead of generic AI output - -## What it is not - -This is a **user-facing skill** for people who build UI with StyleKit. It does not cover contributing new styles or animations to the StyleKit repository — that workflow lives in the main repo's contributor documentation. - -## Source - -The skill body is a single file: [`SKILL.md`](./SKILL.md). Full docs and catalog: https://www.stylekit.top - -## License - -MIT — see [LICENSE](./LICENSE). diff --git a/SKILL.md b/SKILL.md index 31e104f..c08efec 100644 --- a/SKILL.md +++ b/SKILL.md @@ -1,30 +1,14 @@ --- name: stylekit description: Apply a specific, consistent visual style to frontend UI you are generating. Use when building or styling web UI (pages, components, dashboards, landing pages) and you want a named aesthetic — Glassmorphism, Neo-Brutalist, Cyberpunk, Bauhaus, Apple, Stripe, Linear, and many more — instead of generic AI defaults. StyleKit gives you design tokens, component recipes, and AI rules for each style, with themes installable through the shadcn registry. -metadata: - homepage: https://www.stylekit.top --- # StyleKit -StyleKit is an open-source style library for AI coding with 146 curated -visual styles, each with machine-readable design tokens, component recipes, and -AI rules. Use it to make the UI you generate look like a deliberate, named style -instead of generic AI output. - -## When to use - -- The user asks for a specific look ("make it look like Stripe", "cyberpunk - dashboard", "cozy cottagecore blog", "brutalist landing page"). -- You are generating frontend UI and want a coherent, consistent design system - rather than ad-hoc styling. -- The user wants their AI-generated site to match an aesthetic across many - components. +Apply StyleKit's 146 curated visual styles to generated UI. Use the catalog, fetch the exact spec, install the theme, and honor the style's rules. ## Workflow -For any request, follow this order: - 1. **Pick a style** — match the user's intent to a catalog slug. 2. **Fetch the full spec** — pull tokens, recipes, and AI rules for that slug. 3. **Install the theme** (optional) — drop the shadcn registry theme into the project. @@ -32,42 +16,42 @@ For any request, follow this order: ## Step 1 — Pick a style -Browse the catalog and machine-readable index: +Match the user's request to a slug from the catalog: -- Human catalog: https://www.stylekit.top/styles -- Browse by theme: https://www.stylekit.top/collections (dark-mode, retro-vintage, - anime-manga, game-ui, colorful-bold, hand-drawn) -- Colors / hex codes: https://www.stylekit.top/colors -- JSON list of every style: `GET https://www.stylekit.top/api/styles` - → `{ total, styles: [{ slug, nameEn, description, styleType, keywords, colors, ... }] }` -- Full machine-readable spec for agents: https://www.stylekit.top/llms-full.txt -- Markdown spec for agents: https://www.stylekit.top/llms.txt +- **Human catalog**: https://www.stylekit.top/styles +- **By theme**: https://www.stylekit.top/collections (dark-mode, retro-vintage, anime-manga, game-ui, colorful-bold, hand-drawn) +- **Colors / hex codes**: https://www.stylekit.top/colors +- **Machine-readable list**: `GET https://www.stylekit.top/api/styles` → `{ total, styles: [{ slug, nameEn, description, styleType, keywords, colors }] }` +- **Common style signatures**: see [references/style-signatures.md](references/style-signatures.md) for the visual traits of popular styles -Each style has a `slug` (e.g. `glassmorphism`, `neo-brutalist`, `stripe-style`, -`bauhaus`). You need the slug for the next step. +For an ambiguous request, scan the `/api/styles` list keywords and pick the closest slug. When in doubt, ask the user between two candidates. ## Step 2 — Fetch the full spec -For the chosen slug, fetch the machine-readable spec — do not guess tokens or -rules from memory (styles get updated): +Fetch the machine-readable spec for the chosen slug — do not guess tokens or rules from memory (styles get updated): -- Full style pack: `GET https://www.stylekit.top/api/styles/{slug}` - → `{ slug, name, description, philosophy, doList, dontList, aiRules, colors, components, globalCss, tokens, recipes, version }` -- Markdown rendering: `GET https://www.stylekit.top/api/styles/{slug}/md` -- Tokens only: `GET https://www.stylekit.top/api/styles/{slug}/tokens` -- Recipes only: `GET https://www.stylekit.top/api/styles/{slug}/recipes` -- Human page: https://www.stylekit.top/styles/{slug} +```bash +python3 scripts/fetch-style.py # full spec: tokens, recipes, rules +python3 scripts/fetch-style.py --tokens # tokens only +python3 scripts/fetch-style.py --recipes # recipes only +``` + +The script prints a compact spec for code generation. Raw endpoints are also available: -### Understand the style anatomy +- Full pack: `GET https://www.stylekit.top/api/styles/{slug}` +- Markdown: `GET https://www.stylekit.top/api/styles/{slug}/md` +- Tokens: `GET https://www.stylekit.top/api/styles/{slug}/tokens` +- Recipes: `GET https://www.stylekit.top/api/styles/{slug}/recipes` +- Human page: https://www.stylekit.top/styles/{slug} -Process the spec fields in this priority order: +### Process the spec in priority order -1. **aiRules** — compact instruction string written specifically for AI. Highest priority; overrides general patterns when they conflict. -2. **doList / dontList** — hard constraints, not suggestions. Every generated component must satisfy all items. -3. **philosophy** — the "why" behind the style. Read first to determine ambiguous decisions (visual hierarchy, spacing intent, mood). -4. **colors** — `{ primary, secondary, accent[] }`. Always the source of truth for the palette. -5. **tokens** — semantic categories mapped to exact Tailwind classes. Use them instead of inventing classes. -6. **components** — code templates for button, card, input (and optionally nav, hero, footer). Starting points, not copy-paste targets. +1. **aiRules** — instruction string written for AI. Highest priority; overrides general patterns when they conflict. +2. **doList / dontList** — hard constraints. Every generated component must satisfy all items. +3. **philosophy** — the "why" behind the style. Determines ambiguous decisions (visual hierarchy, spacing, mood). +4. **colors** — `{ primary, secondary, accent[] }`. Source of truth for the palette. +5. **tokens** — semantic categories mapped to exact Tailwind classes. Use instead of inventing classes. +6. **components** — code templates for button, card, input (and optionally nav, hero, footer). Starting points. 7. **globalCss** — base CSS that must be included in the page/layout when using this style. ## Step 3 — Install the theme (optional) @@ -78,25 +62,19 @@ Drop the theme into an existing shadcn/ui project (Tailwind v4): npx shadcn add https://www.stylekit.top/r/.json ``` -Requires a `tsconfig.json` in the target project. The CLI injects the style's -light + dark `cssVars` into `globals.css`. Full guide: https://www.stylekit.top/developers +Requires a `tsconfig.json` in the target project. Injects the style's light + dark `cssVars` into `globals.css`. Full guide: https://www.stylekit.top/developers ## Step 4 — Generate with the style's rules -1. Use the style's **design tokens** (colors, spacing, typography, shadows, - radii) — do not invent your own values. -2. Follow the **AI rules** and **doList/dontList** — these encode what makes the - style read as intentional (e.g. Neo-Brutalist: thick borders, hard shadows, - no rounded corners; Glassmorphism: high blur, translucency, inner glow). -3. Use the **component templates** and **recipes** as starting points; adapt to - the user's content. -4. Keep the style consistent across every component you generate in the session, - including responsive breakpoints (mobile-first). +1. Use the style's **design tokens** (colors, spacing, typography, shadows, radii) — do not invent your own values. +2. Follow the **AI rules** and **doList/dontList** — they encode what makes the style read as intentional (e.g. Neo-Brutalist: thick borders, hard shadows, no rounded corners; Glassmorphism: high blur, translucency, inner glow). +3. Use **component templates** and **recipes** as starting points; adapt to the user's content. +4. Keep the style consistent across every component in the session, including responsive breakpoints (mobile-first). -### Example — good (uses exact token classes) +### Good — uses exact token classes ```tsx -// Neo-Brutalist button — token classes from the style pack +// Neo-Brutalist button — token classes from the fetched spec