| name | dev-create-component |
| description | Use when adding a new UI component to an existing module - handles templates, inputs, and test scaffolding. |
| user-invocable | true |
| argument-hint | [ComponentName] |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
Create an Angular standalone component following docs/ARCHITECTURE.md section 5.
Component: $ARGUMENTS
Steps
-
Read docs/ARCHITECTURE.md section 5.
-
Determine the type:
- Feature component ->
src/modules/[module]/components/kebab-case.component.ts
- Shared component ->
src/shared/components/kebab-case.component.ts
- Page ->
src/modules/[module]/pages/kebab-case-page.component.ts
-
Create the component with the standard template:
import { Component, ChangeDetectionStrategy, inject, input, output, signal, computed } from '@angular/core'
@Component({
selector: 'app-kebab-case',
standalone: true,
imports: [],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- clean template, < 100 lines -->
`,
})
export class PascalCaseComponent {
readonly myInput = input<string>()
readonly myOutput = output<string>()
private readonly service = inject(MyService)
}
-
Checklist:
- Standalone component ✅
- input()/output() signals ✅
- inject() for DI ✅
- OnPush change detection ✅
- < 200 lines ✅
- kebab-case.component.ts ✅
-
Validate: npx tsc --noEmit