create-auto-app 0.13.3 → 0.15.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.
@@ -1,4 +1,5 @@
1
- import { experience, narrative, it } from '@auto-engineer/narrative';
1
+ import { experience, it, narrative } from '@auto-engineer/narrative';
2
+
2
3
  narrative('App Structure', 'A8u1Ee4Sz', () => {
3
4
  experience('Application Layout', 'L9v2Ff5Tz').client(() => {
4
5
  it('display clean top navigation bar spanning full width');
@@ -1,18 +1,19 @@
1
+ import type { Command, Event, State } from '@auto-engineer/narrative';
1
2
  import {
2
3
  command,
3
4
  data,
5
+ describe,
4
6
  example,
5
7
  gql,
8
+ it,
6
9
  narrative,
7
10
  query,
8
11
  rule,
9
- describe,
10
- it,
11
12
  sink,
12
13
  source,
13
14
  specs,
14
15
  } from '@auto-engineer/narrative';
15
- import type { Command, Event, State } from '@auto-engineer/narrative';
16
+
16
17
  type AddTodo = Command<
17
18
  'AddTodo',
18
19
  {
@@ -3,8 +3,8 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "scripts": {
6
- "auto": "node ../../packages/cli/dist/bin/auto.js",
7
- "auto:debug": "DEBUG=auto:* node ../../packages/cli/dist/bin/auto.js",
6
+ "auto": "auto",
7
+ "auto:debug": "DEBUG=auto:* auto",
8
8
  "start": "dotenv -e .env -- pnpm --parallel start"
9
9
  },
10
10
  "dependencies": {
@@ -18,6 +18,7 @@
18
18
  "@auto-engineer/frontend-implementer": "workspace:*",
19
19
  "@auto-engineer/information-architect": "workspace:*",
20
20
  "@auto-engineer/message-bus": "workspace:*",
21
+ "@auto-engineer/pipeline": "workspace:*",
21
22
  "@auto-engineer/server-checks": "workspace:*",
22
23
  "@auto-engineer/server-generator-apollo-emmett": "workspace:*",
23
24
  "@auto-engineer/server-implementer": "workspace:*"
@@ -0,0 +1,161 @@
1
+ # Support Files
2
+
3
+ Shared design system assets for Auto Engineer examples.
4
+
5
+ ---
6
+
7
+ ## Purpose
8
+
9
+ This directory provides pre-configured design system files that other examples copy into their `.context/` directories. These files are consumed by the `@auto-engineer/design-system-importer` package and frontend generation plugins.
10
+
11
+ ---
12
+
13
+ ## Directory Structure
14
+
15
+ ```
16
+ support-files/
17
+ ├── .env.example # Environment variable template
18
+ └── .context/
19
+ ├── design-system.md # Component documentation
20
+ ├── figma-file.json # Figma design tokens (~44MB)
21
+ └── shadcn-filter.ts # Component filtering logic
22
+ ```
23
+
24
+ ---
25
+
26
+ ## File Descriptions
27
+
28
+ ### .env.example
29
+
30
+ Template for Auto Engineer environment variables:
31
+
32
+ ```bash
33
+ # AI Provider Keys
34
+ ANTHROPIC_API_KEY=
35
+ OPENAI_API_KEY=
36
+ GEMINI_API_KEY=
37
+ XAI_API_KEY=
38
+
39
+ # Defaults
40
+ DEFAULT_AI_PROVIDER=anthropic
41
+ DEFAULT_AI_MODEL=claude-sonnet-4-20250514
42
+
43
+ # Debug
44
+ DEBUG=auto:*
45
+ ```
46
+
47
+ ### .context/design-system.md
48
+
49
+ Generated markdown listing 55+ shadcn/ui components:
50
+
51
+ | Category | Components |
52
+ |----------|------------|
53
+ | Form | button, checkbox, input, select, switch, textarea, slider |
54
+ | Layout | accordion, card, dialog, drawer, sheet, tabs, separator |
55
+ | Navigation | breadcrumb, menubar, navigation-menu, pagination |
56
+ | Data | avatar, badge, calendar, data-table, table |
57
+ | Feedback | alert, alert-dialog, progress, skeleton, toast, tooltip |
58
+
59
+ ### .context/figma-file.json
60
+
61
+ Raw Figma API export containing design tokens:
62
+
63
+ - **Spacing**: `spacing/0`, `spacing/px`, `spacing/1`...`spacing/96`
64
+ - **Dimensions**: `w-0`, `h-0`, `h-px`, `w-full`, `h-screen`
65
+ - **Scopes**: GAP, WIDTH_HEIGHT configurations
66
+
67
+ ### .context/shadcn-filter.ts
68
+
69
+ Filter function for processing Figma components during import:
70
+
71
+ **Excludes:**
72
+ - Generic names: `image`, `slot`, `logo`, `icon`
73
+ - Internal components: `toolbar`, `stepper`, `sidebar`
74
+
75
+ **Includes:**
76
+ - Valid component names (1-3 words, alphabetic)
77
+ - `INSTANCE` type components
78
+ - Hierarchy depth ≤ 3
79
+
80
+ **Transforms:**
81
+ - Converts to lowercase kebab-case
82
+ - Deduplicates and sorts
83
+
84
+ ---
85
+
86
+ ## Usage
87
+
88
+ ### Copying to a Project
89
+
90
+ From another example directory:
91
+
92
+ ```bash
93
+ rm -rf .context && mkdir .context && cp ../support-files/.context/* ./.context
94
+ ```
95
+
96
+ The `kanban-todo` example includes this in its clean script:
97
+
98
+ ```bash
99
+ pnpm clean # Runs the copy automatically
100
+ ```
101
+
102
+ ### Using with Design System Importer
103
+
104
+ ```bash
105
+ auto import:design-system \
106
+ --output-dir=./.context \
107
+ --strategy=WITH_COMPONENT_SETS \
108
+ --filter-path=./shadcn-filter.ts
109
+ ```
110
+
111
+ ### Pipeline Integration
112
+
113
+ In `auto.config.ts`, reference these files:
114
+
115
+ ```typescript
116
+ .on('IAGenerated')
117
+ .emit('GenerateClient', () => ({
118
+ figmaVariablesPath: resolvePath('./.context/figma-file.json'),
119
+ }))
120
+
121
+ .emit('ImplementComponent', (c) => ({
122
+ designSystemPath: resolvePath('./.context/design-system.md'),
123
+ }))
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Regenerating Files
129
+
130
+ To regenerate from a Figma source:
131
+
132
+ ```bash
133
+ # Set credentials
134
+ export FIGMA_PERSONAL_TOKEN=your-token
135
+ export FIGMA_FILE_ID=your-file-id
136
+
137
+ # Run importer
138
+ auto import:design-system \
139
+ --output-dir=./.context \
140
+ --strategy=WITH_ALL_FIGMA_INSTANCES \
141
+ --filter-path=./shadcn-filter.ts
142
+ ```
143
+
144
+ **Import Strategies:**
145
+
146
+ | Strategy | Description |
147
+ |----------|-------------|
148
+ | `WITH_COMPONENTS` | Individual components only |
149
+ | `WITH_COMPONENT_SETS` | Component sets (default) |
150
+ | `WITH_ALL_FIGMA_INSTANCES` | Full document traversal |
151
+
152
+ ---
153
+
154
+ ## Related Packages
155
+
156
+ | Package | Relationship |
157
+ |---------|--------------|
158
+ | `@auto-engineer/design-system-importer` | Consumes filter, produces design-system.md |
159
+ | `@auto-engineer/frontend-generator-react-graphql` | Uses figma-file.json for tokens |
160
+ | `@auto-engineer/component-implementer` | Uses design-system.md for constraints |
161
+ | `@auto-engineer/information-architect` | References component list for IA |
@@ -1,4 +0,0 @@
1
- .context
2
- server
3
- client
4
- /.context/
@@ -1,239 +0,0 @@
1
- import { autoConfig, on, dispatch } from '@auto-engineer/cli';
2
- import type { ExportSchemaCommand, ExportSchemaEvents } from '@auto-engineer/narrative';
3
- import type { GenerateServerCommand, GenerateServerEvents } from '@auto-engineer/server-generator-apollo-emmett';
4
- import type {
5
- ImplementServerCommand,
6
- ImplementServerEvents,
7
- ImplementSliceEvents,
8
- ImplementSliceCommand,
9
- } from '@auto-engineer/server-implementer';
10
- import type {
11
- CheckTestsCommand,
12
- CheckTestsEvents,
13
- CheckTypesCommand,
14
- CheckTypesEvents,
15
- CheckLintCommand,
16
- CheckLintEvents,
17
- TestsCheckFailedEvent,
18
- TypeCheckFailedEvent,
19
- LintCheckFailedEvent,
20
- } from '@auto-engineer/server-checks';
21
- import type { GenerateIACommand, GenerateIAEvents } from '@auto-engineer/information-architect';
22
- import type { ImplementClientCommand, ImplementClientEvents } from '@auto-engineer/frontend-implementer';
23
- import type { GenerateClientCommand, GenerateClientEvents } from '@auto-engineer/frontend-generator-react-graphql';
24
- import {
25
- CheckClientCommand,
26
- CheckClientEvents,
27
- ClientCheckFailedEvent,
28
- } from '../../packages/frontend-checks/dist/src/commands/check-client';
29
- import { SliceGeneratedEvent } from '../../packages/server-generator-apollo-emmett/dist/src/commands/generate-server';
30
-
31
- export default autoConfig({
32
- fileId: 'test44444', // unique 9-character base62 canvas file id where all flows in this project will be shown
33
-
34
- plugins: [
35
- '@auto-engineer/server-checks',
36
- '@auto-engineer/design-system-importer',
37
- '@auto-engineer/server-generator-apollo-emmett',
38
- '@auto-engineer/narrative',
39
- '@auto-engineer/frontend-checks',
40
- '@auto-engineer/frontend-implementer',
41
- '@auto-engineer/component-implementer',
42
- '@auto-engineer/information-architect',
43
- '@auto-engineer/frontend-generator-react-graphql',
44
- '@auto-engineer/server-implementer',
45
- ],
46
- aliases: {
47
- // Resolve command name conflicts between packages
48
- // 'test:types': checkTypesCommandHandler,
49
- },
50
- pipeline: () => {
51
- on<ExportSchemaEvents>('SchemaExported', () =>
52
- dispatch<GenerateServerCommand>('GenerateServer', {
53
- modelPath: './.context/schema.json',
54
- destination: '.',
55
- }),
56
- );
57
- on<SliceGeneratedEvent>('SliceGenerated', (e) =>
58
- dispatch<ImplementSliceCommand>('ImplementSlice', {
59
- slicePath: e.data.slicePath,
60
- context: {
61
- previousOutputs: 'errors',
62
- attemptNumber: 0,
63
- },
64
- }),
65
- );
66
-
67
- on<ImplementSliceEvents>('SliceImplemented', (e) =>
68
- dispatch<CheckTestsCommand>('CheckTests', {
69
- targetDirectory: e.data.slicePath,
70
- scope: 'slice',
71
- }),
72
- );
73
-
74
- on<ImplementSliceEvents>('SliceImplemented', (e) =>
75
- dispatch<CheckTypesCommand>('CheckTypes', {
76
- targetDirectory: e.data.slicePath,
77
- scope: 'slice',
78
- }),
79
- );
80
-
81
- on<ImplementSliceEvents>('SliceImplemented', (e) =>
82
- dispatch<CheckLintCommand>('CheckLint', {
83
- targetDirectory: e.data.slicePath,
84
- scope: 'slice',
85
- fix: true,
86
- }),
87
- );
88
-
89
- on<ImplementSliceEvents>('SliceImplemented', (e) =>
90
- dispatch<CheckTestsCommand>('CheckTests', {
91
- targetDirectory: e.data.slicePath,
92
- scope: 'slice',
93
- }),
94
- );
95
-
96
- on<ImplementSliceEvents>('SliceImplemented', (e) =>
97
- dispatch<CheckTypesCommand>('CheckTypes', {
98
- targetDirectory: e.data.slicePath,
99
- scope: 'slice',
100
- }),
101
- );
102
-
103
- on<ImplementSliceEvents>('SliceImplemented', (e) =>
104
- dispatch<CheckLintCommand>('CheckLint', {
105
- targetDirectory: e.data.slicePath,
106
- scope: 'slice',
107
- fix: true,
108
- }),
109
- );
110
-
111
- on.settled<CheckTestsCommand, CheckTypesCommand, CheckLintCommand>(
112
- ['CheckTests', 'CheckTypes', 'CheckLint'],
113
- dispatch<ImplementSliceCommand>(['ImplementSlice'], (events, send) => {
114
- const hasFailures =
115
- events.CheckTests.some((e: CheckTestsEvents) => e.type === 'TestsCheckFailed') ||
116
- events.CheckTypes.some((e: CheckTypesEvents) => e.type === 'TypeCheckFailed') ||
117
- events.CheckLint.some((e: CheckLintEvents) => e.type === 'LintCheckFailed');
118
-
119
- if (hasFailures) {
120
- send({
121
- type: 'ImplementSlice',
122
- data: {
123
- slicePath: (events.CheckTests[0] as CheckTestsEvents).data.targetDirectory,
124
- context: {
125
- previousOutputs:
126
- events.CheckTests.filter((e): e is TestsCheckFailedEvent => e.type === 'TestsCheckFailed')
127
- .map((e) => e.data.errors)
128
- .join('\n') +
129
- events.CheckTypes.filter((e): e is TypeCheckFailedEvent => e.type === 'TypeCheckFailed')
130
- .map((e) => e.data.errors)
131
- .join('\n') +
132
- events.CheckLint.filter((e): e is LintCheckFailedEvent => e.type === 'LintCheckFailed')
133
- .map((e) => e.data.errors)
134
- .join('\n'),
135
- attemptNumber: 0,
136
- },
137
- },
138
- });
139
- }
140
- }),
141
- );
142
-
143
- on<GenerateServerEvents>('ServerGenerated', () =>
144
- dispatch<GenerateIACommand>('GenerateIA', {
145
- modelPath: './.context/schema.json',
146
- outputDir: './.context',
147
- }),
148
- );
149
-
150
- on<GenerateIAEvents>('IAGenerated', () =>
151
- dispatch<GenerateClientCommand>('GenerateClient', {
152
- targetDir: './client',
153
- iaSchemaPath: './.context/auto-ia-scheme.json',
154
- gqlSchemaPath: './.context/schema.graphql',
155
- figmaVariablesPath: './.context/figma-file.json',
156
- }),
157
- );
158
-
159
- on<GenerateClientEvents>('ClientGenerated', () =>
160
- dispatch<ImplementClientCommand>('ImplementClient', {
161
- projectDir: './client',
162
- iaSchemeDir: './.context',
163
- designSystemPath: './.context/design-system.md',
164
- }),
165
- );
166
-
167
- // on<ImplementClientEvents>('ClientImplemented', () =>
168
- // dispatch<CheckClientCommand>('CheckClient', {
169
- // clientDirectory: './client',
170
- // skipBrowserChecks: true,
171
- // }),
172
- // );
173
-
174
- on<CheckClientEvents>('ClientChecked', (e) => {
175
- if (e.type === 'ClientChecked') {
176
- const hasErrors = e.data.tsErrors > 0 || e.data.buildErrors > 0 || e.data.consoleErrors > 0;
177
-
178
- if (hasErrors) {
179
- const failures = [
180
- ...(e.data.tsErrorDetails || []),
181
- ...(e.data.buildErrorDetails || []),
182
- ...(e.data.consoleErrorDetails || []),
183
- ];
184
- return dispatch<ImplementClientCommand>('ImplementClient', {
185
- projectDir: './client',
186
- iaSchemeDir: './.context',
187
- designSystemPath: './.context/design-system.md',
188
- failures,
189
- });
190
- }
191
- }
192
- });
193
- },
194
- });
195
- /*
196
-
197
- rm -rf server client .context/schema.json .context/schema.graphql .context/auto-ia-scheme.json
198
- pnpm auto export:schema
199
- pnpm auto generate:ia --output-dir=./.context --flow-files=./narratives/questionnaires.narrative.ts
200
- pnpm auto generate:server --schema-path=./.context/schema.json --destination=.
201
- pnpm auto generate:client --starter-dir=../../packages/frontend-generator-react-graphql/shadcn-starter --target-dir=./client --ia-schema-path=./.context/auto-ia-scheme.json --gql-schema-path=./.context/schema.graphql --figma-variables-path=./.context/figma-file.json
202
- pnpm auto implement:client --project-dir=./questionnaires/client --ia-scheme-dir=./questionnaires/.context --design-system-path=./questionnaires/.context/design-system.md
203
-
204
-
205
- // make this emit one slice at a time
206
- pnpm auto generate:server --schema-path=./.context/schema.json --destination=.
207
-
208
- // TODO remove the AI part and make it mathematical
209
- pnpm auto generate:client --starter-dir=/Users/sam/WebstormProjects/top/auto-engineer/packages/frontend-generator-react-graphql/shadcn-starter --target-dir=./client --ia-schema-path=./.context/auto-ia-scheme.json --gql-schema-path=./.context/schema.graphql --figma-variables-path=./.context/figma-file.json
210
-
211
- // run this per slice in parallel
212
- pnpm auto implement:slice --slice-path=./questionnaires/server/src/domain/narratives/questionnaires/submits-the-questionnaire
213
- // add checks
214
- // add retry logic tore-implement failed slices with a retry count
215
-
216
- // slice these up
217
- pnpm auto implement:client --project-dir=./questionnaires/client --ia-scheme-dir=./questionnaires/.context --design-system-path=./questionnaires/.context/design-system.md
218
-
219
-
220
- // implement atoms in parallel - how do I know all atoms are done?
221
- // implement molecules in parallel - how do I know all molecules are done?
222
- // implement organisms in parallel - how do I know all organisms are done?
223
- // implement pages in parallel - how do I know all pages are done?
224
-
225
-
226
- // generate slice > implement slice > check slice > retry failure 3 times >
227
- // generate slice > implement slice > check slice > retry failure 3 times >
228
- // generate slice > implement slice > check slice > retry failure 3 times >
229
-
230
- cd ~/WebstormProjects/top/auto-engineer/examples/questionnaires &&\
231
- pnpm -w build &&\
232
- rm -rf server client .context/schema.json .context/schema.graphql .context/auto-ia-scheme.json &&\
233
- DEBUG=* pnpm auto export:schema &&\
234
- DEBUG=* pnpm auto generate:server --schema-path=./.context/schema.json --destination=. &&\
235
- DEBUG=* pnpm auto generate:ia --output-dir=./.context --flow-files=./narratives/questionnaires.narrative.ts &&\
236
- DEBUG=* pnpm auto generate:client --starter-dir=../../packages/frontend-generator-react-graphql/shadcn-starter --target-dir=./client --ia-schema-path=./.context/auto-ia-scheme.json --gql-schema-path=./.context/schema.graphql --figma-variables-path=./.context/figma-file.json
237
-
238
-
239
- */
@@ -1,103 +0,0 @@
1
- import { experience, narrative, it } from '@auto-engineer/narrative';
2
- narrative('Home Screen', 'cDAZP41Kb', () => {
3
- experience('Active Surveys Summary', 'aifPcU3hw').client(() => {
4
- it('show active surveys summary and response rate overview');
5
- });
6
- experience('Recent Survey Responses', 'B2gF5k9Xj').client(() => {
7
- it('display recent survey responses list');
8
- });
9
- experience('Completion Rate Progress', 'C3hG6l0Yk').client(() => {
10
- it('show visual progress of completion rate goals');
11
- });
12
- experience('Quick Access Actions', 'D4iH7m1Zl').client(() => {
13
- it('show quick access buttons for Create Survey, Analytics, Templates');
14
- });
15
- });
16
- narrative('Create Survey', 'OnuAvj45V', () => {
17
- experience('Create Survey Form', 'MPviTMrQC').client(() => {
18
- it('allow entering survey title, description, and question types');
19
- });
20
- experience('Question Templates Selection', 'E5jI8n2Am').client(() => {
21
- it('show recent/frequent question templates for quick selection');
22
- });
23
- experience('Survey Creation Confirmation', 'F6kJ9o3Bn').client(() => {
24
- it('display confirmation toast after creating survey');
25
- });
26
- experience('Real-time Dashboard Updates', 'G7lK0p4Co').client(() => {
27
- it('update survey dashboard and analytics in real-time');
28
- });
29
- });
30
- narrative('Response Analytics', 'dRYuxORz0', () => {
31
- experience('Response Rate Charts', 'eME978Euk').client(() => {
32
- it('show daily response rate charts');
33
- it('show weekly response rate charts');
34
- });
35
- experience('High Engagement Survey Highlights', 'H8mL1q5Dp').client(() => {
36
- it('highlight surveys with highest engagement');
37
- });
38
- experience('Analytics Filtering', 'I9nM2r6Eq').client(() => {
39
- it('allow filtering by survey type or date range');
40
- });
41
- experience('Real-time Analytics Updates', 'J0oN3s7Fr').client(() => {
42
- it('update dynamically when new responses are received');
43
- });
44
- });
45
- narrative('Manage Templates', 'KFxx8k1ul', () => {
46
- experience('Templates List View', 'TRJBgM1JS').client(() => {
47
- it('list all survey templates with usage count and last modified date');
48
- });
49
- experience('Template Management Actions', 'K1pO4t8Gs').client(() => {
50
- it('allow creating, editing, and deleting survey templates');
51
- });
52
- experience('Template Usage Statistics', 'L2qP5u9Ht').client(() => {
53
- it('show monthly summary of template usage statistics');
54
- });
55
- experience('Popular Templates Highlights', 'M3rQ6v0Iu').client(() => {
56
- it('highlight most popular and recently used templates');
57
- });
58
- });
59
- narrative('Survey Completion Tracker', 'wXdtfGpFr', () => {
60
- experience('Completion Rate Progress View', 'oDBBOUNzr').client(() => {
61
- it('show current completion rate and target progress');
62
- });
63
- experience('Target Setting Interface', 'N4sR7w1Jv').client(() => {
64
- it('allow setting completion rate targets');
65
- });
66
- experience('Automatic Completion Tracking', 'O5tS8x2Kw').client(() => {
67
- it('automatically track new survey completions');
68
- });
69
- experience('Shell Progress Bar Display', 'P6uT9y3Lx').client(() => {
70
- it('display visual completion progress bar consistently in shell');
71
- });
72
- });
73
- narrative('Response Goals Tracker', 'W8dytm3oC', () => {
74
- experience('Response Target Setting', 'Idmim68Yf').client(() => {
75
- it('allow setting monthly/weekly response targets');
76
- });
77
- experience('Response Target Progress Bar', 'Q7vU0z4My').client(() => {
78
- it('show remaining response targets as a progress bar');
79
- });
80
- experience('Underperforming Survey Highlights', 'R8wV1a5Nz').client(() => {
81
- it('highlight underperforming surveys');
82
- });
83
- experience('Real-time Goals Updates', 'S9xW2b6Oa').client(() => {
84
- it('update in real-time when responses are received');
85
- });
86
- });
87
- narrative('Response History', 'JizW21yrr', () => {
88
- experience('Response History List', 'cIpwPlqRq').client(() => {
89
- it('allow viewing full response history');
90
- });
91
- experience('Response History Filtering', 'T0yX3c7Pb').client(() => {
92
- it('filter by survey type, date, or completion status');
93
- });
94
- experience('Detailed Response View', 'U1zY4d8Qc').client(() => {
95
- it('view detailed response data and export individual responses');
96
- });
97
- experience('Response Export Functionality', 'V2aZ5e9Rd').client(() => {
98
- it('export individual responses');
99
- });
100
- experience('Response Engagement Contribution', 'W3ba6f0Se').client(() => {
101
- it('show contribution of each response to daily/weekly/monthly engagement totals');
102
- });
103
- });