specweave 0.23.18 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/.claude-plugin/marketplace.json +93 -49
  2. package/CLAUDE.md +137 -4
  3. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  4. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  5. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  6. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  7. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  8. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  9. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  10. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  11. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  13. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  15. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  16. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  17. package/dist/src/cli/helpers/smart-filter.js +265 -0
  18. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  19. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  20. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  21. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  22. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  23. package/dist/src/core/qa/risk-calculator.js +2 -2
  24. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  25. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  26. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  27. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  28. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  29. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  30. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  31. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  32. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  33. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  34. package/dist/src/integrations/jira/filter-processor.js +207 -0
  35. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  36. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  37. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  38. package/dist/src/integrations/jira/jira-client.js +33 -0
  39. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  40. package/dist/src/utils/ac-embedder.d.ts +63 -0
  41. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  42. package/dist/src/utils/ac-embedder.js +217 -0
  43. package/dist/src/utils/ac-embedder.js.map +1 -0
  44. package/dist/src/utils/env-manager.d.ts +86 -0
  45. package/dist/src/utils/env-manager.d.ts.map +1 -0
  46. package/dist/src/utils/env-manager.js +188 -0
  47. package/dist/src/utils/env-manager.js.map +1 -0
  48. package/package.json +1 -1
  49. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  50. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  51. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  52. package/plugins/specweave/commands/specweave-do.md +37 -0
  53. package/plugins/specweave/commands/specweave-done.md +159 -0
  54. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  55. package/plugins/specweave/commands/specweave-next.md +148 -3
  56. package/plugins/specweave/commands/specweave-qa.md +2 -2
  57. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  58. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  59. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  60. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  61. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  62. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  63. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  64. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  65. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  66. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  67. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  68. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  69. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  70. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  71. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  72. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  73. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  74. package/plugins/specweave-core/commands/code-review.md +213 -0
  75. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  76. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  77. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  78. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  79. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  80. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  81. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  82. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  83. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  84. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  85. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  86. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  87. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  88. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  89. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  90. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  91. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  92. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  93. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  94. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  95. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  96. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  97. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  98. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  99. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
  100. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  101. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  102. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  103. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  104. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  105. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  106. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  107. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  108. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  109. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  110. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  111. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  112. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  113. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
  114. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  115. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  116. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  117. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  118. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  119. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  120. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  121. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  122. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  123. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  124. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  125. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  126. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  127. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  128. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  129. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  130. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
  131. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  132. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  133. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  134. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  135. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  136. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  137. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  138. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  139. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  140. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  141. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
  142. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  143. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  144. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  145. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  146. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  147. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  148. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  149. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  150. package/plugins/specweave-testing/commands/test-init.md +409 -0
  151. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  152. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  153. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  154. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  155. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  156. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  157. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  158. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  159. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  160. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  161. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  162. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  163. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  164. package/plugins/specweave/commands/check-hooks.md +0 -257
  165. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  166. package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
  167. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,510 @@
1
+ # /specweave-frontend:component-generate
2
+
3
+ Generate React/Vue/Angular components with tests, stories, and documentation following Atomic Design principles.
4
+
5
+ You are an expert frontend developer who creates well-structured, tested, and documented components.
6
+
7
+ ## Your Task
8
+
9
+ Generate production-ready components with complete test coverage, Storybook stories, and documentation.
10
+
11
+ ### 1. Component Types
12
+
13
+ **Atomic Design Levels**:
14
+ - **Atoms**: Basic UI elements (Button, Input, Icon, Text, Badge)
15
+ - **Molecules**: Simple component combinations (FormField, SearchBar, Card)
16
+ - **Organisms**: Complex components (Header, Form, DataTable, Modal)
17
+ - **Templates**: Page layouts (DashboardLayout, AuthLayout)
18
+
19
+ ### 2. React Component Template
20
+
21
+ **TypeScript with Props Interface**:
22
+ ```typescript
23
+ import React from 'react';
24
+ import { cn } from '@/lib/utils';
25
+
26
+ export interface CardProps {
27
+ /**
28
+ * Card title
29
+ */
30
+ title?: string;
31
+ /**
32
+ * Card content
33
+ */
34
+ children: React.ReactNode;
35
+ /**
36
+ * Card variant style
37
+ */
38
+ variant?: 'default' | 'outlined' | 'elevated';
39
+ /**
40
+ * Optional footer content
41
+ */
42
+ footer?: React.ReactNode;
43
+ /**
44
+ * Additional CSS classes
45
+ */
46
+ className?: string;
47
+ /**
48
+ * Click handler
49
+ */
50
+ onClick?: () => void;
51
+ }
52
+
53
+ export const Card = React.forwardRef<HTMLDivElement, CardProps>(
54
+ ({ title, children, variant = 'default', footer, className, onClick }, ref) => {
55
+ const baseStyles = 'rounded-lg p-6 transition-all';
56
+
57
+ const variants = {
58
+ default: 'bg-white border border-gray-200',
59
+ outlined: 'bg-transparent border-2 border-gray-300',
60
+ elevated: 'bg-white shadow-lg hover:shadow-xl',
61
+ };
62
+
63
+ return (
64
+ <div
65
+ ref={ref}
66
+ className={cn(
67
+ baseStyles,
68
+ variants[variant],
69
+ onClick && 'cursor-pointer hover:border-blue-500',
70
+ className
71
+ )}
72
+ onClick={onClick}
73
+ >
74
+ {title && (
75
+ <h3 className="text-lg font-semibold mb-4 text-gray-900">{title}</h3>
76
+ )}
77
+ <div className="text-gray-700">{children}</div>
78
+ {footer && (
79
+ <div className="mt-4 pt-4 border-t border-gray-200">{footer}</div>
80
+ )}
81
+ </div>
82
+ );
83
+ }
84
+ );
85
+
86
+ Card.displayName = 'Card';
87
+ ```
88
+
89
+ ### 3. Component Test Template
90
+
91
+ **Comprehensive Testing**:
92
+ ```typescript
93
+ import { render, screen, fireEvent } from '@testing-library/react';
94
+ import { Card } from './Card';
95
+
96
+ describe('Card', () => {
97
+ describe('Rendering', () => {
98
+ it('renders children correctly', () => {
99
+ render(<Card>Test content</Card>);
100
+ expect(screen.getByText('Test content')).toBeInTheDocument();
101
+ });
102
+
103
+ it('renders title when provided', () => {
104
+ render(<Card title="Test Title">Content</Card>);
105
+ expect(screen.getByText('Test Title')).toBeInTheDocument();
106
+ });
107
+
108
+ it('renders footer when provided', () => {
109
+ render(
110
+ <Card footer={<button>Action</button>}>
111
+ Content
112
+ </Card>
113
+ );
114
+ expect(screen.getByText('Action')).toBeInTheDocument();
115
+ });
116
+ });
117
+
118
+ describe('Variants', () => {
119
+ it('applies default variant styles', () => {
120
+ const { container } = render(<Card>Content</Card>);
121
+ expect(container.firstChild).toHaveClass('bg-white', 'border-gray-200');
122
+ });
123
+
124
+ it('applies outlined variant styles', () => {
125
+ const { container } = render(<Card variant="outlined">Content</Card>);
126
+ expect(container.firstChild).toHaveClass('border-2');
127
+ });
128
+
129
+ it('applies elevated variant styles', () => {
130
+ const { container } = render(<Card variant="elevated">Content</Card>);
131
+ expect(container.firstChild).toHaveClass('shadow-lg');
132
+ });
133
+ });
134
+
135
+ describe('Interactions', () => {
136
+ it('handles click events', () => {
137
+ const onClick = vi.fn();
138
+ render(<Card onClick={onClick}>Content</Card>);
139
+ fireEvent.click(screen.getByText('Content'));
140
+ expect(onClick).toHaveBeenCalledTimes(1);
141
+ });
142
+
143
+ it('applies hover styles when clickable', () => {
144
+ const { container } = render(<Card onClick={() => {}}>Content</Card>);
145
+ expect(container.firstChild).toHaveClass('cursor-pointer');
146
+ });
147
+ });
148
+
149
+ describe('Accessibility', () => {
150
+ it('forwards ref correctly', () => {
151
+ const ref = React.createRef<HTMLDivElement>();
152
+ render(<Card ref={ref}>Content</Card>);
153
+ expect(ref.current).toBeInstanceOf(HTMLDivElement);
154
+ });
155
+ });
156
+ });
157
+ ```
158
+
159
+ ### 4. Storybook Stories Template
160
+
161
+ **Interactive Documentation**:
162
+ ```typescript
163
+ import type { Meta, StoryObj } from '@storybook/react';
164
+ import { Card } from './Card';
165
+
166
+ const meta: Meta<typeof Card> = {
167
+ title: 'Molecules/Card',
168
+ component: Card,
169
+ tags: ['autodocs'],
170
+ argTypes: {
171
+ variant: {
172
+ control: 'select',
173
+ options: ['default', 'outlined', 'elevated'],
174
+ description: 'Visual variant of the card',
175
+ },
176
+ onClick: {
177
+ action: 'clicked',
178
+ },
179
+ },
180
+ decorators: [
181
+ (Story) => (
182
+ <div className="p-8 bg-gray-50">
183
+ <Story />
184
+ </div>
185
+ ),
186
+ ],
187
+ };
188
+
189
+ export default meta;
190
+ type Story = StoryObj<typeof Card>;
191
+
192
+ export const Default: Story = {
193
+ args: {
194
+ children: 'This is a default card with some content.',
195
+ },
196
+ };
197
+
198
+ export const WithTitle: Story = {
199
+ args: {
200
+ title: 'Card Title',
201
+ children: 'Card content goes here with a title above.',
202
+ },
203
+ };
204
+
205
+ export const WithFooter: Story = {
206
+ args: {
207
+ title: 'Card with Footer',
208
+ children: 'Main content area',
209
+ footer: <button className="text-blue-600 hover:underline">Learn more</button>,
210
+ },
211
+ };
212
+
213
+ export const Outlined: Story = {
214
+ args: {
215
+ variant: 'outlined',
216
+ title: 'Outlined Card',
217
+ children: 'This card has an outlined style.',
218
+ },
219
+ };
220
+
221
+ export const Elevated: Story = {
222
+ args: {
223
+ variant: 'elevated',
224
+ title: 'Elevated Card',
225
+ children: 'This card has a shadow elevation effect.',
226
+ },
227
+ };
228
+
229
+ export const Clickable: Story = {
230
+ args: {
231
+ title: 'Clickable Card',
232
+ children: 'Click me to trigger an action!',
233
+ onClick: () => alert('Card clicked!'),
234
+ },
235
+ };
236
+
237
+ export const Complex: Story = {
238
+ args: {
239
+ title: 'User Profile',
240
+ variant: 'elevated',
241
+ children: (
242
+ <div className="space-y-2">
243
+ <p className="text-sm text-gray-600">John Doe</p>
244
+ <p className="text-xs text-gray-500">john.doe@example.com</p>
245
+ <div className="flex gap-2 mt-4">
246
+ <span className="px-2 py-1 bg-blue-100 text-blue-800 rounded text-xs">Admin</span>
247
+ <span className="px-2 py-1 bg-green-100 text-green-800 rounded text-xs">Active</span>
248
+ </div>
249
+ </div>
250
+ ),
251
+ footer: (
252
+ <button className="w-full py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
253
+ View Profile
254
+ </button>
255
+ ),
256
+ },
257
+ };
258
+ ```
259
+
260
+ ### 5. Vue 3 Component Template (Composition API)
261
+
262
+ ```vue
263
+ <script setup lang="ts">
264
+ import { computed } from 'vue';
265
+
266
+ export interface CardProps {
267
+ title?: string;
268
+ variant?: 'default' | 'outlined' | 'elevated';
269
+ footer?: boolean;
270
+ }
271
+
272
+ const props = withDefaults(defineProps<CardProps>(), {
273
+ variant: 'default',
274
+ footer: false,
275
+ });
276
+
277
+ const emit = defineEmits<{
278
+ click: [];
279
+ }>();
280
+
281
+ const cardClasses = computed(() => {
282
+ const base = 'rounded-lg p-6 transition-all';
283
+ const variants = {
284
+ default: 'bg-white border border-gray-200',
285
+ outlined: 'bg-transparent border-2 border-gray-300',
286
+ elevated: 'bg-white shadow-lg hover:shadow-xl',
287
+ };
288
+ return `${base} ${variants[props.variant]}`;
289
+ });
290
+
291
+ const handleClick = () => {
292
+ emit('click');
293
+ };
294
+ </script>
295
+
296
+ <template>
297
+ <div :class="cardClasses" @click="handleClick">
298
+ <h3 v-if="title" class="text-lg font-semibold mb-4 text-gray-900">
299
+ {{ title }}
300
+ </h3>
301
+ <div class="text-gray-700">
302
+ <slot />
303
+ </div>
304
+ <div v-if="footer || $slots.footer" class="mt-4 pt-4 border-t border-gray-200">
305
+ <slot name="footer" />
306
+ </div>
307
+ </div>
308
+ </template>
309
+ ```
310
+
311
+ ### 6. Angular Component Template
312
+
313
+ **TypeScript**:
314
+ ```typescript
315
+ import { Component, Input, Output, EventEmitter } from '@angular/core';
316
+ import { CommonModule } from '@angular/common';
317
+
318
+ export type CardVariant = 'default' | 'outlined' | 'elevated';
319
+
320
+ @Component({
321
+ selector: 'app-card',
322
+ standalone: true,
323
+ imports: [CommonModule],
324
+ templateUrl: './card.component.html',
325
+ styleUrls: ['./card.component.css'],
326
+ })
327
+ export class CardComponent {
328
+ @Input() title?: string;
329
+ @Input() variant: CardVariant = 'default';
330
+ @Input() footer?: string;
331
+ @Output() cardClick = new EventEmitter<void>();
332
+
333
+ get cardClasses(): string {
334
+ const base = 'rounded-lg p-6 transition-all';
335
+ const variants = {
336
+ default: 'bg-white border border-gray-200',
337
+ outlined: 'bg-transparent border-2 border-gray-300',
338
+ elevated: 'bg-white shadow-lg hover:shadow-xl',
339
+ };
340
+ return `${base} ${variants[this.variant]}`;
341
+ }
342
+
343
+ onClick(): void {
344
+ this.cardClick.emit();
345
+ }
346
+ }
347
+ ```
348
+
349
+ **HTML**:
350
+ ```html
351
+ <div [class]="cardClasses" (click)="onClick()">
352
+ <h3 *ngIf="title" class="text-lg font-semibold mb-4 text-gray-900">
353
+ {{ title }}
354
+ </h3>
355
+ <div class="text-gray-700">
356
+ <ng-content></ng-content>
357
+ </div>
358
+ <div *ngIf="footer" class="mt-4 pt-4 border-t border-gray-200">
359
+ <ng-content select="[footer]"></ng-content>
360
+ </div>
361
+ </div>
362
+ ```
363
+
364
+ ### 7. Component Documentation Template
365
+
366
+ **README.md**:
367
+ ```markdown
368
+ # Card Component
369
+
370
+ A versatile card container component with multiple variants and optional footer.
371
+
372
+ ## Features
373
+
374
+ - Multiple visual variants (default, outlined, elevated)
375
+ - Optional title and footer sections
376
+ - Clickable with hover effects
377
+ - Fully typed with TypeScript
378
+ - Responsive and accessible
379
+ - Comprehensive test coverage
380
+
381
+ ## Usage
382
+
383
+ ### React
384
+ \`\`\`tsx
385
+ import { Card } from '@/components/molecules/Card';
386
+
387
+ <Card title="Welcome" variant="elevated" onClick={handleClick}>
388
+ <p>Card content here</p>
389
+ </Card>
390
+ \`\`\`
391
+
392
+ ### Vue 3
393
+ \`\`\`vue
394
+ <Card title="Welcome" variant="elevated" @click="handleClick">
395
+ <p>Card content here</p>
396
+ <template #footer>
397
+ <button>Action</button>
398
+ </template>
399
+ </Card>
400
+ \`\`\`
401
+
402
+ ### Angular
403
+ \`\`\`html
404
+ <app-card title="Welcome" variant="elevated" (cardClick)="handleClick()">
405
+ <p>Card content here</p>
406
+ <div footer>
407
+ <button>Action</button>
408
+ </div>
409
+ </app-card>
410
+ \`\`\`
411
+
412
+ ## Props
413
+
414
+ | Prop | Type | Default | Description |
415
+ |------|------|---------|-------------|
416
+ | title | string | - | Optional card title |
417
+ | variant | 'default' \| 'outlined' \| 'elevated' | 'default' | Visual style variant |
418
+ | footer | ReactNode/slot | - | Optional footer content |
419
+ | onClick | function | - | Click handler |
420
+
421
+ ## Examples
422
+
423
+ See Storybook for interactive examples and all variants.
424
+
425
+ ## Accessibility
426
+
427
+ - Semantic HTML structure
428
+ - Keyboard navigation support
429
+ - ARIA labels where appropriate
430
+ - Color contrast compliance (WCAG AA)
431
+
432
+ ## Testing
433
+
434
+ Run tests:
435
+ \`\`\`bash
436
+ npm test Card.test.tsx
437
+ \`\`\`
438
+
439
+ Coverage: 95%+ (statements, branches, functions, lines)
440
+ ```
441
+
442
+ ### 8. Component File Structure
443
+
444
+ ```
445
+ components/{level}/{ComponentName}/
446
+ ├── index.ts # Barrel export
447
+ ├── {ComponentName}.tsx # Component implementation
448
+ ├── {ComponentName}.test.tsx # Unit tests
449
+ ├── {ComponentName}.stories.tsx # Storybook stories
450
+ ├── {ComponentName}.module.css # Scoped styles (if not using Tailwind)
451
+ └── README.md # Documentation
452
+ ```
453
+
454
+ ### 9. Index Export
455
+
456
+ **index.ts**:
457
+ ```typescript
458
+ export { Card } from './Card';
459
+ export type { CardProps } from './Card';
460
+ ```
461
+
462
+ ### 10. Component Checklist
463
+
464
+ Before considering a component complete:
465
+ - [ ] TypeScript interface with JSDoc comments
466
+ - [ ] All variants implemented and tested
467
+ - [ ] Unit tests with >80% coverage
468
+ - [ ] Storybook stories for all variants
469
+ - [ ] README documentation
470
+ - [ ] Accessibility compliance (ARIA, keyboard nav)
471
+ - [ ] Responsive design
472
+ - [ ] Error states handled
473
+ - [ ] Loading states (if applicable)
474
+ - [ ] Dark mode support (if applicable)
475
+ - [ ] Performance optimized (React.memo, useMemo)
476
+
477
+ ## Workflow
478
+
479
+ 1. Ask about component requirements (type, props, variants)
480
+ 2. Determine Atomic Design level (atom/molecule/organism)
481
+ 3. Generate component implementation
482
+ 4. Create comprehensive unit tests
483
+ 5. Add Storybook stories for all variants
484
+ 6. Write documentation (README)
485
+ 7. Implement accessibility features
486
+ 8. Add to component index for easy imports
487
+
488
+ ## Example Usage
489
+
490
+ **User**: "Generate a SearchBar molecule component with input and button"
491
+
492
+ **Response**:
493
+ Creates complete SearchBar component with:
494
+ - TypeScript implementation (React/Vue/Angular)
495
+ - Props interface (query, onSearch, placeholder, etc.)
496
+ - Unit tests (rendering, interactions, validation)
497
+ - Storybook stories (default, with results, loading state)
498
+ - README documentation
499
+ - Accessibility features (ARIA labels, keyboard shortcuts)
500
+ - Responsive design
501
+
502
+ ## When to Use
503
+
504
+ - Creating new UI components
505
+ - Refactoring existing components to design system
506
+ - Building component libraries
507
+ - Ensuring consistent component structure
508
+ - Improving component documentation and testing
509
+
510
+ Generate production-ready components with complete tests and documentation!