Feature Scaffolding
Create new feature pages following the established project patterns.
Standard Structure
code
src/features/{feature-name}/
page.tsx # Main page, imports and composes components
components/ # Feature-specific components (one per file)
component-name.tsx
types.ts # (if needed) Feature-specific types
page.tsx Template
tsx
import { ComponentName } from './components/component-name'
export function Page() {
return (
<div>
<ComponentName />
</div>
)
}
Component Template
tsx
// components/component-name.tsx
interface ComponentNameProps {
// props here
}
export function ComponentName({ ...props }: ComponentNameProps) {
return (
// JSX here
)
}
Rules
- •One component per file - See component-organization skill
- •Kebab-case filenames -
summary-card.tsx, notSummaryCard.tsx - •Named exports -
export function X, notexport default - •No barrel files - Import directly from component files
- •Avoid useEffect - Prefer event handlers, props, and state
When to Apply
- •Creating a new feature/page from scratch
- •User asks to "scaffold", "set up", or "create" a new section
- •Adding a new route that needs standard structure