specwright/templates/skills/component-architecture/SKILL.md
--- name: [PROJECT]-component-patterns description: [PROJECT] frontend component architecture and patterns globs: ["**/*.{tsx,jsx,ts,js,vue,svelte}"] --- # Component Architecture Patterns > **Template for project-specific component patterns skill** > Fill in [CUSTOMIZE] sections with your project's detected or chosen patterns **Project**: [PROJECT NAME] **Framework**: [CUSTOMIZE: React / Angular / Vue / Svelte / SolidJS] **Language**: [CUSTOMIZE: TypeScript / JavaScript] **Last Updated**: [DA
npx skillsauth add michsindlinger/specwright specwright/templates/skills/component-architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Template for project-specific component patterns skill Fill in [CUSTOMIZE] sections with your project's detected or chosen patterns
Project: [PROJECT NAME] Framework: [CUSTOMIZE: React / Angular / Vue / Svelte / SolidJS] Language: [CUSTOMIZE: TypeScript / JavaScript] Last Updated: [DATE]
Location: [CUSTOMIZE: src/components / app/components / src/ui]
Directory Pattern: [CUSTOMIZE: Flat / By-feature / Atomic design / Nested]
Example Structure:
[CUSTOMIZE: Show your actual directory structure]
Examples:
- React: src/components/UserList/UserList.tsx, UserList.module.css, UserList.test.tsx
- Angular: src/app/components/user-list/user-list.component.ts, .html, .css
- Vue: src/components/UserList.vue
Primary Pattern: [CUSTOMIZE: Functional components / Class components / Composition API / Components]
Example - Simple Component:
[CUSTOMIZE: Show basic component pattern]
Examples:
- React: export const UserCard: React.FC<Props> = ({ user }) => {...}
- Angular: @Component({...}) export class UserCardComponent {...}
- Vue: <script setup lang="ts">...</script>
[CUSTOMIZE WITH YOUR PROJECT PATTERN]
Example - Props Interface:
[CUSTOMIZE: How props/inputs are defined]
Examples:
- React: interface UserListProps { users: User[]; onSelect: (u: User) => void }
- Angular: @Input() users: User[] = []; @Output() select = new EventEmitter<User>()
- Vue: defineProps<{ users: User[] }>()
Props: [CUSTOMIZE: camelCase / kebab-case / PascalCase] Event Handlers: [CUSTOMIZE: onAction / handleAction / @action] Callbacks: [CUSTOMIZE: onUserClick / handleUserClick / userClick]
Pattern: [CUSTOMIZE: useState / reactive / ref / createSignal]
Example:
[CUSTOMIZE: Show local state pattern]
Examples:
- React: const [users, setUsers] = useState<User[]>([])
- Angular: users: User[] = []
- Vue: const users = ref<User[]>([])
Pattern: [CUSTOMIZE: useMemo / computed / $: / createMemo]
Example:
[CUSTOMIZE: Show computed values]
Approach: [CUSTOMIZE: Context API / Redux / NgRx / Pinia / Zustand / Signals]
When to Use: [CUSTOMIZE: Authentication / Theme / Cached data / User preferences]
Pattern:
[CUSTOMIZE: Show global state usage]
Hooks/Lifecycle: [CUSTOMIZE: useEffect / ngOnInit / onMounted / onMount]
Example - Data Loading:
[CUSTOMIZE: Show data fetching pattern]
Example - Cleanup:
[CUSTOMIZE: Show cleanup pattern]
Event Handlers: [CUSTOMIZE: handleClick / onClick / onButtonClick]
Example:
[CUSTOMIZE: Show event handler pattern]
Examples:
- React: const handleUserClick = (user: User) => {...}
- Angular: onUserClick(user: User): void {...}
- Vue: const handleUserClick = (user: User) => {...}
Location: [CUSTOMIZE: src/services / src/api / app/services]
Pattern: [CUSTOMIZE: Class / Functions / Composables / Custom hooks]
Example:
[CUSTOMIZE: Show API service pattern]
Examples:
- React: export class UserService { static async getUsers() {...}}
- Angular: @Injectable() export class UserService {...}
- Vue: export function useUsers() {...}
Library: [CUSTOMIZE: fetch / axios / Angular HttpClient / ky]
Error Handling:
[CUSTOMIZE: Show error handling pattern]
Pattern: [CUSTOMIZE: Boolean / Enum / Status object]
Example:
[CUSTOMIZE: Show loading state pattern]
Examples:
- const [loading, setLoading] = useState(false)
- loading: boolean = false
- const loading = ref(false)
Primary: [CUSTOMIZE: CSS Modules / styled-components / Tailwind / SCSS / Vanilla CSS / Vue scoped]
File Extension: [CUSTOMIZE: .module.css / .styled.ts / .css / .scss]
Class Naming: [CUSTOMIZE: BEM / camelCase / kebab-case / Utility classes]
[CUSTOMIZE: Show styling pattern]
Examples:
- CSS Modules: import styles from './UserList.module.css'; <div className={styles.container}>
- styled-components: const Container = styled.div`...`
- Tailwind: <div className="p-4 bg-white rounded-lg">
Library: [CUSTOMIZE: React Hook Form / Formik / Angular Reactive Forms / VeeValidate / None]
Pattern:
[CUSTOMIZE: Show form handling pattern]
Approach: [CUSTOMIZE: Schema-based / Inline / Custom validators]
Example:
[CUSTOMIZE: Show validation pattern]
Pattern: [CUSTOMIZE: Inline / Toast / Modal / Field-specific]
Framework: [CUSTOMIZE: Jest + React Testing Library / Vitest / Jasmine/Karma / Vue Test Utils]
Pattern: [CUSTOMIZE: Behavior-driven / Implementation / Integration]
Example:
[CUSTOMIZE: Show component test pattern]
Examples:
- React: render(<Component />); expect(screen.getByText('...')).toBeInTheDocument()
- Angular: TestBed.configureTestingModule({...}); expect(compiled.querySelector('...')).toBeTruthy()
[CUSTOMIZE WITH PROJECT GUIDELINES]
Always test:
Techniques: [CUSTOMIZE: useMemo / React.memo / OnPush / v-memo / createMemo]
When to Use: [CUSTOMIZE: Expensive calculations / Large lists / Frequent re-renders]
Approach: [CUSTOMIZE: React.lazy / loadChildren / defineAsyncComponent]
Example:
[CUSTOMIZE: Show lazy loading pattern]
Approach: [CUSTOMIZE: Use semantic tags / ARIA / Both]
Required Elements:
for attributeWhen to Use: [CUSTOMIZE: Custom components / Non-semantic elements / Complex widgets]
Common Patterns:
[CUSTOMIZE: Show ARIA usage]
Examples:
- aria-label, aria-describedby
- role="button", role="dialog"
- aria-live for dynamic content
When generating components, always include:
[CUSTOMIZE - ADD DETECTED OR CHOSEN PATTERNS]
Customization Complete: Replace all [CUSTOMIZE] sections with project-detected or chosen patterns.
Auto-generated by: /add-skill component-architecture command
tools
Session Handoff: Erstellt eine vollständige Zusammenfassung der aktuellen Session für einen sauberen Kontextwechsel. NUR bei explizitem Aufruf (/session-handoff). NICHT automatisch auslösen. Geeignet wenn der User die Session resetten will, den Kontext aufräumen will, oder bei ~120k Tokens angelangt ist.
development
Pre-Mortem Risk Analysis: Strukturierte Prospective-Hindsight-Übung um launch-blocking Risiken vor Commitment aufzudecken. Team stellt sich vor, das Produkt sei 14 Tage nach Launch gefloppt, und arbeitet rückwärts. Klassifiziert Risiken in Tigers (echt), Paper Tigers (hypothetisch), Elephants (unausgesprochen). Nutze diesen Skill vor Build-Commitment, bei zu hoher Stakeholder-Confidence, vor Major-Releases, oder wenn das Team vage Sorgen nicht artikulieren kann. Trigger: /pre-mortem, 'pre-mortem', 'risk analysis', 'was könnte schiefgehen', 'risiken vor launch'.
testing
Six-Sigma Atomicity Validator for create-spec stories
tools
UX pattern definition guidance for navigation, user flows, interactions, and accessibility