add-feature-component
Scaffold a new component inside an existing feature module with proper patterns
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new component inside an existing feature module with proper patterns
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Audit components and pages for accessibility issues
Full code review across accessibility, SEO, performance, and design consistency
Stage changes and create a git commit following project naming conventions
基于 SOC 职业分类
| name | add-feature-component |
| description | Scaffold a new component inside an existing feature module with proper patterns |
Creates a new component inside a feature module following the project's conventions.
Ask which feature module the component belongs to (home, about-me, projects, contact-me). If it's a new feature, create the full feature folder structure first.
Ask for the component name in PascalCase (e.g., ProjectCard, SkillBadge).
Ask whether the component needs client-side interactivity ("use client"). Default to no — only add it if the component uses hooks, browser APIs, or event handlers.
Create the component file at features/<feature>/components/<component-name>.tsx following these patterns:
Server component (default):
import Underline from "@/components/underline";
type ComponentNameProps = {
// define props
};
export default function ComponentName({ /* props */ }: ComponentNameProps) {
return (
<div>
{/* content */}
</div>
);
}
Client component (only when needed):
"use client";
import { motion } from "motion/react";
import CornerAccent from "@/components/corner-accent";
type ComponentNameProps = {
delay?: number;
};
export default function ComponentName({ delay = 0 }: ComponentNameProps) {
return (
<motion.div
initial={{ y: 30, opacity: 0 }}
whileInView={{ y: 0, opacity: 1 }}
transition={{ duration: 0.55, delay, ease: [0.22, 1, 0.36, 1] }}
viewport={{ once: true, amount: 0.2 }}
className="border overflow-hidden relative border-secondary-400/30 p-5 md:p-8 rounded-xl dark:bg-primary-950 dark:text-white transform-gpu"
>
<CornerAccent position="top-right" />
<CornerAccent position="bottom-left" />
{/* content */}
</motion.div>
);
}
Export the component from the feature's index.ts barrel file.
Remind the user to import and use the component in the parent page/component.
motion from "motion/react" for animations (not framer-motion)CornerAccent for decorative card borders[0.22, 1, 0.36, 1] (ease-out-expo)cn() from @/lib/utils for conditional classes@/components/ui/ where applicablesecondary-400 for accents, primary-950 for dark backgroundsdark: variants for dark mode