Frontend react nextjs
Skill FairMind-Gen-AI-Studio/fairmind-integration/skills/frontend-react-nextjs
Use when implementing frontend features with React, NextJS, TypeScript, Tailwind CSS, or Shadcn UI. This skill provides patterns, conventions, and best practices for modern React development including component architecture, state management with Zustand, and responsive design.From its SKILL.md
npx -y skills add FairMind-Gen-AI-Studio/fairmind-integration --skill frontend-react-nextjsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.9 KB, as published. Nobody here has run it
Frontend Development with React & NextJS
Overview
This skill provides guidance for frontend development using the React/NextJS/TypeScript stack with Tailwind CSS and Shadcn UI components.
Announce at start: "I'm using the frontend-react-nextjs skill for this frontend implementation."
When to Use
Use this skill when:
- Building React components with TypeScript
- Implementing NextJS pages or app router components
- Creating responsive layouts with Tailwind CSS
- Integrating or customizing Shadcn UI components
- Managing state with Zustand or React Context
- Implementing forms, data fetching, or authentication UI
Core Workflow
Step 1: Understand Requirements
Before writing any code:
- Review the user story acceptance criteria
- Identify UI/UX requirements from mockups or descriptions
- Check for existing components that can be reused
- Understand the data flow and API contracts
Step 2: Design Component Architecture
- Break down the UI into logical components
- Define component hierarchy (parent/child relationships)
- Identify shared vs. page-specific components
- Plan props interfaces and state management
Step 3: Implement Components
Follow this order:
- Types first - Define TypeScript interfaces
- Component skeleton - Basic structure with props
- State and logic - Add hooks and handlers
- Styling - Apply Tailwind classes
- Accessibility - Add ARIA attributes and keyboard support
Step 4: Integrate and Test
- Connect to API endpoints or mock data
- Test all user interactions
- Verify responsive behavior
- Check accessibility compliance
Reference Files
For detailed patterns and examples, load the appropriate reference file:
| File | Content | When to Use |
|---|---|---|
references/react-patterns.md | Component patterns, hooks, composition | Building any React component |
references/nextjs-conventions.md | App router, server components, routing | NextJS-specific features |
references/typescript-guidelines.md | Type patterns, interfaces, generics | Type definitions, complex types |
references/tailwind-shadcn.md | UI components, styling patterns | Styling and UI components |
references/zustand-state.md | State management patterns | Global or complex state |
Key Principles
Component Design
- Prefer composition over inheritance
- Keep components focused on single responsibility
- Extract reusable logic into custom hooks
- Use TypeScript to enforce prop contracts
State Management
- Local state for component-specific data
- Zustand for global/shared state
- Server state with React Query or SWR
- Avoid prop drilling with context or state managers
Styling
- Use Tailwind utility classes primarily
- Create custom components for repeated patterns
- Follow mobile-first responsive design
- Maintain consistent spacing and typography
Performance
- Use
React.memofor expensive renders - Implement lazy loading for routes and large components
- Optimize images with next/image
- Avoid unnecessary re-renders with proper dependency arrays
Integration with Fairmind
When working on Fairmind tasks:
- Use
fairmind-contextskill to gather requirements first - Check work package for specific UI requirements
- Reference architectural blueprints for component patterns
- Update journal with UI decisions and component structure
Error Handling
If design requirements are unclear:
- Ask for mockups or detailed descriptions
- Document assumptions in the journal
- Propose component structure for approval
If API contracts are missing:
- Define provisional TypeScript interfaces
- Note dependencies on backend work
- Use mock data during development
Example Usage
// Example: Creating a user profile component
// 1. Define types
interface UserProfileProps {
userId: string;
onUpdate?: (user: User) => void;
}
// 2. Create component with proper patterns
export function UserProfile({ userId, onUpdate }: UserProfileProps) {
// 3. Use appropriate hooks
const { user, isLoading } = useUser(userId);
// 4. Handle states
if (isLoading) return <ProfileSkeleton />;
if (!user) return <NotFound />;
// 5. Render with Tailwind + Shadcn
return (
<Card className="p-6">
<Avatar src={user.avatar} fallback={user.initials} />
<h2 className="text-lg font-semibold">{user.name}</h2>
{/* ... */}
</Card>
);
}
Next Steps
After completing frontend implementation:
- Use
fairmind-tddskill for component testing - Request code review via Code Reviewer agent
- Update journal with final component inventory