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