anhpht06/frontend-skill-pack/01-ui-conventions
Claude Code and agent skill by anhpht06/frontend-skill-pack
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Guidelines and rules for writing and organizing UI Components in React/Next.js projects.
Install
npx vskill@latest install anhpht06/frontend-skill-pack/01-ui-conventionsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as anhpht06/frontend-skill-pack/01-ui-conventions.
Frontend UI Conventions (React / Next.js)
This document defines the core rules for building and organizing UI Components. AI Agents and Developers MUST follow these guidelines.
1. Naming Conventions
- Components: Always use
PascalCase(e.g.,Button.tsx,UserProfile.tsx). - Files & Directories: Always use
kebab-case(e.g.,user-profile.tsx,components/ui/). - Hooks: Always use
camelCasestarting withuse(e.g.,useAuth,useWindowSize).
2. Server vs Client Components
- By default, all components in Next.js App Router are Server Components.
- Only add `"use client"` at the top of the file when the component requires:
- User interaction (onClick, onChange...).
- React hooks (useState, useEffect, useContext...).
- Browser APIs (window, document...).
- Keep components as Server Components as much as possible to optimize performance.
3. Styling & Tailwind CSS
- Use Tailwind CSS for all styling.
- DO NOT concatenate classNames manually. Always use
clsxcombined withtailwind-merge(usually wrapped in acn()utility function) for conditional classNames to avoid conflicts.
``tsx // ❌ Bad <div className={btn ${isActive ? 'bg-blue-500' : 'bg-gray-500'} ${className}`}>
// ✅ Good import { cn } from "@/lib/utils"; <div className={cn("btn", isActive ? "bg-blue-500" : "bg-gray-500", className)}> ```
4. Component Directory Structure
components/ui/: Reusable, generic UI components without business logic (e.g., Button, Input, Modal). Often generated by tools like shadcn/ui.components/errors/: Error display components (e.g., AppError, NotFound).components/[feature]/: Feature-specific components that may contain business logic (e.g.,components/auth/LoginForm.tsx).
5. Separation of Concerns (UI vs Logic)
- DO NOT write complex logic directly inside JSX.
- If a component has too much state management, calculations, or API calls, extract that logic into a separate Custom Hook. The component should focus solely on rendering the View.
6. Error Handling (Error Boundaries)
- When a component errors, NEVER show a blank white screen.
- Always use the
AppErrorcomponent (or equivalent) to show a friendly error message to the user, ideally with a "Try again" button. - Integrate
AppErrorwithin Next.jserror.tsxfiles.
7. Icons (Lucide React)
- Use
lucide-reactfor icons. - Always import specific icons, do not import the entire library to optimize bundle size.
```tsx // ❌ Bad import * as Icons from "lucide-react";
// ✅ Good import { X, Check } from "lucide-react"; ```
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingen/01-ui-conventions/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/anhpht06/frontend-skill-pack/01-ui-conventions)