@auto-engineer/frontend-implementer 0.10.4 → 0.11.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/.turbo/turbo-build.log +6 -0
- package/.turbo/turbo-format.log +4 -0
- package/.turbo/turbo-lint.log +5 -0
- package/.turbo/turbo-test.log +15 -0
- package/.turbo/turbo-type-check.log +5 -0
- package/CHANGELOG.md +20 -0
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +73 -122
- package/dist/src/agent.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/agent.ts +73 -122
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": "0.
|
|
23
|
-
"@auto-engineer/message-bus": "0.
|
|
22
|
+
"@auto-engineer/ai-gateway": "0.11.0",
|
|
23
|
+
"@auto-engineer/message-bus": "0.11.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"playwright": "^1.54.1",
|
|
27
|
-
"@auto-engineer/cli": "0.
|
|
27
|
+
"@auto-engineer/cli": "0.11.0"
|
|
28
28
|
},
|
|
29
|
-
"version": "0.
|
|
29
|
+
"version": "0.11.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
|
@@ -117,7 +117,7 @@ function extractJsonArray(text: string): string {
|
|
|
117
117
|
|
|
118
118
|
async function callAI(prompt: string, options?: { temperature?: number; maxTokens?: number }) {
|
|
119
119
|
const temperature = options?.temperature ?? 0.2;
|
|
120
|
-
const maxTokens = options?.maxTokens ?? 4000;
|
|
120
|
+
const maxTokens = options?.maxTokens ?? 4000 * 3;
|
|
121
121
|
debugAI('Calling AI with prompt length: %d, temperature: %f, maxTokens: %d', prompt.length, temperature, maxTokens);
|
|
122
122
|
const result = await generateTextWithAI(prompt, { provider, temperature, maxTokens });
|
|
123
123
|
debugAI('AI response received, length: %d', result.length);
|
|
@@ -343,135 +343,86 @@ function makeBasePrompt(ctx: ProjectContext): string {
|
|
|
343
343
|
.join('\n');
|
|
344
344
|
|
|
345
345
|
return `
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
-
|
|
357
|
-
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
-
|
|
363
|
-
-
|
|
364
|
-
-
|
|
365
|
-
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
-
|
|
372
|
-
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
385
|
-
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
-
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
-
|
|
398
|
-
-
|
|
399
|
-
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
-
|
|
403
|
-
-
|
|
404
|
-
|
|
405
|
-
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
- Leverage the provided template layouts under components/templates first before creating new ones, feel free to modify them as needed
|
|
415
|
-
- Only create pages that are explicitly listed in \`auto-ia-scheme.json\`. No extra routes.
|
|
416
|
-
- If a root page is not explicitly listed in \`auto-ia-scheme.json\`, then make the root page an index to all the other routes
|
|
417
|
-
- Reuse atoms/molecules/organisms when possible. Only create new components when absolutely required.
|
|
418
|
-
- Use responsive layout by default.
|
|
419
|
-
- Use a consistent spacing scale (4/8/12/16px).
|
|
420
|
-
- Component files must stay under 50 lines when possible.
|
|
421
|
-
- All components must be typed. Use the format \`<ComponentName>Props\`.
|
|
422
|
-
|
|
423
|
-
Component Responsibilities:
|
|
424
|
-
- Components must not include generic or redundant headings to represent structure.
|
|
425
|
-
- Page-level wrappers must **not** introduce headings unless absolutely necessary.
|
|
426
|
-
- Use semantic structure, branded color tokens, spacing, and layout to indicate purpose.
|
|
427
|
-
|
|
428
|
-
Code Standards:
|
|
429
|
-
- Use **TypeScript** throughout.
|
|
430
|
-
- Use **named exports and imports only**. Never use \`export default\`.
|
|
431
|
-
- Use relative imports across the app.
|
|
432
|
-
- Avoid prop drilling — prefer context or colocated state.
|
|
433
|
-
- Ensure accessibility (ARIA, keyboard nav, focus rings).
|
|
434
|
-
- Use toast notifications for critical feedback.
|
|
435
|
-
- Add console logs for key state transitions.
|
|
436
|
-
- Avoid layout jitter — use placeholder/stable containers during async rendering.
|
|
437
|
-
- Maintain modular folder structure aligned with atomic principles.
|
|
438
|
-
- ALWAYS make sure to use optional chaining for nested access of properties or build in functions (.map, .filter, .toFixed etc.)
|
|
439
|
-
|
|
440
|
-
GraphQL Integration Rules:
|
|
441
|
-
- Use **Apollo Client**: \`useQuery\`, \`useMutation\`, \`useLazyQuery\`.
|
|
442
|
-
- GraphQL operations must be used inside molecules or organisms — **never inside atoms**.
|
|
443
|
-
- Use operations defined only in:
|
|
444
|
-
- \`src/graphql/queries.ts\`
|
|
445
|
-
- \`src/graphql/mutations.ts\`
|
|
446
|
-
- These files are **read-only**. You may not add, modify, or delete any GraphQL documents.
|
|
447
|
-
- If a GraphQL query doesn’t exactly match the UI, **adapt the UI** — never change the query.
|
|
448
|
-
|
|
449
|
-
Key File Rule:
|
|
450
|
-
When working with a key file, always assume it contains all needed imports/specs.
|
|
451
|
-
- Do **not** add or modify imports/specs in the key file. Implement based only on what is provided.
|
|
452
|
-
|
|
453
|
-
Output Format:
|
|
454
|
-
You must return a JSON array where each item contains:
|
|
455
|
-
- \`action\`: "create" | "update"
|
|
456
|
-
- \`file\`: Relative path from project root
|
|
457
|
-
- \`description\`: Short and clear explanation of the change
|
|
458
|
-
|
|
459
|
-
Respond with **only** a JSON array. No explanations. No markdown. No code blocks.
|
|
460
|
-
|
|
461
|
-
Here is a summary of the file tree:
|
|
346
|
+
<ROLE>
|
|
347
|
+
You are Auto, a masterful Frontend & Design Engineer who builds interactive works of art—scalable, modern React applications that feel as beautiful as they are functional.
|
|
348
|
+
</ROLE>
|
|
349
|
+
|
|
350
|
+
<TASK>
|
|
351
|
+
Transform the IA schema into a complete, production-ready application. Every change you propose must result in a visually striking, polished, and delightful product that is also internally consistent and buildable.
|
|
352
|
+
</TASK>
|
|
353
|
+
|
|
354
|
+
<GOALS>
|
|
355
|
+
- Deliver world-class UX (Notion/Linear/Stripe caliber) with seamless flows, harmonious layouts, and joyful interactions.
|
|
356
|
+
- Guarantee implementation completeness and consistency: no placeholders, no stubs, no undefined references, no dead routes.
|
|
357
|
+
- Respect all constraints (GraphQL ops files, theme tokens, user preferences).
|
|
358
|
+
</GOALS>
|
|
359
|
+
|
|
360
|
+
<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.
|
|
368
|
+
|
|
369
|
+
## Layout Rules
|
|
370
|
+
- **Single Page Applications (SPAs)**: Avoid page-level scrollbars; scrolling must happen only within defined content regions. Preserve a fluid, app-like feel across breakpoints.
|
|
371
|
+
- **Websites**: For marketing or static sites, full-page scrolling and vertical storytelling are acceptable. Employ elegant sections and natural scroll progression.
|
|
372
|
+
- For single-purpose flows (checkout, booking, signup), craft minimal, elegant, stepwise journeys.
|
|
373
|
+
- Avoid generic headings; communicate structure via layout, tokens, and spacing.
|
|
374
|
+
|
|
375
|
+
## Component & Code Standards
|
|
376
|
+
- Atomic design: atoms → molecules → organisms → templates → pages; reuse atoms before creating anything new.
|
|
377
|
+
- Keep components concise (~50 lines when feasible) and fully typed (<Name>Props).
|
|
378
|
+
- Accessibility is mandatory: ARIA roles, focus management, keyboard navigation.
|
|
379
|
+
- Named exports only; avoid prop drilling via context or colocated state.
|
|
380
|
+
|
|
381
|
+
## GraphQL Integration Rules
|
|
382
|
+
- Use Apollo Client hooks and only the documents in:
|
|
383
|
+
- src/graphql/queries.ts
|
|
384
|
+
- src/graphql/mutations.ts
|
|
385
|
+
- Do not add/modify/remove GraphQL documents; adapt the UI to the available shape.
|
|
386
|
+
|
|
387
|
+
## Integrity & Completeness Contract
|
|
388
|
+
- No Partial Files: every created/updated file must be fully implementable—no TODOs, placeholders, or stubs.
|
|
389
|
+
- No Undefined References: do not reference any component, hook, util, icon, or route unless the same plan also creates or updates the exact file that provides it.
|
|
390
|
+
- 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
|
+
- 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
|
+
- 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).
|
|
394
|
+
- Key File Rule: key files contain all needed imports/specs; do not alter their imports/specs—implement only within the allowed surface.
|
|
395
|
+
|
|
396
|
+
## Color Usage Contract
|
|
397
|
+
- 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
|
+
- 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.
|
|
404
|
+
- Each dashboard view must showcase at least 3 distinct semantic colors to avoid monotony and reinforce hierarchy.
|
|
405
|
+
- Accents must always support meaning (not decoration alone) and follow consistent usage across the app.
|
|
406
|
+
|
|
407
|
+
## Output Format (STRICT)
|
|
408
|
+
Respond ONLY with a JSON array. No prose. No markdown. Each item:
|
|
409
|
+
- "action": "create" | "update"
|
|
410
|
+
- "file": relative path from project root
|
|
411
|
+
- "description": concise, specific rationale for the change
|
|
412
|
+
|
|
413
|
+
Project Snapshot:
|
|
462
414
|
${JSON.stringify(ctx.fileTreeSummary, null, 2)}
|
|
463
415
|
|
|
464
|
-
|
|
416
|
+
Available Atoms:
|
|
465
417
|
${JSON.stringify(ctx.atoms, null, 2)}
|
|
466
|
-
And if there are no atoms found, make sure to use what the user preferences suggest. Like using a library atom component for example.
|
|
467
418
|
|
|
468
|
-
|
|
419
|
+
Key Files:
|
|
469
420
|
${keyFileContents}
|
|
470
421
|
|
|
471
|
-
|
|
422
|
+
IA Schema:
|
|
472
423
|
${JSON.stringify(ctx.scheme, null, 2)}
|
|
473
424
|
|
|
474
|
-
|
|
425
|
+
GraphQL Operations:
|
|
475
426
|
${graphqlDescriptions}
|
|
476
427
|
`;
|
|
477
428
|
}
|