@launchsecure/launch-kit 0.0.1
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/README.md +37 -0
- package/dist/client/assets/index-C8GAsRGO.css +32 -0
- package/dist/client/assets/index-CcHIoRl6.js +286 -0
- package/dist/client/index.html +22 -0
- package/dist/server/cli.js +8853 -0
- package/dist/server/fb-wizard.js +136 -0
- package/dist/server/graph-mcp-entry.js +1542 -0
- package/dist/server/public/app.js +1312 -0
- package/dist/server/public/icons.js +36 -0
- package/dist/server/public/index.html +159 -0
- package/dist/server/public/plan-detector.js +186 -0
- package/dist/server/public/session-manager.js +1129 -0
- package/dist/server/public/splits.js +569 -0
- package/dist/server/public/style.css +1620 -0
- package/package.json +73 -0
- package/prompts/analysis.md +992 -0
- package/prompts/architect-reconcile.md +931 -0
- package/prompts/architecture-sync.md +902 -0
- package/prompts/be-contract.md +709 -0
- package/prompts/be-impl.md +565 -0
- package/prompts/be-policy.md +551 -0
- package/prompts/be-test.md +591 -0
- package/prompts/bug-diagnosis.md +653 -0
- package/prompts/bug-intake.md +563 -0
- package/prompts/change-request-intake.md +593 -0
- package/prompts/db-contract.md +644 -0
- package/prompts/db-impl.md +522 -0
- package/prompts/db-interaction.md +569 -0
- package/prompts/db-test.md +630 -0
- package/prompts/decision-pack.md +654 -0
- package/prompts/fe-contract.md +992 -0
- package/prompts/fe-flow.md +537 -0
- package/prompts/fe-impl.md +597 -0
- package/prompts/fe-reconcile.md +506 -0
- package/prompts/fe-review.md +550 -0
- package/prompts/fe-test.md +705 -0
- package/prompts/fix-planner.md +1219 -0
- package/prompts/global-db-patterns.md +588 -0
- package/prompts/global-env-config.md +460 -0
- package/prompts/global-integrations.md +504 -0
- package/prompts/global-middleware.md +442 -0
- package/prompts/global-navigation.md +502 -0
- package/prompts/global-security.md +603 -0
- package/prompts/global-services.md +427 -0
- package/prompts/greenfield-classifier.md +590 -0
- package/prompts/llm-council.md +597 -0
- package/prompts/module-sequencer.md +529 -0
- package/prompts/normalize.md +611 -0
- package/prompts/optimization.md +633 -0
- package/prompts/prd-generation.md +544 -0
- package/prompts/prd-reconcile.md +584 -0
- package/prompts/prd-review.md +504 -0
- package/prompts/pre-code-analysis.md +565 -0
- package/prompts/pre-code-global-analysis.md +169 -0
- package/prompts/production-bootstrap.md +577 -0
- package/prompts/research.md +702 -0
- package/prompts/retrofit-analysis.md +845 -0
- package/prompts/spike.md +850 -0
- package/prompts/theming.md +835 -0
- package/prompts/triage.md +599 -0
- package/prompts/unified-reconcile.md +628 -0
- package/prompts/unified-review.md +592 -0
- package/prompts/user-stories.md +486 -0
- package/prompts/wireframe.md +576 -0
|
@@ -0,0 +1,992 @@
|
|
|
1
|
+
# FE Contract Agent
|
|
2
|
+
|
|
3
|
+
> **Greek:** Prósopsis (Prósopsis) — "facade/appearance"
|
|
4
|
+
> **Sanskrit:** दर्शन (Darśana) — "vision/sight"
|
|
5
|
+
> **Tagline:** *"The user's window into the system"*
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Agent Identity
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|---|---|
|
|
13
|
+
| ID | `fe_contract` |
|
|
14
|
+
| Name | FE Contract Agent |
|
|
15
|
+
| Phase | 5 — Contracts & Wireframes |
|
|
16
|
+
| Type | `pipeline` |
|
|
17
|
+
| Granularity | `per_module` |
|
|
18
|
+
| Interaction | `interactive` |
|
|
19
|
+
| Mode | `all` |
|
|
20
|
+
| Domain | `dev` |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Goal & Objectives
|
|
25
|
+
|
|
26
|
+
**Goal:** Derive frontend screen definitions, navigation structures, and state requirements from user stories — following a story-first approach where screens emerge from user needs rather than being designed in isolation — and produce endpoint proposals that the BE Contract Agent can honor, reshape, or extend.
|
|
27
|
+
|
|
28
|
+
| Priority | Objective |
|
|
29
|
+
|---|---|
|
|
30
|
+
| primary | Derive screens from user stories ensuring every story maps to at least one screen and every screen traces back to at least one story |
|
|
31
|
+
| secondary | Produce well-structured endpoint proposals that communicate FE data needs to the BE Contract Agent without dictating API design |
|
|
32
|
+
| tertiary | Identify state management requirements and navigation flows that prevent orphan screens and unreachable routes |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Inputs
|
|
37
|
+
|
|
38
|
+
### user_stories_{module_id}.json
|
|
39
|
+
- **Source:** `user_stories` agent -> `agent_output/stories/{module_id}/user_stories_{module_id}.json`
|
|
40
|
+
- **Required:** yes
|
|
41
|
+
- **Shape:**
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"module_id": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Unique identifier for the module",
|
|
47
|
+
"example": "auth"
|
|
48
|
+
},
|
|
49
|
+
"stories": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"description": "User stories for this module",
|
|
52
|
+
"items": {
|
|
53
|
+
"story_id": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Unique story identifier",
|
|
56
|
+
"example": "US-AUTH-001"
|
|
57
|
+
},
|
|
58
|
+
"role": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "Who the user is",
|
|
61
|
+
"example": "registered user"
|
|
62
|
+
},
|
|
63
|
+
"action": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "What the user wants to do",
|
|
66
|
+
"example": "log in with email and password"
|
|
67
|
+
},
|
|
68
|
+
"outcome": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "Why the user wants to do it",
|
|
71
|
+
"example": "so I can access my account dashboard"
|
|
72
|
+
},
|
|
73
|
+
"acceptance_criteria": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"description": "Conditions that must be true for the story to be complete",
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"example": ["Given valid credentials, the user is redirected to the dashboard", "Given invalid credentials, an error message is shown"]
|
|
80
|
+
},
|
|
81
|
+
"scenarios": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"description": "Specific test scenarios for this story",
|
|
84
|
+
"items": {
|
|
85
|
+
"scenario_id": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"example": "SC-AUTH-001-01"
|
|
88
|
+
},
|
|
89
|
+
"name": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"example": "Successful login"
|
|
92
|
+
},
|
|
93
|
+
"steps": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"items": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"example": ["User navigates to /login", "User enters valid email and password", "User clicks Submit", "User is redirected to /dashboard"]
|
|
99
|
+
},
|
|
100
|
+
"expected_outcome": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"example": "User sees the dashboard with their account information"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"priority": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"enum": ["must", "should", "could", "wont"],
|
|
109
|
+
"example": "must"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### design_tokens.json
|
|
117
|
+
- **Source:** `theming` agent -> `agent_output/design/design_tokens.json`
|
|
118
|
+
- **Required:** yes
|
|
119
|
+
- **Shape:**
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"colors": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"description": "Color palette tokens",
|
|
125
|
+
"fields": {
|
|
126
|
+
"primary": { "type": "string", "example": "#3B82F6" },
|
|
127
|
+
"secondary": { "type": "string", "example": "#10B981" },
|
|
128
|
+
"background": { "type": "string", "example": "#FFFFFF" },
|
|
129
|
+
"surface": { "type": "string", "example": "#F9FAFB" },
|
|
130
|
+
"error": { "type": "string", "example": "#EF4444" },
|
|
131
|
+
"warning": { "type": "string", "example": "#F59E0B" },
|
|
132
|
+
"success": { "type": "string", "example": "#10B981" },
|
|
133
|
+
"text": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"fields": {
|
|
136
|
+
"primary": { "type": "string", "example": "#111827" },
|
|
137
|
+
"secondary": { "type": "string", "example": "#6B7280" },
|
|
138
|
+
"disabled": { "type": "string", "example": "#9CA3AF" }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"typography": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"description": "Typography tokens",
|
|
146
|
+
"fields": {
|
|
147
|
+
"fontFamily": { "type": "string", "example": "Inter, sans-serif" },
|
|
148
|
+
"scale": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"fields": {
|
|
151
|
+
"xs": { "type": "string", "example": "0.75rem" },
|
|
152
|
+
"sm": { "type": "string", "example": "0.875rem" },
|
|
153
|
+
"base": { "type": "string", "example": "1rem" },
|
|
154
|
+
"lg": { "type": "string", "example": "1.125rem" },
|
|
155
|
+
"xl": { "type": "string", "example": "1.25rem" }
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"spacing": {
|
|
161
|
+
"type": "object",
|
|
162
|
+
"description": "Spacing scale tokens"
|
|
163
|
+
},
|
|
164
|
+
"shadows": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"description": "Box shadow tokens"
|
|
167
|
+
},
|
|
168
|
+
"borderRadius": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"description": "Border radius tokens"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### spike_summary.json
|
|
176
|
+
- **Source:** `spike` agent -> `agent_output/research/spike_summary.json`
|
|
177
|
+
- **Required:** no (enrichment — if spike was skipped, agent proceeds without constraints/package decisions; component choices default to analysis tech stack)
|
|
178
|
+
- **Shape:**
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"constraints": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"description": "Technical constraints discovered during spike research",
|
|
184
|
+
"items": {
|
|
185
|
+
"constraint_id": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"example": "CON-001"
|
|
188
|
+
},
|
|
189
|
+
"description": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"example": "OAuth provider does not support PKCE flow for mobile web"
|
|
192
|
+
},
|
|
193
|
+
"affects_layers": {
|
|
194
|
+
"type": "array",
|
|
195
|
+
"items": { "type": "string", "enum": ["fe", "be", "db"] },
|
|
196
|
+
"example": ["fe", "be"]
|
|
197
|
+
},
|
|
198
|
+
"severity": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"enum": ["blocking", "significant", "minor"],
|
|
201
|
+
"example": "significant"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"package_decisions": {
|
|
206
|
+
"type": "array",
|
|
207
|
+
"description": "Package/library decisions made during spikes",
|
|
208
|
+
"items": {
|
|
209
|
+
"package_name": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"example": "react-hook-form"
|
|
212
|
+
},
|
|
213
|
+
"purpose": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"example": "Form state management and validation"
|
|
216
|
+
},
|
|
217
|
+
"version": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"example": "^7.45.0"
|
|
220
|
+
},
|
|
221
|
+
"layer": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"enum": ["fe", "be", "db", "shared"],
|
|
224
|
+
"example": "fe"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### knowledge_handoff.json
|
|
232
|
+
- **Source:** `spike` agent -> `agent_output/research/knowledge_handoff.json`
|
|
233
|
+
- **Required:** no (enrichment — if spike was skipped, agent proceeds without technical findings; screen design uses analysis and stories alone)
|
|
234
|
+
- **Shape:**
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"findings": {
|
|
238
|
+
"type": "array",
|
|
239
|
+
"description": "Key technical findings from spike research",
|
|
240
|
+
"items": {
|
|
241
|
+
"finding_id": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"example": "KH-001"
|
|
244
|
+
},
|
|
245
|
+
"category": {
|
|
246
|
+
"type": "string",
|
|
247
|
+
"enum": ["pattern", "limitation", "recommendation", "risk"],
|
|
248
|
+
"example": "pattern"
|
|
249
|
+
},
|
|
250
|
+
"summary": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"example": "Use server-side rendering for initial page load to improve SEO"
|
|
253
|
+
},
|
|
254
|
+
"details": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"description": "Detailed explanation of the finding"
|
|
257
|
+
},
|
|
258
|
+
"affects_modules": {
|
|
259
|
+
"type": "array",
|
|
260
|
+
"items": { "type": "string" },
|
|
261
|
+
"example": ["auth", "dashboard"]
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Outputs
|
|
271
|
+
|
|
272
|
+
### fe_details.json
|
|
273
|
+
- **Path:** `agent_output/contracts/{module_id}/fe_details.json`
|
|
274
|
+
- **Format:** `json`
|
|
275
|
+
- **Consumers:** `wireframe`, `be_contract`, `db_contract`, `fe_review`, `unified_review`
|
|
276
|
+
- **Shape:**
|
|
277
|
+
```json
|
|
278
|
+
{
|
|
279
|
+
"module_id": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"description": "Module this FE contract belongs to",
|
|
282
|
+
"example": "auth"
|
|
283
|
+
},
|
|
284
|
+
"screens": {
|
|
285
|
+
"type": "array",
|
|
286
|
+
"description": "Screens derived from user stories",
|
|
287
|
+
"items": {
|
|
288
|
+
"screen_id": {
|
|
289
|
+
"type": "string",
|
|
290
|
+
"description": "Unique screen ID in format SCR-{MODULE}-{NNN}",
|
|
291
|
+
"example": "SCR-AUTH-001"
|
|
292
|
+
},
|
|
293
|
+
"name": {
|
|
294
|
+
"type": "string",
|
|
295
|
+
"description": "Human-readable screen name",
|
|
296
|
+
"example": "Login Screen"
|
|
297
|
+
},
|
|
298
|
+
"description": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"description": "What this screen does and why it exists",
|
|
301
|
+
"example": "Allows registered users to authenticate with email and password"
|
|
302
|
+
},
|
|
303
|
+
"route": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"description": "URL route for this screen",
|
|
306
|
+
"example": "/login"
|
|
307
|
+
},
|
|
308
|
+
"story_refs": {
|
|
309
|
+
"type": "array",
|
|
310
|
+
"description": "Story IDs that this screen serves — must have at least one",
|
|
311
|
+
"items": { "type": "string" },
|
|
312
|
+
"example": ["US-AUTH-001", "US-AUTH-002"]
|
|
313
|
+
},
|
|
314
|
+
"components": {
|
|
315
|
+
"type": "array",
|
|
316
|
+
"description": "UI components on this screen",
|
|
317
|
+
"items": {
|
|
318
|
+
"name": {
|
|
319
|
+
"type": "string",
|
|
320
|
+
"description": "Component name in PascalCase",
|
|
321
|
+
"example": "LoginForm"
|
|
322
|
+
},
|
|
323
|
+
"type": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"description": "Component category",
|
|
326
|
+
"enum": ["form", "display", "navigation", "layout", "feedback", "modal", "list", "chart", "action"],
|
|
327
|
+
"example": "form"
|
|
328
|
+
},
|
|
329
|
+
"props": {
|
|
330
|
+
"type": "object",
|
|
331
|
+
"description": "Expected props with types",
|
|
332
|
+
"example": {
|
|
333
|
+
"onSubmit": "function(credentials: { email: string, password: string }) => void",
|
|
334
|
+
"isLoading": "boolean",
|
|
335
|
+
"error": "string | null"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"dataDisplayed": {
|
|
341
|
+
"type": "array",
|
|
342
|
+
"description": "Data fields displayed on this screen (read from API or state)",
|
|
343
|
+
"items": {
|
|
344
|
+
"field": {
|
|
345
|
+
"type": "string",
|
|
346
|
+
"description": "Field name as displayed",
|
|
347
|
+
"example": "userEmail"
|
|
348
|
+
},
|
|
349
|
+
"source": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"description": "Where this data comes from",
|
|
352
|
+
"enum": ["api", "local_state", "global_state", "derived", "url_param", "static"],
|
|
353
|
+
"example": "global_state"
|
|
354
|
+
},
|
|
355
|
+
"format": {
|
|
356
|
+
"type": "string | null",
|
|
357
|
+
"description": "Display format if applicable",
|
|
358
|
+
"example": "email"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"dataCaptured": {
|
|
363
|
+
"type": "array",
|
|
364
|
+
"description": "Data fields captured from user input on this screen",
|
|
365
|
+
"items": {
|
|
366
|
+
"field": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"description": "Field name as captured",
|
|
369
|
+
"example": "email"
|
|
370
|
+
},
|
|
371
|
+
"type": {
|
|
372
|
+
"type": "string",
|
|
373
|
+
"description": "Input data type",
|
|
374
|
+
"enum": ["string", "number", "boolean", "date", "file", "select", "multi-select", "rich-text"],
|
|
375
|
+
"example": "string"
|
|
376
|
+
},
|
|
377
|
+
"validation_rules": {
|
|
378
|
+
"type": "array",
|
|
379
|
+
"description": "Validation rules for this field",
|
|
380
|
+
"items": {
|
|
381
|
+
"type": "string"
|
|
382
|
+
},
|
|
383
|
+
"example": ["required", "email_format", "max_length:255"]
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
"endpointProposals": {
|
|
388
|
+
"type": "array",
|
|
389
|
+
"description": "Proposed API endpoints this screen needs — suggestions for BE, not mandates",
|
|
390
|
+
"items": {
|
|
391
|
+
"method": {
|
|
392
|
+
"type": "string",
|
|
393
|
+
"enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
|
|
394
|
+
"example": "POST"
|
|
395
|
+
},
|
|
396
|
+
"path": {
|
|
397
|
+
"type": "string",
|
|
398
|
+
"description": "Proposed endpoint path",
|
|
399
|
+
"example": "/api/auth/login"
|
|
400
|
+
},
|
|
401
|
+
"purpose": {
|
|
402
|
+
"type": "string",
|
|
403
|
+
"description": "What this endpoint is for",
|
|
404
|
+
"example": "Authenticate user with email and password"
|
|
405
|
+
},
|
|
406
|
+
"request_shape": {
|
|
407
|
+
"type": "object",
|
|
408
|
+
"description": "Proposed request body structure with field types",
|
|
409
|
+
"example": {
|
|
410
|
+
"email": "string",
|
|
411
|
+
"password": "string",
|
|
412
|
+
"remember_me": "boolean"
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"response_shape": {
|
|
416
|
+
"type": "object",
|
|
417
|
+
"description": "Expected response body structure with field types",
|
|
418
|
+
"example": {
|
|
419
|
+
"access_token": "string",
|
|
420
|
+
"refresh_token": "string",
|
|
421
|
+
"user": {
|
|
422
|
+
"id": "string",
|
|
423
|
+
"email": "string",
|
|
424
|
+
"name": "string"
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
"story_ref": {
|
|
429
|
+
"type": "string",
|
|
430
|
+
"description": "Story ID this endpoint proposal traces to",
|
|
431
|
+
"example": "US-AUTH-001"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
"state_requirements": {
|
|
436
|
+
"type": "object",
|
|
437
|
+
"description": "State management needs for this screen",
|
|
438
|
+
"fields": {
|
|
439
|
+
"local_state": {
|
|
440
|
+
"type": "object",
|
|
441
|
+
"description": "Component-level state fields with types",
|
|
442
|
+
"example": {
|
|
443
|
+
"formValues": "{ email: string, password: string }",
|
|
444
|
+
"isSubmitting": "boolean",
|
|
445
|
+
"showPassword": "boolean"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"global_state": {
|
|
449
|
+
"type": "object",
|
|
450
|
+
"description": "App-level state fields this screen reads or writes",
|
|
451
|
+
"example": {
|
|
452
|
+
"currentUser": "User | null",
|
|
453
|
+
"isAuthenticated": "boolean"
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"derived_state": {
|
|
457
|
+
"type": "object",
|
|
458
|
+
"description": "Computed state derived from other state",
|
|
459
|
+
"example": {
|
|
460
|
+
"isFormValid": "derived from formValues validation",
|
|
461
|
+
"displayName": "derived from currentUser.firstName + currentUser.lastName"
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
"navigation": {
|
|
467
|
+
"type": "object",
|
|
468
|
+
"description": "Navigation relationships for this screen",
|
|
469
|
+
"fields": {
|
|
470
|
+
"links_to": {
|
|
471
|
+
"type": "array",
|
|
472
|
+
"description": "Screen IDs this screen can navigate to",
|
|
473
|
+
"items": { "type": "string" },
|
|
474
|
+
"example": ["SCR-AUTH-003", "SCR-DASH-001"]
|
|
475
|
+
},
|
|
476
|
+
"back_to": {
|
|
477
|
+
"type": "string | null",
|
|
478
|
+
"description": "Screen ID for back navigation, null if top-level",
|
|
479
|
+
"example": null
|
|
480
|
+
},
|
|
481
|
+
"conditional_routes": {
|
|
482
|
+
"type": "array",
|
|
483
|
+
"description": "Navigation that depends on conditions",
|
|
484
|
+
"items": {
|
|
485
|
+
"condition": {
|
|
486
|
+
"type": "string",
|
|
487
|
+
"example": "isAuthenticated === true"
|
|
488
|
+
},
|
|
489
|
+
"target": {
|
|
490
|
+
"type": "string",
|
|
491
|
+
"example": "SCR-DASH-001"
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### screen_registry.json
|
|
503
|
+
- **Path:** `agent_output/contracts/{module_id}/screen_registry.json`
|
|
504
|
+
- **Format:** `json`
|
|
505
|
+
- **Consumers:** `fe_review`, `wireframe`, `unified_review`
|
|
506
|
+
- **Shape:**
|
|
507
|
+
```json
|
|
508
|
+
{
|
|
509
|
+
"module_id": {
|
|
510
|
+
"type": "string",
|
|
511
|
+
"description": "Module this registry belongs to",
|
|
512
|
+
"example": "auth"
|
|
513
|
+
},
|
|
514
|
+
"screens": {
|
|
515
|
+
"type": "array",
|
|
516
|
+
"description": "All screens in this module",
|
|
517
|
+
"items": {
|
|
518
|
+
"screen_id": {
|
|
519
|
+
"type": "string",
|
|
520
|
+
"description": "Unique screen ID",
|
|
521
|
+
"example": "SCR-AUTH-001"
|
|
522
|
+
},
|
|
523
|
+
"name": {
|
|
524
|
+
"type": "string",
|
|
525
|
+
"description": "Screen display name",
|
|
526
|
+
"example": "Login Screen"
|
|
527
|
+
},
|
|
528
|
+
"route": {
|
|
529
|
+
"type": "string",
|
|
530
|
+
"description": "URL route",
|
|
531
|
+
"example": "/login"
|
|
532
|
+
},
|
|
533
|
+
"module_id": {
|
|
534
|
+
"type": "string",
|
|
535
|
+
"description": "Module this screen belongs to",
|
|
536
|
+
"example": "auth"
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
### navigation_graph.json
|
|
544
|
+
- **Path:** `agent_output/contracts/{module_id}/navigation_graph.json`
|
|
545
|
+
- **Format:** `json`
|
|
546
|
+
- **Consumers:** `fe_review`, `wireframe`
|
|
547
|
+
- **Shape:**
|
|
548
|
+
```json
|
|
549
|
+
{
|
|
550
|
+
"module_id": {
|
|
551
|
+
"type": "string",
|
|
552
|
+
"description": "Module this graph belongs to",
|
|
553
|
+
"example": "auth"
|
|
554
|
+
},
|
|
555
|
+
"nodes": {
|
|
556
|
+
"type": "array",
|
|
557
|
+
"description": "All navigable screens as graph nodes",
|
|
558
|
+
"items": {
|
|
559
|
+
"screen_id": {
|
|
560
|
+
"type": "string",
|
|
561
|
+
"example": "SCR-AUTH-001"
|
|
562
|
+
},
|
|
563
|
+
"route": {
|
|
564
|
+
"type": "string",
|
|
565
|
+
"example": "/login"
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
"edges": {
|
|
570
|
+
"type": "array",
|
|
571
|
+
"description": "Navigation links between screens",
|
|
572
|
+
"items": {
|
|
573
|
+
"from": {
|
|
574
|
+
"type": "string",
|
|
575
|
+
"description": "Source screen ID",
|
|
576
|
+
"example": "SCR-AUTH-001"
|
|
577
|
+
},
|
|
578
|
+
"to": {
|
|
579
|
+
"type": "string",
|
|
580
|
+
"description": "Target screen ID",
|
|
581
|
+
"example": "SCR-AUTH-003"
|
|
582
|
+
},
|
|
583
|
+
"trigger": {
|
|
584
|
+
"type": "string",
|
|
585
|
+
"description": "What user action triggers this navigation",
|
|
586
|
+
"example": "click 'Forgot Password' link"
|
|
587
|
+
},
|
|
588
|
+
"condition": {
|
|
589
|
+
"type": "string | null",
|
|
590
|
+
"description": "Condition for this navigation, null if unconditional",
|
|
591
|
+
"example": null
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### state_matrix.json
|
|
599
|
+
- **Path:** `agent_output/contracts/{module_id}/state_matrix.json`
|
|
600
|
+
- **Format:** `json`
|
|
601
|
+
- **Consumers:** `fe_review`
|
|
602
|
+
- **Shape:**
|
|
603
|
+
```json
|
|
604
|
+
{
|
|
605
|
+
"module_id": {
|
|
606
|
+
"type": "string",
|
|
607
|
+
"description": "Module this state matrix belongs to",
|
|
608
|
+
"example": "auth"
|
|
609
|
+
},
|
|
610
|
+
"state_entries": {
|
|
611
|
+
"type": "array",
|
|
612
|
+
"description": "Per-screen state read/write map",
|
|
613
|
+
"items": {
|
|
614
|
+
"screen_id": {
|
|
615
|
+
"type": "string",
|
|
616
|
+
"example": "SCR-AUTH-001"
|
|
617
|
+
},
|
|
618
|
+
"reads": {
|
|
619
|
+
"type": "array",
|
|
620
|
+
"description": "State keys this screen reads",
|
|
621
|
+
"items": {
|
|
622
|
+
"key": {
|
|
623
|
+
"type": "string",
|
|
624
|
+
"example": "currentUser"
|
|
625
|
+
},
|
|
626
|
+
"scope": {
|
|
627
|
+
"type": "string",
|
|
628
|
+
"enum": ["local", "global", "derived"],
|
|
629
|
+
"example": "global"
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
"writes": {
|
|
634
|
+
"type": "array",
|
|
635
|
+
"description": "State keys this screen writes/mutates",
|
|
636
|
+
"items": {
|
|
637
|
+
"key": {
|
|
638
|
+
"type": "string",
|
|
639
|
+
"example": "isAuthenticated"
|
|
640
|
+
},
|
|
641
|
+
"scope": {
|
|
642
|
+
"type": "string",
|
|
643
|
+
"enum": ["local", "global"],
|
|
644
|
+
"example": "global"
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
### story_screen_map.json
|
|
654
|
+
- **Path:** `agent_output/contracts/{module_id}/story_screen_map.json`
|
|
655
|
+
- **Format:** `json`
|
|
656
|
+
- **Consumers:** `fe_review`, `unified_review`
|
|
657
|
+
- **Shape:**
|
|
658
|
+
```json
|
|
659
|
+
{
|
|
660
|
+
"module_id": {
|
|
661
|
+
"type": "string",
|
|
662
|
+
"description": "Module this mapping belongs to",
|
|
663
|
+
"example": "auth"
|
|
664
|
+
},
|
|
665
|
+
"mappings": {
|
|
666
|
+
"type": "array",
|
|
667
|
+
"description": "Maps each story to the screens that serve it",
|
|
668
|
+
"items": {
|
|
669
|
+
"story_id": {
|
|
670
|
+
"type": "string",
|
|
671
|
+
"description": "User story ID",
|
|
672
|
+
"example": "US-AUTH-001"
|
|
673
|
+
},
|
|
674
|
+
"screen_ids": {
|
|
675
|
+
"type": "array",
|
|
676
|
+
"description": "Screen IDs that implement this story",
|
|
677
|
+
"items": { "type": "string" },
|
|
678
|
+
"example": ["SCR-AUTH-001", "SCR-AUTH-002"]
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
## Dependencies
|
|
688
|
+
|
|
689
|
+
| Depends On | Agent | Artifact | Why |
|
|
690
|
+
|---|---|---|---|
|
|
691
|
+
| input | `user_stories` | `user_stories_{module_id}.json` | PRIMARY input — stories drive screen derivation in the story-first approach |
|
|
692
|
+
| input | `theming` | `design_tokens.json` | Needed to ensure screens reference valid design tokens and components align with the design system |
|
|
693
|
+
| input | `spike` | `spike_summary.json` | Technical constraints and package decisions influence component choices and feasibility |
|
|
694
|
+
| input | `spike` | `knowledge_handoff.json` | Technical findings may affect screen design (e.g., SSR requirements, auth flow patterns) |
|
|
695
|
+
|
|
696
|
+
| Blocks | Agent | Why |
|
|
697
|
+
|---|---|---|
|
|
698
|
+
| output | `wireframe` | Wireframe agent needs fe_details.json screens, components, and navigation to produce HTML wireframes |
|
|
699
|
+
| output | `be_contract` | BE Contract agent uses endpointProposals as secondary input for consumer-enriched API design |
|
|
700
|
+
| output | `fe_review` | FE Review agent needs all fe_details.json files to perform cross-module consistency checks |
|
|
701
|
+
| output | `db_contract` | DB Contract agent uses fe_details.json as one of its triple sources |
|
|
702
|
+
|
|
703
|
+
---
|
|
704
|
+
|
|
705
|
+
## Orchestrator Communication
|
|
706
|
+
|
|
707
|
+
**Agent Identity:** `fe_contract` — Use this ID in all `node_write`, `node_read`, `tracker_read`, and `tracker_update` calls.
|
|
708
|
+
|
|
709
|
+
### Tracker Access
|
|
710
|
+
|
|
711
|
+
| Operation | Fields | Why |
|
|
712
|
+
|---|---|---|
|
|
713
|
+
| `tracker_read` | `md.a` | Read active modules list to determine which module this per-module invocation targets |
|
|
714
|
+
| `tracker_update` | `ag` | Report agent status (in_progress, completed, failed) |
|
|
715
|
+
|
|
716
|
+
### Output Meta
|
|
717
|
+
|
|
718
|
+
`null` — This agent produces contract artifacts only. No routing metadata for the orchestrator.
|
|
719
|
+
|
|
720
|
+
### Completion Signal
|
|
721
|
+
|
|
722
|
+
**Success:**
|
|
723
|
+
```
|
|
724
|
+
tracker_update({ agent_status: { agent_id: "fe_contract", status: "completed" } })
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
**Failure:**
|
|
728
|
+
```
|
|
729
|
+
tracker_update({ agent_status: { agent_id: "fe_contract", status: "failed" } })
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
### Scope Resolution
|
|
733
|
+
|
|
734
|
+
Per-module agent. Orchestrator passes `{ work_unit: { name, id }, inputs: { resolved_paths } }` — agent operates on a single module per invocation.
|
|
735
|
+
|
|
736
|
+
---
|
|
737
|
+
|
|
738
|
+
## Compressed Keymap
|
|
739
|
+
|
|
740
|
+
Use these compressed keys in all `node_write` and `node_read` calls. The registry validates against this map — unknown keys are rejected.
|
|
741
|
+
|
|
742
|
+
### fe_details.json
|
|
743
|
+
|
|
744
|
+
| Key | Full Name | Description |
|
|
745
|
+
|---|---|---|
|
|
746
|
+
| `m` | module_id | Module this FE contract belongs to |
|
|
747
|
+
| `sc` | screens | Array of screen objects |
|
|
748
|
+
| `si` | screen_id | Unique screen ID (SCR-{MODULE}-{NNN}) |
|
|
749
|
+
| `sn` | name | Human-readable screen name |
|
|
750
|
+
| `sd` | description | What this screen does and why |
|
|
751
|
+
| `rt` | route | URL route for this screen |
|
|
752
|
+
| `sr` | story_refs | Story IDs this screen serves |
|
|
753
|
+
| `cm` | components | Array of UI component objects |
|
|
754
|
+
| `cn` | name (component) | Component name in PascalCase |
|
|
755
|
+
| `ct` | type (component) | Component category (form, display, navigation, etc.) |
|
|
756
|
+
| `cp` | props | Expected props with types |
|
|
757
|
+
| `dd` | dataDisplayed | Array of data fields displayed |
|
|
758
|
+
| `df` | field (display) | Field name as displayed |
|
|
759
|
+
| `ds` | source (display) | Where data comes from (api, local_state, global_state, etc.) |
|
|
760
|
+
| `dff` | format (display) | Display format if applicable |
|
|
761
|
+
| `dc` | dataCaptured | Array of data fields captured from user input |
|
|
762
|
+
| `cf` | field (capture) | Field name as captured |
|
|
763
|
+
| `cft` | type (capture) | Input data type (string, number, boolean, etc.) |
|
|
764
|
+
| `cvr` | validation_rules | Validation rules for captured field |
|
|
765
|
+
| `ep` | endpointProposals | Proposed API endpoints for this screen |
|
|
766
|
+
| `em` | method (endpoint) | HTTP method (GET, POST, PUT, PATCH, DELETE) |
|
|
767
|
+
| `ept` | path (endpoint) | Proposed endpoint path |
|
|
768
|
+
| `epu` | purpose (endpoint) | What this endpoint is for |
|
|
769
|
+
| `erq` | request_shape | Proposed request body structure |
|
|
770
|
+
| `ers` | response_shape | Expected response body structure |
|
|
771
|
+
| `esr` | story_ref (endpoint) | Story ID this endpoint traces to |
|
|
772
|
+
| `stq` | state_requirements | State management needs object |
|
|
773
|
+
| `ls` | local_state | Component-level state fields |
|
|
774
|
+
| `gs` | global_state | App-level state fields |
|
|
775
|
+
| `dvs` | derived_state | Computed state derived from other state |
|
|
776
|
+
| `nv` | navigation | Navigation relationships object |
|
|
777
|
+
| `lt` | links_to | Screen IDs this screen navigates to |
|
|
778
|
+
| `bt` | back_to | Screen ID for back navigation |
|
|
779
|
+
| `cr` | conditional_routes | Condition-dependent navigation |
|
|
780
|
+
| `crc` | condition (route) | Condition expression |
|
|
781
|
+
| `crt` | target (route) | Target screen ID |
|
|
782
|
+
|
|
783
|
+
### screen_registry.json
|
|
784
|
+
|
|
785
|
+
| Key | Full Name | Description |
|
|
786
|
+
|---|---|---|
|
|
787
|
+
| `m` | module_id | Module this registry belongs to |
|
|
788
|
+
| `sc` | screens | Array of screen entries |
|
|
789
|
+
| `si` | screen_id | Unique screen ID |
|
|
790
|
+
| `sn` | name | Screen display name |
|
|
791
|
+
| `rt` | route | URL route |
|
|
792
|
+
| `sm` | module_id (screen) | Module this screen belongs to |
|
|
793
|
+
|
|
794
|
+
### navigation_graph.json
|
|
795
|
+
|
|
796
|
+
| Key | Full Name | Description |
|
|
797
|
+
|---|---|---|
|
|
798
|
+
| `m` | module_id | Module this graph belongs to |
|
|
799
|
+
| `nd` | nodes | Array of navigable screen nodes |
|
|
800
|
+
| `ni` | screen_id (node) | Screen ID |
|
|
801
|
+
| `nr` | route (node) | Route |
|
|
802
|
+
| `eg` | edges | Array of navigation edges |
|
|
803
|
+
| `ef` | from | Source screen ID |
|
|
804
|
+
| `et` | to | Target screen ID |
|
|
805
|
+
| `etr` | trigger | User action that triggers navigation |
|
|
806
|
+
| `ec` | condition (edge) | Condition for navigation, null if unconditional |
|
|
807
|
+
|
|
808
|
+
### state_matrix.json
|
|
809
|
+
|
|
810
|
+
| Key | Full Name | Description |
|
|
811
|
+
|---|---|---|
|
|
812
|
+
| `m` | module_id | Module this state matrix belongs to |
|
|
813
|
+
| `se` | state_entries | Array of per-screen state entries |
|
|
814
|
+
| `si` | screen_id | Screen ID |
|
|
815
|
+
| `rd` | reads | State keys this screen reads |
|
|
816
|
+
| `rk` | key (read) | State key name |
|
|
817
|
+
| `rsc` | scope (read) | Scope: local, global, or derived |
|
|
818
|
+
| `wr` | writes | State keys this screen writes |
|
|
819
|
+
| `wk` | key (write) | State key name |
|
|
820
|
+
| `wsc` | scope (write) | Scope: local or global |
|
|
821
|
+
|
|
822
|
+
### story_screen_map.json
|
|
823
|
+
|
|
824
|
+
| Key | Full Name | Description |
|
|
825
|
+
|---|---|---|
|
|
826
|
+
| `m` | module_id | Module this mapping belongs to |
|
|
827
|
+
| `mp` | mappings | Array of story-to-screen mappings |
|
|
828
|
+
| `sid` | story_id | User story ID |
|
|
829
|
+
| `sci` | screen_ids | Screen IDs that implement this story |
|
|
830
|
+
|
|
831
|
+
---
|
|
832
|
+
|
|
833
|
+
## Tools Required
|
|
834
|
+
|
|
835
|
+
| Tool | Purpose |
|
|
836
|
+
|---|---|
|
|
837
|
+
| `node_write` | Write agent output artifacts using compressed keys. Output key: `fe_details`, `screen_registry`, `navigation_graph`, `state_matrix`, `story_screen_map` |
|
|
838
|
+
| `node_read` | Read input artifacts from upstream agents. Input keys: `user_stories`, `design_tokens`, `spike_summary`, `knowledge_handoff` |
|
|
839
|
+
| `tracker_read` | Read tracker state — active modules via `md.a` |
|
|
840
|
+
| `tracker_update` | Report agent status and completion signal |
|
|
841
|
+
|
|
842
|
+
---
|
|
843
|
+
|
|
844
|
+
## Guardrails
|
|
845
|
+
|
|
846
|
+
### Rules
|
|
847
|
+
|
|
848
|
+
| ID | Category | Severity | Rule |
|
|
849
|
+
|---|---|---|---|
|
|
850
|
+
| R-001 | `constraint` | `must` | Every user story must map to at least one screen. No story may be left unserved by the FE contract. |
|
|
851
|
+
| R-002 | `constraint` | `must` | Every screen must have at least one story_ref. No screen may exist without a story-driven reason. |
|
|
852
|
+
| R-003 | `scope_boundary` | `must` | endpointProposals are suggestions for the BE Contract Agent. FE must not assume BE will use the exact paths, methods, or shapes proposed. The word "proposal" is intentional. |
|
|
853
|
+
| R-004 | `not_allowed` | `must` | Must not dictate BE endpoint structure. Propose based on FE data needs, but never assume the final API shape. |
|
|
854
|
+
| R-005 | `constraint` | `must` | Screen IDs must follow the format SCR-{MODULE}-{NNN} where MODULE is the uppercase module_id and NNN is a zero-padded three-digit number. |
|
|
855
|
+
| R-006 | `output_quality` | `must` | Every screen must define at least one component, and every component must have a type and props definition. |
|
|
856
|
+
| R-007 | `data_handling` | `must` | dataCaptured fields must include validation_rules. No captured field may lack validation — even if the rule is just ["required"]. |
|
|
857
|
+
| R-008 | `constraint` | `should` | Navigation must form a connected graph — no orphan screens that cannot be reached from any other screen in the module. |
|
|
858
|
+
| R-009 | `output_quality` | `should` | endpointProposals should include both request_shape and response_shape with full field types, not just field names. |
|
|
859
|
+
| R-010 | `interaction` | `should` | When a story is ambiguous about which screen it belongs to, the agent should ask the user rather than guessing. |
|
|
860
|
+
| R-011 | `constraint` | `must` | Routes must be unique within a module. No two screens may share the same route path. |
|
|
861
|
+
| R-012 | `data_handling` | `should` | State requirements should distinguish between local, global, and derived state. Overuse of global state should be flagged to the user. |
|
|
862
|
+
| R-013 | `constraint` | `must` | Must use compressed keys for all `node_write` and `node_read` calls. Raw/uncompressed keys are rejected by the registry. |
|
|
863
|
+
| R-014 | `constraint` | `must` | Must use `node_write`/`node_read` for all artifact I/O. Raw file system writes are not permitted for pipeline artifacts. |
|
|
864
|
+
| R-015 | `constraint` | `must` | Must call `tracker_update` with final agent status (completed or failed) before exiting. |
|
|
865
|
+
| R-016 | `constraint` | `must` | Must read active modules via `tracker_read` (`md.a`) to resolve which module this invocation targets. |
|
|
866
|
+
|
|
867
|
+
### Limits
|
|
868
|
+
|
|
869
|
+
| Resource | Value |
|
|
870
|
+
|---|---|
|
|
871
|
+
| max_retries | 3 |
|
|
872
|
+
| max_tokens | 16384 |
|
|
873
|
+
| max_screens_per_module | 50 |
|
|
874
|
+
| max_clarification_rounds | 5 |
|
|
875
|
+
| timeout_seconds | 300 |
|
|
876
|
+
|
|
877
|
+
---
|
|
878
|
+
|
|
879
|
+
## Scope Boundary
|
|
880
|
+
|
|
881
|
+
**In scope:**
|
|
882
|
+
- Deriving screens from user stories (story-first approach)
|
|
883
|
+
- Defining component structures, props, and types for each screen
|
|
884
|
+
- Specifying data displayed and data captured per screen
|
|
885
|
+
- Proposing endpoint shapes based on FE data needs
|
|
886
|
+
- Defining state management requirements (local, global, derived)
|
|
887
|
+
- Building navigation graphs between screens
|
|
888
|
+
- Mapping stories to screens bidirectionally
|
|
889
|
+
- Applying design token references to component specifications
|
|
890
|
+
- Incorporating spike constraints and package decisions into component choices
|
|
891
|
+
|
|
892
|
+
**Out of scope:**
|
|
893
|
+
- Defining final API endpoint structure (that is be_contract's job)
|
|
894
|
+
- Producing visual wireframes or HTML (that is wireframe agent's job)
|
|
895
|
+
- Defining database models or schemas (that is db_contract's job)
|
|
896
|
+
- Making backend architectural decisions
|
|
897
|
+
- Implementing any code — this is contract phase, not implementation
|
|
898
|
+
- Choosing CSS frameworks or build tools (those come from spike/theming)
|
|
899
|
+
- Defining authentication/authorization logic (that is BE's responsibility)
|
|
900
|
+
- Cross-module navigation (handled at fe_review level)
|
|
901
|
+
|
|
902
|
+
---
|
|
903
|
+
|
|
904
|
+
## Triggers
|
|
905
|
+
|
|
906
|
+
- Orchestrator activates this agent when a module enters Phase 5
|
|
907
|
+
- Per-module streaming: each module's fe_contract runs independently as its Phase 4 (design tokens) is complete
|
|
908
|
+
- In retrofit mode, activated only for modules flagged by the triage agent
|
|
909
|
+
|
|
910
|
+
---
|
|
911
|
+
|
|
912
|
+
## Checkpoints
|
|
913
|
+
|
|
914
|
+
| ID | Description | Action |
|
|
915
|
+
|---|---|---|
|
|
916
|
+
| `CP-001` | User stories loaded and parsed for module | `log` |
|
|
917
|
+
| `CP-002` | Design tokens and spike constraints loaded | `log` |
|
|
918
|
+
| `CP-003` | Screen derivation complete — story-to-screen mapping produced | `notify` — user can review derived screens before proceeding |
|
|
919
|
+
| `CP-004` | Endpoint proposals drafted for all screens | `log` |
|
|
920
|
+
| `CP-005` | Navigation graph validated (no orphans, no unreachable routes) | `log` |
|
|
921
|
+
| `CP-006` | State conflict detection complete | `notify` — if conflicts found, user is alerted |
|
|
922
|
+
| `CP-007` | All output artifacts written and validated | `log` |
|
|
923
|
+
|
|
924
|
+
---
|
|
925
|
+
|
|
926
|
+
## Validation Criteria
|
|
927
|
+
|
|
928
|
+
- Every story_id from user_stories_{module_id}.json appears in at least one screen's story_refs array
|
|
929
|
+
- Every screen has a non-empty story_refs array
|
|
930
|
+
- All screen_ids follow the SCR-{MODULE}-{NNN} format
|
|
931
|
+
- All routes are unique within the module
|
|
932
|
+
- Navigation graph has no orphan nodes (every screen reachable from at least one other, except a designated entry screen)
|
|
933
|
+
- All dataCaptured fields have non-empty validation_rules arrays
|
|
934
|
+
- All endpointProposals have both request_shape and response_shape defined
|
|
935
|
+
- state_matrix.json is consistent with each screen's state_requirements
|
|
936
|
+
- story_screen_map.json is a complete bijective mapping (all stories covered, all screens referenced)
|
|
937
|
+
- Output files conform to their defined JSON schemas
|
|
938
|
+
- No duplicate component names within a single screen
|
|
939
|
+
|
|
940
|
+
---
|
|
941
|
+
|
|
942
|
+
## Context Sources
|
|
943
|
+
|
|
944
|
+
- user_stories_{module_id}.json from Phase 3 (story agent)
|
|
945
|
+
- design_tokens.json from Phase 4 (theming agent)
|
|
946
|
+
- spike_summary.json and knowledge_handoff.json from Phase 2 (spike agent)
|
|
947
|
+
- analysis_output.json from Phase 1 (module/feature definitions for context)
|
|
948
|
+
- Existing FE contract patterns from previous pipeline runs (retrofit mode)
|
|
949
|
+
|
|
950
|
+
---
|
|
951
|
+
|
|
952
|
+
## Operation Mode
|
|
953
|
+
|
|
954
|
+
| Field | Value |
|
|
955
|
+
|---|---|
|
|
956
|
+
| Type | `interactive` |
|
|
957
|
+
| Fallback | `none` — if FE contract fails, the module cannot proceed to wireframe or BE contract |
|
|
958
|
+
|
|
959
|
+
---
|
|
960
|
+
|
|
961
|
+
## Tool Gaps
|
|
962
|
+
|
|
963
|
+
| Gap ID | Description | Needed By | Impact Without |
|
|
964
|
+
|---|---|---|---|
|
|
965
|
+
| `TG-001` | `node_write` — Universal tool for writing agent output artifacts using compressed keys with registry validation | this agent | Agent cannot persist output artifacts through the pipeline-standard interface |
|
|
966
|
+
| `TG-002` | `node_read` — Universal tool for reading upstream agent artifacts using compressed keys | this agent | Agent cannot load input artifacts through the pipeline-standard interface |
|
|
967
|
+
| `TG-003` | `tracker_read` — Universal tool for reading pipeline tracker state | this agent | Agent cannot resolve active modules or check upstream agent completion |
|
|
968
|
+
| `TG-004` | `tracker_update` — Universal tool for reporting agent status and completion signals | this agent | Orchestrator cannot track agent progress or route downstream agents |
|
|
969
|
+
| `TG-005` | Navigation graph validator that checks for orphan screens, unreachable routes, dead-end screens, and circular navigation traps | this agent | Broken navigation would propagate to wireframes and eventually to implementation, causing UX issues |
|
|
970
|
+
| `TG-006` | State conflict detector that identifies conflicting writes to the same global state key across different screens | this agent | State conflicts would only be caught during implementation or testing, significantly increasing rework cost |
|
|
971
|
+
|
|
972
|
+
---
|
|
973
|
+
|
|
974
|
+
## Generation Readiness
|
|
975
|
+
|
|
976
|
+
| `generate_agent` Param | Status | Notes |
|
|
977
|
+
|---|---|---|
|
|
978
|
+
| `fileName` | ready | `fe-contract` |
|
|
979
|
+
| `agentName` | ready | `fe_contract` |
|
|
980
|
+
| `agentRole` | ready | "Frontend Contract Designer — Story-First Screen Derivation" |
|
|
981
|
+
| `agentDescription` | ready | Full description available from Goal section |
|
|
982
|
+
| `operationMode` | ready | `interactive`, no fallback |
|
|
983
|
+
| `goal` | ready | 3 objectives defined with priorities |
|
|
984
|
+
| `inputs` | ready | 4 inputs: user_stories (required), design_tokens (required), spike_summary (required), knowledge_handoff (required) |
|
|
985
|
+
| `guardrails` | ready | 16 rules defined across constraint, scope_boundary, not_allowed, output_quality, data_handling, interaction categories |
|
|
986
|
+
| `scopeBoundary` | ready | 9 in-scope items, 8 out-of-scope items |
|
|
987
|
+
| `outputFormat` | ready | JSON output with full schemas for all 5 output files |
|
|
988
|
+
| `triggers` | ready | 3 triggers defined |
|
|
989
|
+
| `checkpoints` | ready | 7 checkpoints with actions |
|
|
990
|
+
| `validation` | ready | 11 validation criteria |
|
|
991
|
+
| `contextSources` | ready | 5 context sources |
|
|
992
|
+
| `metadata` | ready | phase: "5", mode: "both", granularity: "per_module" |
|