| name | dev-create-component |
| description | Use when adding a new UI component to the project - handles templates, props, and scoped styles. |
| user-invocable | true |
| argument-hint | [ComponentName] |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
Create an Astro component following docs/ARCHITECTURE.md section 5.
Component: $ARGUMENTS
Steps
-
Read docs/ARCHITECTURE.md section 5.
-
Determine the type:
- Feature component ->
src/components/ComponentName.astro
- Shared component ->
src/shared/components/ComponentName.astro
- Layout ->
src/layouts/LayoutName.astro
-
Create the component with the standard template:
---
interface Props {
// type all props
}
const { prop1, prop2 } = Astro.props
---
<div class="component-name">
<!-- clean template -->
</div>
<style>
/* scoped styles */
</style>
-
Checklist:
Props interface defined
- Props destructured from
Astro.props
- PascalCase.astro filename
- Scoped
<style> tag
- No JavaScript shipped (zero JS)
- No event handlers (use island if needed)
-
Validate: npx astro check