@minhduydev/mdpi 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/template/.pi/VERSION +1 -1
- package/dist/template/.pi/extensions/templates-injector.ts +1 -1
- package/dist/template/.pi/skills/INDEX.md +43 -12
- package/dist/template/.pi/skills/accessibility-audit/SKILL.md +8 -2
- package/dist/template/.pi/skills/baseline-ui/SKILL.md +211 -0
- package/dist/template/.pi/skills/design-taste-frontend/SKILL.md +53 -42
- package/dist/template/.pi/skills/fixing-accessibility/SKILL.md +509 -0
- package/dist/template/.pi/skills/frontend-design/SKILL.md +59 -46
- package/dist/template/.pi/skills/frontend-ui-engineering/SKILL.md +21 -27
- package/dist/template/.pi/skills/oklch-color-workflow/SKILL.md +426 -0
- package/dist/template/.pi/skills/production-hardening/SKILL.md +652 -0
- package/dist/template/.pi/skills/ui-craft-principles/SKILL.md +564 -0
- package/dist/template/.pi/skills/ui-quality-audit/SKILL.md +329 -0
- package/dist/template/.pi/templates/DESIGN.md +76 -0
- package/dist/template/.pi/workflows/INDEX.md +2 -1
- package/dist/template/.pi/workflows/frontend-feature-workflow.md +343 -0
- package/dist/template/.pi/workflows/quality-loop.md +1 -1
- package/package.json +1 -1
- /package/dist/template/.pi/templates/{design.md → feature-design.md} +0 -0
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { spawn, spawnSync } from "node:child_process";
|
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
import { mkdir, readdir } from "node:fs/promises";
|
|
12
12
|
//#region package.json
|
|
13
|
-
var version = "0.4.
|
|
13
|
+
var version = "0.4.1";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/utils/manifest.ts
|
|
16
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.1
|
|
@@ -21,7 +21,7 @@ import * as fs from "node:fs";
|
|
|
21
21
|
import * as path from "node:path";
|
|
22
22
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
23
23
|
|
|
24
|
-
const ALWAYS_INJECT = ["project.md", "tech-stack.md", "state.md"];
|
|
24
|
+
const ALWAYS_INJECT = ["project.md", "tech-stack.md", "state.md", "DESIGN.md"];
|
|
25
25
|
|
|
26
26
|
function readTemplate(cwd: string, name: string): string | null {
|
|
27
27
|
// Prefer live file at .pi/{name} (filled by /init — real project state);
|
|
@@ -5,7 +5,7 @@ description: "Task-to-skill routing table with File Match + Keyword triggers, Ph
|
|
|
5
5
|
|
|
6
6
|
# Skills Index — Task → Skill Mapping
|
|
7
7
|
|
|
8
|
-
This file helps the agent (and humans) discover which skill to load for a given task. Skills are auto-loaded into the system prompt at startup (Tier 1), triggered by File/Keyword Match rules, or loaded on-demand via `/skill:<name>` (Tier 2). All
|
|
8
|
+
This file helps the agent (and humans) discover which skill to load for a given task. Skills are auto-loaded into the system prompt at startup (Tier 1), triggered by File/Keyword Match rules, or loaded on-demand via `/skill:<name>` (Tier 2). All skills are available directly in `.pi/skills/`.
|
|
9
9
|
|
|
10
10
|
**How routing works:** File Match → Keyword Match → Quick Routing Table → Decision Tree (if ambiguous).
|
|
11
11
|
|
|
@@ -24,9 +24,10 @@ When the agent edits files matching these patterns, the listed skills auto-load.
|
|
|
24
24
|
| `.github/workflows/**,Dockerfile,docker-compose*.yml` | `ci-cd-and-automation` | Pipeline design + caching |
|
|
25
25
|
| `.pi/skills/*/SKILL.md` | `writing-skills` | Skill authoring best practices |
|
|
26
26
|
| `.pi/loops/**`,`loop-orchestrator.*`,`loop-guard.ts` | `loop-engineering`, `loop-audit` | Loop design/qualification + readiness scoring |
|
|
27
|
-
| `*.css,*.scss,*.less` | `frontend-design`, `design-taste-frontend` |
|
|
28
|
-
| `*.tsx,*.jsx` | `frontend-ui-engineering` |
|
|
27
|
+
| `*.css,*.scss,*.less` | `baseline-ui`, `frontend-design`, `design-taste-frontend` | Deslop pass + design system consistency |
|
|
28
|
+
| `*.tsx,*.jsx` | `baseline-ui`, `frontend-ui-engineering` | Deslop pass + production-quality UI standards |
|
|
29
29
|
| `*.md,docs/**,ADR*.md` | `documentation-and-adrs` | Doc structure + ADR format |
|
|
30
|
+
| `.pi/**/DESIGN.md` | `frontend-design`, `design-taste-frontend` | Project design identity — load aesthetic skills when DESIGN.md is edited |
|
|
30
31
|
|
|
31
32
|
---
|
|
32
33
|
|
|
@@ -43,7 +44,13 @@ When the user's prompt contains these keywords (case-insensitive), the listed sk
|
|
|
43
44
|
| refactor, cleanup, simplify, clean code, complex | `code-cleanup`, `code-simplification`, `deep-module-design` |
|
|
44
45
|
| test, spec, verify, assert, coverage, TDD | `test-driven-development`, `testing-anti-patterns` |
|
|
45
46
|
| review, audit, quality, check, PR | `code-review-and-quality`, `agent-code-quality-gate` |
|
|
46
|
-
| design, UI, component, style, layout, CSS, tailwind | `frontend-design`, `design-taste-frontend` |
|
|
47
|
+
| design, UI, component, style, layout, CSS, tailwind, DESIGN.md, design identity, design token, brand identity | `frontend-design`, `design-taste-frontend` |
|
|
48
|
+
| accessibility, a11y, WCAG, ARIA, keyboard, focus, fix a11y | `fixing-accessibility` |
|
|
49
|
+
| craft, polish, detail, micro-interaction, concentric, optical, border-radius | `ui-craft-principles` |
|
|
50
|
+
| i18n, internationalization, RTL, edge case, error state, empty state, harden, text overflow | `production-hardening` |
|
|
51
|
+
| audit, quality score, UI audit, anti-pattern detection, P0 P1 P2 | `ui-quality-audit` |
|
|
52
|
+
| OKLCH, color system, color palette, color space, gamut, color conversion | `oklch-color-workflow` |
|
|
53
|
+
| deslop, quick fix, baseline, fix AI patterns, auto-fix UI | `baseline-ui` |
|
|
47
54
|
| database, query, SQL, postgres, supabase, RLS, migration | `supabase`, `supabase-postgres-best-practices` |
|
|
48
55
|
| docs, documentation, README, ADR, changelog | `documentation-and-adrs` |
|
|
49
56
|
| commit, branch, merge, rebase, git, worktree | `git-workflow-and-versioning`, `using-git-worktrees` |
|
|
@@ -60,6 +67,7 @@ When the user's prompt contains these keywords (case-insensitive), the listed sk
|
|
|
60
67
|
| Jira, Confluence, Atlassian, issue, ticket | `jira` |
|
|
61
68
|
| browser, e2e, screenshot, playwright, chrome | `playwright`, `chrome-devtools`, `browser-testing-with-devtools` |
|
|
62
69
|
| dependency, package, library, npm, PyPI, source | `opensrc` |
|
|
70
|
+
| scrape, crawl, webclaw, bot protection, 403, webfetch fail, extract web content, web scraping | `webclaw` |
|
|
63
71
|
| loop, unattended loop, nightly triage, loop-readiness, loop-cost, loop-check, loop-review | `loop-engineering`, `loop-audit`, `loop-cost` |
|
|
64
72
|
| Swift, iOS, macOS, actor, async/await, Sendable | `swift-concurrency`, `swiftui-expert-skill`, `core-data-expert` |
|
|
65
73
|
|
|
@@ -134,17 +142,23 @@ When the user's prompt contains these keywords (case-insensitive), the listed sk
|
|
|
134
142
|
|
|
135
143
|
| Skill | Use when | Phase | Risk |
|
|
136
144
|
|-------|----------|-------|------|
|
|
137
|
-
| `
|
|
138
|
-
| `
|
|
145
|
+
| `accessibility-audit` | ⚠️ DEPRECATED — use `fixing-accessibility` instead | Review | Medium |
|
|
146
|
+
| `baseline-ui` | Quick deslop pass — fixes common AI-generated UI anti-patterns automatically | Build | Low |
|
|
147
|
+
| `design-system-audit` | Auditing an existing design system for consistency | Review | Medium |
|
|
139
148
|
| `design-taste-frontend` | BASE aesthetic layer to override default LLM design biases | Build | Low |
|
|
149
|
+
| `fixing-accessibility` | Actionable WCAG 2.1 AA accessibility fixes — before/after code examples | Build + Review | Medium |
|
|
150
|
+
| `frontend-design` | Building any web UI with React-based frameworks | Build | Medium |
|
|
151
|
+
| `frontend-ui-engineering` | Production-quality UIs — component architecture, design systems, WCAG 2.1 AA, avoid AI aesthetic | Build | Medium |
|
|
140
152
|
| `high-end-visual-design` | Premium, agency-quality, or luxury visual design | Build | Low |
|
|
141
|
-
| `minimalist-ui` | Clean, editorial, or minimalist aesthetics | Build | Low |
|
|
142
153
|
| `industrial-brutalist-ui` | Brutalist, military-terminal, or raw mechanical aesthetics | Build | Low |
|
|
154
|
+
| `minimalist-ui` | Clean, editorial, or minimalist aesthetics | Build | Low |
|
|
155
|
+
| `mockup-to-code` | Converting UI mockups, screenshots, Figma/Sketch designs into code | Build | Medium |
|
|
156
|
+
| `oklch-color-workflow` | Complete OKLCH color system — syntax, palette generation, contrast, Tailwind v4 | Build | Low |
|
|
157
|
+
| `production-hardening` | Production hardening — i18n, error states, edge cases, cross-browser | Ship | High |
|
|
143
158
|
| `react-best-practices` | Writing, reviewing, or refactoring React/Next.js code for performance | Build | Medium |
|
|
144
159
|
| `redesign-existing-projects` | Upgrading an existing website or app's visual design | Build | High |
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
147
|
-
| `design-system-audit` | Auditing an existing design system for consistency | Review | Medium |
|
|
160
|
+
| `ui-craft-principles` | 16 craft principles — concentric radius, optical alignment, interruptible animations | Build | Low |
|
|
161
|
+
| `ui-quality-audit` | 5-dimension UI quality scoring (0-4) with P0-P3 severity tags | Review | Medium |
|
|
148
162
|
|
|
149
163
|
### Platform / Infrastructure
|
|
150
164
|
|
|
@@ -227,8 +241,15 @@ Maps user intent to skill(s). `→` = sequential pipeline (execute in order). `+
|
|
|
227
241
|
| "add payment" / "subscription" / "checkout" | `polar` | Build | High |
|
|
228
242
|
| "Figma to code" / "mockup to code" / "design to code" | `figma` → `mockup-to-code` → `frontend-design` | Build | Medium |
|
|
229
243
|
| "redisign" / "visual upgrade" / "restyle" | `redesign-existing-projects` | Build | High |
|
|
230
|
-
| "
|
|
244
|
+
| "color system" / "OKLCH" / "color palette" | `oklch-color-workflow` | Build | Low |
|
|
245
|
+
| "fix accessibility" / "a11y fix" / "WCAG fix" | `fixing-accessibility` | Build | Medium |
|
|
246
|
+
| "make it feel better" / "craft details" / "UI polish" | `ui-craft-principles` | Build | Low |
|
|
247
|
+
| "production ready" / "harden UI" / "edge cases" | `production-hardening` | Ship | High |
|
|
248
|
+
| "quick polish" / "deslop" / "baseline fix" | `baseline-ui` | Build | Low |
|
|
249
|
+
| "UI audit" / "quality score" / "score my UI" | `ui-quality-audit` | Review | Medium |
|
|
250
|
+
| "accessibility" / "a11y" / "WCAG" | `fixing-accessibility` | Review | Medium |
|
|
231
251
|
| "dependency issue" / "how does library X work" | `opensrc` | Build | Low |
|
|
252
|
+
| "scrape this" / "extract from" / "webclaw" / "crawl site" / "webfetch failed" | `webclaw` | Build | Low |
|
|
232
253
|
| "browser test" / "e2e test" / "playwright" | `playwright` \| `browser-testing-with-devtools` | Verify | Medium |
|
|
233
254
|
| "migrate" / "deprecate" / "remove old API" | `deprecation-and-migration` | Ship | High |
|
|
234
255
|
| "create skill" / "write skill" / "edit skill" | `writing-skills` | Build | Low |
|
|
@@ -246,6 +267,7 @@ Execute skills in order — output of one feeds the next.
|
|
|
246
267
|
brainstorming → spec-driven-development → planning-and-task-breakdown → incremental-implementation
|
|
247
268
|
figma → mockup-to-code → frontend-design
|
|
248
269
|
root-cause-tracing → debugging-and-error-recovery → verification-before-completion
|
|
270
|
+
baseline-ui → frontend-design → ui-craft-principles → production-hardening → ui-quality-audit
|
|
249
271
|
```
|
|
250
272
|
|
|
251
273
|
### Parallel Load (`+`)
|
|
@@ -253,7 +275,7 @@ Load multiple skills simultaneously for independent concerns.
|
|
|
253
275
|
|
|
254
276
|
```
|
|
255
277
|
code-review-and-quality + performance-optimization + security-and-hardening
|
|
256
|
-
frontend-design + design-taste-frontend + accessibility
|
|
278
|
+
frontend-design + design-taste-frontend + fixing-accessibility
|
|
257
279
|
test-driven-development + testing-anti-patterns + defense-in-depth
|
|
258
280
|
```
|
|
259
281
|
|
|
@@ -267,6 +289,15 @@ Phase 3 (Review): code-review-and-quality + code-simplification
|
|
|
267
289
|
Phase 4 (Ship): verification-before-completion → shipping-and-launch
|
|
268
290
|
```
|
|
269
291
|
|
|
292
|
+
```
|
|
293
|
+
Phase 1 (Deslop): baseline-ui
|
|
294
|
+
Phase 2 (Design): design-taste-frontend → frontend-design
|
|
295
|
+
Phase 3 (Craft): ui-craft-principles + oklch-color-workflow
|
|
296
|
+
Phase 4 (Build): frontend-ui-engineering + incremental-implementation
|
|
297
|
+
Phase 5 (Harden): production-hardening + fixing-accessibility
|
|
298
|
+
Phase 6 (Audit): ui-quality-audit
|
|
299
|
+
```
|
|
300
|
+
|
|
270
301
|
### Choose One (`|`)
|
|
271
302
|
Pick the best single skill when options are context-dependent.
|
|
272
303
|
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: accessibility-audit
|
|
3
|
-
description: Use
|
|
3
|
+
description: ⚠️ DEPRECATED — Use fixing-accessibility instead. Previously used for auditing UI components or pages for accessibility compliance.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
> **⚠️ DEPRECATED — This skill has been replaced by [`fixing-accessibility`](../fixing-accessibility/SKILL.md).**
|
|
7
|
+
>
|
|
8
|
+
> `fixing-accessibility` provides actionable WCAG 2.1 AA fixes with before/after code examples, not just audit checklists. It covers 9 priority categories with concrete fix recipes.
|
|
9
|
+
>
|
|
10
|
+
> This file is retained for backward compatibility. All references should redirect to `fixing-accessibility`.
|
|
11
|
+
|
|
12
|
+
# Accessibility Audit Skill (Deprecated)
|
|
7
13
|
|
|
8
14
|
## When to Use
|
|
9
15
|
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: baseline-ui
|
|
3
|
+
description: Auto-load when editing *.tsx,*.jsx,*.css — quick deslop pass that fixes common AI-generated UI anti-patterns before any design work begins
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Baseline UI
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- Auto-load when editing `*.tsx`, `*.jsx`, `*.css`, `*.scss` — runs a quick deslop pass first
|
|
11
|
+
- Before loading any aesthetic overlay (`design-taste-frontend`, `minimalist-ui`, etc.)
|
|
12
|
+
- When reviewing or cleaning up existing UI that looks "AI-generated"
|
|
13
|
+
- First step in any frontend implementation pipeline
|
|
14
|
+
|
|
15
|
+
## When NOT to Use
|
|
16
|
+
|
|
17
|
+
- When `design-taste-frontend` or a specific aesthetic overlay is already loaded (they supersede these rules)
|
|
18
|
+
- When building non-UI code (backend, CLI, data processing, APIs)
|
|
19
|
+
- When working with an established design system that already bakes in these rules
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Quick Deslop Pass — Three Rule Tiers
|
|
24
|
+
|
|
25
|
+
Apply these rules in order. **MUST** rules are hard errors — fix before proceeding. **SHOULD** rules are warnings — fix unless there's a deliberate exception. **NEVER** rules are blocking patterns — rewrite entirely.
|
|
26
|
+
|
|
27
|
+
### MUST Rules (Hard Errors)
|
|
28
|
+
|
|
29
|
+
Patterns that are never acceptable in production UI. Fix before any other work.
|
|
30
|
+
|
|
31
|
+
| Rule | Anti-pattern | Fix |
|
|
32
|
+
|------|-------------|-----|
|
|
33
|
+
| **No purple gradients** | `bg-gradient-to-r from-purple-500 to-indigo-600` | Use a single flat accent color from the project palette, or a subtle tonal gradient within the same hue |
|
|
34
|
+
| **No Inter/Roboto/Arial** | `font-['Inter']`, `font-['Roboto']`, or bare `sans-serif` fallback to Arial | Use `Geist`, `Outfit`, `Satoshi`, `Cabinet Grotesk`, or system font stack (`-apple-system, BlinkMacSystemFont`) |
|
|
35
|
+
| **No emojis in code** | `🎉`, `🚀`, `✨` in React components, headings, or alt text | Replace with SVG icons (Phosphor, Radix) or clean primitives |
|
|
36
|
+
| **No `h-screen`** | `h-screen` on hero sections or full-page layouts | Use `min-h-[100dvh]` to prevent mobile browser chrome layout jump |
|
|
37
|
+
| **No `div` onClick as button** | `<div onClick={...} className="cursor-pointer">` | Use `<button type="button">` or `<button type="submit">` with proper styling |
|
|
38
|
+
| **No lorem ipsum** | `Lorem ipsum dolor sit amet...` or any lorem ipsum variant | Use real or realistic domain-appropriate text. For placeholder text, use context-aware content (e.g., "Product launch strategy Q3 2026" not "Lorem ipsum"). |
|
|
39
|
+
| **No generic data** | "Jane Doe", "John Smith", "$99/mo", "amazing", "powerful" | Use realistic names, numbers, and domain-appropriate language. No filler testimonials, no startup slop words. |
|
|
40
|
+
|
|
41
|
+
**Before/After examples:**
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
// BEFORE — MUST fix: purple gradient + emoji + h-screen
|
|
45
|
+
<section className="h-screen bg-gradient-to-r from-purple-500 to-indigo-600">
|
|
46
|
+
<h1>🚀 Launch Your App</h1>
|
|
47
|
+
</section>
|
|
48
|
+
|
|
49
|
+
// AFTER
|
|
50
|
+
<section className="min-h-[100dvh] bg-zinc-900">
|
|
51
|
+
<h1 className="text-white">Launch Your App</h1>
|
|
52
|
+
</section>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
// BEFORE — MUST fix: div as button
|
|
57
|
+
<div onClick={handleSubmit} className="cursor-pointer rounded px-4 py-2 bg-blue-500 text-white">
|
|
58
|
+
Submit
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
// AFTER
|
|
62
|
+
<button type="button" onClick={handleSubmit} className="rounded px-4 py-2 bg-blue-500 text-white">
|
|
63
|
+
Submit
|
|
64
|
+
</button>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### SHOULD Rules (Warnings)
|
|
70
|
+
|
|
71
|
+
Patterns that signal low-quality AI output. Fix unless you have a specific reason not to.
|
|
72
|
+
|
|
73
|
+
| Rule | Anti-pattern | Fix |
|
|
74
|
+
|------|-------------|-----|
|
|
75
|
+
| **Use 4pt spacing scale** | Arbitrary spacing: `p-3`, `gap-3`, `m-5` | Use 4pt increments: `p-2` (8px), `p-4` (16px), `p-6` (24px), `p-8` (32px), `p-12` (48px) |
|
|
76
|
+
| **Use semantic color tokens** | Raw hex: `text="#3B82F6"`, `bg="#1E40AF"` | Use Tailwind semantic tokens: `text-primary`, `bg-primary-700`, `text-muted-foreground` |
|
|
77
|
+
| **Max 1 accent color** | Two+ accent colors competing: blue buttons + green badges + orange links | Pick one accent hue. Use it for all interactive elements. Use neutrals for everything else. |
|
|
78
|
+
| **Skeleton loaders, not spinners** | Full-page spinner: `<div className="flex justify-center"><Spinner /></div>` | Match the layout with skeleton bars: `<div className="space-y-4"><div className="h-4 w-3/4 rounded bg-zinc-200 animate-pulse" />...` |
|
|
79
|
+
| **Left-align content by default** | Every section centered (`text-center`, `mx-auto`) | Left-align content blocks. Reserve center for short hero headlines only. |
|
|
80
|
+
| **Use CSS Grid for layouts** | `flex-wrap` with `w-[calc(33%-1rem)]` math | Use `grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6` |
|
|
81
|
+
| **Consistent border-radius** | Mixed: `rounded-sm` on cards, `rounded-2xl` on inputs, `rounded-full` on buttons | Pick one radius tier: `rounded-md` (6px) for cards/buttons, `rounded-lg` (8px) for modals. Don't mix. |
|
|
82
|
+
|
|
83
|
+
**Before/After examples:**
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
// BEFORE — SHOULD fix: arbitrary spacing, raw hex, flex percentage
|
|
87
|
+
<div className="flex flex-wrap p-3 gap-3">
|
|
88
|
+
{items.map(i => (
|
|
89
|
+
<div className="w-[calc(50%-6px)] bg="#F3F4F6" p-2.5">
|
|
90
|
+
{i.name}
|
|
91
|
+
</div>
|
|
92
|
+
))}
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
// AFTER
|
|
96
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 p-4">
|
|
97
|
+
{items.map(i => (
|
|
98
|
+
<div className="bg-muted p-4 rounded-md">
|
|
99
|
+
{i.name}
|
|
100
|
+
</div>
|
|
101
|
+
))}
|
|
102
|
+
</div>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
// BEFORE — SHOULD fix: spinner loading state
|
|
107
|
+
{loading && <div className="flex justify-center py-12"><Spinner /></div>}
|
|
108
|
+
|
|
109
|
+
// AFTER
|
|
110
|
+
{loading && (
|
|
111
|
+
<div className="space-y-4 p-4">
|
|
112
|
+
<div className="h-4 w-3/4 rounded bg-zinc-200 animate-pulse" />
|
|
113
|
+
<div className="h-4 w-1/2 rounded bg-zinc-200 animate-pulse" />
|
|
114
|
+
<div className="h-4 w-5/6 rounded bg-zinc-200 animate-pulse" />
|
|
115
|
+
</div>
|
|
116
|
+
)}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### NEVER Rules (Blocking — Rewrite Entirely)
|
|
122
|
+
|
|
123
|
+
Patterns that signal complete design failure. Block the output and rewrite.
|
|
124
|
+
|
|
125
|
+
| Rule | Why it's blocked |
|
|
126
|
+
|------|-----------------|
|
|
127
|
+
| **Pure black `#000`** | Never looks good in UI. Destroys depth. Use `#111`, `#18181b`, or `#1c1c1e` instead. |
|
|
128
|
+
| **Centered hero with low variance** | Forces boring landing pages. Use split-screen or left-aligned content. Establish a layout variance baseline (see `design-taste-frontend` for DESIGN_VARIANCE dial if loaded). |
|
|
129
|
+
| **3-column identical cards** | Three identical feature cards is the #1 sign of AI-generated UI. Vary layout: 2-col then 1-col, or 4-col grid, or asymmetric bento. |
|
|
130
|
+
| **Glassmorphism as decoration** | `backdrop-blur-xl bg-white/10` applied to elements with no functional need for depth. Use flat surfaces or layered shadows instead. |
|
|
131
|
+
| **Bounce/elastic easing** | `cubic-bezier(0.68, -0.55, 0.265, 1.55)` or CSS `bounce` animation on UI elements. Use `ease-out` or spring-based motion instead. |
|
|
132
|
+
| **Gray text on colored backgrounds** | White text on pastel backgrounds or gray text on white. Always meet 4.5:1 contrast. |
|
|
133
|
+
|
|
134
|
+
**Before/After examples:**
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
// BEFORE — NEVER: pure black + 3 identical cards + glassmorphism
|
|
138
|
+
<div className="bg-black text-white">
|
|
139
|
+
<div className="backdrop-blur-xl bg-white/10 rounded-2xl p-8">
|
|
140
|
+
<div className="grid grid-cols-3 gap-4">
|
|
141
|
+
<div className="text-center p-6"><h3>Feature 1</h3><p>Description</p></div>
|
|
142
|
+
<div className="text-center p-6"><h3>Feature 2</h3><p>Description</p></div>
|
|
143
|
+
<div className="text-center p-6"><h3>Feature 3</h3><p>Description</p></div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
// AFTER
|
|
149
|
+
<div className="bg-[#111] text-zinc-100">
|
|
150
|
+
<div className="max-w-7xl mx-auto px-6 py-24">
|
|
151
|
+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
|
152
|
+
<div className="lg:col-span-2 bg-zinc-900 border border-zinc-800 rounded-lg p-8">
|
|
153
|
+
<h3 className="text-xl font-semibold">Feature 1</h3>
|
|
154
|
+
<p className="text-zinc-400 mt-2">Description</p>
|
|
155
|
+
</div>
|
|
156
|
+
<div className="bg-zinc-900 border border-zinc-800 rounded-lg p-8">
|
|
157
|
+
<h3 className="text-xl font-semibold">Feature 2</h3>
|
|
158
|
+
<p className="text-zinc-400 mt-2">Description</p>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Pipeline Position
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
baseline-ui ──► design-taste-frontend ──► frontend-design ──► frontend-ui-engineering
|
|
171
|
+
↑
|
|
172
|
+
Quick deslop pass before any design or implementation work
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Run `baseline-ui` first when starting any frontend work. It catches the most common AI-generation artifacts so downstream skills can focus on real design quality.
|
|
176
|
+
|
|
177
|
+
## Don't
|
|
178
|
+
|
|
179
|
+
| Pattern | Replacement | Because |
|
|
180
|
+
|---------|-------------|---------|
|
|
181
|
+
| Purple/indigo gradients as primary palette | Single flat accent color from project palette | Purple gradient is the #1 AI-generation fingerprint |
|
|
182
|
+
| Inter, Roboto, Arial fonts | Geist, Outfit, Satoshi, or system font stack | Overused fonts signal generic AI output |
|
|
183
|
+
| Emojis in JSX/TSX or CSS content | SVG icons (Phosphor, Radix) or clean primitives | Emojis look unprofessional in production UI |
|
|
184
|
+
| `h-screen` on hero sections | `min-h-[100dvh]` | h-screen causes layout jump on mobile browsers |
|
|
185
|
+
| `<div onClick>` as interactive element | `<button type="button">` with proper styling | div onClick breaks keyboard and screen reader access |
|
|
186
|
+
| Pure black `#000` in UI | Off-black (`#111`, Zinc-950, or `#1c1c1e`) | Pure black destroys visual depth |
|
|
187
|
+
| 3-column identical card grids | Varied 2-col, asymmetric bento, or alternating layouts | Three identical cards is the #1 AI UI tell |
|
|
188
|
+
| Glassmorphism without functional purpose | Flat surfaces or layered shadows | Decorative glassmorphism adds visual noise |
|
|
189
|
+
| Bounce/elastic CSS easing on UI elements | `ease-out` or spring-based motion | Bounce easing feels unnatural for UI |
|
|
190
|
+
|
|
191
|
+
## Verification
|
|
192
|
+
|
|
193
|
+
- [ ] No `h-screen` — all full-height containers use `min-h-[100dvh]`
|
|
194
|
+
- [ ] No `div` with `onClick` used as a button — all interactive elements use `<button>`, `<a>`, or proper ARIA roles
|
|
195
|
+
- [ ] No emojis in any JSX/TSX or CSS content
|
|
196
|
+
- [ ] No purple/indigo-blue gradients
|
|
197
|
+
- [ ] No Inter, Roboto, or Arial font references
|
|
198
|
+
- [ ] No pure black (`#000`/`#000000`) color values
|
|
199
|
+
- [ ] Spacing uses 4pt scale (multiples of 4: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96)
|
|
200
|
+
- [ ] No 3-column identical card patterns
|
|
201
|
+
- [ ] No glassmorphism (`backdrop-blur` + semi-transparent bg) used purely decoratively
|
|
202
|
+
- [ ] No bounce/elastic CSS easing curves on UI elements
|
|
203
|
+
- [ ] Skeleton loaders used instead of spinners for content loading states
|
|
204
|
+
|
|
205
|
+
### Self-Critique (Run Before Output)
|
|
206
|
+
|
|
207
|
+
1. **Contrast Check:** Are all text/background combinations ≥ 4.5:1 ratio? No low-contrast gray text on colored backgrounds.
|
|
208
|
+
2. **Data Check:** Is every text string real or realistic? No "Lorem ipsum", "Jane Doe", "$99", or filler words ("amazing", "powerful").
|
|
209
|
+
3. **Grid Check:** Do all spacing values use the 4pt scale (4, 8, 12, 16, 24, 32, 48, 64)? No arbitrary pixel values.
|
|
210
|
+
4. **Font Check:** No Inter, Roboto, Arial, or other AI-default fonts. No oversized H1 (>40px without explicit design reason).
|
|
211
|
+
5. **Color Check:** No pure black `#000`, no purple/indigo gradients, no oversaturated accents like `#FF4500`.
|
|
@@ -3,6 +3,8 @@ name: design-taste-frontend
|
|
|
3
3
|
description: Use when building any web UI as the BASE aesthetic layer to override default LLM design biases. Enforces strict typography, color, spacing, and component architecture rules. Load BEFORE frontend-design when premium visual quality is required.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
**Aesthetic Context:** This is a premium aesthetic layer. Read `.pi/DESIGN.md` first to internalize the project's visual identity — every typographic, color, and spacing rule here is shaped by that mood. Design taste means the design feels intentional, not AI-generated.
|
|
7
|
+
|
|
6
8
|
## When to Use
|
|
7
9
|
|
|
8
10
|
- When building any web UI that needs to override default LLM design biases
|
|
@@ -15,7 +17,7 @@ description: Use when building any web UI as the BASE aesthetic layer to overrid
|
|
|
15
17
|
- For non-UI tasks (backend, CLI, data processing)
|
|
16
18
|
|
|
17
19
|
|
|
18
|
-
#
|
|
20
|
+
# Design Taste Frontend
|
|
19
21
|
|
|
20
22
|
## 1. ACTIVE BASELINE CONFIGURATION
|
|
21
23
|
* DESIGN_VARIANCE: 8 (1=Perfect Symmetry, 10=Artsy Chaos)
|
|
@@ -43,7 +45,6 @@ Unless the user explicitly specifies a different stack, adhere to these structur
|
|
|
43
45
|
* **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`) for reliable structures.
|
|
44
46
|
* **Icons:** You MUST use exactly `@phosphor-icons/react` or `@radix-ui/react-icons` as the import paths (check installed version). Standardize `strokeWidth` globally (e.g., exclusively use `1.5` or `2.0`).
|
|
45
47
|
|
|
46
|
-
|
|
47
48
|
## 3. DESIGN ENGINEERING DIRECTIVES (Bias Correction)
|
|
48
49
|
LLMs have statistical biases toward specific UI cliché patterns. Proactively construct premium interfaces using these engineered rules:
|
|
49
50
|
|
|
@@ -55,7 +56,7 @@ LLMs have statistical biases toward specific UI cliché patterns. Proactively co
|
|
|
55
56
|
|
|
56
57
|
**Rule 2: Color Calibration**
|
|
57
58
|
* **Constraint:** Max 1 Accent Color. Saturation < 80%.
|
|
58
|
-
* **THE LILA BAN:** The "AI Purple/Blue" aesthetic is strictly BANNED. No purple button glows, no neon gradients. Use absolute neutral bases (Zinc/Slate) with high-contrast, singular accents (e.g
|
|
59
|
+
* **THE LILA BAN:** The "AI Purple/Blue" aesthetic is strictly BANNED. No purple button glows, no neon gradients. Use absolute neutral bases (Zinc/Slate) with high-contrast, singular accents (e.g., Emerald, Electric Blue, or Deep Rose).
|
|
59
60
|
* **COLOR CONSISTENCY:** Stick to one palette for the entire output. Do not fluctuate between warm and cool grays within the same project.
|
|
60
61
|
|
|
61
62
|
**Rule 3: Layout Diversification**
|
|
@@ -106,36 +107,50 @@ To actively combat generic AI designs, systematically implement these high-end c
|
|
|
106
107
|
* **4-7 (Daily App Mode):** Normal spacing for standard web apps.
|
|
107
108
|
* **8-10 (Cockpit Mode):** Tiny paddings. No card boxes; just 1px lines to separate data. Everything is packed. **Mandatory:** Use Monospace (`font-mono`) for all numbers.
|
|
108
109
|
|
|
109
|
-
## 7.
|
|
110
|
-
To guarantee a premium, non-generic output, you MUST strictly avoid these common AI design signatures unless explicitly requested:
|
|
110
|
+
## 7. Don't
|
|
111
111
|
|
|
112
112
|
### Visual & CSS
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
|
|
114
|
+
| Pattern | Replacement | Because |
|
|
115
|
+
|---------|-------------|---------|
|
|
116
|
+
| Neon/outer box-shadow glows | Inner borders or subtle tinted shadows | Glows are an instant AI-design signature |
|
|
117
|
+
| Pure black `#000000` | Off-black, Zinc-950, or Charcoal | Pure black destroys visual depth |
|
|
118
|
+
| Oversaturated accent colors | Desaturated accents blending with neutrals | High-saturation colors look amateurish |
|
|
119
|
+
| Gradient text on large headers | Single solid heading color | Gradient text is an AI design cliché |
|
|
120
|
+
| Custom mouse cursors | Default system cursor | Custom cursors hurt performance and accessibility |
|
|
118
121
|
|
|
119
122
|
### Typography
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
|
|
124
|
+
| Pattern | Replacement | Because |
|
|
125
|
+
|---------|-------------|---------|
|
|
126
|
+
| Inter as display typeface | Geist, Outfit, Cabinet Grotesk, or Satoshi | Inter signals default AI-generated output |
|
|
127
|
+
| Oversized H1 (>40px without reason) | Control hierarchy with weight and color, not just massive scale | Giant headings scream without communicating |
|
|
128
|
+
| Serif fonts on dashboards or data UIs | Sans-serif for data; serif only for editorial/creative contexts | Serifs on dashboards feel out of place |
|
|
123
129
|
|
|
124
130
|
### Layout & Spacing
|
|
125
|
-
* **Align & Space Perfectly:** Ensure padding and margins are mathematically perfect. Avoid floating elements with awkward gaps.
|
|
126
|
-
* **NO 3-Column Card Layouts:** The generic "3 equal cards horizontally" feature row is BANNED. Use a 2-column Zig-Zag, asymmetric grid, or horizontal scrolling approach instead.
|
|
127
131
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
| Pattern | Replacement | Because |
|
|
133
|
+
|---------|-------------|---------|
|
|
134
|
+
| 3-column identical card layouts | 2-column zig-zag, asymmetric grid, or horizontal scroll | Three equal cards is the #1 AI UI tell |
|
|
135
|
+
| Floating elements with awkward gaps | Mathematically perfect padding and margin alignment | Misaligned spacing reads as sloppy |
|
|
136
|
+
|
|
137
|
+
### Content & Data
|
|
134
138
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
| Pattern | Replacement | Because |
|
|
140
|
+
|---------|-------------|---------|
|
|
141
|
+
| Generic placeholder names (John Doe, Sarah Chan) | Creative, realistic-sounding names (Dr. Sarah Chen, Marcus Okonkwo) | Generic names feel fake and unprofessional |
|
|
142
|
+
| Emoji avatars or Lucide user icons | Creative photo placeholders or styled SVGs | Emoji avatars degrade perceived quality |
|
|
143
|
+
| Fake or predictable numbers (`99.99%`, `50%`, `$99/mo`) | Organic, messy data (`47.2%`, `$12,450`, `+18.3%`) | Round numbers look fabricated |
|
|
144
|
+
| Startup slop names (Acme, Nexus, SmartFlow) | Premium, contextual brand names | Startup-slop names are a dead AI giveaway |
|
|
145
|
+
| Filler words (Elevate, Seamless, Unleash, Next-Gen) | Concrete, specific verbs and descriptions | AI copywriting clichés destroy credibility |
|
|
146
|
+
| Unsplash URLs in image sources | `picsum.photos/seed/{seed}/800/600` or SVG placeholders | Unsplash links break and leave broken images |
|
|
147
|
+
| Default shadcn/ui appearance | Customized radii, colors, and shadows | Default shadcn reads as AI-generated |
|
|
148
|
+
|
|
149
|
+
### Code Quality
|
|
150
|
+
|
|
151
|
+
| Pattern | Replacement | Because |
|
|
152
|
+
|---------|-------------|---------|
|
|
153
|
+
| Sloppy output — misaligned elements, poor spacing, generic feel | Meticulously refined, visually striking, memorable output | Production-ready cleanliness is non-negotiable for premium UI |
|
|
139
154
|
|
|
140
155
|
## 8. THE CREATIVE ARSENAL (High-End Inspiration)
|
|
141
156
|
Do not default to generic UI. Pull from this library of advanced concepts to ensure the output is visually striking and memorable. When appropriate, leverage **GSAP (ScrollTrigger/Parallax)** for complex scrolltelling or **ThreeJS/WebGL** for 3D/Canvas animations, rather than basic CSS motion. **CRITICAL:** Never mix GSAP/ThreeJS with Framer Motion in the same component tree. Default to Framer Motion for UI/Bento interactions. Use GSAP/ThreeJS EXCLUSIVELY for isolated full-page scrolltelling or canvas backgrounds, wrapped in strict useEffect cleanup blocks.
|
|
@@ -143,7 +158,7 @@ Do not default to generic UI. Pull from this library of advanced concepts to ens
|
|
|
143
158
|
### The Standard Hero Paradigm
|
|
144
159
|
* Stop doing centered text over a dark image. Try asymmetric Hero sections: Text cleanly aligned to the left or right. The background should feature a high-quality, relevant image with a subtle stylistic fade (darkening or lightening gracefully into the background color depending on if it is Light or Dark mode).
|
|
145
160
|
|
|
146
|
-
### Navigation &
|
|
161
|
+
### Navigation & Menus
|
|
147
162
|
* **Mac OS Dock Magnification:** Nav-bar at the edge; icons scale fluidly on hover.
|
|
148
163
|
* **Magnetic Button:** Buttons that physically pull toward the cursor.
|
|
149
164
|
* **Gooey Menu:** Sub-items detach from the main button like a viscous liquid.
|
|
@@ -237,19 +252,15 @@ Evaluate your code against this matrix before outputting. This is the **last** f
|
|
|
237
252
|
- [ ] Are cards omitted in favor of spacing where possible?
|
|
238
253
|
- [ ] Did you strictly isolate CPU-heavy perpetual animations in their own Client Components?
|
|
239
254
|
|
|
240
|
-
##
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
-
|
|
252
|
-
- No explicit font pairing decisions documented
|
|
253
|
-
- Color palette not extracted from project context
|
|
254
|
-
- Components lack hover/focus/active state differentiation
|
|
255
|
-
- Visual hierarchy is flat — everything looks equally important
|
|
255
|
+
## Verification
|
|
256
|
+
|
|
257
|
+
- [ ] Aesthetic baseline config (DESIGN_VARIANCE, MOTION_INTENSITY, VISUAL_DENSITY) respected throughout output
|
|
258
|
+
- [ ] No banned fonts (Inter, Roboto, Arial, system-ui) used as display font
|
|
259
|
+
- [ ] No AI purple/blue gradients, no neon glows, no pure black (`#000000`)
|
|
260
|
+
- [ ] No centered Hero/H1 when DESIGN_VARIANCE > 4
|
|
261
|
+
- [ ] No 3-column identical card layouts
|
|
262
|
+
- [ ] All interactive states (loading, empty, error) implemented
|
|
263
|
+
- [ ] Mobile layout collapse verified at 320px, 768px
|
|
264
|
+
- [ ] `min-h-[100dvh]` used instead of `h-screen` for full-height sections
|
|
265
|
+
- [ ] No emojis in code, markup, or alt text
|
|
266
|
+
- [ ] Perpetual animations isolated in their own Client Components
|