@minhduydev/mdpi 0.3.2 → 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.
Files changed (36) hide show
  1. package/README.md +2 -1
  2. package/dist/index.js +202 -4
  3. package/dist/template/.pi/README.md +29 -8
  4. package/dist/template/.pi/VERSION +1 -1
  5. package/dist/template/.pi/agents/general.md +1 -1
  6. package/dist/template/.pi/agents/review.md +1 -1
  7. package/dist/template/.pi/extensions/templates-injector.ts +1 -1
  8. package/dist/template/.pi/packages.json +13 -0
  9. package/dist/template/.pi/prompts/audit.md +4 -1
  10. package/dist/template/.pi/prompts/create.md +1 -0
  11. package/dist/template/.pi/prompts/fix.md +7 -1
  12. package/dist/template/.pi/prompts/gc.md +3 -0
  13. package/dist/template/.pi/prompts/init.md +3 -0
  14. package/dist/template/.pi/prompts/plan.md +5 -2
  15. package/dist/template/.pi/prompts/research.md +3 -0
  16. package/dist/template/.pi/prompts/ship.md +7 -1
  17. package/dist/template/.pi/prompts/verify.md +4 -1
  18. package/dist/template/.pi/skills/INDEX.md +49 -12
  19. package/dist/template/.pi/skills/accessibility-audit/SKILL.md +8 -2
  20. package/dist/template/.pi/skills/baseline-ui/SKILL.md +211 -0
  21. package/dist/template/.pi/skills/dcp-hygiene/SKILL.md +106 -0
  22. package/dist/template/.pi/skills/design-taste-frontend/SKILL.md +53 -42
  23. package/dist/template/.pi/skills/fixing-accessibility/SKILL.md +509 -0
  24. package/dist/template/.pi/skills/frontend-design/SKILL.md +59 -46
  25. package/dist/template/.pi/skills/frontend-ui-engineering/SKILL.md +21 -27
  26. package/dist/template/.pi/skills/memory-system/SKILL.md +118 -0
  27. package/dist/template/.pi/skills/oklch-color-workflow/SKILL.md +426 -0
  28. package/dist/template/.pi/skills/production-hardening/SKILL.md +652 -0
  29. package/dist/template/.pi/skills/ui-craft-principles/SKILL.md +564 -0
  30. package/dist/template/.pi/skills/ui-quality-audit/SKILL.md +329 -0
  31. package/dist/template/.pi/templates/DESIGN.md +76 -0
  32. package/dist/template/.pi/workflows/INDEX.md +2 -1
  33. package/dist/template/.pi/workflows/frontend-feature-workflow.md +343 -0
  34. package/dist/template/.pi/workflows/quality-loop.md +3 -1
  35. package/package.json +1 -1
  36. /package/dist/template/.pi/templates/{design.md → feature-design.md} +0 -0
@@ -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 70 skills are available directly in `.pi/skills/`.
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` | Design system consistency |
28
- | `*.tsx,*.jsx` | `frontend-ui-engineering` | Production-quality UI standards |
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,11 +44,19 @@ 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` |
50
57
  | context, memory, token, agent quality, degraded | `context-engineering` |
58
+ | memory_system, memory-search, memory_search, pi-hermes, /memory-insights, save memory, remember this, past failure, previous attempt | `memory-system` |
59
+ | compress, dcp, context prune, cleanup context, context filling up | `context-engineering`, `dcp-hygiene` |
51
60
  | brainstorm, idea, design, concept, explore, ideate, refine | `brainstorming`, `idea-refine`, `spec-driven-development` |
52
61
  | interview, grill, are we sure, what do you want | `interview-me` |
53
62
  | plan, break down, decompose, tasks, roadmap | `planning-and-task-breakdown` |
@@ -58,6 +67,7 @@ When the user's prompt contains these keywords (case-insensitive), the listed sk
58
67
  | Jira, Confluence, Atlassian, issue, ticket | `jira` |
59
68
  | browser, e2e, screenshot, playwright, chrome | `playwright`, `chrome-devtools`, `browser-testing-with-devtools` |
60
69
  | dependency, package, library, npm, PyPI, source | `opensrc` |
70
+ | scrape, crawl, webclaw, bot protection, 403, webfetch fail, extract web content, web scraping | `webclaw` |
61
71
  | loop, unattended loop, nightly triage, loop-readiness, loop-cost, loop-check, loop-review | `loop-engineering`, `loop-audit`, `loop-cost` |
62
72
  | Swift, iOS, macOS, actor, async/await, Sendable | `swift-concurrency`, `swiftui-expert-skill`, `core-data-expert` |
63
73
 
@@ -98,6 +108,8 @@ When the user's prompt contains these keywords (case-insensitive), the listed sk
98
108
  | `deprecation-and-migration` | Deprecating APIs, migrating library versions, removing legacy code | Ship | High |
99
109
  | `writing-skills` | Creating new skills, editing existing skills, verifying skills before deployment | Build | Low |
100
110
  | `context-engineering` | Optimizing agent context setup — rules files, selective loading, confusion management | All | Low |
111
+ | `dcp-hygiene` | At command/phase closure — compress closed exploratory work-streams via pi-dcp when `compress` is available; no-ops if DCP absent | All | Low |
112
+ | `memory-system` | Understanding/leveraging pi-hermes-memory — auto-flywheel, tools, commands, when to use memory_search vs vcc_recall | All | Low |
101
113
  | `doubt-driven-development` | In-flight adversarial review of non-trivial decisions before they stand | Build | Medium |
102
114
  | `loop-engineering` | Designing/qualifying/running unattended coding loops; 2-condition test + VISION/state + confidence-gated action | All | Medium |
103
115
  | `loop-audit` | Scoring a project's loop-readiness 0-100 + L0/L1/L2/L3; L3 gated on proven run | Review | Low |
@@ -130,17 +142,23 @@ When the user's prompt contains these keywords (case-insensitive), the listed sk
130
142
 
131
143
  | Skill | Use when | Phase | Risk |
132
144
  |-------|----------|-------|------|
133
- | `frontend-ui-engineering` | Production-quality UIscomponent architecture, design systems, WCAG 2.1 AA, avoid AI aesthetic | Build | Medium |
134
- | `frontend-design` | Building any web UI with React-based frameworks | Build | Medium |
145
+ | `accessibility-audit` | ⚠️ DEPRECATEDuse `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 |
135
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 |
136
152
  | `high-end-visual-design` | Premium, agency-quality, or luxury visual design | Build | Low |
137
- | `minimalist-ui` | Clean, editorial, or minimalist aesthetics | Build | Low |
138
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 |
139
158
  | `react-best-practices` | Writing, reviewing, or refactoring React/Next.js code for performance | Build | Medium |
140
159
  | `redesign-existing-projects` | Upgrading an existing website or app's visual design | Build | High |
141
- | `mockup-to-code` | Converting UI mockups, screenshots, Figma/Sketch designs into code | Build | Medium |
142
- | `accessibility-audit` | Auditing UI components or pages for accessibility compliance | Review | Medium |
143
- | `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 |
144
162
 
145
163
  ### Platform / Infrastructure
146
164
 
@@ -214,6 +232,8 @@ Maps user intent to skill(s). `→` = sequential pipeline (execute in order). `+
214
232
  | "set up database" / "Supabase" | `supabase` + `supabase-postgres-best-practices` | Build | High |
215
233
  | "add logging" / "monitoring" / "observability" | `observability-and-instrumentation` | Ship | Medium |
216
234
  | "optimize context" / "agent quality degraded" / "too many tokens" | `context-engineering` | All | Low |
235
+ | "remember this" / "memory-search" / "past failure" / "previous attempt" / "save to memory" | `memory-system` | All | Low |
236
+ | "compress context" / "dcp" / "context filling up" / "cleanup context" | `dcp-hygiene` | All | Low |
217
237
  | "verify this approach" / "challenge this decision" / "doubt check" | `doubt-driven-development` | Build | Medium |
218
238
  | "security audit" / "auth setup" / "vulnerability" | `security-and-hardening` | Review | High |
219
239
  | "profile" / "too slow" / "bundle size" / "lighthouse" | `performance-optimization` | Review | Medium |
@@ -221,8 +241,15 @@ Maps user intent to skill(s). `→` = sequential pipeline (execute in order). `+
221
241
  | "add payment" / "subscription" / "checkout" | `polar` | Build | High |
222
242
  | "Figma to code" / "mockup to code" / "design to code" | `figma` → `mockup-to-code` → `frontend-design` | Build | Medium |
223
243
  | "redisign" / "visual upgrade" / "restyle" | `redesign-existing-projects` | Build | High |
224
- | "accessibility" / "a11y" / "WCAG" | `accessibility-audit` | Review | Medium |
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 |
225
251
  | "dependency issue" / "how does library X work" | `opensrc` | Build | Low |
252
+ | "scrape this" / "extract from" / "webclaw" / "crawl site" / "webfetch failed" | `webclaw` | Build | Low |
226
253
  | "browser test" / "e2e test" / "playwright" | `playwright` \| `browser-testing-with-devtools` | Verify | Medium |
227
254
  | "migrate" / "deprecate" / "remove old API" | `deprecation-and-migration` | Ship | High |
228
255
  | "create skill" / "write skill" / "edit skill" | `writing-skills` | Build | Low |
@@ -240,6 +267,7 @@ Execute skills in order — output of one feeds the next.
240
267
  brainstorming → spec-driven-development → planning-and-task-breakdown → incremental-implementation
241
268
  figma → mockup-to-code → frontend-design
242
269
  root-cause-tracing → debugging-and-error-recovery → verification-before-completion
270
+ baseline-ui → frontend-design → ui-craft-principles → production-hardening → ui-quality-audit
243
271
  ```
244
272
 
245
273
  ### Parallel Load (`+`)
@@ -247,7 +275,7 @@ Load multiple skills simultaneously for independent concerns.
247
275
 
248
276
  ```
249
277
  code-review-and-quality + performance-optimization + security-and-hardening
250
- frontend-design + design-taste-frontend + accessibility-audit
278
+ frontend-design + design-taste-frontend + fixing-accessibility
251
279
  test-driven-development + testing-anti-patterns + defense-in-depth
252
280
  ```
253
281
 
@@ -261,6 +289,15 @@ Phase 3 (Review): code-review-and-quality + code-simplification
261
289
  Phase 4 (Ship): verification-before-completion → shipping-and-launch
262
290
  ```
263
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
+
264
301
  ### Choose One (`|`)
265
302
  Pick the best single skill when options are context-dependent.
266
303
 
@@ -1,9 +1,15 @@
1
1
  ---
2
2
  name: accessibility-audit
3
- description: Use when auditing UI components or pages for accessibility compliance, checking WCAG conformance, identifying keyboard navigation issues, color contrast problems, and pre-launch accessibility verification
3
+ description: ⚠️ DEPRECATED — Use fixing-accessibility instead. Previously used for auditing UI components or pages for accessibility compliance.
4
4
  ---
5
5
 
6
- # Accessibility Audit Skill
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`.
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: dcp-hygiene
3
+ description: "Use at command/phase closure points to compress closed exploratory work-streams via the pi-dcp `compress` tool, preserving file:line refs, root causes, decisions, and verification results in the summary. No-ops gracefully when DCP is not installed."
4
+ ---
5
+
6
+ # DCP Hygiene
7
+
8
+ ## When to Use
9
+
10
+ - A slash command's Report/Closure phase just finished writing its artifact (spec.md, plan.md, progress.md, fix.md, audit.md, research.md, etc.) — the exploratory tool output (reads, greps, bash) that produced it is now closed.
11
+ - A long command transitions between phases and the previous phase's detailed output is captured in the next phase's input or an artifact.
12
+ - A workflow loop iteration (e.g. quality-loop) finishes a fix cycle and is about to re-review — accumulated output can be compressed before the next round.
13
+
14
+ ## When NOT to Use
15
+
16
+ - The `compress` tool is not registered (DCP extension not installed, or `compress.permission: "deny"`) — see No-op clause below.
17
+ - The work-stream is still in-flight or spans your most recent turn — DCP turn protection (last 3 turns) already refuses these; don't try.
18
+ - The user just asked about the content you'd be compressing — they still need it verbatim.
19
+ - The command is read-only/scaffold and produced almost no tool output (`/status`, `/close`, `/loop-init`, `/loop-check`, `/loop-review`) — compressing near-empty streams wastes more tokens than it saves.
20
+ - Inside orchestrator workflows' phase prompts — subagents carry their own context; only the orchestrator's accumulated summaries matter, and those are bounded by "Keep under N words" per prompt.
21
+
22
+ ## Core Principle
23
+
24
+ **Compress closed work, preserve the facts that produced it.**
25
+
26
+ A compress call only pays off when (a) the tool output is genuinely closed and (b) the summary keeps every fact a later turn might need. A lossy summary that drops a file:line or a root cause is worse than no compression — it forces a re-read.
27
+
28
+ ## The Compress Protocol (range mode)
29
+
30
+ DCP's default `compress.mode` is `"range"` — pass the FIRST and LAST tool-call IDs of the closed span.
31
+
32
+ 1. **Identify the closed span** — the contiguous block of tool calls from the start of the just-completed phase/section up to (but not including) the current in-flight turn.
33
+ 2. **Pick endpoints** — `startToolCallId` = first call of the span, `endToolCallId` = last call of the span. Everything between (inclusive) is summarized, except protected tools (write/edit/todo/task/skill/compress) which are appended verbatim.
34
+ 3. **Never pick endpoints inside your most recent turn or in-flight work** — DCP refuses these upfront; respect the boundary.
35
+ 4. **Write a lossless-but-terse summary** in the `summary` argument. Include:
36
+ - What was accomplished (one line)
37
+ - **Concrete facts**: file paths, line numbers, error messages, decisions made
38
+ - Root cause / diagnosis (for `/fix`)
39
+ - Verification results (for `/verify`, `/ship`)
40
+ - What is still open / unresolved
41
+ 5. **The replacement applies on the next LLM request** — your current turn still sees the originals, so you can read them while writing the summary.
42
+
43
+ ## What to Preserve (per command)
44
+
45
+ | Command | Must keep in summary |
46
+ |---------|----------------------|
47
+ | `/fix` | root cause with file:line, fix applied, verification results |
48
+ | `/verify` | gate results (typecheck/lint/test pass/fail), completeness score, phantom score |
49
+ | `/ship` | tasks completed/total, commits made, verification gate results, review summary |
50
+ | `/gc` | quality grades (before→after), issue counts by severity, PRs opened |
51
+ | `/audit` | pattern, occurrence count, issues by severity with file:line, recommended fixes |
52
+ | `/research` | questions, answer status + confidence, key insights, sources |
53
+ | `/plan` | discovery level, observable truths, required artifacts, dependency waves |
54
+ | `/init` | detected tech stack, validated commands, created files |
55
+
56
+ ## What NEVER to Compress
57
+
58
+ - Your most recent turn (turn protection: last 3 turns are immune anyway).
59
+ - In-flight work — anything you're still actively reading/editing.
60
+ - Content the user just referenced in their last message.
61
+ - Protected tools' output (write/edit/todo/task/skill/compress) — DCP appends these verbatim regardless, so don't exclude them from your span; just know they survive.
62
+
63
+ ## No-op Clause (portability)
64
+
65
+ This skill must work whether or not DCP is installed:
66
+
67
+ - If the `compress` tool is **not available** in the current tool set, **skip compression entirely**. The artifact (spec.md/plan.md/progress.md/etc.) already captures the durable facts — skipping is correct, not a failure.
68
+ - If `compress` is available but the closed span is tiny (< ~5 tool calls, < ~2k tokens of output), the compress call costs more than it saves — skip.
69
+ - Never error or retry on a missing `compress` tool. Treat it as an optional optimization.
70
+
71
+ ## Procedure
72
+
73
+ ### At a closure point
74
+
75
+ 1. Confirm the work-stream is actually closed (artifact written OR next phase already has the summary it needs).
76
+ 2. Check: is `compress` available? If no → stop here, report "DCP not installed — skipped, artifact captures facts."
77
+ 3. Check: is the span worth it? (≥ ~5 tool calls, ≥ ~2k tokens). If no → skip.
78
+ 4. Call `compress({ startToolCallId, endToolCallId, topic, summary })` with a terse, lossless summary preserving the table above.
79
+ 5. Continue to the next phase/command. The compression applies on the next request.
80
+
81
+ ### At a mid-command phase transition (long commands only: `/ship`, `/fix`, `quality-loop`)
82
+
83
+ 1. Confirm the previous phase's output is fully consumed by the next phase's input (the next prompt references `{phase_N_output}` or the artifact).
84
+ 2. Compress the previous phase's exploratory calls (reads/greps/bash), NOT the phase output summary itself if it's about to be passed forward.
85
+ 3. Proceed to the next phase.
86
+
87
+ ## Pitfalls
88
+
89
+ - **Compressing too early** — before the artifact is written — loses the facts with nowhere captured. Always write the artifact first, then compress what produced it.
90
+ - **Lossy summaries** — dropping file:line or "because" clauses forces expensive re-reads. Terse ≠ incomplete.
91
+ - **Compressing the phase output you're about to pass forward** — the next phase needs it. Compress the *exploratory calls* that produced the output, not the output itself.
92
+ - **Forcing compress when DCP is absent** — errors and wastes a turn. The no-op is the correct behavior.
93
+ - **Compressing inside turn protection** — DCP refuses; don't try to work around it.
94
+ - **Over-compressing short commands** — a 3-call `/status` has nothing worth compressing.
95
+
96
+ ## Verification
97
+
98
+ Before claiming a compress was done correctly:
99
+
100
+ - [ ] `compress` tool was available (else no-op was the correct outcome)
101
+ - [ ] The compressed span was genuinely closed (artifact written or output consumed)
102
+ - [ ] Summary preserves file:line, root cause/decisions, verification results per the table above
103
+ - [ ] No endpoint landed inside the most recent turn or in-flight work
104
+ - [ ] The next phase/command still has everything it needs (no forced re-reads)
105
+
106
+ If `compress` was unavailable and you skipped — that's a successful no-op, not a failure. Report "DCP not installed — artifact captures facts; skipped compression."