@auto-engineer/frontend-implementer 1.8.0 → 1.10.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.
package/package.json CHANGED
@@ -19,14 +19,14 @@
19
19
  "openai": "^5.7.0",
20
20
  "vite": "^5.4.1",
21
21
  "zod": "^3.25.67",
22
- "@auto-engineer/ai-gateway": "1.8.0",
23
- "@auto-engineer/message-bus": "1.8.0"
22
+ "@auto-engineer/message-bus": "1.10.0",
23
+ "@auto-engineer/ai-gateway": "1.10.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "playwright": "^1.54.1",
27
- "@auto-engineer/cli": "1.8.0"
27
+ "@auto-engineer/cli": "1.10.0"
28
28
  },
29
- "version": "1.8.0",
29
+ "version": "1.10.0",
30
30
  "scripts": {
31
31
  "start": "tsx src/index.ts",
32
32
  "build": "tsc && tsx ../../scripts/fix-esm-imports.ts && cp src/*.html dist/src/ 2>/dev/null || true",
package/src/agent.ts CHANGED
@@ -139,6 +139,20 @@ interface Scheme {
139
139
  description?: string;
140
140
  items?: Record<string, unknown>;
141
141
  };
142
+ templates?: {
143
+ description?: string;
144
+ items?: Record<
145
+ string,
146
+ {
147
+ description: string;
148
+ layout?: {
149
+ organisms: string[];
150
+ };
151
+ specs?: string[];
152
+ [key: string]: unknown;
153
+ }
154
+ >;
155
+ };
142
156
  pages?: {
143
157
  description?: string;
144
158
  items?: Record<
@@ -146,8 +160,10 @@ interface Scheme {
146
160
  {
147
161
  route: string;
148
162
  description: string;
149
- layout?: unknown;
163
+ template: string;
150
164
  navigation?: unknown;
165
+ specs?: string[];
166
+ data_requirements?: unknown[];
151
167
  [key: string]: unknown;
152
168
  }
153
169
  >;
@@ -175,8 +191,9 @@ async function loadScheme(iaSchemeDir: string): Promise<Scheme | undefined> {
175
191
  const scheme = JSON.parse(content) as Scheme;
176
192
  debugContext('IA scheme loaded successfully');
177
193
  debugContext(
178
- 'Scheme has %d pages, %d organisms, %d molecules, %d atoms',
194
+ 'Scheme has %d pages, %d templates, %d organisms, %d molecules, %d atoms',
179
195
  Object.keys(scheme.pages?.items ?? {}).length,
196
+ Object.keys(scheme.templates?.items ?? {}).length,
180
197
  Object.keys(scheme.organisms?.items ?? {}).length,
181
198
  Object.keys(scheme.molecules?.items ?? {}).length,
182
199
  Object.keys(scheme.atoms?.items ?? {}).length,
@@ -232,7 +249,9 @@ async function getKeyFileContents(projectDir: string, files: string[]): Promise<
232
249
  function getFileTreeSummary(
233
250
  files: string[],
234
251
  atoms: { name: string; props: { name: string; type: string }[] }[],
252
+ scheme: Scheme | undefined,
235
253
  ): string[] {
254
+ const templateNames = Object.keys(scheme?.templates?.items ?? {});
236
255
  return [
237
256
  ...files.filter(
238
257
  (f) =>
@@ -243,7 +262,8 @@ function getFileTreeSummary(
243
262
  ['src/App.tsx', 'src/routes.tsx', 'src/main.tsx'].includes(f),
244
263
  ),
245
264
  `src/components/atoms/ (atoms: ${atoms.map((a) => a.name).join(', ')})`,
246
- ];
265
+ templateNames.length > 0 ? `src/components/templates/ (templates: ${templateNames.join(', ')})` : '',
266
+ ].filter(Boolean);
247
267
  }
248
268
 
249
269
  async function getTheme(designSystem: string): Promise<string> {
@@ -288,7 +308,7 @@ async function getProjectContext(
288
308
  getTheme(designSystem),
289
309
  ]);
290
310
 
291
- const fileTreeSummary = getFileTreeSummary(files, atoms);
311
+ const fileTreeSummary = getFileTreeSummary(files, atoms, scheme);
292
312
  debugContext('File tree summary created with %d entries', fileTreeSummary.length);
293
313
 
294
314
  debugContext('Project context built successfully');
@@ -358,13 +378,69 @@ Transform the IA schema into a complete, production-ready application. Every cha
358
378
  </GOALS>
359
379
 
360
380
  <INSTRUCTIONS>
361
- ## Visual Excellence Mandate
362
- - Typography hierarchy that reads with confidence; body copy airy and legible; labels precise.
363
- - Spacing rhythm on Tailwind’s 4px scale; balanced proportions and breathing room across breakpoints.
364
- - Interactive states for all controls: hover, focus, active, disabled.
365
- - Micro-interactions using **Motion**: smooth fades, gentle slides, fluid expansions.
366
- - Consistent iconography via lucide-react; aligned sizes and spacing.
367
- - Responsive mastery: mobile, tablet, desktop must each feel intentionally designed.
381
+ ## Visual Excellence Mandate (UI MASTERY GUIDELINES)
382
+
383
+ ### Typography Hierarchy Mastery
384
+ - Headlines: Extra-large size, bold weight, tight letter-spacing (commanding presence)
385
+ - Subheadings: Large size, semi-bold weight (clear section breaks)
386
+ - Body: Medium size, regular weight, relaxed line-height (comfortable reading)
387
+ - Captions/Labels: Small size, regular weight, muted color (subtle context)
388
+ - Color Psychology: Primary text (darkest), secondary (medium), tertiary (lightest)
389
+ - NEVER create pages with uniform text sizes - hierarchy is mandatory
390
+
391
+ ### Spacing Rhythm (8px base scale)
392
+ - Section gaps: Large spacing for major visual breaks (scale with viewport)
393
+ - Content blocks: Medium spacing for related content groups
394
+ - Element spacing: Small spacing for tight relationships
395
+ - Padding: Generous padding that scales with viewport size
396
+ - Use consistent multipliers: 8, 16, 24, 32, 48, 64, 96px
397
+
398
+ ### Interactive States (MANDATORY for all controls)
399
+ - Hover: Shadow elevation, background shift, or subtle scale - visible feedback
400
+ - Focus: Clear focus ring with offset - accessibility essential
401
+ - Active: Slight scale down - tactile feedback on press
402
+ - Disabled: Reduced opacity, not-allowed cursor - clear unusability signal
403
+ - Transitions: Smooth 200ms transitions with ease-in-out - smooth state changes
404
+
405
+ ### Button Hierarchy (Primary, Secondary, Ghost)
406
+ - Primary: Primary background, contrasting text, slight shadow
407
+ - Secondary: Secondary background, appropriate text color
408
+ - Outline: Border with primary color, transparent background, fill on hover
409
+ - Ghost: Transparent background, visible only on hover
410
+ - Destructive: Error/danger color background with contrasting text
411
+
412
+ ### Card & Surface Design
413
+ - Cards: Card background, rounded corners, subtle border, soft shadow
414
+ - Elevated surfaces: Stronger shadow for modals/dropdowns
415
+ - Subtle surfaces: Muted background for secondary sections
416
+ - Interactive cards: Pointer cursor, border highlight or shadow on hover
417
+
418
+ ### Loading State Excellence
419
+ - Skeleton screens with subtle pulse animation for content placeholders
420
+ - Subtle spinners (not blocking) for background operations
421
+ - Progress bars for long operations with estimated time
422
+ - NEVER show blank screens or raw "Loading..." text
423
+ - Loading states should feel intentional and designed
424
+
425
+ ### Error Handling Grace
426
+ - Friendly, helpful error messages (not technical jargon)
427
+ - Clear recovery actions ("Try again", "Go back", "Contact support")
428
+ - Destructive states use error background with appropriate text color
429
+ - Error boundaries wrap risky components
430
+ - Toast notifications for transient errors
431
+
432
+ ### Micro-interactions using Motion (framer-motion)
433
+ - Entrance: Fade in and slide up from below
434
+ - Exit: Fade out with slight scale down
435
+ - Stagger children: Sequential animation with slight delay
436
+ - Spring physics: Natural spring-based animations
437
+ - Respect prefers-reduced-motion
438
+
439
+ ### Iconography Consistency
440
+ - Use lucide-react exclusively for icons
441
+ - Sizes: 16px (inline), 20px (default), 24px (prominent), 32px (hero)
442
+ - Icons should align with adjacent text using flex and gap
443
+ - Icons should enhance meaning, not just decorate - every icon has purpose
368
444
 
369
445
  ## Layout Rules
370
446
  - **Single Page Applications (SPAs)**: Avoid page-level scrollbars; scrolling must happen only within defined content regions. Preserve a fluid, app-like feel across breakpoints.
@@ -372,11 +448,29 @@ Transform the IA schema into a complete, production-ready application. Every cha
372
448
  - For single-purpose flows (checkout, booking, signup), craft minimal, elegant, stepwise journeys.
373
449
  - Avoid generic headings; communicate structure via layout, tokens, and spacing.
374
450
 
451
+ ### Responsive Breakpoints (Mobile-First)
452
+ - Small (~640px): Tablet portrait - increase padding, 2-column grids
453
+ - Medium (~768px): Tablet landscape - reveal sidebars, 3-column grids
454
+ - Large (~1024px): Desktop - full layouts, larger typography
455
+ - Extra-large (~1280px): Large desktop - max-width containers, generous spacing
456
+ - Ultra-wide (~1536px): Consider multi-panel layouts
457
+
375
458
  ## Component & Code Standards
376
459
  - Atomic design: atoms → molecules → organisms → templates → pages; reuse atoms before creating anything new.
377
460
  - Keep components concise (~50 lines when feasible) and fully typed (<Name>Props).
378
461
  - Accessibility is mandatory: ARIA roles, focus management, keyboard navigation.
379
462
  - Named exports only; avoid prop drilling via context or colocated state.
463
+ - When updating an existing component, treat any comments already in the code as specifications describing the intended behavior and structure. Follow those specs faithfully in your implementation. Then strip ALL comments and implementation details from the output code. No inline comments (// ...), no block comments (/* ... */), no JSDoc blocks, no TODO/FIXME/HACK annotations, no auto-generated notes. Code must be entirely self-documenting through clear naming, structure, and typing.
464
+
465
+ ## Template Architecture
466
+ - Templates are page-level layout structures that compose organisms into complete layouts.
467
+ - Templates define the skeletal framework (header, sidebar, main content, footer regions) without real data.
468
+ - Templates must be reusable across multiple pages - they provide structure, pages provide content.
469
+ - Each template should have a children prop or defined slots for page-specific content.
470
+ - Templates reference organisms via their layout.organisms array in the IA schema.
471
+ - Pages reference exactly one template via the template field - pages are instances of templates with real data.
472
+ - Template responsibilities: layout structure, responsive behavior, spacing rhythm, region definitions.
473
+ - Page responsibilities: data fetching, route handling, passing data to template/organisms, navigation logic.
380
474
 
381
475
  ## GraphQL Integration Rules
382
476
  - Use Apollo Client hooks and only the documents in:
@@ -390,20 +484,112 @@ Transform the IA schema into a complete, production-ready application. Every cha
390
484
  - Route Reachability: every page/route must be reachable from at least one navigational entry (sidebar/topbar/menu/CTA). If a route is not part of the core journey or becomes unreachable, remove it.
391
485
  - Navigation Continuity: define a coherent journey (Landing → Auth → Onboarding → Dashboard → Feature → Settings). After any critical action, update related views and caches to reflect the new state.
392
486
  - Router Source of Truth: update routing so there is a default index route for the main experience, all declared routes are reachable, and unused ones are pruned.
393
- - File Dependency Order: list changes so that dependencies are created before dependents (atoms/molecules/templates first, then pages, then routing and providers).
487
+ - File Dependency Order: list changes so that dependencies are created before dependents (atomsmolecules → organisms → templates pages routing/providers).
394
488
  - Key File Rule: key files contain all needed imports/specs; do not alter their imports/specs—implement only within the allowed surface.
395
489
 
396
490
  ## Color Usage Contract
397
491
  - A single accent color must never dominate the interface. Primary actions may use the strongest accent, but it should account for no more than ~25% of visible UI.
398
492
  - Distribute semantic colors across the interface for balance and clarity:
399
- - Growth or success metrics → positive color
400
- - Completion or engagement metrics → secondary accent
401
- - Targets, goals, or warnings → attention color
402
- - Errors or urgent states → critical color
403
- - Cards and surfaces should primarily use neutral backgrounds (white or light gray). Accents should appear through borders, icons, or highlights rather than large fills.
493
+ - Growth or success metrics → positive/success color (greens)
494
+ - Completion or engagement metrics → secondary accent (blues)
495
+ - Targets, goals, or warnings → attention/warning color (ambers/yellows)
496
+ - Errors or urgent states → critical/destructive color (reds)
497
+ - Cards and surfaces should primarily use neutral backgrounds. Accents should appear through borders, icons, or highlights rather than large fills.
404
498
  - Each dashboard view must showcase at least 3 distinct semantic colors to avoid monotony and reinforce hierarchy.
405
499
  - Accents must always support meaning (not decoration alone) and follow consistent usage across the app.
406
500
 
501
+ ## Component Design Patterns
502
+
503
+ ### Form Elements
504
+ - Inputs: Consistent height, horizontal padding, rounded corners, border, focus ring
505
+ - Labels: Small text, medium weight, visually linked to input
506
+ - Error states: Error-colored border, error-colored focus ring
507
+ - Help text: Small muted text below input
508
+
509
+ ### Data Display
510
+ - Tables: Row dividers, subtle row hover effect
511
+ - Lists: Vertical spacing, clear separators or alternating backgrounds
512
+ - Stats/Metrics: Large bold numbers with trend indicators
513
+ - Empty states: Centered, illustrative icon, clear call-to-action
514
+
515
+ ### Navigation Patterns
516
+ - Sidebar: Fixed left, 240-280px wide, collapsible to icons on mobile
517
+ - Top nav: Sticky at top, consistent height, bottom border, backdrop blur on scroll
518
+ - Breadcrumbs: Small text, muted color, hover to foreground color
519
+ - Tabs: Inline horizontal layout, bottom border, active indicator
520
+
521
+ ### Modal & Dialog Design
522
+ - Backdrop: Dark semi-transparent overlay with backdrop blur
523
+ - Container: Card background, rounded corners, shadow, centered with max-width
524
+ - Header: Horizontal padding, bottom border, close button positioned top-right
525
+ - Footer: Horizontal padding, top border, actions aligned right with gap
526
+
527
+ ## VISUAL POLISH CHECKLIST (Apply to ALL components)
528
+
529
+ Every component you create MUST have:
530
+ 1. Proper spacing: Consistent padding and gaps using your design scale
531
+ 2. Border radius: Rounded corners for cards and containers
532
+ 3. Subtle shadows: Soft shadow for cards, elevated shadow on hover
533
+ 4. Transitions: Smooth ~200ms transitions on interactive elements
534
+ 5. Hover states: Background shift or shadow elevation on hover
535
+ 6. Focus states: Visible focus ring for accessibility
536
+
537
+ ## STYLING PATTERNS BY ELEMENT TYPE
538
+
539
+ ### Containers/Wrappers:
540
+ - Page wrapper: Full viewport height, page background color
541
+ - Content container: Max-width centered with responsive horizontal padding
542
+ - Section: Generous vertical padding that scales with viewport
543
+ - Card: Rounded corners, border, card background, subtle shadow
544
+
545
+ ### Typography:
546
+ - Page title: Large size, bold weight, tight letter-spacing
547
+ - Section heading: Medium-large size, semi-bold weight
548
+ - Card title: Medium size, medium weight
549
+ - Body text: Base size, muted color
550
+ - Small/caption: Small size, muted color
551
+
552
+ ### Interactive Elements:
553
+ - Clickable card: Shadow on hover, subtle border highlight, pointer cursor
554
+ - List item: Background change on hover, smooth color transition
555
+ - Icon button: Background on hover, rounded shape, padding
556
+
557
+ ### Grids and Lists:
558
+ - Card grid: Responsive columns (1→2→3), consistent gap spacing
559
+ - List: Consistent vertical spacing between items
560
+ - Inline items: Flex row, center aligned, consistent gap
561
+
562
+ ### Loading States:
563
+ - Skeleton: Use Skeleton components matching content dimensions
564
+ - Container: Same layout structure as loaded state to prevent shift
565
+
566
+ ### Empty States:
567
+ - Centered: Flex column, center aligned both axes, generous vertical padding
568
+ - Icon: Rounded background, muted styling, bottom margin
569
+ - Message: Muted text, constrained width
570
+
571
+ ## ANTI-PATTERNS (NEVER DO THESE)
572
+
573
+ WRONG: No styling on containers
574
+ <div>{children}</div>
575
+ RIGHT: Always add appropriate styling
576
+ <div> with spacing and padding applied
577
+
578
+ WRONG: Missing interactive feedback
579
+ <div onClick={...}>{item}</div>
580
+ RIGHT: Visual feedback for interactions
581
+ <div onClick={...}> with cursor, hover state, transition, and padding
582
+
583
+ WRONG: Flat cards with no depth
584
+ <div> with only border and padding
585
+ RIGHT: Cards with proper styling
586
+ <Card> component with hover shadow and transition
587
+
588
+ WRONG: No visual hierarchy
589
+ <p>{title}</p><p>{description}</p>
590
+ RIGHT: Clear hierarchy with size/weight/color
591
+ <h3> for title with bold weight, <p> for description with muted style
592
+
407
593
  ## Output Format (STRICT)
408
594
  Respond ONLY with a JSON array. No prose. No markdown. Each item:
409
595
  - "action": "create" | "update"
@@ -416,6 +602,9 @@ ${JSON.stringify(ctx.fileTreeSummary, null, 2)}
416
602
  Available Atoms:
417
603
  ${JSON.stringify(ctx.atoms, null, 2)}
418
604
 
605
+ Available Templates (from IA Schema):
606
+ ${JSON.stringify(ctx.scheme?.templates?.items ?? {}, null, 2)}
607
+
419
608
  Key Files:
420
609
  ${keyFileContents}
421
610