Agent Skills
› biersoeckli/QuickStack
› frontend-ui-patterns
frontend-ui-patterns
GitHub规范 QuickStack 前端开发,涵盖 React 组件、表单验证、状态管理及服务/客户端边界划分。指导使用 shadcn/ui、Zustand 及 Server Actions 构建符合项目约定的 UI。
Trigger Scenarios
创建或更新前端页面和 React 组件
实现基于 Zod 的表单和 Server Action
配置 Zustand 状态管理和对话框
处理流式 UI 或服务端/客户端边界逻辑
Install
npx skills add biersoeckli/QuickStack --skill frontend-ui-patterns -g -y
SKILL.md
Frontmatter
{
"name": "frontend-ui-patterns",
"description": "Create and update QuickStack frontend pages, React components, forms, dialogs, tables, streaming UI, and Zustand-backed state using the project's established UI conventions. Use when editing frontend files, shadcn\/ui composition, react-hook-form + Zod flows, Server Action consumption from client components, or client\/server component boundaries."
}
Frontend UI Patterns
Quick Start
For QuickStack frontend work:
- Use kebab-case filenames.
- Put shadcn/ui primitives in
src/components/ui/. - Put composed UI in
src/components/custom/. - Put frontend hooks, helpers, sockets, and Zustand usage in
src/frontend/. - Co-locate page-specific Server Actions in
actions.tsbeside the consuming page.
Core Workflow
When creating or updating frontend UI:
- Decide the boundary first: server pages fetch data and check auth; client components handle interaction.
- Build forms with
react-hook-form, Zod, shadcnForm, and shared field wrappers. - Choose the Server Action flow by UI need:
Toast.fromAction()for immediate feedback,Actions.run()for imperatively loaded data, anduseActionStateplusFormUtils.mapValidationErrorsToForm()for forms with field errors. - Use Zustand-backed dialogs and stores for reusable or cross-component flows; use local state for page-owned dialogs.
- Use
SimpleDataTablefor standard tables before building custom table behavior. - Style with shadcn/ui plus Tailwind utilities and
cn().
Boundary Rules
- Use
'use server'for pages and layouts that fetch data or gate authorization. - Use
'use client'for dialogs, forms, tables, event handlers, and streaming UI. - Use auth helpers from
action-wrapper.utils.tsin server components.
Forms And Actions
- Add route-safe validation with shared or local Zod schemas.
- With Zod 4 and
zodResolver, type every form with the schema's input and output types. Importzfrom"zod"and useuseForm<z.input<typeof schema>, unknown, z.output<typeof schema>>({ resolver: zodResolver(schema), ... }). Do not usez.inferas theuseFormfield-values type when the schema has coercion, transforms, preprocessors, or defaults. - Map server validation errors back with
FormUtils.mapValidationErrorsToForm(...). - Use
SubmitButtonfor form submits when possible.
State, Dialogs, And Streaming
- Reuse stores in
src/frontend/states/zustand.states.tsbefore adding new ones. - Use
useDialog,useConfirmDialog, anduseInputDialogfor modal flows. - Clean up SSE and socket work with
AbortControlleror equivalent effect cleanup.
Reference
See REFERENCE.md for concrete examples covering server/client boundaries, auth helpers, forms, Server Actions, Zustand stores, SimpleDataTable, dialogs, styling, and real-time UI.
Version History
- 0.0.13 Current 2026-08-20 14:28


