一键导入
new-component
Scaffold a new React component with co-located test, shadcn/ui primitives, and barrel export registration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new React component with co-located test, shadcn/ui primitives, and barrel export registration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Drive the real GUI against the real engine via the standalone dev HTTP bridge (`npm run dev:bridge`). Use whenever "does the wiring test actually hold up against real code?" matters — smoke verification, UI development with live engine state, real-engine bug repro, exploratory debugging with Chrome DevTools instruments.
Generate Playwright E2E tests following project conventions (Tauri fixture, storage isolation, helpers).
Generate unit tests following project conventions. Use when the user asks to create, generate, or write tests for a file or component.
Review changes and determine if PROJECT_SHADOW.md needs updating per AI_CONTRACT.md criteria. Runs automatically during code review.
Scaffold a new Tauri command across Rust backend and TypeScript frontend with proper patterns.
| name | new-component |
| description | Scaffold a new React component with co-located test, shadcn/ui primitives, and barrel export registration. |
Scaffold a new React component following project conventions.
Input: Component name and location. Examples:
/new-component StatusBadge in components/app → src/components/app/status-badge.tsx/new-component LiveCounter in components/app/overview/components → in the overview subdirectorySteps
Determine file paths
src/<location>/<kebab-case-name>.tsxsrc/<location>/<kebab-case-name>.test.tsxCreate the component file with:
<Name>Props)@/ path alias for all project importslucide-react if neededframer-motion for animations if neededCreate the co-located test file with:
@/test/test-utils (not @testing-library/react directly)Register in barrel export if one exists in the target directory's index.ts
Verify — run the test: npx vitest run <test-file>
Component Template
import { ComponentProp } from '@/components/ui/button'; // shadcn as needed
interface MyComponentProps {
// typed props
}
export function MyComponent({ ...props }: MyComponentProps) {
return (
// JSX using shadcn/ui primitives for interactive elements
);
}
Mandatory Rules
@/components/ui/<button>, <select>, <input> are only allowed for non-interactive semantic markup or documented exceptionssuccess, warning, danger, panel, muted (defined in tailwind.config.js)