Agent Skills
› NicholasFlemmer/styx-app
› ui-component
ui-component
GitHub用于在packages/ui中根据规范快速生成或扩展UI组件,包含CSS Modules、Stories、键盘测试及无障碍检查。
Trigger Scenarios
需要创建新的UI组件
扩展现有UI组件功能
Install
npx skills add NicholasFlemmer/styx-app --skill ui-component -g -y
SKILL.md
Frontmatter
{
"name": "ui-component",
"description": "Add or extend a component in packages\/ui from the spec §8 inventory and prototype recipe, with CSS Modules from tokens, stories for every variant\/state, keyboard\/focus test, and axe check.",
"allowed-tools": "Read, Grep, Glob, Edit, Write, Bash(pnpm:*), Bash(grep:*), Bash(sed:*)",
"argument-hint": "<ComponentName> [variant]"
}
UI component: $ARGUMENTS
- Read the §8 row (
/spec-lookup 8) and grepdesign/handoff/Styx.dc.htmlfor 2–3 instances; copy the inline recipe (padding, font, border, hover, attributes). - Scaffold
packages/ui/src/<group>/<Name>/{<Name>.tsx,<Name>.module.css,<Name>.stories.tsx,<Name>.test.tsx,index.ts}; export fromsrc/index.ts. - Props: semantic props +
inv?,on?,disabled?,className?; renderdata-inv/data-ononly when true; forwardref. - CSS in
@layer components, token vars only; hover = instantbackground: var(--s2); no radius/shadow/transition. Hit target ≥28px (::afterinset for compact buttons). - Stories: one per variant × state + a
Matrixstory; a11y addon enabled. - Test: renders, keyboard activation,
aria-*, focus ring visibility. pnpm test -F @styx/ui && pnpm typecheckandpnpm storybook:testwhen available.
Version History
- 1d72019 Current 2026-10-18 15:23


