new-component
Scaffold a new MUI component with Digital Playbook theme, proper client/server boundary, and project conventions
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Scaffold a new MUI component with Digital Playbook theme, proper client/server boundary, and project conventions
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Create a Prisma database migration: edit schema, run migrate dev, generate client, and verify types
Generate Vitest tests for a server action or component, following project conventions with Prisma mocks
Scaffold a new Server Action with auth, Zod validation, Prisma mutation, revalidation, and ActionResult types
| name | new-component |
| description | Scaffold a new MUI component with Digital Playbook theme, proper client/server boundary, and project conventions |
| disable-model-invocation | true |
Scaffolds a React component following the project's MUI v7 + Digital Playbook aesthetic conventions.
Accepts a name and location (e.g., /new-component PlayerStatCard components/features/roster/).
'use client' if the component needs interactivity, hooks, or browser APIs. Default to Server Component.bun run type-checkcomponents/features/<domain>/<ComponentName>.tsxcomponents/ui/<ComponentName>.tsxcomponents/providers/<ProviderName>.tsxprimary.main from MUI themesecondary.main for links, CTAs, active statesbackground.default (Fresh Ice white) and background.papersuccess.mainerror.mainBox, Stack, Grid for layout (not raw divs with Tailwind flex)Typography with theme variants for textCard/CardContent for data containerssx prop for one-off styling, Tailwind only for utility classes MUI doesn't coveruseTheme() and useMediaQuery() for responsive behavior in client componentsxs (<600px), sm (600-960px), md (>960px)'use client';
import { useState } from 'react';
import {
Card,
CardContent,
Typography,
Button,
} from '@mui/material';
interface ComponentNameProps {
title: string;
}
export function ComponentName({ title }: ComponentNameProps) {
const [expanded, setExpanded] = useState(false);
return (
<Card>
<CardContent>
<Typography variant="h6" component="h2">
{title}
</Typography>
{expanded && (
<Typography variant="body2" color="text.secondary">
{/* Expanded content */}
</Typography>
)}
<Button size="small" onClick={() => setExpanded(!expanded)}>
{expanded ? 'Less' : 'More'}
</Button>
</CardContent>
</Card>
);
}
import {
Card,
CardContent,
Typography,
} from '@mui/material';
interface ComponentNameProps {
// Define typed props — data passed from page.tsx
title: string;
items: Array<{ id: string; label: string }>;
}
export function ComponentName({ title, items }: ComponentNameProps) {
return (
<Card>
<CardContent>
<Typography variant="h6" component="h2">
{title}
</Typography>
{items.map((item) => (
<Typography key={item.id} variant="body2">
{item.label}
</Typography>
))}
</CardContent>
</Card>
);
}