@auto-engineer/frontend-implementer 1.8.0 → 1.9.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/ai-gateway": "1.9.0",
23
+ "@auto-engineer/message-bus": "1.9.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "playwright": "^1.54.1",
27
- "@auto-engineer/cli": "1.8.0"
27
+ "@auto-engineer/cli": "1.9.0"
28
28
  },
29
- "version": "1.8.0",
29
+ "version": "1.9.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,12 +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.
380
463
 
464
+ ## Template Architecture
465
+ - Templates are page-level layout structures that compose organisms into complete layouts.
466
+ - Templates define the skeletal framework (header, sidebar, main content, footer regions) without real data.
467
+ - Templates must be reusable across multiple pages - they provide structure, pages provide content.
468
+ - Each template should have a children prop or defined slots for page-specific content.
469
+ - Templates reference organisms via their layout.organisms array in the IA schema.
470
+ - Pages reference exactly one template via the template field - pages are instances of templates with real data.
471
+ - Template responsibilities: layout structure, responsive behavior, spacing rhythm, region definitions.
472
+ - Page responsibilities: data fetching, route handling, passing data to template/organisms, navigation logic.
473
+
381
474
  ## GraphQL Integration Rules
382
475
  - Use Apollo Client hooks and only the documents in:
383
476
  - src/graphql/queries.ts
@@ -390,20 +483,112 @@ Transform the IA schema into a complete, production-ready application. Every cha
390
483
  - 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
484
  - 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
485
  - 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).
486
+ - File Dependency Order: list changes so that dependencies are created before dependents (atomsmolecules → organisms → templates pages routing/providers).
394
487
  - Key File Rule: key files contain all needed imports/specs; do not alter their imports/specs—implement only within the allowed surface.
395
488
 
396
489
  ## Color Usage Contract
397
490
  - 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
491
  - 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.
492
+ - Growth or success metrics → positive/success color (greens)
493
+ - Completion or engagement metrics → secondary accent (blues)
494
+ - Targets, goals, or warnings → attention/warning color (ambers/yellows)
495
+ - Errors or urgent states → critical/destructive color (reds)
496
+ - Cards and surfaces should primarily use neutral backgrounds. Accents should appear through borders, icons, or highlights rather than large fills.
404
497
  - Each dashboard view must showcase at least 3 distinct semantic colors to avoid monotony and reinforce hierarchy.
405
498
  - Accents must always support meaning (not decoration alone) and follow consistent usage across the app.
406
499
 
500
+ ## Component Design Patterns
501
+
502
+ ### Form Elements
503
+ - Inputs: Consistent height, horizontal padding, rounded corners, border, focus ring
504
+ - Labels: Small text, medium weight, visually linked to input
505
+ - Error states: Error-colored border, error-colored focus ring
506
+ - Help text: Small muted text below input
507
+
508
+ ### Data Display
509
+ - Tables: Row dividers, subtle row hover effect
510
+ - Lists: Vertical spacing, clear separators or alternating backgrounds
511
+ - Stats/Metrics: Large bold numbers with trend indicators
512
+ - Empty states: Centered, illustrative icon, clear call-to-action
513
+
514
+ ### Navigation Patterns
515
+ - Sidebar: Fixed left, 240-280px wide, collapsible to icons on mobile
516
+ - Top nav: Sticky at top, consistent height, bottom border, backdrop blur on scroll
517
+ - Breadcrumbs: Small text, muted color, hover to foreground color
518
+ - Tabs: Inline horizontal layout, bottom border, active indicator
519
+
520
+ ### Modal & Dialog Design
521
+ - Backdrop: Dark semi-transparent overlay with backdrop blur
522
+ - Container: Card background, rounded corners, shadow, centered with max-width
523
+ - Header: Horizontal padding, bottom border, close button positioned top-right
524
+ - Footer: Horizontal padding, top border, actions aligned right with gap
525
+
526
+ ## VISUAL POLISH CHECKLIST (Apply to ALL components)
527
+
528
+ Every component you create MUST have:
529
+ 1. Proper spacing: Consistent padding and gaps using your design scale
530
+ 2. Border radius: Rounded corners for cards and containers
531
+ 3. Subtle shadows: Soft shadow for cards, elevated shadow on hover
532
+ 4. Transitions: Smooth ~200ms transitions on interactive elements
533
+ 5. Hover states: Background shift or shadow elevation on hover
534
+ 6. Focus states: Visible focus ring for accessibility
535
+
536
+ ## STYLING PATTERNS BY ELEMENT TYPE
537
+
538
+ ### Containers/Wrappers:
539
+ - Page wrapper: Full viewport height, page background color
540
+ - Content container: Max-width centered with responsive horizontal padding
541
+ - Section: Generous vertical padding that scales with viewport
542
+ - Card: Rounded corners, border, card background, subtle shadow
543
+
544
+ ### Typography:
545
+ - Page title: Large size, bold weight, tight letter-spacing
546
+ - Section heading: Medium-large size, semi-bold weight
547
+ - Card title: Medium size, medium weight
548
+ - Body text: Base size, muted color
549
+ - Small/caption: Small size, muted color
550
+
551
+ ### Interactive Elements:
552
+ - Clickable card: Shadow on hover, subtle border highlight, pointer cursor
553
+ - List item: Background change on hover, smooth color transition
554
+ - Icon button: Background on hover, rounded shape, padding
555
+
556
+ ### Grids and Lists:
557
+ - Card grid: Responsive columns (1→2→3), consistent gap spacing
558
+ - List: Consistent vertical spacing between items
559
+ - Inline items: Flex row, center aligned, consistent gap
560
+
561
+ ### Loading States:
562
+ - Skeleton: Use Skeleton components matching content dimensions
563
+ - Container: Same layout structure as loaded state to prevent shift
564
+
565
+ ### Empty States:
566
+ - Centered: Flex column, center aligned both axes, generous vertical padding
567
+ - Icon: Rounded background, muted styling, bottom margin
568
+ - Message: Muted text, constrained width
569
+
570
+ ## ANTI-PATTERNS (NEVER DO THESE)
571
+
572
+ WRONG: No styling on containers
573
+ <div>{children}</div>
574
+ RIGHT: Always add appropriate styling
575
+ <div> with spacing and padding applied
576
+
577
+ WRONG: Missing interactive feedback
578
+ <div onClick={...}>{item}</div>
579
+ RIGHT: Visual feedback for interactions
580
+ <div onClick={...}> with cursor, hover state, transition, and padding
581
+
582
+ WRONG: Flat cards with no depth
583
+ <div> with only border and padding
584
+ RIGHT: Cards with proper styling
585
+ <Card> component with hover shadow and transition
586
+
587
+ WRONG: No visual hierarchy
588
+ <p>{title}</p><p>{description}</p>
589
+ RIGHT: Clear hierarchy with size/weight/color
590
+ <h3> for title with bold weight, <p> for description with muted style
591
+
407
592
  ## Output Format (STRICT)
408
593
  Respond ONLY with a JSON array. No prose. No markdown. Each item:
409
594
  - "action": "create" | "update"
@@ -416,6 +601,9 @@ ${JSON.stringify(ctx.fileTreeSummary, null, 2)}
416
601
  Available Atoms:
417
602
  ${JSON.stringify(ctx.atoms, null, 2)}
418
603
 
604
+ Available Templates (from IA Schema):
605
+ ${JSON.stringify(ctx.scheme?.templates?.items ?? {}, null, 2)}
606
+
419
607
  Key Files:
420
608
  ${keyFileContents}
421
609