.claude/skills/component-creation/SKILL.md
Patterns for creating React components with shadcn/ui and Tailwind CSS in YHIN. Use when building any new UI component.
npx skillsauth add LilMikey-CN/YHIN component-creationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
// components/features/ResourceCard.tsx
'use client';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { useTranslations } from 'next-intl';
import type { Resource } from '@/types';
interface ResourceCardProps {
resource: Resource;
onContact?: (resourceId: string) => void;
}
export default function ResourceCard({ resource, onContact }: ResourceCardProps) {
const t = useTranslations('resource');
return (
<Card className="hover:shadow-md transition-shadow">
<CardHeader className="pb-3">
<div className="flex items-center justify-between">
<CardTitle className="text-lg">{resource.title}</CardTitle>
<Badge variant={resource.type === 'HAVE' ? 'default' : 'secondary'}>
{t(resource.type === 'HAVE' ? 'typeHave' : 'typeWant')}
</Badge>
</div>
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground line-clamp-3">
{resource.description}
</p>
{resource.tags.length > 0 && (
<div className="flex flex-wrap gap-1 mt-3">
{resource.tags.map(tag => (
<Badge key={tag} variant="outline" className="text-xs">
{tag}
</Badge>
))}
</div>
)}
</CardContent>
</Card>
);
}
text-muted-foreground, bg-primary)
not arbitrary colors (text-gray-500, bg-blue-600)text-sm for body, text-lg for card titles, text-2xl for page titlessm:, md:, lg: breakpointscomponents/ui/ — shadcn primitives (don't edit these directly, use npx shadcn@latest add)components/features/ — domain components (ResourceCard, MatchList, ChatWindow)components/layout/ — structural (Navbar, Sidebar, PageHeader)Use shadcn's Form component with react-hook-form + Zod:
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { resourceCreateSchema } from '@/lib/validations';
const form = useForm({
resolver: zodResolver(resourceCreateSchema),
defaultValues: { title: '', description: '', type: 'HAVE' as const },
});
Always show skeleton loaders, never spinners:
import { Skeleton } from '@/components/ui/skeleton';
function ResourceCardSkeleton() {
return (
<Card>
<CardHeader>
<Skeleton className="h-6 w-3/4" />
</CardHeader>
<CardContent>
<Skeleton className="h-4 w-full mb-2" />
<Skeleton className="h-4 w-2/3" />
</CardContent>
</Card>
);
}
Every list component needs an empty state with an action:
{items.length === 0 && (
<div className="text-center py-12">
<p className="text-muted-foreground mb-4">{t('empty')}</p>
<Button onClick={onCreateNew}>{t('createFirst')}</Button>
</div>
)}
documentation
One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.
data-ai
Prisma ORM patterns including schema design, JSONB fields, pgvector integration, and migration workflow for YHIN
tools
Next.js 15 App Router patterns, server/client components, layouts, and routing conventions for YHIN
development
Core matching algorithm using pgvector semantic similarity. Finds "I have, they need" and "I need, they have" connections between users.