@sayknow-cli/coding-agent 0.5.13 → 0.5.15

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 (41) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/types/cli/setup-cli.d.ts +1 -1
  3. package/dist/types/defaults/skc-ui-skills.d.ts +12 -0
  4. package/dist/types/hooks/native-skill-hook.d.ts +1 -0
  5. package/dist/types/hooks/ui-skill-keywords.d.ts +84 -0
  6. package/dist/types/session-import/redact.d.ts +1 -1
  7. package/dist/types/setup/external-ui-skills.d.ts +37 -0
  8. package/package.json +7 -7
  9. package/src/cli/setup-cli.ts +22 -1
  10. package/src/cli/skills-cli.ts +29 -10
  11. package/src/commands/setup.ts +1 -0
  12. package/src/defaults/skc/ui-skills/LICENSE.appllama +21 -0
  13. package/src/defaults/skc/ui-skills/LICENSE.emilkowalski +21 -0
  14. package/src/defaults/skc/ui-skills/NOTICE.md +43 -0
  15. package/src/defaults/skc/ui-skills/animate/SKILL.md +536 -0
  16. package/src/defaults/skc/ui-skills/animation-vocabulary/SKILL.md +178 -0
  17. package/src/defaults/skc/ui-skills/apple-design/SKILL.md +285 -0
  18. package/src/defaults/skc/ui-skills/appllama-app-design-skill/SKILL.md +821 -0
  19. package/src/defaults/skc/ui-skills/ask-sonner/SKILL.md +157 -0
  20. package/src/defaults/skc/ui-skills/emil-design-eng/SKILL.md +671 -0
  21. package/src/defaults/skc/ui-skills/find-animation-opportunities/SKILL.md +137 -0
  22. package/src/defaults/skc/ui-skills/improve-animations/SKILL.md +305 -0
  23. package/src/defaults/skc/ui-skills/mobile-native/SKILL.md +308 -0
  24. package/src/defaults/skc/ui-skills/pick-ui-library/SKILL.md +82 -0
  25. package/src/defaults/skc/ui-skills/prototype/SKILL.md +300 -0
  26. package/src/defaults/skc/ui-skills/react-bits/SKILL.md +113 -0
  27. package/src/defaults/skc/ui-skills/review-animations/SKILL.md +312 -0
  28. package/src/defaults/skc-ui-skills.ts +108 -0
  29. package/src/extensibility/runtime-skill-discovery.ts +8 -2
  30. package/src/hooks/native-skill-hook.ts +21 -0
  31. package/src/hooks/ui-skill-keywords.ts +316 -0
  32. package/src/internal-urls/docs-index.generated.ts +1 -1
  33. package/src/prompts/agents/architect.md +1 -0
  34. package/src/prompts/agents/critic.md +1 -0
  35. package/src/prompts/agents/executor.md +1 -0
  36. package/src/prompts/agents/planner.md +1 -0
  37. package/src/prompts/system/system-prompt.md +1 -0
  38. package/src/prompts/tools/skill.md +2 -2
  39. package/src/sdk/session.ts +7 -5
  40. package/src/session-import/redact.ts +11 -6
  41. package/src/setup/external-ui-skills.ts +132 -0
@@ -0,0 +1,312 @@
1
+ ---
2
+ name: review-animations
3
+ description: Reviews animation and motion code against a high craft bar derived from Emil Kowalski's design engineering philosophy. Default to flagging; approval is earned.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Reviewing Animations
8
+
9
+ ## SKC invocation
10
+
11
+ SKC loads this skill automatically for matching frontend UI/UX work.
12
+ Do not wait for a follow-up question. Apply the craft rules immediately
13
+ and keep going on the user's actual task.
14
+
15
+ This skill's companion reference files are appended inline at the end of
16
+ this document. Read them there; they are not separate files on disk.
17
+
18
+
19
+ ## Operating Posture
20
+
21
+ You are a senior design engineer with a brutal eye for craft. Your bias is toward **motion that feels right**, not motion that merely runs. A transition that "works" but feels sluggish, lands from the wrong origin, fires too often, or drops frames is a regression, not a pass. Default to flagging. Approval is earned, not assumed.
22
+
23
+ The substantive bar comes from Emil Kowalski's animation philosophy (animations.dev). The review *method* — non-negotiable standards, escalation triggers, a remedial hierarchy, tiered output, and explicit approval criteria — is adapted from aggressive code-quality review.
24
+
25
+ For the full rule catalog (easing curves, duration tables, spring config, gestures, clip-path, performance, a11y), see [STANDARDS.md](#appendix-standards-md). Load it whenever a finding needs a precise value or citation.
26
+
27
+ ## The Ten Non-Negotiable Standards
28
+
29
+ Every animation in the diff is measured against these. A violation is a finding.
30
+
31
+ 1. **Justified motion.** Every animation must answer "why does this animate?" — spatial consistency, state indication, feedback, explanation, or preventing a jarring change. "It looks cool" on a frequently-seen element is a block.
32
+
33
+ 2. **Frequency-appropriate.** Match motion to how often it's seen. Keyboard-initiated and 100+/day actions get **no** animation. Tens/day gets reduced motion. Occasional gets standard. Rare/first-time can have delight.
34
+
35
+ 3. **Responsive easing.** Entering/exiting elements use `ease-out` or a strong custom curve. `ease-in` on UI is a block — it delays the moment the user watches most. Built-in CSS easings are too weak; expect custom cubic-beziers.
36
+
37
+ 4. **Sub-300ms UI.** UI animations stay under 300ms; anything slower on a UI element needs justification or it's a finding. Per-element budgets live in [STANDARDS.md](#appendix-standards-md).
38
+
39
+ 5. **Origin & physical correctness.** Popovers/dropdowns/tooltips scale from their trigger (`transform-origin`), not center. Never animate from `scale(0)` — start from `scale(0.9–0.97)` + opacity (Modals are exempt — they stay centered.)
40
+
41
+ 6. **Interruptibility.** Rapidly-triggered or gesture-driven motion (toasts, toggles, drags) must be interruptible — CSS transitions or springs that retarget from current state, not keyframes that restart from zero.
42
+
43
+ 7. **GPU-only properties.** Animate `transform` and `opacity` only. Animating `width`/`height`/`margin`/`padding`/`top`/`left` (or Framer Motion `x`/`y`/`scale` shorthands under load) is a performance finding.
44
+
45
+ 8. **Accessibility.** `prefers-reduced-motion` is honored (gentler, not zero — keep opacity/color, drop movement). Hover animations are gated behind `@media (hover: hover) and (pointer: fine)`.
46
+
47
+ 9. **Asymmetric enter/exit.** Deliberate actions (a press, a hold, a destructive confirm) animate slower; system responses snap. Symmetric timing on a press-and-release or hold interaction is a finding.
48
+
49
+ 10. **Cohesion.** Motion matches the component's personality and the rest of the product — playful can be bouncier, a dashboard stays crisp. Mismatched personality, or a jarring crossfade where a subtle blur would bridge two states, is a finding. When unsure whether motion feels right, the strongest move is often to delete it.
50
+
51
+ ## Aggressive Escalation Triggers
52
+
53
+ Flag these on sight, hard:
54
+
55
+ - `transition: all` (unbounded property animation)
56
+ - `scale(0)` or pure-fade entrances with no initial transform
57
+ - `ease-in` on any UI interaction; weak built-in easing on a deliberate animation
58
+ - Animation on a keyboard shortcut, command-palette toggle, or 100+/day action
59
+ - UI duration > 300ms with no stated reason
60
+ - `transform-origin: center` on a trigger-anchored popover/dropdown/tooltip
61
+ - Keyframes on toasts, toggles, or anything added/triggered rapidly
62
+ - Animating layout properties (`width`/`height`/`margin`/`padding`/`top`/`left`)
63
+ - Framer Motion `x`/`y`/`scale` props on motion that runs while the page is busy
64
+ - Updating a CSS variable on a parent to drive a child transform (style recalc storm)
65
+ - Missing `prefers-reduced-motion` handling on movement
66
+ - Ungated `:hover` motion
67
+ - Symmetric enter/exit timing on a press-and-release or hold interaction
68
+ - Everything-at-once entrance where a 30–80ms stagger belongs
69
+
70
+ ## Remedial Preference Hierarchy
71
+
72
+ When proposing fixes, prefer earlier moves over later ones:
73
+
74
+ 1. **Delete the animation** (high-frequency / no purpose / keyboard-triggered).
75
+ 2. **Reduce it** — shorter duration, smaller transform, fewer animated properties.
76
+ 3. **Fix the easing** — swap `ease-in`→`ease-out`/custom curve; use a strong cubic-bezier.
77
+ 4. **Fix the origin/physicality** — correct `transform-origin`; replace `scale(0)` with `scale(0.95)`+opacity.
78
+ 5. **Make it interruptible** — keyframes → transitions, or a spring for gesture-driven motion.
79
+ 6. **Move it to the GPU** — layout props → `transform`/`opacity`; shorthand → full `transform` string; WAAPI for programmatic CSS.
80
+ 7. **Asymmetric timing** — slow the deliberate phase, snap the response.
81
+ 8. **Polish** — blur to mask crossfades, stagger for groups, `@starting-style` for entry, spring for "alive" elements.
82
+ 9. **Accessibility & cohesion** — add reduced-motion + hover gating; tune to match the component's personality.
83
+
84
+ ## Required Output Format
85
+
86
+ Two parts, in this order.
87
+
88
+ ### Part 1 — Findings table (REQUIRED)
89
+
90
+ A single markdown table. One row per issue. Never a "Before:/After:" list.
91
+
92
+ | Before | After | Why |
93
+ | --- | --- | --- |
94
+ | `transition: all 300ms` | `transition: transform 200ms ease-out` | Specify exact properties; `all` animates unintended properties off-GPU |
95
+ | `transform: scale(0)` | `transform: scale(0.95); opacity: 0` | Nothing appears from nothing — `scale(0)` looks like it came from nowhere |
96
+ | `ease-in` on dropdown | `ease-out` + custom curve | `ease-in` delays the moment the user watches most; feels sluggish |
97
+ | `transform-origin: center` on popover | `var(--transform-origin)` (Base UI) | Popovers scale from their trigger, not center (modals are exempt) |
98
+
99
+ ### Part 2 — Verdict (REQUIRED)
100
+
101
+ Group remaining commentary by impact tier, highest first. Omit empty tiers.
102
+
103
+ 1. **Feel-breaking regressions** — sluggish easing, comes-from-nowhere, fires on high-frequency/keyboard actions.
104
+ 2. **Missed simplifications** — animations that should be removed or drastically reduced.
105
+ 3. **Performance** — non-GPU properties, dropped-frame risks, recalc storms.
106
+ 4. **Interruptibility & timing** — keyframes where transitions/springs belong; symmetric timing that should be asymmetric.
107
+ 5. **Origin, physicality & cohesion** — wrong origin, mismatched personality, jarring crossfades.
108
+ 6. **Accessibility** — reduced-motion and pointer/hover gating.
109
+
110
+ Close with an explicit decision:
111
+
112
+ - **Block** — any feel-breaking regression, animation on a keyboard/high-frequency action, `scale(0)`/`ease-in` on UI, or a non-GPU animation with an easy GPU fix.
113
+ - **Approve** — no feel-breaking regressions, no obvious motion that should be deleted, durations and easing within bounds, interruptibility handled where needed, reduced-motion respected.
114
+
115
+ Be specific and cite `file:line`. When a value is needed (a curve, a duration, a spring config), pull the exact one from [STANDARDS.md](#appendix-standards-md) rather than approximating.
116
+
117
+ ## Guidelines
118
+
119
+ - Prefer CSS transitions/`@starting-style`/WAAPI for predetermined motion; JS/springs for dynamic, interruptible, gesture-driven motion.
120
+ - When unsure whether motion feels right, recommend reviewing it in slow motion / frame-by-frame and with fresh eyes the next day rather than guessing.
121
+
122
+ ---
123
+
124
+ ## Appendix: STANDARDS.md
125
+
126
+ # Animation Standards Reference
127
+
128
+ The precise values, curves, and rules behind the review. Cite these in findings instead of approximating. Distilled from Emil Kowalski's design engineering philosophy.
129
+
130
+ ## Should it animate? (frequency table)
131
+
132
+ | Frequency | Decision |
133
+ | --- | --- |
134
+ | 100+ times/day (keyboard shortcuts, command palette toggle) | No animation. Ever. |
135
+ | Tens of times/day (hover effects, list navigation) | Remove or drastically reduce |
136
+ | Occasional (modals, drawers, toasts) | Standard animation |
137
+ | Rare / first-time (onboarding, feedback, celebrations) | Can add delight |
138
+
139
+ **Never animate keyboard-initiated actions** — they repeat hundreds of times daily; animation makes them feel slow and disconnected. (Raycast has no open/close animation — correct for something used hundreds of times a day.)
140
+
141
+ Valid purposes for motion: spatial consistency, state indication, explanation, feedback, preventing jarring change. "It looks cool" on a frequently-seen element is not valid.
142
+
143
+ ## Easing
144
+
145
+ Decision order:
146
+ - Entering or exiting → **`ease-out`** (starts fast, feels responsive)
147
+ - Moving / morphing on screen → **`ease-in-out`**
148
+ - Hover / color change → **`ease`**
149
+ - Constant motion (marquee, progress) → **`linear`**
150
+ - Default → **`ease-out`**
151
+
152
+ **Never `ease-in` on UI.** It starts slow, delaying the exact moment the user is watching. `ease-out` at 200ms *feels* faster than `ease-in` at 200ms.
153
+
154
+ Built-in CSS easings are too weak. Use strong custom curves:
155
+
156
+ ```css
157
+ --ease-out: cubic-bezier(0.23, 1, 0.32, 1); /* strong ease-out for UI */
158
+ --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* strong ease-in-out for on-screen movement */
159
+ --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1); /* iOS-like drawer curve (Ionic) */
160
+ ```
161
+
162
+ Find curves at [easing.dev](https://easing.dev/) or [easings.co](https://easings.co/) — don't hand-roll from scratch.
163
+
164
+ ## Duration
165
+
166
+ | Element | Duration |
167
+ | --- | --- |
168
+ | Button press feedback | 100–160ms |
169
+ | Tooltips, small popovers | 125–200ms |
170
+ | Dropdowns, selects | 150–250ms |
171
+ | Modals, drawers | 200–500ms |
172
+ | Marketing / explanatory | Can be longer |
173
+
174
+ **Rule: UI animations stay under 300ms.** A 180ms dropdown feels more responsive than a 400ms one. Faster spinners make load feel faster (same actual time). Instant tooltips after the first (skip delay + animation) make a toolbar feel faster.
175
+
176
+ ## Physicality
177
+
178
+ - **Never `scale(0)`.** Start from `scale(0.9–0.97)` + `opacity: 0`. Nothing in the real world appears from nothing.
179
+ - **Origin-aware popovers.** Scale from the trigger, not center:
180
+ ```css
181
+ .popover { transform-origin: var(--transform-origin); } /* Base UI */
182
+ ```
183
+ **Modals are exempt** — they appear centered in the viewport, keep `transform-origin: center`.
184
+ - **Button press feedback.** `transform: scale(0.97)` on `:active`, `transition: transform 160ms ease-out`. Subtle (0.95–0.98). Applies to any pressable element.
185
+
186
+ ## Springs
187
+
188
+ Feel natural because they simulate physics; no fixed duration — they settle on parameters. Use for: drag with momentum, "alive" elements (Dynamic Island), interruptible gestures, decorative mouse-tracking.
189
+
190
+ ```js
191
+ // Apple-style (easier to reason about) — recommended
192
+ { type: "spring", duration: 0.5, bounce: 0.2 }
193
+
194
+ // Traditional physics (more control)
195
+ { type: "spring", mass: 1, stiffness: 100, damping: 10 }
196
+ ```
197
+
198
+ Keep bounce subtle (0.1–0.3); avoid bounce in most UI — reserve for drag-to-dismiss and playful interactions. Springs maintain velocity when interrupted (keyframes restart from zero), so they're ideal for gestures users may reverse mid-motion.
199
+
200
+ Mouse interactions: interpolate with `useSpring` rather than tying value directly to mouse position (direct = artificial, no momentum). Only do this when the motion is decorative.
201
+
202
+ ## Interruptibility
203
+
204
+ CSS **transitions** can be interrupted and retargeted mid-animation; **keyframes** restart from zero. For anything triggered rapidly (toasts being added, toggles), transitions are smoother.
205
+
206
+ ```css
207
+ /* Interruptible — good for dynamic UI */
208
+ .toast { transition: transform 400ms ease; }
209
+
210
+ /* Not interruptible — avoid for dynamic UI */
211
+ @keyframes slideIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
212
+ ```
213
+
214
+ Use `@starting-style` for entry without JS:
215
+
216
+ ```css
217
+ .toast {
218
+ opacity: 1; transform: translateY(0);
219
+ transition: opacity 400ms ease, transform 400ms ease;
220
+ @starting-style { opacity: 0; transform: translateY(100%); }
221
+ }
222
+ ```
223
+
224
+ Legacy fallback: `useEffect(() => setMounted(true), [])` + `data-mounted` attribute.
225
+
226
+ ## Asymmetric timing
227
+
228
+ Slow where the user is deciding, fast where the system responds.
229
+
230
+ ```css
231
+ .overlay { transition: clip-path 200ms ease-out; } /* release: fast */
232
+ .button:active .overlay { transition: clip-path 2s linear; } /* press: slow, deliberate */
233
+ ```
234
+
235
+ ## Performance
236
+
237
+ - **Only animate `transform` and `opacity`** — they skip layout/paint and run on the GPU. `padding`/`margin`/`height`/`width`/`top`/`left` trigger all three rendering steps.
238
+ - **Don't drive child transforms via a CSS variable on the parent** — it recalcs styles for all children. Set `transform` directly on the element.
239
+ ```js
240
+ element.style.setProperty('--swipe-amount', `${d}px`); // bad: recalc on all children
241
+ element.style.transform = `translateY(${d}px)`; // good: only this element
242
+ ```
243
+ - **Framer Motion shorthands are NOT hardware-accelerated.** `x`/`y`/`scale` run on the main thread via rAF and drop frames under load. Use the full transform string:
244
+ ```jsx
245
+ <motion.div animate={{ x: 100 }} /> // drops frames under load
246
+ <motion.div animate={{ transform: "translateX(100px)" }} /> // hardware accelerated
247
+ ```
248
+ - **CSS animations beat JS under load** — they run off the main thread; rAF-based animations stutter while the browser loads/scripts/paints. Use CSS for predetermined motion, JS for dynamic/interruptible.
249
+ - **WAAPI** gives JS control with CSS performance (hardware-accelerated, interruptible, no library):
250
+ ```js
251
+ element.animate([{ clipPath: 'inset(0 0 100% 0)' }, { clipPath: 'inset(0 0 0 0)' }],
252
+ { duration: 1000, fill: 'forwards', easing: 'cubic-bezier(0.77, 0, 0.175, 1)' });
253
+ ```
254
+
255
+ ## Transforms & clip-path
256
+
257
+ - **`translate` percentages** are relative to the element's own size — `translateY(100%)` moves by the element's height regardless of dimensions (how Sonner/Vaul position toasts/drawers). Prefer over hardcoded px.
258
+ - **`scale()` scales children too** (font, icons, content) — a feature for press feedback.
259
+ - **3D**: `rotateX/Y` + `transform-style: preserve-3d` for depth/orbit/flip without JS.
260
+ - **`clip-path: inset(t r b l)`** is a powerful animation tool: each value eats in from that side. Uses: reveal-on-scroll (`inset(0 0 100% 0)` → `inset(0 0 0 0)`), hold-to-delete overlay, seamless tab color transitions (duplicate + clip the active copy), comparison sliders.
261
+
262
+ ## Gestures & drag
263
+
264
+ - **Momentum dismissal**: don't require crossing a distance threshold — compute velocity (`Math.abs(distance)/elapsedMs`); dismiss if `> ~0.11`. A flick should be enough.
265
+ - **Damping at boundaries**: dragging past a natural edge moves less the further you go (real things slow before stopping).
266
+ - **Pointer capture** once dragging starts, so it continues when the pointer leaves bounds.
267
+ - **Multi-touch protection**: ignore extra touch points after the drag begins (`if (isDragging) return`) — prevents jumps.
268
+ - **Friction over hard stops** — allow over-drag with rising resistance rather than an invisible wall.
269
+
270
+ ## Masking imperfect crossfades
271
+
272
+ When a crossfade shows two overlapping states despite tuning easing/duration, add subtle `filter: blur(2px)` during the transition to blend them into one perceived transformation. Keep blur < 20px (heavy blur is expensive, especially Safari).
273
+
274
+ ## Stagger
275
+
276
+ Stagger group entrances; 30–80ms between items. Longer delays feel slow. Stagger is decorative — never block interaction while it plays.
277
+
278
+ ```css
279
+ .item { opacity: 0; transform: translateY(8px); animation: fadeIn 300ms ease-out forwards; }
280
+ .item:nth-child(2) { animation-delay: 50ms; }
281
+ .item:nth-child(3) { animation-delay: 100ms; }
282
+ @keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }
283
+ ```
284
+
285
+ ## Accessibility
286
+
287
+ ```css
288
+ @media (prefers-reduced-motion: reduce) {
289
+ .element { animation: fade 0.2s ease; } /* keep opacity/color, drop transform-based motion */
290
+ }
291
+ @media (hover: hover) and (pointer: fine) {
292
+ .element:hover { transform: scale(1.05); } /* gate hover motion — touch fires false hovers on tap */
293
+ }
294
+ ```
295
+
296
+ ```jsx
297
+ const reduce = useReducedMotion();
298
+ const closedX = reduce ? 0 : '-100%';
299
+ ```
300
+
301
+ Reduced motion means fewer and gentler animations, not zero — keep transitions that aid comprehension, remove movement/position changes.
302
+
303
+ ## Debugging (recommend in reviews when feel is uncertain)
304
+
305
+ - **Slow motion**: bump duration 2–5× or use DevTools animation inspector. Check colors crossfade cleanly, easing doesn't stop abruptly, `transform-origin` is right, coordinated properties stay in sync.
306
+ - **Frame-by-frame**: Chrome DevTools Animations panel reveals timing drift between coordinated properties.
307
+ - **Real devices** for gestures (drawers, swipe) — connect a phone, hit the dev server by IP, use Safari remote devtools.
308
+ - **Fresh eyes next day** — imperfections invisible during development surface later.
309
+
310
+ ## Cohesion
311
+
312
+ Match motion to the component's personality: playful can be bouncier; a professional dashboard should be crisp and fast. Sonner feels right partly because easing, duration, design, and even the name are in harmony — slightly slower, `ease` rather than `ease-out`, to feel elegant. Opacity + height in entering/exiting lists is trial and error; there's no formula — adjust until it feels right.
@@ -0,0 +1,108 @@
1
+ import { parseFrontmatter } from "@sayknow-cli/utils";
2
+ import type { Skill } from "../extensibility/skills";
3
+ import animateSkill from "./skc/ui-skills/animate/SKILL.md" with { type: "text" };
4
+ import animationVocabularySkill from "./skc/ui-skills/animation-vocabulary/SKILL.md" with { type: "text" };
5
+ import appleDesignSkill from "./skc/ui-skills/apple-design/SKILL.md" with { type: "text" };
6
+ import appllamaAppDesignSkill from "./skc/ui-skills/appllama-app-design-skill/SKILL.md" with { type: "text" };
7
+ import askSonnerSkill from "./skc/ui-skills/ask-sonner/SKILL.md" with { type: "text" };
8
+ import emilDesignEngSkill from "./skc/ui-skills/emil-design-eng/SKILL.md" with { type: "text" };
9
+ import findAnimationOpportunitiesSkill from "./skc/ui-skills/find-animation-opportunities/SKILL.md" with {
10
+ type: "text",
11
+ };
12
+ import improveAnimationsSkill from "./skc/ui-skills/improve-animations/SKILL.md" with { type: "text" };
13
+ import mobileNativeSkill from "./skc/ui-skills/mobile-native/SKILL.md" with { type: "text" };
14
+ import pickUiLibrarySkill from "./skc/ui-skills/pick-ui-library/SKILL.md" with { type: "text" };
15
+ import prototypeSkill from "./skc/ui-skills/prototype/SKILL.md" with { type: "text" };
16
+ import reactBitsSkill from "./skc/ui-skills/react-bits/SKILL.md" with { type: "text" };
17
+ import reviewAnimationsSkill from "./skc/ui-skills/review-animations/SKILL.md" with { type: "text" };
18
+
19
+ /**
20
+ * Bundled frontend UI/UX craft skills. These are NOT public SKC workflow skills.
21
+ * The four public workflows remain deep-interview, ralplan, ultragoal, and team.
22
+ *
23
+ * Sources and deliberate exclusions are documented in
24
+ * `skc/ui-skills/NOTICE.md`; regenerate with `scripts/build-ui-skill-bundle.ts`.
25
+ */
26
+ export const BUNDLED_SKC_UI_SKILL_NAMES = [
27
+ "emil-design-eng",
28
+ "animate",
29
+ "review-animations",
30
+ "improve-animations",
31
+ "find-animation-opportunities",
32
+ "pick-ui-library",
33
+ "prototype",
34
+ "mobile-native",
35
+ "animation-vocabulary",
36
+ "apple-design",
37
+ "ask-sonner",
38
+ "appllama-app-design-skill",
39
+ "react-bits",
40
+ ] as const;
41
+
42
+ export type BundledSkcUiSkillName = (typeof BUNDLED_SKC_UI_SKILL_NAMES)[number];
43
+
44
+ interface BundledUiSkillSource {
45
+ name: BundledSkcUiSkillName;
46
+ relativePath: string;
47
+ content: string;
48
+ }
49
+
50
+ const BUNDLED_UI_SKILL_SOURCES: readonly BundledUiSkillSource[] = [
51
+ { name: "emil-design-eng", relativePath: "ui-skills/emil-design-eng/SKILL.md", content: emilDesignEngSkill },
52
+ { name: "animate", relativePath: "ui-skills/animate/SKILL.md", content: animateSkill },
53
+ { name: "review-animations", relativePath: "ui-skills/review-animations/SKILL.md", content: reviewAnimationsSkill },
54
+ {
55
+ name: "improve-animations",
56
+ relativePath: "ui-skills/improve-animations/SKILL.md",
57
+ content: improveAnimationsSkill,
58
+ },
59
+ {
60
+ name: "find-animation-opportunities",
61
+ relativePath: "ui-skills/find-animation-opportunities/SKILL.md",
62
+ content: findAnimationOpportunitiesSkill,
63
+ },
64
+ { name: "pick-ui-library", relativePath: "ui-skills/pick-ui-library/SKILL.md", content: pickUiLibrarySkill },
65
+ { name: "prototype", relativePath: "ui-skills/prototype/SKILL.md", content: prototypeSkill },
66
+ { name: "mobile-native", relativePath: "ui-skills/mobile-native/SKILL.md", content: mobileNativeSkill },
67
+ {
68
+ name: "animation-vocabulary",
69
+ relativePath: "ui-skills/animation-vocabulary/SKILL.md",
70
+ content: animationVocabularySkill,
71
+ },
72
+ { name: "apple-design", relativePath: "ui-skills/apple-design/SKILL.md", content: appleDesignSkill },
73
+ { name: "ask-sonner", relativePath: "ui-skills/ask-sonner/SKILL.md", content: askSonnerSkill },
74
+ {
75
+ name: "appllama-app-design-skill",
76
+ relativePath: "ui-skills/appllama-app-design-skill/SKILL.md",
77
+ content: appllamaAppDesignSkill,
78
+ },
79
+ { name: "react-bits", relativePath: "ui-skills/react-bits/SKILL.md", content: reactBitsSkill },
80
+ ];
81
+
82
+ export function getEmbeddedSkcUiSkills(): Skill[] {
83
+ return BUNDLED_UI_SKILL_SOURCES.map(source => {
84
+ const { frontmatter } = parseFrontmatter(source.content, {
85
+ source: `embedded:skc/${source.relativePath}`,
86
+ level: "warn",
87
+ });
88
+ const description =
89
+ typeof frontmatter.description === "string" ? frontmatter.description : `SKC UI skill ${source.name}`;
90
+ return {
91
+ name: source.name,
92
+ description,
93
+ filePath: `embedded:skc/${source.relativePath}`,
94
+ baseDir: `embedded:skc/ui-skills/${source.name}`,
95
+ source: "bundled:ui",
96
+ hide: false,
97
+ content: source.content,
98
+ };
99
+ });
100
+ }
101
+
102
+ export function withEmbeddedSkcUiSkills(skills: Skill[]): Skill[] {
103
+ const byName = new Map(skills.map(skill => [skill.name, skill]));
104
+ for (const uiSkill of getEmbeddedSkcUiSkills()) {
105
+ if (!byName.has(uiSkill.name)) byName.set(uiSkill.name, uiSkill);
106
+ }
107
+ return [...byName.values()];
108
+ }
@@ -4,6 +4,7 @@ import * as path from "node:path";
4
4
  import { findRepoRoot } from "../capability/fs";
5
5
  import type { Skill as CapabilitySkill } from "../capability/skill";
6
6
  import type { SkillsSettings } from "../config/settings-schema";
7
+ import { BUNDLED_SKC_UI_SKILL_NAMES } from "../defaults/skc-ui-skills";
7
8
  import { compareSkillOrder, SOURCE_PATHS, scanSkillsFromDir } from "../discovery/helpers";
8
9
  import { CANONICAL_SKC_WORKFLOW_SKILLS } from "../skill-state/canonical-skills";
9
10
  import type { Skill } from "./skills";
@@ -33,7 +34,7 @@ function getRuntimeHome(): string {
33
34
 
34
35
  const DEFAULT_LIMIT = 20;
35
36
  const MAX_LIMIT = 50;
36
- const BUILT_IN_SKILL_NAMES = new Set<string>(CANONICAL_SKC_WORKFLOW_SKILLS);
37
+ const BUILT_IN_SKILL_NAMES = new Set<string>([...CANONICAL_SKC_WORKFLOW_SKILLS, ...BUNDLED_SKC_UI_SKILL_NAMES]);
37
38
 
38
39
  function normalizeLimit(limit: number | undefined): number {
39
40
  if (limit === undefined || !Number.isFinite(limit)) return DEFAULT_LIMIT;
@@ -203,7 +204,12 @@ export async function discoverRuntimeSkills(
203
204
  };
204
205
  if (matchesQuery(candidate, options.query ?? "")) candidates.push(candidate);
205
206
  }
206
- candidates.sort((a, b) => compareSkillOrder(a.name, a.path, b.name, b.path));
207
+ candidates.sort((a, b) => {
208
+ // Project scope is reported first: a populated user-home catalog must not
209
+ // exhaust the bounded result budget before a project skill is ever named.
210
+ const scopeRank = (source: RuntimeSkillDiscoverySource) => (source === "project" ? 0 : 1);
211
+ return scopeRank(a.source) - scopeRank(b.source) || compareSkillOrder(a.name, a.path, b.name, b.path);
212
+ });
207
213
  return candidates.slice(0, normalizeLimit(options.limit));
208
214
  }
209
215
 
@@ -1,4 +1,5 @@
1
1
  import { appendFile, mkdir, stat } from "node:fs/promises";
2
+ import * as os from "node:os";
2
3
  import * as path from "node:path";
3
4
  import { getAgentDir, getConfigDirName } from "@sayknow-cli/utils";
4
5
  import { YAML } from "bun";
@@ -14,6 +15,7 @@ import {
14
15
  type EffectiveSkillConfigInput,
15
16
  recordSkillActivation,
16
17
  } from "./skill-state";
18
+ import { buildExternalUiSkillContext, buildUiSkillActivationContext } from "./ui-skill-keywords";
17
19
 
18
20
  export type SkcNativeHookEventName = "UserPromptSubmit" | "Stop";
19
21
 
@@ -26,6 +28,7 @@ type HookPayload = Record<string, unknown>;
26
28
 
27
29
  interface SkcNativeHookDispatchOptions {
28
30
  cwd?: string;
31
+ home?: string;
29
32
  stateDir?: string;
30
33
  effectiveSkillConfig?: EffectiveSkillConfigInput;
31
34
  configPaths?: string[];
@@ -339,8 +342,26 @@ export async function dispatchSkcNativeSkillHook(
339
342
  },
340
343
  };
341
344
  }
345
+ // Frontend skills SKC routes to but does not vendor (license-restricted
346
+ // collections). Resolved against the user's own install roots. A lookup
347
+ // failure must not swallow the bundled UI-skill directive.
348
+ let externalUiContext: string | null = null;
349
+ try {
350
+ externalUiContext = await buildExternalUiSkillContext({
351
+ cwd,
352
+ home: options.home ?? os.homedir(),
353
+ text: prompt,
354
+ });
355
+ } catch {
356
+ externalUiContext = null;
357
+ }
342
358
  const additionalContext = [
343
359
  skillState ? buildSkillActivationAdditionalContext(skillState, effectiveSkillConfig) : activeUltragoalContext,
360
+ // Bundled frontend UI skills are advertised independently of workflow
361
+ // activation: they have no mode state and must fire even when a
362
+ // workflow keyword already matched.
363
+ buildUiSkillActivationContext(prompt),
364
+ externalUiContext,
344
365
  recoveryContext,
345
366
  classifyQuestionOnlyPrompt(prompt),
346
367
  ]