@skilly-hand/skilly-hand 0.14.0 → 0.15.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 (28) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/catalog/README.md +4 -2
  3. package/catalog/catalog-index.json +2 -0
  4. package/catalog/skills/frontend-design/SKILL.md +55 -9
  5. package/catalog/skills/frontend-design/agents/component-designer.md +25 -1
  6. package/catalog/skills/frontend-design/agents/design-context-setter.md +156 -0
  7. package/catalog/skills/frontend-design/agents/motion-designer.md +184 -0
  8. package/catalog/skills/frontend-design/agents/visual-refiner.md +137 -0
  9. package/catalog/skills/frontend-design/assets/aesthetic-archetypes.md +155 -0
  10. package/catalog/skills/frontend-design/manifest.json +11 -7
  11. package/catalog/skills/output-optimizer/SKILL.md +159 -0
  12. package/catalog/skills/output-optimizer/manifest.json +33 -0
  13. package/catalog/skills/output-optimizer/references/mode-protocols.md +76 -0
  14. package/catalog/skills/project-security/SKILL.md +163 -0
  15. package/catalog/skills/project-security/assets/generic-ci-security-gate.sh +36 -0
  16. package/catalog/skills/project-security/assets/github-actions-security-gate.yml +38 -0
  17. package/catalog/skills/project-security/assets/gitlab-ci-security-gate.yml +21 -0
  18. package/catalog/skills/project-security/assets/high-risk-files-checklist.md +49 -0
  19. package/catalog/skills/project-security/assets/pre-commit.sample.sh +9 -0
  20. package/catalog/skills/project-security/assets/pre-publish.sample.sh +12 -0
  21. package/catalog/skills/project-security/assets/pre-push.sample.sh +38 -0
  22. package/catalog/skills/project-security/assets/run-security-check.shared.sh +27 -0
  23. package/catalog/skills/project-security/manifest.json +41 -0
  24. package/package.json +1 -1
  25. package/packages/catalog/package.json +1 -1
  26. package/packages/cli/package.json +1 -1
  27. package/packages/core/package.json +1 -1
  28. package/packages/detectors/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -16,6 +16,46 @@ All notable changes to this project are documented in this file.
16
16
  ### Removed
17
17
  - _None._
18
18
 
19
+ ## [0.15.1] - 2026-04-07
20
+ [View on npm](https://www.npmjs.com/package/@skilly-hand/skilly-hand/v/0.15.1)
21
+
22
+ ### Added
23
+ - _None._
24
+
25
+ ### Changed
26
+ - _None._
27
+
28
+ ### Fixed
29
+ - _None._
30
+
31
+ ### Removed
32
+ - _None._
33
+
34
+ ## [0.15.0] - 2026-04-05
35
+ [View on npm](https://www.npmjs.com/package/@skilly-hand/skilly-hand/v/0.15.0)
36
+
37
+ ### Added
38
+
39
+ - **frontend-design skill v1.1.0:** New `design-context-setter` agent for capturing design intent on greenfield projects via a persistent `DESIGN.md` file
40
+ - **frontend-design skill v1.1.0:** New `motion-designer` agent for stack-aware animations and micro-interactions with GPU safety and `prefers-reduced-motion` compliance
41
+ - **frontend-design skill v1.1.0:** New `visual-refiner` agent for post-generation quality evaluation (AI slop detection, interaction state coverage, Nielsen's heuristics, directional refinement)
42
+ - **frontend-design skill v1.1.0:** New `aesthetic-archetypes` reference asset with 8 design archetypes for greenfield project direction
43
+ - Enhanced `component-designer` with aesthetic principles, DESIGN.md integration, and complete interaction-state checklist
44
+
45
+ ### Changed
46
+
47
+ - Updated `AGENTS.md` with expanded frontend-design workflow triggers and routing
48
+ - Updated frontend-design routing map to include optional motion and visual refinement phases
49
+ - Expanded frontend-design auto-invoke triggers to include greenfield setup, motion, and visual refinement scenarios
50
+
51
+ ### Fixed
52
+
53
+ - _None._
54
+
55
+ ### Removed
56
+
57
+ - Removed "Clarification-First Planning Workflow" from `AGENTS.md` (superseded by refined workflows)
58
+
19
59
  ## [0.14.0] - 2026-04-06
20
60
  [View on npm](https://www.npmjs.com/package/@skilly-hand/skilly-hand/v/0.14.0)
21
61
 
package/catalog/README.md CHANGED
@@ -8,8 +8,10 @@ Published portable skills consumed by the `skilly-hand` CLI.
8
8
  | `agents-root-orchestrator` | Author root AGENTS.md as a Where/What/When orchestrator that routes tasks and skill invocation clearly. | core, workflow, orchestration | all |
9
9
  | `angular-guidelines` | Guide Angular code generation and review using latest stable Angular verification and modern framework best practices. | angular, frontend, workflow, best-practices | all |
10
10
  | `figma-mcp-0to1` | Guide users from Figma MCP installation and authentication through first canvas creation, with function-level tool coverage and operational recovery patterns. | figma, mcp, workflow, design | all |
11
- | `frontend-design` | Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. | frontend, design, workflow, ui | all |
12
- | `project-teacher` | Scan the active project and teach any concept, code path, or decision using verified information, interactive questions, and simple explanations. | core, workflow, education | all |
11
+ | `frontend-design` | Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. Supports greenfield projects via DESIGN.md context setup, and includes post-generation motion and visual refinement phases. | frontend, design, workflow, ui, motion, greenfield | all |
12
+ | `output-optimizer` | Optimize output token consumption through compact interpreter modes with controlled expansion when complexity, ambiguity, or risk requires more detail. Trigger: minimizing response verbosity while preserving clarity and correctness. | core, workflow, efficiency, communication | all |
13
+ | `project-security` | Scan project configuration and release surfaces for leak and security risks, and enforce security gates on commit, push, and publish workflows across GitHub, GitLab, npm, pnpm, yarn, and generic CI. Trigger: validating repository security posture, preventing secret leaks, or hardening delivery pipelines. | security, workflow, quality, core | all |
14
+ | `project-teacher` | Scan the active project and teach any concept, code path, or decision using verified information, interactive questions, and simple explanations. Trigger: user asks to explain, understand, clarify, or learn about anything in the project or codebase. | core, workflow, education | all |
13
15
  | `react-guidelines` | Guide React code generation and review using latest stable React verification and modern framework best practices. | react, frontend, workflow, best-practices | all |
14
16
  | `review-rangers` | Review code, decisions, and artifacts through a multi-perspective committee and a domain expert safety guard, then synthesize a structured verdict. | core, workflow, review, quality | all |
15
17
  | `skill-creator` | Create and standardize AI skills with reusable structure, metadata rules, and templates. | core, workflow, authoring | all |
@@ -4,6 +4,8 @@
4
4
  "angular-guidelines",
5
5
  "figma-mcp-0to1",
6
6
  "frontend-design",
7
+ "output-optimizer",
8
+ "project-security",
7
9
  "project-teacher",
8
10
  "react-guidelines",
9
11
  "review-rangers",
@@ -8,10 +8,10 @@ Use this skill when:
8
8
  - You are adding new visual elements that must match the project's existing design language.
9
9
  - You are refactoring styling or structure of frontend code to align with established patterns.
10
10
  - You need to choose between UI components, tokens, or styles already available in the project.
11
+ - You are starting a greenfield project and need to establish a design direction before building.
11
12
 
12
13
  Do not use this skill for:
13
14
 
14
- - Greenfield design system creation with no existing codebase to read from.
15
15
  - Backend, API, or data-layer tasks with no UI surface.
16
16
  - Design tool work (Figma, Sketch) unrelated to code implementation.
17
17
  - Projects where the user has explicitly opted out of stack detection.
@@ -25,17 +25,40 @@ Always run stack detection first. Never skip to design.
25
25
  | Step | Intent | Sub-agent |
26
26
  | --- | --- | --- |
27
27
  | 0 (always first) | Detect framework, UI library, CSS approach, tokens, and existing patterns | [agents/stack-detector.md](agents/stack-detector.md) |
28
+ | 0b (if no DESIGN.md and no existing components) | Gather design intent and create DESIGN.md | [agents/design-context-setter.md](agents/design-context-setter.md) |
28
29
  | 1 (only after confirmation) | Design and implement components using confirmed stack | [agents/component-designer.md](agents/component-designer.md) |
30
+ | 2 (optional) | Add motion and micro-interactions | [agents/motion-designer.md](agents/motion-designer.md) |
31
+ | 3 (optional) | Evaluate quality and refine the output | [agents/visual-refiner.md](agents/visual-refiner.md) |
29
32
 
30
33
  ---
31
34
 
32
35
  ## Standard Execution Sequence
33
36
 
34
37
  1. **Run stack detection** — always start with `stack-detector`, no exceptions.
35
- 2. **Present findings to the user** — surface the detected stack clearly and ask for explicit confirmation.
36
- 3. **If anything is unclear or ambiguous, ask** — do not proceed with partial or uncertain information.
37
- 4. **Scan existing tokens and components** — read what already exists before proposing anything.
38
- 5. **Design with confirmed context only** — hand off to `component-designer` only after step 2 is complete.
38
+ 2. **Check for DESIGN.md** — if it exists, read it before any design work. If it does not exist and the project has no existing components to sample, run `design-context-setter` to create it.
39
+ 3. **Present findings to the user** — surface the detected stack and any DESIGN.md context clearly, then ask for explicit confirmation.
40
+ 4. **If anything is unclear or ambiguous, ask** — do not proceed with partial or uncertain information.
41
+ 5. **Scan existing tokens and components** — read what already exists before proposing anything.
42
+ 6. **Design with confirmed context only** — hand off to `component-designer` only after steps 2–4 are complete.
43
+ 7. **Optionally add motion** — invoke `motion-designer` if the component needs micro-interactions.
44
+ 8. **Optionally refine** — invoke `visual-refiner` for a quality pass before handoff.
45
+
46
+ ---
47
+
48
+ ## DESIGN.md — Persistent Design Brief
49
+
50
+ `DESIGN.md` is a plain Markdown file at the project root that captures the project's design intent: target users, brand personality, aesthetic direction, color strategy, typography intent, spacing philosophy, and motion character.
51
+
52
+ It is created by `design-context-setter` on greenfield projects and can be updated at any time by the user.
53
+
54
+ **Every agent in this skill reads `DESIGN.md` if it exists before making aesthetic decisions.** This prevents design drift between sessions.
55
+
56
+ ```bash
57
+ # Check if DESIGN.md exists before starting work
58
+ cat DESIGN.md 2>/dev/null
59
+ ```
60
+
61
+ If `DESIGN.md` exists, surface its contents in the stack confirmation step. If it conflicts with what the stack detector found (e.g., DESIGN.md says "warm neutrals" but all existing tokens are cool blues), surface the conflict and ask the user which to follow.
39
62
 
40
63
  ---
41
64
 
@@ -46,6 +69,7 @@ Always run stack detection first. Never skip to design.
46
69
  Before writing a single line of UI code or proposing any design, run [agents/stack-detector.md](agents/stack-detector.md).
47
70
 
48
71
  This means:
72
+
49
73
  - Reading `package.json` to identify the framework and installed libraries.
50
74
  - Detecting CSS approach (Tailwind, CSS Modules, styled-components, Sass, vanilla).
51
75
  - Finding existing design tokens (CSS custom properties, theme files, `tokens.json`).
@@ -67,9 +91,10 @@ If the token does not exist in the project, do not invent it. Ask the user: "Thi
67
91
 
68
92
  ### Pattern 3: Confirm Before Every Design Decision
69
93
 
70
- At every fork — layout choice, component variant, color, interaction pattern — if the right answer is not derivable from the existing code, ask the user.
94
+ At every fork — layout choice, component variant, color, interaction pattern — if the right answer is not derivable from the existing code or from `DESIGN.md`, ask the user.
71
95
 
72
96
  Examples of things that require confirmation:
97
+
73
98
  - Which existing component to base a new one on.
74
99
  - Whether to use Tailwind utility classes or a CSS module.
75
100
  - Whether to match a specific existing page's spacing rhythm or start fresh.
@@ -80,12 +105,15 @@ Short, specific questions are better than long ambiguous ones. One question at a
80
105
  ### Pattern 4: Follow the Project's Visual Language
81
106
 
82
107
  After stack detection, read 3–5 existing components before proposing any design. Identify:
108
+
83
109
  - The naming convention (PascalCase components, BEM CSS, camelCase tokens, etc.)
84
110
  - The composition pattern (atomic components, compound components, render props, slots)
85
111
  - The styling approach (co-located styles, global theme, utility-first classes)
86
112
 
87
113
  Every new component or style must feel like it was written by the same team that wrote the existing code — not imported from a different design system.
88
114
 
115
+ If no existing components are found, use `DESIGN.md` as the visual language reference. If neither exists, run `design-context-setter` before proceeding.
116
+
89
117
  ---
90
118
 
91
119
  ## What Not To Do
@@ -95,13 +123,14 @@ These are the most critical rules. Violating any of them produces AI slop.
95
123
  - **Never assume a UI library is present** without verifying it in `package.json`. Shadcn and Radix look similar in JSX — check the deps.
96
124
  - **Never pick colors, fonts, or spacing values not already in the project**. If the project has no purple, do not introduce purple.
97
125
  - **Never use Inter as a default font** unless it is explicitly declared in the project. Inter is a sign of uncontextualized AI output.
98
- - **Never generate a component without reading at least one existing component first**. The project's conventions must be the template.
126
+ - **Never generate a component without reading at least one existing component first** (or DESIGN.md if no components exist). The project's conventions must be the template.
99
127
  - **Never apply a generic layout** (hero + cards + CTA, standard nav + footer) without verifying the project already uses or wants that structure.
100
- - **Never chain design decisions silently**. If one decision implies a downstream choice (e.g. using a grid library implies a layout system), surface it.
128
+ - **Never chain design decisions silently**. If one decision implies a downstream choice (e.g., using a grid library implies a layout system), surface it.
101
129
  - **Never proceed after ambiguity**. If the detected stack is inconsistent (e.g., Tailwind and styled-components both present), stop and ask which one is canonical.
102
130
  - **Never treat a partial stack detection as complete**. If `package.json` was readable but no component files were found, say so and ask for the component directory.
103
131
  - **Never ship a "placeholder" or "you can customize this later" design**. Every value must be intentional and project-derived.
104
132
  - **Never skip the confirmation step** even if the stack looks obvious. One confirmation prevents ten corrections.
133
+ - **Never ignore DESIGN.md when it exists**. It represents deliberate decisions the user has already made.
105
134
 
106
135
  ---
107
136
 
@@ -113,11 +142,17 @@ User asks for UI work
113
142
  NO -> Run stack-detector, present findings, ask for confirmation
114
143
  YES -> Continue
115
144
 
145
+ -> Does DESIGN.md exist?
146
+ YES -> Read it; surface any conflicts with detected stack
147
+ NO -> Are there existing components to sample?
148
+ YES -> Sample them (Pattern 4)
149
+ NO -> Run design-context-setter to create DESIGN.md
150
+
116
151
  Is the requested component similar to an existing one in the project?
117
152
  YES -> Read the existing component, use it as the structural and styling template
118
153
  NO -> Ask the user which existing component is closest, or if this is a net-new pattern
119
154
 
120
- Does the design require a token/value (color, spacing, font) not yet found in the project?
155
+ Does the design require a token/value (color, spacing, font) not yet found in the project or DESIGN.md?
121
156
  YES -> Ask the user: add a new token, use an existing one, or clarify?
122
157
  NO -> Use the existing token
123
158
 
@@ -135,6 +170,10 @@ Is the CSS approach styled-components or CSS-in-JS?
135
170
 
136
171
  Ready to implement?
137
172
  YES -> Hand off to component-designer with full confirmed context
173
+
174
+ After generation:
175
+ -> Does the component need motion? -> Invoke motion-designer
176
+ -> Does the output need a quality pass? -> Invoke visual-refiner
138
177
  ```
139
178
 
140
179
  ---
@@ -192,6 +231,9 @@ grep '"@radix-ui' package.json
192
231
  ## Commands
193
232
 
194
233
  ```bash
234
+ # Check for DESIGN.md at project root
235
+ cat DESIGN.md 2>/dev/null
236
+
195
237
  # Read project dependencies
196
238
  cat package.json | grep -A 50 '"dependencies"'
197
239
 
@@ -213,5 +255,9 @@ find src/components -maxdepth 2 -name "*.tsx" -o -name "*.vue" | head -10
213
255
  ## Resources
214
256
 
215
257
  - Stack detection procedure: [agents/stack-detector.md](agents/stack-detector.md)
258
+ - Design context setup (greenfield): [agents/design-context-setter.md](agents/design-context-setter.md)
216
259
  - Component design rules: [agents/component-designer.md](agents/component-designer.md)
260
+ - Motion and micro-interactions: [agents/motion-designer.md](agents/motion-designer.md)
261
+ - Visual quality refinement: [agents/visual-refiner.md](agents/visual-refiner.md)
217
262
  - Full scan checklist: [assets/stack-scan-checklist.md](assets/stack-scan-checklist.md)
263
+ - Aesthetic archetypes reference: [assets/aesthetic-archetypes.md](assets/aesthetic-archetypes.md)
@@ -8,6 +8,8 @@ If the user asks you to design something and no confirmed stack summary exists,
8
8
  "Before I design anything, I need to scan the project. Running stack detection first."
9
9
  Then invoke stack-detector. Do not skip this, even if the task feels small.
10
10
 
11
+ **Also read `DESIGN.md` before making any aesthetic decisions.** If it exists at the project root, its aesthetic direction, color strategy, and typography intent govern all choices that are not already constrained by the project's existing tokens or components. If `DESIGN.md` conflicts with detected project tokens, surface the conflict to the user before proceeding.
12
+
11
13
  ---
12
14
 
13
15
  ## When to Use
@@ -42,23 +44,39 @@ These rules are absolute. No exceptions without explicit user confirmation.
42
44
 
43
45
  ---
44
46
 
47
+ ## Aesthetic Principles
48
+
49
+ These apply within the constraints of the confirmed stack — they guide choices when multiple options are equally valid.
50
+
51
+ - Prefer generous whitespace over cramped layouts. When in doubt, add more space.
52
+ - Use size and weight to establish hierarchy before reaching for color.
53
+ - One clear visual focus per component — the most important element should be unmistakable.
54
+ - Avoid equal-weight elements. If everything is emphasized, nothing is.
55
+ - When `DESIGN.md` defines a motion character, let it inform transition presence even at this stage — flag it for `motion-designer` rather than omitting it entirely.
56
+
57
+ ---
58
+
45
59
  ## Questioning Protocol
46
60
 
47
61
  At every point of uncertainty, ask the user a short, specific question before proceeding.
48
62
 
49
63
  **Layout questions:**
64
+
50
65
  - "Should this component use the same grid as [ExistingPage], or does it have different spacing requirements?"
51
66
  - "The project breakpoints in tailwind.config are `sm`, `md`, `lg`. Should this component be responsive at all three, or only `md` and above?"
52
67
 
53
68
  **Style questions:**
69
+
54
70
  - "I see `--color-primary` and `--color-accent` in globals.css. Which one should this button use for its default state?"
55
71
  - "The existing Card uses `rounded-md`. Should this modal also use `rounded-md`, or does it need a sharper or rounder corner?"
56
72
 
57
73
  **Interaction / state questions:**
74
+
58
75
  - "Should this component have a loading state? I don't see a Skeleton or Spinner imported in other components — should I add one or skip it?"
59
76
  - "The existing Input has a `disabled` prop. Should this new Select also handle `disabled`?"
60
77
 
61
78
  **Composition questions:**
79
+
62
80
  - "Do you want this to accept children (composable) or receive structured props (data-driven)? The existing Card uses both — which pattern fits here?"
63
81
 
64
82
  One question at a time. Do not front-load a list of 8 questions before starting.
@@ -79,6 +97,11 @@ Before finalizing any output, verify every item:
79
97
  - [ ] No new design tokens were invented without explicit user approval.
80
98
  - [ ] The component was cross-referenced against at least one existing component for structural consistency.
81
99
  - [ ] Accessibility: semantic HTML elements, aria attributes consistent with existing components.
100
+ - [ ] All interactive states handled: hover, focus-visible, active, disabled.
101
+ - [ ] Loading and empty states considered — ask the user if not obvious from the request.
102
+ - [ ] Error state handled where the component can receive or display errors.
103
+ - [ ] If any animation was added, `prefers-reduced-motion` is respected.
104
+ - [ ] `DESIGN.md` was read and its aesthetic direction informed choices where tokens left room for judgment.
82
105
 
83
106
  ---
84
107
 
@@ -89,7 +112,8 @@ A finished component from this agent:
89
112
  - Reads like it was written by the existing team.
90
113
  - Uses the same imports, utilities, and style tokens as the rest of the codebase.
91
114
  - Has no values that can't be traced back to a confirmed project resource.
92
- - Includes no design decisions that weren't explicitly confirmed by the user or directly derived from existing code.
115
+ - Includes no design decisions that weren't explicitly confirmed by the user or directly derived from existing code or `DESIGN.md`.
93
116
  - Has no "you can customize this" placeholder comments.
117
+ - Has all interactive states implemented, not deferred.
94
118
 
95
119
  If the output doesn't meet this bar, it is not done.
@@ -0,0 +1,156 @@
1
+ # Design Context Setter
2
+
3
+ ## Goal
4
+
5
+ Gather the project's design intent once, then write it to `DESIGN.md` at the project root. This file becomes the single source of truth for all design decisions across sessions and across agents. Every other agent in this skill reads `DESIGN.md` before making aesthetic choices.
6
+
7
+ This agent is modeled on how modern AI-first design platforms (Stitch, v0, Galileo) treat a persistent design brief — a short, always-available document that anchors every generation.
8
+
9
+ ---
10
+
11
+ ## When to Use
12
+
13
+ Run this agent when:
14
+
15
+ - `DESIGN.md` does not exist at the project root and the project has no existing components to read style conventions from.
16
+ - The user starts a greenfield project (no `src/components`, no existing UI, blank or near-blank codebase).
17
+ - The user says "let's set up the design" or "define the visual direction" before any component work.
18
+ - The stack detector finds no design tokens and no existing components to sample.
19
+
20
+ Do not run this agent when:
21
+
22
+ - `DESIGN.md` already exists and the user has not asked to update it. Read it instead.
23
+ - The project has existing components — stack detection provides sufficient context for matching.
24
+ - The user has explicitly said "just match what's there."
25
+
26
+ ---
27
+
28
+ ## Check First
29
+
30
+ Before starting the interview, check:
31
+
32
+ ```bash
33
+ # Is DESIGN.md already present?
34
+ cat DESIGN.md 2>/dev/null
35
+
36
+ # Are there existing components to learn from instead?
37
+ find src -name "*.tsx" -o -name "*.vue" -o -name "*.svelte" 2>/dev/null | head -5
38
+ ```
39
+
40
+ If `DESIGN.md` exists, surface it to the user and ask: "A `DESIGN.md` already exists. Should I use it as-is, update it, or start fresh?"
41
+
42
+ If components exist but no `DESIGN.md`, suggest: "I found existing components. I can either read those to infer style conventions, or we can write a `DESIGN.md` to set a deliberate direction. Which do you prefer?"
43
+
44
+ ---
45
+
46
+ ## Interview Protocol
47
+
48
+ Ask these questions one at a time. Do not front-load the full list.
49
+
50
+ **1. Who is this for?**
51
+ "Who are the primary users of this interface? (e.g., technical professionals, general public, enterprise ops teams, consumers aged 25–35)"
52
+
53
+ **2. What does this product do — in one sentence?**
54
+ "Describe the product's core value proposition in a single sentence."
55
+
56
+ **3. What's the brand personality?**
57
+ "Pick 3 adjectives that describe how this interface should feel. Examples: sharp, friendly, calm, bold, minimal, playful, authoritative, warm, precise."
58
+
59
+ **4. Are there any visual references?**
60
+ "Any products, sites, or brands whose aesthetic this should feel close to? (Optional — skip if none.)"
61
+
62
+ **5. What's the accessibility baseline?**
63
+ "Should we target WCAG 2.2 Level AA (standard), AAA (enhanced), or is there a specific requirement? Default is AA."
64
+
65
+ **6. Any hard constraints?**
66
+ "Are there colors, fonts, or patterns that must be used or must be avoided? (brand guidelines, corporate requirements, legal restrictions)"
67
+
68
+ After collecting answers, propose a brief aesthetic direction and ask for confirmation before writing the file.
69
+
70
+ ---
71
+
72
+ ## Output Format
73
+
74
+ Write the following structure to `DESIGN.md` at the project root. Every field must come from user answers — no invented values.
75
+
76
+ ```markdown
77
+ # DESIGN.md
78
+
79
+ > This file is the canonical design brief for this project.
80
+ > All AI agents and contributors should read it before making visual decisions.
81
+ > Update it when the design direction changes.
82
+
83
+ ## Product
84
+
85
+ **What it is:** [one-sentence description]
86
+ **Primary users:** [user description]
87
+
88
+ ## Brand Personality
89
+
90
+ **Adjectives:** [3 adjectives from user]
91
+ **Visual references:** [references, or "none specified"]
92
+
93
+ ## Aesthetic Direction
94
+
95
+ [2–4 sentences written in plain language describing the desired look and feel.
96
+ Derived from the adjectives and references above.
97
+ Example: "Clean, high-contrast layouts with generous whitespace. Typography-driven hierarchy — let size and weight do the work before reaching for color. Warm neutrals, not pure grays. Motion should feel intentional and restrained."]
98
+
99
+ ## Color Strategy
100
+
101
+ > Intent only — not token declarations. Actual color values are determined after stack detection reads the project's existing tokens.
102
+
103
+ **Approach:** [e.g., "Monochromatic with a single warm accent" / "High contrast, dark-first" / "Muted palette, earthy tones" / "To be defined — read from stack tokens"]
104
+ **Accent color intent:** [e.g., "Call-to-action only" / "Interactive states only" / "Not yet defined"]
105
+
106
+ ## Typography Intent
107
+
108
+ > Intent only — not font declarations. Actual font families and sizes are determined after stack detection reads the project's existing tokens or dependencies.
109
+
110
+ **Character:** [e.g., "Geometric sans-serif for clarity" / "Humanist serif for warmth" / "Monospace for technical credibility" / "To be determined from stack"]
111
+ **Scale approach:** [e.g., "Tight utilitarian scale for app UI" / "Dramatic editorial scale for marketing" / "Match existing project scale"]
112
+
113
+ ## Spacing Philosophy
114
+
115
+ [e.g., "Generous whitespace — let content breathe" / "Dense, information-rich — prioritize data density" / "Match existing project rhythm"]
116
+
117
+ ## Motion Character
118
+
119
+ [e.g., "Subtle and purposeful — transitions only, no decorative motion" / "Expressive — micro-interactions on every interaction" / "Minimal — respect reduced-motion by default"]
120
+
121
+ ## Accessibility
122
+
123
+ **Target level:** [WCAG 2.2 AA / AAA / project-specific]
124
+ **Hard constraints:** [any must-have or must-avoid rules from user]
125
+
126
+ ## Notes
127
+
128
+ [Any other constraints, references, or decisions captured during setup]
129
+ ```
130
+
131
+ ---
132
+
133
+ ## After Writing DESIGN.md
134
+
135
+ Tell the user:
136
+
137
+ > `DESIGN.md` has been created at the project root. Every design agent in this skill will read it before making visual decisions. You can edit it at any time — it's plain Markdown.
138
+ >
139
+ > Ready to proceed with stack detection and component design.
140
+
141
+ Then hand off to `stack-detector.md`.
142
+
143
+ **If the assistant cannot write files** (sandboxed or read-only environment): Tell the user the DESIGN.md content that would have been written, and ask them to create the file manually or paste it into the project. Do not block on the write failure — treat the content as confirmed context for the current session even if the file was not persisted.
144
+
145
+ ---
146
+
147
+ ## Updating DESIGN.md
148
+
149
+ If the user asks to update the design direction mid-project:
150
+
151
+ 1. Read the current `DESIGN.md`.
152
+ 2. Ask which section they want to change.
153
+ 3. Make only the requested change — do not rewrite the whole file.
154
+ 4. Confirm the update before writing.
155
+
156
+ Never overwrite the entire file silently.
@@ -0,0 +1,184 @@
1
+ # Motion Designer
2
+
3
+ ## Precondition
4
+
5
+ **Stack detection must be complete before this agent runs.**
6
+
7
+ Motion must be implemented using the animation primitives already available in the project's stack. Never introduce a new animation library without the user's explicit approval.
8
+
9
+ ---
10
+
11
+ ## When to Use
12
+
13
+ Use this agent when:
14
+
15
+ - A component has been generated and the user asks "add animations," "make this feel alive," or "add micro-interactions."
16
+ - You identify that a key interaction is missing feedback (e.g., a button with no active state transition).
17
+ - The user wants to add entrance animations, loading skeletons, or scroll-driven reveals.
18
+ - You need to implement reduced-motion-safe transitions.
19
+
20
+ Do not use this agent when:
21
+
22
+ - Stack detection has not been run.
23
+ - The project has zero animation dependencies and no CSS transition usage in existing components — ask the user before adding anything.
24
+ - The user has explicitly said "no animations."
25
+
26
+ ---
27
+
28
+ ## Animation Stack Detection
29
+
30
+ Before proposing any motion, identify what animation primitives the project already uses.
31
+
32
+ ```bash
33
+ # Check for animation libraries
34
+ grep -E '"framer-motion"|"@motionone/dom"|"gsap"|"animejs"|"motion"' package.json
35
+
36
+ # Check for CSS transitions in existing components
37
+ grep -rn "transition" src/ --include="*.css" --include="*.scss" --include="*.module.css" | head -10
38
+
39
+ # Check for @keyframes usage
40
+ grep -rn "@keyframes" src/ --include="*.css" --include="*.scss" | head -5
41
+
42
+ # Check for Tailwind animation utilities
43
+ grep -n "transition\|duration\|ease\|animate-" src/ --include="*.tsx" --include="*.vue" | head -10
44
+ ```
45
+
46
+ Report what was found:
47
+
48
+ ```
49
+ Animation stack:
50
+ Library: [framer-motion v11 | @motionone/dom | GSAP | none detected]
51
+ CSS approach: [Tailwind transition utilities | CSS custom properties | @keyframes | none]
52
+ Existing patterns: [fade-in on mount | slide transitions | skeleton loaders | none found]
53
+ ```
54
+
55
+ If no animation primitives are found, ask: "This project has no existing animation setup. Should I use CSS transitions only (no new dependencies), or would you like to add a library? If so, which one?"
56
+
57
+ ---
58
+
59
+ ## Opportunity Assessment
60
+
61
+ Evaluate the component for four animation opportunities. Before implementing any of them, summarize what you found and confirm with the user: "I identified N animation opportunities. Here's what I'd add — confirm before I make any changes?" All code changes in this agent require user confirmation, even when framed as feedback fixes.
62
+
63
+ ### 1. Missing Feedback
64
+
65
+ UI actions that complete silently feel broken. Look for:
66
+
67
+ - Buttons with no active/press state visual change
68
+ - Form submissions with no loading indicator
69
+ - Toggle switches with no transition
70
+ - Tabs or accordion panels that snap without transition
71
+
72
+ **Fix**: Add a 100–200ms `transition` on `transform`, `opacity`, or `background-color`. Never animate `width`, `height`, `top`, `left`, `margin`, or `padding` — these trigger layout and cause jank.
73
+
74
+ ### 2. Jarring Transitions
75
+
76
+ Elements that appear/disappear instantly feel glitchy:
77
+
78
+ - Modals, drawers, tooltips that pop in without entrance
79
+ - Dropdown menus that appear with no transition
80
+ - Route changes with no fade
81
+
82
+ **Fix**: 200–350ms `opacity` + `transform: translateY(4px)` entrance. Exit should be faster than entrance (150–250ms).
83
+
84
+ ### 3. Unclear Relationships
85
+
86
+ Motion can communicate hierarchy and causality:
87
+
88
+ - List items that load simultaneously when staggered would feel more natural
89
+ - A parent collapsing without carrying its children
90
+ - A notification appearing without connecting to its trigger
91
+
92
+ **Fix**: Stagger delays of 30–60ms between sibling elements. Keep total stagger duration under 400ms for lists of 6+ items.
93
+
94
+ ### 4. Delight Opportunities
95
+
96
+ Moments where a small motion adds personality without adding noise:
97
+
98
+ - Success state on form submission
99
+ - Empty state illustrations that have a subtle loop
100
+ - First-load entrance for a hero section
101
+
102
+ **Fix**: These are always optional and always ask the user first. Never add delight motion without explicit approval.
103
+
104
+ ---
105
+
106
+ ## Timing Reference
107
+
108
+ | Use Case | Duration | Easing |
109
+ | -------- | -------- | ------ |
110
+ | Button feedback (press, hover) | 100–150ms | ease-out |
111
+ | Tooltip / popover entrance | 150–200ms | ease-out |
112
+ | Dropdown open | 200–250ms | ease-out |
113
+ | Modal / drawer entrance | 250–350ms | cubic-bezier(0.16, 1, 0.3, 1) |
114
+ | Page / route transition | 300–400ms | ease-in-out |
115
+ | Hero entrance (first load) | 500–800ms | cubic-bezier(0.16, 1, 0.3, 1) |
116
+ | Stagger delay between siblings | 30–60ms | — |
117
+
118
+ Never exceed 800ms for any UI transition. If it needs more than 800ms, it is decorative animation, not UI motion — ask the user.
119
+
120
+ ---
121
+
122
+ ## GPU Safety Rules
123
+
124
+ **Only animate these properties** — they are GPU-composited and do not trigger layout:
125
+
126
+ - `transform` (translate, scale, rotate)
127
+ - `opacity`
128
+ - `filter` (use sparingly — can be expensive)
129
+
130
+ **Never animate** layout-triggering properties:
131
+
132
+ - `width`, `height`, `max-height`
133
+ - `top`, `left`, `right`, `bottom`
134
+ - `margin`, `padding`
135
+ - `border-width`
136
+ - `font-size`
137
+
138
+ If you need a height animation (e.g., accordion expand), use `max-height` with caution, or prefer `transform: scaleY()` + `transform-origin: top`.
139
+
140
+ ---
141
+
142
+ ## Reduced Motion — Non-Negotiable
143
+
144
+ Every animation added by this agent must respect `prefers-reduced-motion`. No exceptions.
145
+
146
+ **CSS approach:**
147
+
148
+ ```css
149
+ @media (prefers-reduced-motion: reduce) {
150
+ .animated-element {
151
+ transition: none;
152
+ animation: none;
153
+ }
154
+ }
155
+ ```
156
+
157
+ **Tailwind approach:**
158
+
159
+ ```html
160
+ <div class="transition-opacity duration-200 motion-reduce:transition-none">
161
+ ```
162
+
163
+ **Framer Motion approach:**
164
+
165
+ ```tsx
166
+ const shouldReduce = useReducedMotion();
167
+ <motion.div animate={shouldReduce ? {} : { opacity: 1, y: 0 }} />
168
+ ```
169
+
170
+ If the existing project has no `prefers-reduced-motion` handling anywhere, note it and add it to every animation you introduce.
171
+
172
+ ---
173
+
174
+ ## Implementation Checklist
175
+
176
+ Before finalizing any motion work:
177
+
178
+ - [ ] All animation primitives are from the confirmed stack — no new dependencies added without approval.
179
+ - [ ] No layout-triggering properties are animated.
180
+ - [ ] All animations have a `prefers-reduced-motion` fallback.
181
+ - [ ] Timing values are within the reference ranges above.
182
+ - [ ] Delight animations were explicitly approved by the user.
183
+ - [ ] No animation duration exceeds 800ms.
184
+ - [ ] Stagger lists cap total duration at 400ms.