@vpxa/aikit 0.1.55 → 0.1.56
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/package.json +1 -1
- package/scaffold/adapters/copilot.mjs +2 -0
- package/scaffold/definitions/tools.mjs +6 -0
- package/scaffold/general/agents/Orchestrator.agent.md +1 -1
- package/scaffold/general/agents/Planner.agent.md +1 -1
- package/scaffold/general/skills/adr-skill/SKILL.md +6 -6
- package/scaffold/general/skills/frontend-design/SKILL.md +237 -237
- package/scaffold/general/skills/lesson-learned/SKILL.md +7 -7
- package/scaffold/general/skills/react/SKILL.md +309 -309
- package/scaffold/general/skills/requirements-clarity/SKILL.md +6 -6
- package/scaffold/general/skills/session-handoff/SKILL.md +7 -7
- package/scaffold/general/skills/typescript/SKILL.md +405 -405
package/package.json
CHANGED
|
@@ -40,6 +40,8 @@ const COPILOT_TOOL_MAP = {
|
|
|
40
40
|
web: 'web/fetch, web/githubRepo',
|
|
41
41
|
todo: 'todo',
|
|
42
42
|
memory: 'vscode/memory',
|
|
43
|
+
newWorkspace: 'vscode/newWorkspace',
|
|
44
|
+
reviewPlan: 'vscode/reviewPlan',
|
|
43
45
|
askQuestions: 'vscode/askQuestions',
|
|
44
46
|
resolveMemoryFileUri: 'vscode/resolveMemoryFileUri',
|
|
45
47
|
runCommand: 'vscode/runCommand',
|
|
@@ -113,6 +113,8 @@ export const IDE_CAPABILITIES = {
|
|
|
113
113
|
'memory',
|
|
114
114
|
'runCommand',
|
|
115
115
|
'switchAgent',
|
|
116
|
+
'newWorkspace',
|
|
117
|
+
'reviewPlan',
|
|
116
118
|
'killTerminal',
|
|
117
119
|
'createTask',
|
|
118
120
|
'terminal',
|
|
@@ -199,6 +201,10 @@ export const IDE_CAPABILITIES = {
|
|
|
199
201
|
'terminal',
|
|
200
202
|
'problems',
|
|
201
203
|
'readFile',
|
|
204
|
+
'reviewPlan',
|
|
205
|
+
'memory',
|
|
206
|
+
'askQuestions',
|
|
207
|
+
'resolveMemoryFileUri',
|
|
202
208
|
'lastCommand',
|
|
203
209
|
'subagent',
|
|
204
210
|
'createFile',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: 'Master conductor that orchestrates the full development lifecycle: Planning → Implementation → Review → Recovery → Commit'
|
|
3
|
-
tools: [vscode/memory, vscode/runCommand, vscode/switchAgent, execute/killTerminal, execute/createAndRunTask, execute/runInTerminal, read/terminalSelection, read/terminalLastCommand, read/problems, read/readFile, agent/runSubagent, edit/createFile, edit/editFiles, edit/rename, edit/createDirectory, search/changes, search/codebase, search/usages, web/fetch, web/githubRepo, todo, search/searchSubagent, search/textSearch, browser/openBrowserPage, browser/readPage, browser/screenshotPage, browser/navigatePage, browser/clickElement, browser/dragElement, browser/hoverElement, browser/typeInPage, browser/runPlaywrightCode, browser/handleDialog, vscode/askQuestions, vscode/resolveMemoryFileUri, aikit/*]
|
|
3
|
+
tools: [vscode/memory, vscode/runCommand, vscode/switchAgent, vscode/newWorkspace, vscode/reviewPlan, execute/killTerminal, execute/createAndRunTask, execute/runInTerminal, read/terminalSelection, read/terminalLastCommand, read/problems, read/readFile, agent/runSubagent, edit/createFile, edit/editFiles, edit/rename, edit/createDirectory, search/changes, search/codebase, search/usages, web/fetch, web/githubRepo, todo, search/searchSubagent, search/textSearch, browser/openBrowserPage, browser/readPage, browser/screenshotPage, browser/navigatePage, browser/clickElement, browser/dragElement, browser/hoverElement, browser/typeInPage, browser/runPlaywrightCode, browser/handleDialog, vscode/askQuestions, vscode/resolveMemoryFileUri, aikit/*]
|
|
4
4
|
model: Claude Opus 4.6 (copilot)
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: 'Autonomous planner that researches codebases and writes comprehensive TDD implementation plans'
|
|
3
|
-
tools: [execute/runInTerminal, read/problems, read/readFile, read/terminalLastCommand, agent/runSubagent, edit/createFile, edit/editFiles, edit/rename, edit/createDirectory, search/changes, search/codebase, search/usages, web/fetch, web/githubRepo, todo, search/searchSubagent, browser/openBrowserPage, browser/readPage, browser/screenshotPage, browser/navigatePage, browser/clickElement, browser/dragElement, browser/hoverElement, browser/typeInPage, browser/runPlaywrightCode, browser/handleDialog, aikit/*]
|
|
3
|
+
tools: [execute/runInTerminal, read/problems, read/readFile, vscode/reviewPlan, vscode/memory, vscode/askQuestions, vscode/resolveMemoryFileUri, read/terminalLastCommand, agent/runSubagent, edit/createFile, edit/editFiles, edit/rename, edit/createDirectory, search/changes, search/codebase, search/usages, web/fetch, web/githubRepo, todo, search/searchSubagent, browser/openBrowserPage, browser/readPage, browser/screenshotPage, browser/navigatePage, browser/clickElement, browser/dragElement, browser/hoverElement, browser/typeInPage, browser/runPlaywrightCode, browser/handleDialog, aikit/*]
|
|
4
4
|
model: Claude Opus 4.6 (copilot)
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
name: adr-skill
|
|
3
3
|
description: Create and maintain Architecture Decision Records (ADRs) optimized for agentic coding workflows. Use when you need to propose, write, update, accept/reject, deprecate, or supersede an ADR; bootstrap an adr folder and index; consult existing ADRs before implementing changes; or enforce ADR conventions. This skill uses Socratic questioning to capture intent before drafting, and validates output against an agent-readiness checklist.
|
|
4
4
|
metadata:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
category: cross-cutting
|
|
6
|
+
domain: general
|
|
7
|
+
applicability: on-demand
|
|
8
|
+
inputs: [decisions, context]
|
|
9
|
+
outputs: [adr-document]
|
|
10
|
+
relatedSkills: [c4-architecture]
|
|
11
11
|
internal: true
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -1,237 +1,237 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: frontend-design
|
|
3
|
-
description: "Comprehensive frontend design system — visual design thinking, typography, color, layout, motion, accessibility, performance, and anti-pattern detection."
|
|
4
|
-
metadata:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# Frontend Design
|
|
14
|
-
|
|
15
|
-
> Comprehensive frontend design system — visual design thinking, typography, color, layout, motion, accessibility, performance, and anti-pattern detection. Synthesized from Anthropic's frontend-design skill, Vercel Web Interface Guidelines, and Impeccable design patterns.
|
|
16
|
-
|
|
17
|
-
## When to Use
|
|
18
|
-
|
|
19
|
-
**MANDATORY** for the Frontend agent on every task. Also use when:
|
|
20
|
-
- Building any UI component, page, or layout
|
|
21
|
-
- Styling, theming, or visual design work
|
|
22
|
-
- Reviewing UI for quality, accessibility, or design consistency
|
|
23
|
-
- User says "make it look good", "design", "UI", "styling", "responsive", "dark mode", "animation"
|
|
24
|
-
|
|
25
|
-
## Context Gathering Protocol
|
|
26
|
-
|
|
27
|
-
Before any design work, gather answers to these questions (infer from codebase if user doesn't specify):
|
|
28
|
-
|
|
29
|
-
1. **Design System** — Does one exist? Tokens, variables, component library?
|
|
30
|
-
2. **Brand Guidelines** — Colors, fonts, logo usage, tone?
|
|
31
|
-
3. **Accessibility Requirements** — WCAG level (AA default), assistive tech?
|
|
32
|
-
4. **Responsive Breakpoints** — Mobile-first? Specific breakpoints?
|
|
33
|
-
5. **Motion Preferences** — Animation budget, reduced-motion support?
|
|
34
|
-
6. **Content Model** — CMS, static, dynamic, i18n?
|
|
35
|
-
7. **Dark Mode** — Required? System preference detection?
|
|
36
|
-
8. **Target Platforms** — Desktop, mobile web, tablet, native?
|
|
37
|
-
|
|
38
|
-
## Design Thinking Process
|
|
39
|
-
|
|
40
|
-
Follow this cycle: **Understand → Explore → Evaluate → Refine**
|
|
41
|
-
|
|
42
|
-
1. **Understand** — What is the user trying to accomplish? What are the constraints?
|
|
43
|
-
2. **Explore** — Generate at minimum 2-3 distinct design directions. Name each direction. Describe the aesthetic and rationale.
|
|
44
|
-
3. **Evaluate** — Compare against requirements, accessibility, performance, and the AI Slop Test.
|
|
45
|
-
4. **Refine** — Iterate on the chosen direction. Polish details.
|
|
46
|
-
|
|
47
|
-
## Typography
|
|
48
|
-
|
|
49
|
-
### Hierarchy
|
|
50
|
-
- Use a **clear scale**: display → h1 → h2 → h3 → body → caption → overline
|
|
51
|
-
- Maximum **3 font sizes** per viewport visible at once
|
|
52
|
-
- Use `font-weight` to create hierarchy within same size
|
|
53
|
-
- Line height: 1.5 for body text, 1.2-1.3 for headings
|
|
54
|
-
- **Fluid typography**: use `clamp()` for responsive sizing — e.g., `clamp(1rem, 2.5vw, 1.5rem)`
|
|
55
|
-
|
|
56
|
-
### Rules
|
|
57
|
-
- Never use more than 2 typeface families
|
|
58
|
-
- Ensure minimum **16px** body text on mobile
|
|
59
|
-
- Use `rem` for font sizes, `em` for component-relative spacing
|
|
60
|
-
- Monospace only for code: use a dedicated code font family
|
|
61
|
-
- Set `max-width: 65ch` on text blocks for readability
|
|
62
|
-
- Use `text-wrap: balance` on headings, `text-wrap: pretty` on body
|
|
63
|
-
- Provide room for **text expansion** (50%+) for i18n
|
|
64
|
-
|
|
65
|
-
## Color
|
|
66
|
-
|
|
67
|
-
### 60-30-10 Rule
|
|
68
|
-
- **60%** — Background/surface (neutral)
|
|
69
|
-
- **30%** — Secondary/container (brand subtle)
|
|
70
|
-
- **10%** — Accent/CTA (brand strong)
|
|
71
|
-
|
|
72
|
-
### Systematic Color
|
|
73
|
-
- Define colors as design tokens with semantic names: `--color-surface`, `--color-text-primary`, `--color-accent`
|
|
74
|
-
- Every color needs **4.5:1 contrast ratio** minimum (WCAG AA) for text
|
|
75
|
-
- Non-text elements need **3:1** minimum
|
|
76
|
-
- Never rely on color alone to convey information — pair with icons, text, or patterns
|
|
77
|
-
- Test with color blindness simulators
|
|
78
|
-
|
|
79
|
-
### Dark Mode
|
|
80
|
-
- Detect system preference with `prefers-color-scheme`
|
|
81
|
-
- Don't just invert — re-design surfaces: dark surfaces get lighter elevation, reduce saturation
|
|
82
|
-
- Smooth transition between modes (CSS transitions on `background-color`, `color`)
|
|
83
|
-
- Diagrams/images: consider `filter: invert(1)` or provide alternate assets
|
|
84
|
-
- Store user preference and sync with system default
|
|
85
|
-
|
|
86
|
-
## Layout & Spacing
|
|
87
|
-
|
|
88
|
-
### Grid System
|
|
89
|
-
- Use an **8px base grid** — all spacing is a multiple of 8 (4px for tight spaces)
|
|
90
|
-
- CSS Grid for 2D layouts, Flexbox for 1D alignment
|
|
91
|
-
- Consistent spacing tokens: `--space-xs: 4px`, `--space-sm: 8px`, `--space-md: 16px`, `--space-lg: 24px`, `--space-xl: 32px`, `--space-2xl: 48px`, `--space-3xl: 64px`
|
|
92
|
-
|
|
93
|
-
### Responsive Design
|
|
94
|
-
- **Mobile-first**: design for 320px, scale up
|
|
95
|
-
- Breakpoints: only add when the layout breaks, not at device widths
|
|
96
|
-
- Use `container queries` for component-level responsiveness
|
|
97
|
-
- Fluid layouts with `minmax()`, `auto-fill`, `auto-fit`
|
|
98
|
-
- Every interactive target: minimum **44×44px** touch area (WCAG 2.5.5)
|
|
99
|
-
|
|
100
|
-
### Rules
|
|
101
|
-
- Use consistent gutters — don't mix random padding values
|
|
102
|
-
- Stacking: define a z-index scale (e.g., base: 0, dropdown: 100, modal: 200, toast: 300)
|
|
103
|
-
- Avoid magic numbers — extract to named tokens
|
|
104
|
-
|
|
105
|
-
## Motion & Animation
|
|
106
|
-
|
|
107
|
-
### Principles
|
|
108
|
-
- **Purpose before polish** — every animation must serve a purpose: orientation, feedback, continuity, or delight
|
|
109
|
-
- **Spring physics** over linear easing — use `cubic-bezier(0.175, 0.885, 0.32, 1.275)` or spring-based libraries
|
|
110
|
-
- Duration budget: micro-interactions **100-200ms**, transitions **200-400ms**, page transitions **300-500ms**
|
|
111
|
-
- Never exceed **500ms** unless it's a storytelling/onboarding animation
|
|
112
|
-
|
|
113
|
-
### Performance
|
|
114
|
-
- Animate only `transform` and `opacity` — these run on the compositor thread
|
|
115
|
-
- Never animate `width`, `height`, `top`, `left`, `margin`, `padding` (trigger layout)
|
|
116
|
-
- Use `will-change` sparingly and only before the animation starts
|
|
117
|
-
- `requestAnimationFrame` for JS animations
|
|
118
|
-
|
|
119
|
-
### Accessibility
|
|
120
|
-
- **Always respect `prefers-reduced-motion`**: reduce or remove animations when set
|
|
121
|
-
- Layout animations: use `layout` prop (Framer Motion) or FLIP technique
|
|
122
|
-
- Skeleton screens during loading — never an empty blank page
|
|
123
|
-
- Skeleton loading → content: smooth fade transition, not a hard swap
|
|
124
|
-
|
|
125
|
-
### Patterns
|
|
126
|
-
- Enter/exit transitions with stagger for lists
|
|
127
|
-
- Shared element transitions between route changes
|
|
128
|
-
- Micro-interactions on hover/focus: subtle scale, bg-color shift, shadow change
|
|
129
|
-
- Pull-to-refresh, swipe gestures (mobile) with physics-based feel
|
|
130
|
-
|
|
131
|
-
## Accessibility (WCAG AA Mandatory)
|
|
132
|
-
|
|
133
|
-
### Structure
|
|
134
|
-
- Use **semantic HTML**: `header`, `nav`, `main`, `section`, `article`, `aside`, `footer`
|
|
135
|
-
- Every `<img>` has a meaningful `alt` (or `alt=""` for decorative)
|
|
136
|
-
- Every form field has a visible `<label>` (not just placeholder)
|
|
137
|
-
- Headings form a logical hierarchy (`h1` → `h2` → `h3`, no skipping)
|
|
138
|
-
|
|
139
|
-
### Keyboard Navigation
|
|
140
|
-
- All interactive elements reachable via **Tab** key
|
|
141
|
-
- Logical tab order (follows visual reading order)
|
|
142
|
-
- Focus indicators: visible, high-contrast, never `outline: none` without replacement
|
|
143
|
-
- Escape to close modals/dropdowns, Enter/Space to activate
|
|
144
|
-
- Skip-to-content link for screen readers
|
|
145
|
-
|
|
146
|
-
### Screen Readers
|
|
147
|
-
- ARIA labels on icons-only buttons: `aria-label="Close"`
|
|
148
|
-
- Live regions for dynamic content: `aria-live="polite"` for updates, `"assertive"` for errors
|
|
149
|
-
- Landmark roles if semantic HTML is insufficient
|
|
150
|
-
- Don't use ARIA when a native HTML element works (`<button>` not `<div role="button">`)
|
|
151
|
-
|
|
152
|
-
### Testing
|
|
153
|
-
- Tab through entire flow without mouse
|
|
154
|
-
- Test with screen reader (NVDA, VoiceOver)
|
|
155
|
-
- Run Lighthouse accessibility audit
|
|
156
|
-
- Test at 200% zoom — nothing should break or overflow
|
|
157
|
-
|
|
158
|
-
## Forms
|
|
159
|
-
|
|
160
|
-
- **Instant inline validation** — validate on blur, not on every keystroke
|
|
161
|
-
- Show error messages below the field, not in an alert
|
|
162
|
-
- Preserve user input on error — never clear a form on submit failure
|
|
163
|
-
- **Auto-save** drafts for long forms (debounced)
|
|
164
|
-
- Use `inputmode` for mobile: `numeric`, `email`, `tel`, `url`
|
|
165
|
-
- Multi-step forms: show progress indicator and allow back-navigation
|
|
166
|
-
- File uploads: drag-and-drop zone, progress indicator, file type restrictions, preview
|
|
167
|
-
- **Optimistic UI**: show success immediately, revert on error
|
|
168
|
-
|
|
169
|
-
## Navigation & State
|
|
170
|
-
|
|
171
|
-
- URL should always reflect application state (`/settings/profile` not `/settings#profile`)
|
|
172
|
-
- Support deep linking — any URL should be shareable and land on the right view
|
|
173
|
-
- Breadcrumbs for hierarchical navigation (3+ levels deep)
|
|
174
|
-
- Keyboard shortcuts for power users (document them)
|
|
175
|
-
- Browser back/forward must work correctly — don't break history
|
|
176
|
-
|
|
177
|
-
## Performance
|
|
178
|
-
|
|
179
|
-
- **Virtual scroll** for lists > 100 items — don't render 10,000 DOM nodes
|
|
180
|
-
- **Lazy load** images: use `loading="lazy"`, provide dimensions to prevent layout shift
|
|
181
|
-
- **Prefetch** next-likely routes on hover/viewport intersection
|
|
182
|
-
- **Code split** by route — each page only loads its own JavaScript
|
|
183
|
-
- **Edge rendering** — render at the CDN edge when possible (SSR, RSC)
|
|
184
|
-
- Optimize images: use `<picture>` with WebP/AVIF + fallback
|
|
185
|
-
- Font loading: `font-display: swap`, preload critical fonts
|
|
186
|
-
- Target LCP < 2.5s, INP < 200ms, CLS < 0.1
|
|
187
|
-
|
|
188
|
-
## Error Handling
|
|
189
|
-
|
|
190
|
-
- **Graceful degradation** — partial failures shouldn't crash the entire page
|
|
191
|
-
- Show retry buttons on transient errors
|
|
192
|
-
- Offline indicator when network is lost
|
|
193
|
-
- Clear error messages: what happened, what the user can do about it
|
|
194
|
-
- Error boundaries in React: catch rendering errors, show fallback UI
|
|
195
|
-
- Never show raw error messages, stack traces, or error codes to users
|
|
196
|
-
|
|
197
|
-
## SSR & Hydration
|
|
198
|
-
|
|
199
|
-
- Prevent hydration mismatches: no `Date.now()`, `Math.random()`, `window` in server render
|
|
200
|
-
- Use streaming SSR for faster TTFB
|
|
201
|
-
- Optimistic mutations: update UI before server confirms
|
|
202
|
-
- Handle loading states with Suspense boundaries
|
|
203
|
-
|
|
204
|
-
## Internationalization (i18n)
|
|
205
|
-
|
|
206
|
-
- **RTL support**: use logical properties (`margin-inline-start` not `margin-left`)
|
|
207
|
-
- Format dates/numbers/currencies locale-aware — never hardcode formats
|
|
208
|
-
- Text expansion room: German/French can be 50%+ longer than English
|
|
209
|
-
- Unicode support: test with CJK, Arabic, emoji
|
|
210
|
-
- Externalize all user-visible strings
|
|
211
|
-
|
|
212
|
-
## AI Slop Test — MANDATORY CHECK
|
|
213
|
-
|
|
214
|
-
Before shipping ANY design, verify it does NOT have these AI-generated tells:
|
|
215
|
-
|
|
216
|
-
| AI Slop Pattern | What to check |
|
|
217
|
-
|-----------------|---------------|
|
|
218
|
-
| Centered hero + gradient blob | Does it look like every AI demo landing page? ADD ASYMMETRY |
|
|
219
|
-
| Lowercase geometric sans headings | Add personality: case choices, weight variation, size contrast |
|
|
220
|
-
| Purple-to-blue gradient | If using gradients, use brand-specific or creative color stops |
|
|
221
|
-
| Uniform card grid with icon + heading + text | Vary card sizes, add imagery, break the grid |
|
|
222
|
-
| Stock illustration style | Use real photos, custom illustrations, or no imagery |
|
|
223
|
-
| "Modern SaaS template" look | Add something unexpected: editorial layout, bold typography, color blocking |
|
|
224
|
-
| Generic placeholder copy | Real content or clearly marked FPO (For Placement Only) |
|
|
225
|
-
| Identical padding everywhere | Vary rhythm — tight grouping inside sections, generous between |
|
|
226
|
-
| No texture or depth | Add subtle noise, shadows, borders, layering |
|
|
227
|
-
| Perfectly symmetrical everything | Break symmetry deliberately — offset grids, varied alignments |
|
|
228
|
-
|
|
229
|
-
If 3+ items match → **STOP and redesign**. The goal is distinctive, not generic.
|
|
230
|
-
|
|
231
|
-
## Implementation Principles
|
|
232
|
-
|
|
233
|
-
1. **Design tokens before code** — define variables/tokens first, then use them everywhere
|
|
234
|
-
2. **Component boundaries** — each component owns its internal layout, parent owns its placement
|
|
235
|
-
3. **Progressive enhancement** — works without JS, enhanced with JS
|
|
236
|
-
4. **Content-first** — design with real content, not lorem ipsum
|
|
237
|
-
5. **Test in context** — view components inside the actual page, not just in isolation
|
|
1
|
+
---
|
|
2
|
+
name: frontend-design
|
|
3
|
+
description: "Comprehensive frontend design system — visual design thinking, typography, color, layout, motion, accessibility, performance, and anti-pattern detection."
|
|
4
|
+
metadata:
|
|
5
|
+
category: domain
|
|
6
|
+
domain: frontend
|
|
7
|
+
applicability: on-demand
|
|
8
|
+
inputs: [ui-requirements, codebase]
|
|
9
|
+
outputs: [design-guidance, patterns]
|
|
10
|
+
relatedSkills: [react]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Frontend Design
|
|
14
|
+
|
|
15
|
+
> Comprehensive frontend design system — visual design thinking, typography, color, layout, motion, accessibility, performance, and anti-pattern detection. Synthesized from Anthropic's frontend-design skill, Vercel Web Interface Guidelines, and Impeccable design patterns.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
**MANDATORY** for the Frontend agent on every task. Also use when:
|
|
20
|
+
- Building any UI component, page, or layout
|
|
21
|
+
- Styling, theming, or visual design work
|
|
22
|
+
- Reviewing UI for quality, accessibility, or design consistency
|
|
23
|
+
- User says "make it look good", "design", "UI", "styling", "responsive", "dark mode", "animation"
|
|
24
|
+
|
|
25
|
+
## Context Gathering Protocol
|
|
26
|
+
|
|
27
|
+
Before any design work, gather answers to these questions (infer from codebase if user doesn't specify):
|
|
28
|
+
|
|
29
|
+
1. **Design System** — Does one exist? Tokens, variables, component library?
|
|
30
|
+
2. **Brand Guidelines** — Colors, fonts, logo usage, tone?
|
|
31
|
+
3. **Accessibility Requirements** — WCAG level (AA default), assistive tech?
|
|
32
|
+
4. **Responsive Breakpoints** — Mobile-first? Specific breakpoints?
|
|
33
|
+
5. **Motion Preferences** — Animation budget, reduced-motion support?
|
|
34
|
+
6. **Content Model** — CMS, static, dynamic, i18n?
|
|
35
|
+
7. **Dark Mode** — Required? System preference detection?
|
|
36
|
+
8. **Target Platforms** — Desktop, mobile web, tablet, native?
|
|
37
|
+
|
|
38
|
+
## Design Thinking Process
|
|
39
|
+
|
|
40
|
+
Follow this cycle: **Understand → Explore → Evaluate → Refine**
|
|
41
|
+
|
|
42
|
+
1. **Understand** — What is the user trying to accomplish? What are the constraints?
|
|
43
|
+
2. **Explore** — Generate at minimum 2-3 distinct design directions. Name each direction. Describe the aesthetic and rationale.
|
|
44
|
+
3. **Evaluate** — Compare against requirements, accessibility, performance, and the AI Slop Test.
|
|
45
|
+
4. **Refine** — Iterate on the chosen direction. Polish details.
|
|
46
|
+
|
|
47
|
+
## Typography
|
|
48
|
+
|
|
49
|
+
### Hierarchy
|
|
50
|
+
- Use a **clear scale**: display → h1 → h2 → h3 → body → caption → overline
|
|
51
|
+
- Maximum **3 font sizes** per viewport visible at once
|
|
52
|
+
- Use `font-weight` to create hierarchy within same size
|
|
53
|
+
- Line height: 1.5 for body text, 1.2-1.3 for headings
|
|
54
|
+
- **Fluid typography**: use `clamp()` for responsive sizing — e.g., `clamp(1rem, 2.5vw, 1.5rem)`
|
|
55
|
+
|
|
56
|
+
### Rules
|
|
57
|
+
- Never use more than 2 typeface families
|
|
58
|
+
- Ensure minimum **16px** body text on mobile
|
|
59
|
+
- Use `rem` for font sizes, `em` for component-relative spacing
|
|
60
|
+
- Monospace only for code: use a dedicated code font family
|
|
61
|
+
- Set `max-width: 65ch` on text blocks for readability
|
|
62
|
+
- Use `text-wrap: balance` on headings, `text-wrap: pretty` on body
|
|
63
|
+
- Provide room for **text expansion** (50%+) for i18n
|
|
64
|
+
|
|
65
|
+
## Color
|
|
66
|
+
|
|
67
|
+
### 60-30-10 Rule
|
|
68
|
+
- **60%** — Background/surface (neutral)
|
|
69
|
+
- **30%** — Secondary/container (brand subtle)
|
|
70
|
+
- **10%** — Accent/CTA (brand strong)
|
|
71
|
+
|
|
72
|
+
### Systematic Color
|
|
73
|
+
- Define colors as design tokens with semantic names: `--color-surface`, `--color-text-primary`, `--color-accent`
|
|
74
|
+
- Every color needs **4.5:1 contrast ratio** minimum (WCAG AA) for text
|
|
75
|
+
- Non-text elements need **3:1** minimum
|
|
76
|
+
- Never rely on color alone to convey information — pair with icons, text, or patterns
|
|
77
|
+
- Test with color blindness simulators
|
|
78
|
+
|
|
79
|
+
### Dark Mode
|
|
80
|
+
- Detect system preference with `prefers-color-scheme`
|
|
81
|
+
- Don't just invert — re-design surfaces: dark surfaces get lighter elevation, reduce saturation
|
|
82
|
+
- Smooth transition between modes (CSS transitions on `background-color`, `color`)
|
|
83
|
+
- Diagrams/images: consider `filter: invert(1)` or provide alternate assets
|
|
84
|
+
- Store user preference and sync with system default
|
|
85
|
+
|
|
86
|
+
## Layout & Spacing
|
|
87
|
+
|
|
88
|
+
### Grid System
|
|
89
|
+
- Use an **8px base grid** — all spacing is a multiple of 8 (4px for tight spaces)
|
|
90
|
+
- CSS Grid for 2D layouts, Flexbox for 1D alignment
|
|
91
|
+
- Consistent spacing tokens: `--space-xs: 4px`, `--space-sm: 8px`, `--space-md: 16px`, `--space-lg: 24px`, `--space-xl: 32px`, `--space-2xl: 48px`, `--space-3xl: 64px`
|
|
92
|
+
|
|
93
|
+
### Responsive Design
|
|
94
|
+
- **Mobile-first**: design for 320px, scale up
|
|
95
|
+
- Breakpoints: only add when the layout breaks, not at device widths
|
|
96
|
+
- Use `container queries` for component-level responsiveness
|
|
97
|
+
- Fluid layouts with `minmax()`, `auto-fill`, `auto-fit`
|
|
98
|
+
- Every interactive target: minimum **44×44px** touch area (WCAG 2.5.5)
|
|
99
|
+
|
|
100
|
+
### Rules
|
|
101
|
+
- Use consistent gutters — don't mix random padding values
|
|
102
|
+
- Stacking: define a z-index scale (e.g., base: 0, dropdown: 100, modal: 200, toast: 300)
|
|
103
|
+
- Avoid magic numbers — extract to named tokens
|
|
104
|
+
|
|
105
|
+
## Motion & Animation
|
|
106
|
+
|
|
107
|
+
### Principles
|
|
108
|
+
- **Purpose before polish** — every animation must serve a purpose: orientation, feedback, continuity, or delight
|
|
109
|
+
- **Spring physics** over linear easing — use `cubic-bezier(0.175, 0.885, 0.32, 1.275)` or spring-based libraries
|
|
110
|
+
- Duration budget: micro-interactions **100-200ms**, transitions **200-400ms**, page transitions **300-500ms**
|
|
111
|
+
- Never exceed **500ms** unless it's a storytelling/onboarding animation
|
|
112
|
+
|
|
113
|
+
### Performance
|
|
114
|
+
- Animate only `transform` and `opacity` — these run on the compositor thread
|
|
115
|
+
- Never animate `width`, `height`, `top`, `left`, `margin`, `padding` (trigger layout)
|
|
116
|
+
- Use `will-change` sparingly and only before the animation starts
|
|
117
|
+
- `requestAnimationFrame` for JS animations
|
|
118
|
+
|
|
119
|
+
### Accessibility
|
|
120
|
+
- **Always respect `prefers-reduced-motion`**: reduce or remove animations when set
|
|
121
|
+
- Layout animations: use `layout` prop (Framer Motion) or FLIP technique
|
|
122
|
+
- Skeleton screens during loading — never an empty blank page
|
|
123
|
+
- Skeleton loading → content: smooth fade transition, not a hard swap
|
|
124
|
+
|
|
125
|
+
### Patterns
|
|
126
|
+
- Enter/exit transitions with stagger for lists
|
|
127
|
+
- Shared element transitions between route changes
|
|
128
|
+
- Micro-interactions on hover/focus: subtle scale, bg-color shift, shadow change
|
|
129
|
+
- Pull-to-refresh, swipe gestures (mobile) with physics-based feel
|
|
130
|
+
|
|
131
|
+
## Accessibility (WCAG AA Mandatory)
|
|
132
|
+
|
|
133
|
+
### Structure
|
|
134
|
+
- Use **semantic HTML**: `header`, `nav`, `main`, `section`, `article`, `aside`, `footer`
|
|
135
|
+
- Every `<img>` has a meaningful `alt` (or `alt=""` for decorative)
|
|
136
|
+
- Every form field has a visible `<label>` (not just placeholder)
|
|
137
|
+
- Headings form a logical hierarchy (`h1` → `h2` → `h3`, no skipping)
|
|
138
|
+
|
|
139
|
+
### Keyboard Navigation
|
|
140
|
+
- All interactive elements reachable via **Tab** key
|
|
141
|
+
- Logical tab order (follows visual reading order)
|
|
142
|
+
- Focus indicators: visible, high-contrast, never `outline: none` without replacement
|
|
143
|
+
- Escape to close modals/dropdowns, Enter/Space to activate
|
|
144
|
+
- Skip-to-content link for screen readers
|
|
145
|
+
|
|
146
|
+
### Screen Readers
|
|
147
|
+
- ARIA labels on icons-only buttons: `aria-label="Close"`
|
|
148
|
+
- Live regions for dynamic content: `aria-live="polite"` for updates, `"assertive"` for errors
|
|
149
|
+
- Landmark roles if semantic HTML is insufficient
|
|
150
|
+
- Don't use ARIA when a native HTML element works (`<button>` not `<div role="button">`)
|
|
151
|
+
|
|
152
|
+
### Testing
|
|
153
|
+
- Tab through entire flow without mouse
|
|
154
|
+
- Test with screen reader (NVDA, VoiceOver)
|
|
155
|
+
- Run Lighthouse accessibility audit
|
|
156
|
+
- Test at 200% zoom — nothing should break or overflow
|
|
157
|
+
|
|
158
|
+
## Forms
|
|
159
|
+
|
|
160
|
+
- **Instant inline validation** — validate on blur, not on every keystroke
|
|
161
|
+
- Show error messages below the field, not in an alert
|
|
162
|
+
- Preserve user input on error — never clear a form on submit failure
|
|
163
|
+
- **Auto-save** drafts for long forms (debounced)
|
|
164
|
+
- Use `inputmode` for mobile: `numeric`, `email`, `tel`, `url`
|
|
165
|
+
- Multi-step forms: show progress indicator and allow back-navigation
|
|
166
|
+
- File uploads: drag-and-drop zone, progress indicator, file type restrictions, preview
|
|
167
|
+
- **Optimistic UI**: show success immediately, revert on error
|
|
168
|
+
|
|
169
|
+
## Navigation & State
|
|
170
|
+
|
|
171
|
+
- URL should always reflect application state (`/settings/profile` not `/settings#profile`)
|
|
172
|
+
- Support deep linking — any URL should be shareable and land on the right view
|
|
173
|
+
- Breadcrumbs for hierarchical navigation (3+ levels deep)
|
|
174
|
+
- Keyboard shortcuts for power users (document them)
|
|
175
|
+
- Browser back/forward must work correctly — don't break history
|
|
176
|
+
|
|
177
|
+
## Performance
|
|
178
|
+
|
|
179
|
+
- **Virtual scroll** for lists > 100 items — don't render 10,000 DOM nodes
|
|
180
|
+
- **Lazy load** images: use `loading="lazy"`, provide dimensions to prevent layout shift
|
|
181
|
+
- **Prefetch** next-likely routes on hover/viewport intersection
|
|
182
|
+
- **Code split** by route — each page only loads its own JavaScript
|
|
183
|
+
- **Edge rendering** — render at the CDN edge when possible (SSR, RSC)
|
|
184
|
+
- Optimize images: use `<picture>` with WebP/AVIF + fallback
|
|
185
|
+
- Font loading: `font-display: swap`, preload critical fonts
|
|
186
|
+
- Target LCP < 2.5s, INP < 200ms, CLS < 0.1
|
|
187
|
+
|
|
188
|
+
## Error Handling
|
|
189
|
+
|
|
190
|
+
- **Graceful degradation** — partial failures shouldn't crash the entire page
|
|
191
|
+
- Show retry buttons on transient errors
|
|
192
|
+
- Offline indicator when network is lost
|
|
193
|
+
- Clear error messages: what happened, what the user can do about it
|
|
194
|
+
- Error boundaries in React: catch rendering errors, show fallback UI
|
|
195
|
+
- Never show raw error messages, stack traces, or error codes to users
|
|
196
|
+
|
|
197
|
+
## SSR & Hydration
|
|
198
|
+
|
|
199
|
+
- Prevent hydration mismatches: no `Date.now()`, `Math.random()`, `window` in server render
|
|
200
|
+
- Use streaming SSR for faster TTFB
|
|
201
|
+
- Optimistic mutations: update UI before server confirms
|
|
202
|
+
- Handle loading states with Suspense boundaries
|
|
203
|
+
|
|
204
|
+
## Internationalization (i18n)
|
|
205
|
+
|
|
206
|
+
- **RTL support**: use logical properties (`margin-inline-start` not `margin-left`)
|
|
207
|
+
- Format dates/numbers/currencies locale-aware — never hardcode formats
|
|
208
|
+
- Text expansion room: German/French can be 50%+ longer than English
|
|
209
|
+
- Unicode support: test with CJK, Arabic, emoji
|
|
210
|
+
- Externalize all user-visible strings
|
|
211
|
+
|
|
212
|
+
## AI Slop Test — MANDATORY CHECK
|
|
213
|
+
|
|
214
|
+
Before shipping ANY design, verify it does NOT have these AI-generated tells:
|
|
215
|
+
|
|
216
|
+
| AI Slop Pattern | What to check |
|
|
217
|
+
|-----------------|---------------|
|
|
218
|
+
| Centered hero + gradient blob | Does it look like every AI demo landing page? ADD ASYMMETRY |
|
|
219
|
+
| Lowercase geometric sans headings | Add personality: case choices, weight variation, size contrast |
|
|
220
|
+
| Purple-to-blue gradient | If using gradients, use brand-specific or creative color stops |
|
|
221
|
+
| Uniform card grid with icon + heading + text | Vary card sizes, add imagery, break the grid |
|
|
222
|
+
| Stock illustration style | Use real photos, custom illustrations, or no imagery |
|
|
223
|
+
| "Modern SaaS template" look | Add something unexpected: editorial layout, bold typography, color blocking |
|
|
224
|
+
| Generic placeholder copy | Real content or clearly marked FPO (For Placement Only) |
|
|
225
|
+
| Identical padding everywhere | Vary rhythm — tight grouping inside sections, generous between |
|
|
226
|
+
| No texture or depth | Add subtle noise, shadows, borders, layering |
|
|
227
|
+
| Perfectly symmetrical everything | Break symmetry deliberately — offset grids, varied alignments |
|
|
228
|
+
|
|
229
|
+
If 3+ items match → **STOP and redesign**. The goal is distinctive, not generic.
|
|
230
|
+
|
|
231
|
+
## Implementation Principles
|
|
232
|
+
|
|
233
|
+
1. **Design tokens before code** — define variables/tokens first, then use them everywhere
|
|
234
|
+
2. **Component boundaries** — each component owns its internal layout, parent owns its placement
|
|
235
|
+
3. **Progressive enhancement** — works without JS, enhanced with JS
|
|
236
|
+
4. **Content-first** — design with real content, not lorem ipsum
|
|
237
|
+
5. **Test in context** — view components inside the actual page, not just in isolation
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
name: lesson-learned
|
|
3
3
|
description: "Analyze recent code changes via git history and extract software engineering lessons. Use when the user asks 'what is the lesson here?', 'what can I learn from this?', 'engineering takeaway', 'what did I just learn?', 'reflect on this code', or wants to extract principles from recent work."
|
|
4
4
|
metadata:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
category: cross-cutting
|
|
6
|
+
domain: general
|
|
7
|
+
applicability: on-demand
|
|
8
|
+
inputs: [git-history, code-changes]
|
|
9
|
+
outputs: [engineering-lessons]
|
|
10
|
+
requires: [aikit]
|
|
11
|
+
relatedSkills: [session-handoff]
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
# Lesson Learned
|