@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,544 @@
|
|
|
1
|
+
# PRD Generation Agent
|
|
2
|
+
|
|
3
|
+
> **Greek:** Logos (Lógos) — "word/reason/document"
|
|
4
|
+
> **Sanskrit:** प्रलेख (Pralekha) — "document/record"
|
|
5
|
+
> **Tagline:** *"The contract the whole team reads"*
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Agent Identity
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|---|---|
|
|
13
|
+
| ID | `prd_generation` |
|
|
14
|
+
| Name | PRD Generation Agent |
|
|
15
|
+
| Phase | 8 — Reconciliation & Decisions |
|
|
16
|
+
| Type | `pipeline` |
|
|
17
|
+
| Granularity | `global` |
|
|
18
|
+
| Interaction | `autonomous` |
|
|
19
|
+
| Mode | `all` |
|
|
20
|
+
| Domain | `dev` |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Goal & Objectives
|
|
25
|
+
|
|
26
|
+
**Goal:** Generate a comprehensive, standalone HTML PRD document that covers ALL layers (frontend, backend, database) — not just FE like v1 — by consuming every analysis, story, contract, flow, global output, and decision artifact produced by the pipeline, and presenting them in a navigable, human-readable format that serves as the authoritative reference for the entire project.
|
|
27
|
+
|
|
28
|
+
| Priority | Objective |
|
|
29
|
+
|---|---|
|
|
30
|
+
| primary | Produce a standalone HTML PRD that covers all three layers (FE, BE, DB) with per-module detail including stories, screens, endpoints, DB models, and flows |
|
|
31
|
+
| secondary | Include all decisions from decisions.json and present them in context, showing what was decided, why, and what impact each decision has on the system |
|
|
32
|
+
| tertiary | Make the PRD navigable with a table of contents, anchor links, and cross-references so any team member can quickly find information about any module, story, or decision |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Inputs
|
|
37
|
+
|
|
38
|
+
### analysis_output.json (per module)
|
|
39
|
+
- **Source:** `analysis` agent -> `agent_output/discovery/{module_id}/analysis_output.json`
|
|
40
|
+
- **Required:** yes
|
|
41
|
+
- **Shape:**
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"module_id": { "type": "string" },
|
|
45
|
+
"module_name": { "type": "string" },
|
|
46
|
+
"description": { "type": "string" },
|
|
47
|
+
"features": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": {
|
|
50
|
+
"feature_id": { "type": "string" },
|
|
51
|
+
"name": { "type": "string" },
|
|
52
|
+
"priority": { "type": "string", "enum": ["must_have", "should_have", "nice_to_have"] }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"requirements": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"fields": {
|
|
58
|
+
"functional": { "type": "array" },
|
|
59
|
+
"non_functional": { "type": "array" }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"data_entities": { "type": "array" },
|
|
63
|
+
"integrations": { "type": "array" }
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### user_stories_{module_id}.json (per module)
|
|
68
|
+
- **Source:** `user_stories` agent -> `agent_output/stories/{module_id}/user_stories_{module_id}.json`
|
|
69
|
+
- **Required:** yes
|
|
70
|
+
- **Shape:**
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"module_id": { "type": "string" },
|
|
74
|
+
"stories": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"story_id": { "type": "string" },
|
|
78
|
+
"role": { "type": "string" },
|
|
79
|
+
"action": { "type": "string" },
|
|
80
|
+
"outcome": { "type": "string" },
|
|
81
|
+
"acceptance_criteria": { "type": "array", "items": { "type": "string" } },
|
|
82
|
+
"priority": { "type": "string", "enum": ["must", "should", "could", "wont"] }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### fe_details.json (per module)
|
|
89
|
+
- **Source:** `fe_contract` agent -> `agent_output/contracts/{module_id}/fe_details.json`
|
|
90
|
+
- **Required:** yes
|
|
91
|
+
- **Shape:**
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"module_id": { "type": "string" },
|
|
95
|
+
"screens": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"screen_id": { "type": "string" },
|
|
99
|
+
"name": { "type": "string" },
|
|
100
|
+
"route": { "type": "string" },
|
|
101
|
+
"components": { "type": "array" },
|
|
102
|
+
"story_refs": { "type": "array", "items": { "type": "string" } }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### openapi.json (per module)
|
|
109
|
+
- **Source:** `be_contract` agent -> `agent_output/contracts/{module_id}/openapi.json`
|
|
110
|
+
- **Required:** yes
|
|
111
|
+
- **Shape:**
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"openapi": { "type": "string", "example": "3.0.3" },
|
|
115
|
+
"info": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"fields": {
|
|
118
|
+
"title": { "type": "string" },
|
|
119
|
+
"version": { "type": "string" }
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"paths": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"description": "OpenAPI paths with operations, request/response schemas"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### prisma_contract.json (per module)
|
|
130
|
+
- **Source:** `db_contract` agent -> `agent_output/contracts/{module_id}/prisma_contract.json`
|
|
131
|
+
- **Required:** yes
|
|
132
|
+
- **Shape:**
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"module_id": { "type": "string" },
|
|
136
|
+
"models": {
|
|
137
|
+
"type": "array",
|
|
138
|
+
"items": {
|
|
139
|
+
"name": { "type": "string" },
|
|
140
|
+
"fields": { "type": "array" },
|
|
141
|
+
"relations": { "type": "array" },
|
|
142
|
+
"indexes": { "type": "array" }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### module_flow.json (per module)
|
|
149
|
+
- **Source:** `architect_reconcile` agent -> `agent_output/reconciliation/{module_id}/module_flow.json`
|
|
150
|
+
- **Required:** yes
|
|
151
|
+
- **Shape:**
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"module_id": { "type": "string" },
|
|
155
|
+
"layers": {
|
|
156
|
+
"type": "object",
|
|
157
|
+
"fields": {
|
|
158
|
+
"fe": { "type": "object" },
|
|
159
|
+
"be": { "type": "object" },
|
|
160
|
+
"db": { "type": "object" }
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"cross_layer_links": { "type": "array" },
|
|
164
|
+
"cross_module_dependencies": { "type": "array" }
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### global_flow.json
|
|
169
|
+
- **Source:** `architect_reconcile` agent -> `agent_output/reconciliation/global_flow.json`
|
|
170
|
+
- **Required:** yes
|
|
171
|
+
- **Shape:**
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"total_modules": { "type": "number" },
|
|
175
|
+
"system_dependency_graph": { "type": "object" },
|
|
176
|
+
"global_architecture_summary": { "type": "object" }
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### traceability.json
|
|
181
|
+
- **Source:** `architect_reconcile` agent -> `agent_output/reconciliation/traceability.json`
|
|
182
|
+
- **Required:** yes
|
|
183
|
+
- **Shape:**
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"chains": { "type": "array" },
|
|
187
|
+
"summary": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"fields": {
|
|
190
|
+
"total_stories": { "type": "number" },
|
|
191
|
+
"completeness_percentage": { "type": "number" }
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### decisions.json
|
|
198
|
+
- **Source:** `decision_pack` agent -> `agent_output/reconciliation/decisions.json`
|
|
199
|
+
- **Required:** yes
|
|
200
|
+
- **Shape:**
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"gap_decisions": { "type": "array" },
|
|
204
|
+
"conflict_decisions": { "type": "array" },
|
|
205
|
+
"summary": {
|
|
206
|
+
"type": "object",
|
|
207
|
+
"fields": {
|
|
208
|
+
"total_questions": { "type": "number" },
|
|
209
|
+
"modules_affected": { "type": "array" }
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### All Global Outputs
|
|
216
|
+
- **Source:** Phase 7 global agents -> `agent_output/global/*.json`
|
|
217
|
+
- **Required:** yes
|
|
218
|
+
- **Shape:** (references to global_services_registry, global_middleware_registry, global_security_policies, global_integrations, environment_config_schema, production_bootstrap, global_navigation, global_db_patterns)
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Outputs
|
|
223
|
+
|
|
224
|
+
### prd.html
|
|
225
|
+
- **Path:** `agent_output/reconciliation/prd.html`
|
|
226
|
+
- **Format:** `html`
|
|
227
|
+
- **Consumers:** `user` (human-readable reference), `impl_prep` (project context), all implementation agents (reference)
|
|
228
|
+
- **Shape:**
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"format": "standalone HTML document",
|
|
232
|
+
"description": "Self-contained HTML file with embedded CSS. No external dependencies.",
|
|
233
|
+
"sections": {
|
|
234
|
+
"executive_summary": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"description": "High-level overview of the entire system — what it does, who it serves, key metrics (module count, story count, endpoint count)"
|
|
237
|
+
},
|
|
238
|
+
"table_of_contents": {
|
|
239
|
+
"type": "string",
|
|
240
|
+
"description": "Navigable TOC with anchor links to every section and subsection"
|
|
241
|
+
},
|
|
242
|
+
"modules_overview": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"description": "Summary table of all modules with feature counts, story counts, dependencies, and status"
|
|
245
|
+
},
|
|
246
|
+
"per_module_detail": {
|
|
247
|
+
"type": "array",
|
|
248
|
+
"description": "One section per module containing all layer details",
|
|
249
|
+
"items": {
|
|
250
|
+
"module_header": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"description": "Module name, description, features list"
|
|
253
|
+
},
|
|
254
|
+
"stories_section": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"description": "All user stories for this module with acceptance criteria"
|
|
257
|
+
},
|
|
258
|
+
"screens_section": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"description": "All FE screens with components, routes, state requirements"
|
|
261
|
+
},
|
|
262
|
+
"endpoints_section": {
|
|
263
|
+
"type": "string",
|
|
264
|
+
"description": "All BE endpoints from OpenAPI with request/response schemas"
|
|
265
|
+
},
|
|
266
|
+
"db_models_section": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"description": "All DB models from Prisma contract with fields and relations"
|
|
269
|
+
},
|
|
270
|
+
"flows_section": {
|
|
271
|
+
"type": "string",
|
|
272
|
+
"description": "Module flow diagram showing FE -> BE -> DB interactions"
|
|
273
|
+
},
|
|
274
|
+
"traceability_section": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"description": "Story traceability chains for this module"
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"global_architecture": {
|
|
281
|
+
"type": "string",
|
|
282
|
+
"description": "System-wide architecture: shared services, middleware, security, integrations"
|
|
283
|
+
},
|
|
284
|
+
"security_section": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"description": "Security policies, auth strategy, RBAC, data protection"
|
|
287
|
+
},
|
|
288
|
+
"integrations_section": {
|
|
289
|
+
"type": "string",
|
|
290
|
+
"description": "External integration points and configurations"
|
|
291
|
+
},
|
|
292
|
+
"decisions_section": {
|
|
293
|
+
"type": "string",
|
|
294
|
+
"description": "All decisions made during decision pack with reasoning and impact"
|
|
295
|
+
},
|
|
296
|
+
"appendix": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"description": "Environment variables, DB patterns, production bootstrap data"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Dependencies
|
|
307
|
+
|
|
308
|
+
| Depends On | Agent | Artifact | Why |
|
|
309
|
+
|---|---|---|---|
|
|
310
|
+
| input | `analysis` | `analysis_output.json` (per module) | Module descriptions, features, requirements for executive summary and module detail |
|
|
311
|
+
| input | `user_stories` | `user_stories_{module_id}.json` (per module) | Stories for per-module detail section |
|
|
312
|
+
| input | `fe_contract` | `fe_details.json` (per module) | Screen definitions for FE layer documentation |
|
|
313
|
+
| input | `be_contract` | `openapi.json` (per module) | Endpoint definitions for BE layer documentation |
|
|
314
|
+
| input | `db_contract` | `prisma_contract.json` (per module) | DB model definitions for DB layer documentation |
|
|
315
|
+
| input | `architect_reconcile` | `module_flow.json` (per module), `global_flow.json`, `traceability.json` | Merged flows, system graph, and traceability chains |
|
|
316
|
+
| input | `decision_pack` | `decisions.json` | User decisions to include in decisions section |
|
|
317
|
+
| input | Phase 7 agents | All global outputs | Architecture, security, integrations for global sections |
|
|
318
|
+
|
|
319
|
+
| Blocks | Agent | Why |
|
|
320
|
+
|---|---|---|
|
|
321
|
+
| output | `user` | PRD is the primary human-readable deliverable of the analysis and design phases |
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Orchestrator Communication
|
|
326
|
+
|
|
327
|
+
> Reference: `v2/architecture/agent-orchestrator-communication.md`
|
|
328
|
+
|
|
329
|
+
### Agent Identity
|
|
330
|
+
|
|
331
|
+
This agent's ID is `prd_generation`. Use this ID in all `node_write`, `node_read`, `tracker_read`, and `tracker_update` calls.
|
|
332
|
+
|
|
333
|
+
### Tracker Access
|
|
334
|
+
|
|
335
|
+
| Direction | Compressed Keys | Purpose |
|
|
336
|
+
|---|---|---|
|
|
337
|
+
| read | `md.a` | Read active modules to know which modules to include in the PRD |
|
|
338
|
+
| write | `ag` | Report agent status (completed/failed) |
|
|
339
|
+
|
|
340
|
+
### Output Meta
|
|
341
|
+
|
|
342
|
+
This agent does not produce routing/coordination metadata. `output_meta: null`.
|
|
343
|
+
|
|
344
|
+
### Completion Signal
|
|
345
|
+
|
|
346
|
+
- **On success:** `tracker_update(agent_id: "prd_generation", status: "completed")`
|
|
347
|
+
- **On failure:** `tracker_update(agent_id: "prd_generation", status: "failed", add_intervention: { id: "...", agent_id: "prd_generation", type: "error", message: "..." })`
|
|
348
|
+
|
|
349
|
+
### Scope Resolution
|
|
350
|
+
|
|
351
|
+
Global agent — runs once across all modules. Reads `md.a` from tracker via `tracker_read` to know which modules to document.
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Compressed Keymap
|
|
356
|
+
|
|
357
|
+
Use these compressed keys in all `node_write` calls. The registry validates against this map — unknown keys are rejected.
|
|
358
|
+
|
|
359
|
+
**prd.html**
|
|
360
|
+
|
|
361
|
+
| Key | Full Name | Description |
|
|
362
|
+
|---|---|---|
|
|
363
|
+
| `fm` | format | Output format (html) |
|
|
364
|
+
| `ds` | description | PRD document description |
|
|
365
|
+
| `sc` | sections | Top-level sections object |
|
|
366
|
+
| `sc.es` | executive_summary | Executive summary section |
|
|
367
|
+
| `sc.tc` | table_of_contents | Table of contents section |
|
|
368
|
+
| `sc.mo` | modules_overview | Modules overview section |
|
|
369
|
+
| `sc.pm` | per_module_detail | Array of per-module detail sections |
|
|
370
|
+
| `sc.pm.mh` | module_header | Module header and metadata |
|
|
371
|
+
| `sc.pm.ss` | stories_section | User stories for the module |
|
|
372
|
+
| `sc.pm.sr` | screens_section | Screen definitions for the module |
|
|
373
|
+
| `sc.pm.ep` | endpoints_section | API endpoint definitions |
|
|
374
|
+
| `sc.pm.db` | db_models_section | Database model definitions |
|
|
375
|
+
| `sc.pm.fl` | flows_section | Flow diagrams and descriptions |
|
|
376
|
+
| `sc.pm.tr` | traceability_section | Story-to-artifact traceability |
|
|
377
|
+
| `sc.ga` | global_architecture | Global architecture section |
|
|
378
|
+
| `sc.se` | security_section | Security requirements section |
|
|
379
|
+
| `sc.ig` | integrations_section | External integrations section |
|
|
380
|
+
| `sc.dc` | decisions_section | Decisions log section |
|
|
381
|
+
| `sc.ap` | appendix | Appendix section |
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## Tools Required
|
|
386
|
+
|
|
387
|
+
| Tool | Purpose | Exists? |
|
|
388
|
+
|---|---|---|
|
|
389
|
+
| `node_write` | Write PRD output via registry-validated compressed keys. Agent calls `node_write(agent_id: "prd_generation", output_key: "prd", data: {...})`. | Pending |
|
|
390
|
+
| `node_read` | Read all upstream artifacts (analysis, stories, contracts, flows, global outputs, decisions). Agent calls `node_read(agent_id: "prd_generation", input_key: "analysis", unit_id: "{module_id}")`. | Pending |
|
|
391
|
+
| `tracker_read` | Read active modules. Agent calls `tracker_read(agent_id: "prd_generation", fields: ["md.a"])`. | Pending |
|
|
392
|
+
| `tracker_update` | Report completion/failure. Agent calls `tracker_update(agent_id: "prd_generation", status: "completed")`. | Pending |
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## Guardrails
|
|
397
|
+
|
|
398
|
+
### Rules
|
|
399
|
+
|
|
400
|
+
| ID | Category | Severity | Rule |
|
|
401
|
+
|---|---|---|---|
|
|
402
|
+
| R-001 | `constraint` | `must` | Must cover ALL three layers (FE, BE, DB) for every module. This is not an FE-only PRD like v1. |
|
|
403
|
+
| R-002 | `constraint` | `must` | Must be standalone HTML — no external CSS, JS, or image dependencies. Everything embedded inline. |
|
|
404
|
+
| R-003 | `constraint` | `must` | Must include all decisions from decisions.json with reasoning and impact. No decision may be omitted. |
|
|
405
|
+
| R-004 | `output_quality` | `must` | Must be navigable with a table of contents and working anchor links. Every section and module must be linkable. |
|
|
406
|
+
| R-005 | `constraint` | `must` | Must read ALL inputs — analysis, stories, contracts (FE, BE, DB), flows, global outputs, decisions, traceability. Partial reads produce incomplete PRDs. |
|
|
407
|
+
| R-006 | `output_quality` | `must` | Every module section must include stories, screens, endpoints, DB models, and flows. No layer may be silently omitted. |
|
|
408
|
+
| R-007 | `scope_boundary` | `must` | Must not include implementation details or code. The PRD documents what and why, not how. |
|
|
409
|
+
| R-008 | `output_quality` | `should` | Should include an executive summary with key metrics: total modules, total stories, total endpoints, total DB models, traceability completeness percentage. |
|
|
410
|
+
| R-009 | `output_quality` | `should` | Should render flow diagrams (even as ASCII/text-based) for each module showing the FE -> BE -> DB interaction pattern. |
|
|
411
|
+
| R-010 | `data_handling` | `should` | Should include the traceability chain for each module, highlighting any remaining gaps after decisions. |
|
|
412
|
+
| R-011 | `output_quality` | `should` | HTML should be clean, readable, and printable. Should use a professional, minimal design with good typography. |
|
|
413
|
+
| R-012 | `not_allowed` | `must` | Must not fabricate content. Every piece of information in the PRD must trace to an input artifact. |
|
|
414
|
+
| R-013 | `constraint` | `must` | Must use compressed keys as defined in the Compressed Keymap section for all `node_write` / `node_read` calls. Never use expanded/full key names. |
|
|
415
|
+
| R-014 | `constraint` | `must` | Must use `node_write` to write output and `node_read` to read upstream artifacts. Must not use raw file writes, generic file_writer, or any other method. |
|
|
416
|
+
| R-015 | `constraint` | `must` | Must call `tracker_update(agent_id: "prd_generation", status: "completed")` before exiting on success. Must call `tracker_update(agent_id: "prd_generation", status: "failed", add_intervention: {...})` before exiting on failure. |
|
|
417
|
+
| R-016 | `constraint` | `must` | Must read active modules via `tracker_read(agent_id: "prd_generation", fields: ["md.a"])` when resolving scope. Must not hardcode module lists. |
|
|
418
|
+
|
|
419
|
+
### Limits
|
|
420
|
+
|
|
421
|
+
| Resource | Value |
|
|
422
|
+
|---|---|
|
|
423
|
+
| max_retries | 3 |
|
|
424
|
+
| max_tokens | 65536 |
|
|
425
|
+
| max_html_size_mb | 10 |
|
|
426
|
+
| timeout_seconds | 900 |
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## Scope Boundary
|
|
431
|
+
|
|
432
|
+
**In scope:**
|
|
433
|
+
- Generating a comprehensive HTML PRD from all upstream artifacts
|
|
434
|
+
- Covering all three layers (FE, BE, DB) for every module
|
|
435
|
+
- Including executive summary, module overview, per-module detail
|
|
436
|
+
- Documenting all decisions with reasoning and impact
|
|
437
|
+
- Creating navigable TOC with anchor links
|
|
438
|
+
- Including global architecture, security, integrations sections
|
|
439
|
+
- Including traceability information and completeness metrics
|
|
440
|
+
- Rendering flow diagrams within the HTML
|
|
441
|
+
|
|
442
|
+
**Out of scope:**
|
|
443
|
+
- Generating implementation code
|
|
444
|
+
- Making decisions (decisions come from decisions.json)
|
|
445
|
+
- Modifying any input artifacts
|
|
446
|
+
- Producing separate documents per module (single unified PRD)
|
|
447
|
+
- Interactive content (the HTML is static/read-only)
|
|
448
|
+
- Hosting or deploying the PRD
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## Triggers
|
|
453
|
+
|
|
454
|
+
- Orchestrator activates this agent after both architect_reconcile and decision_pack complete
|
|
455
|
+
- Requires decisions.json to exist (even if empty)
|
|
456
|
+
- In retrofit mode, the PRD reflects only changed modules but maintains the full document structure
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## Checkpoints
|
|
461
|
+
|
|
462
|
+
| ID | Description | Action |
|
|
463
|
+
|---|---|---|
|
|
464
|
+
| `CP-001` | All input artifacts loaded from all phases | `log` |
|
|
465
|
+
| `CP-002` | Executive summary and module overview generated | `log` |
|
|
466
|
+
| `CP-003` | Per-module detail sections generated for all modules | `notify` — progress update on large systems |
|
|
467
|
+
| `CP-004` | Global architecture and security sections generated | `log` |
|
|
468
|
+
| `CP-005` | Decisions section generated with all user decisions | `log` |
|
|
469
|
+
| `CP-006` | TOC and anchor links generated and validated | `log` |
|
|
470
|
+
| `CP-007` | prd.html written and validated as well-formed HTML | `notify` — PRD is ready for user review |
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
## Validation Criteria
|
|
475
|
+
|
|
476
|
+
- prd.html file exists and is valid HTML
|
|
477
|
+
- HTML has no external dependencies (all CSS inline, no external scripts or images)
|
|
478
|
+
- Every module in modules_registry.json has a corresponding section in the PRD
|
|
479
|
+
- Every module section contains stories, screens, endpoints, DB models, and flows subsections
|
|
480
|
+
- All decisions from decisions.json appear in the decisions section
|
|
481
|
+
- TOC links resolve to valid anchor targets within the document
|
|
482
|
+
- Executive summary contains key metrics (module count, story count, etc.)
|
|
483
|
+
- Global architecture section covers services, middleware, security, and integrations
|
|
484
|
+
- No fabricated content — every data point traces to an input artifact
|
|
485
|
+
- File size is under the max_html_size_mb limit
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
## Context Sources
|
|
490
|
+
|
|
491
|
+
- analysis_output.json per module (Phase 1)
|
|
492
|
+
- user_stories_{module_id}.json per module (Phase 3)
|
|
493
|
+
- fe_details.json per module (Phase 5)
|
|
494
|
+
- openapi.json per module (Phase 5)
|
|
495
|
+
- prisma_contract.json per module (Phase 5)
|
|
496
|
+
- module_flow.json per module, global_flow.json, traceability.json (Phase 8)
|
|
497
|
+
- decisions.json (Phase 8)
|
|
498
|
+
- All 8 global output artifacts (Phase 7)
|
|
499
|
+
- modules_registry.json (Phase 1)
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
## Operation Mode
|
|
504
|
+
|
|
505
|
+
| Field | Value |
|
|
506
|
+
|---|---|
|
|
507
|
+
| Type | `autonomous` |
|
|
508
|
+
| Fallback | `none` — if PRD generation fails, the user loses the primary documentation deliverable but pipeline can still proceed to implementation prep |
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
## Tool Gaps
|
|
513
|
+
|
|
514
|
+
| Gap ID | Description | Needed By | Impact Without |
|
|
515
|
+
|---|---|---|---|
|
|
516
|
+
| `TG-001` | `node_write` MCP tool not yet built | this agent | Cannot write output with registry validation -- blocked |
|
|
517
|
+
| `TG-002` | `node_read` MCP tool not yet built | this agent | Cannot read upstream artifacts with field enforcement -- blocked |
|
|
518
|
+
| `TG-003` | `tracker_read` MCP tool not yet built | this agent | Cannot read active modules -- blocked |
|
|
519
|
+
| `TG-004` | `tracker_update` MCP tool not yet built | this agent | Cannot report completion -- blocked |
|
|
520
|
+
| `TG-005` | HTML document generator that produces structured, well-formed HTML with embedded CSS, TOC, anchor links, and professional styling | this agent | Would need to construct HTML strings manually, risking broken markup and poor visual quality |
|
|
521
|
+
| `TG-006` | Diagram renderer that can produce inline SVG or ASCII flow diagrams showing FE -> BE -> DB interactions per module | this agent | Flow sections would be text-only descriptions, harder for stakeholders to understand the system architecture |
|
|
522
|
+
| `TG-007` | Markdown-to-HTML converter for embedding formatted content within the HTML document structure | this agent | Content authoring would require direct HTML, increasing complexity and error risk |
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## Generation Readiness
|
|
527
|
+
|
|
528
|
+
| `generate_agent` Param | Status | Notes |
|
|
529
|
+
|---|---|---|
|
|
530
|
+
| `fileName` | ready | `prd-generation` |
|
|
531
|
+
| `agentName` | ready | `prd_generation` |
|
|
532
|
+
| `agentRole` | ready | "Comprehensive HTML PRD Document Generator" |
|
|
533
|
+
| `agentDescription` | ready | Full description available from Goal section |
|
|
534
|
+
| `operationMode` | ready | `autonomous`, no fallback |
|
|
535
|
+
| `goal` | ready | 3 objectives defined with priorities |
|
|
536
|
+
| `inputs` | ready | All upstream artifacts: analysis, stories, contracts (FE/BE/DB), flows, global outputs, decisions, traceability |
|
|
537
|
+
| `guardrails` | ready | 16 rules defined across constraint, output_quality, scope_boundary, data_handling, not_allowed categories |
|
|
538
|
+
| `scopeBoundary` | ready | 8 in-scope items, 6 out-of-scope items |
|
|
539
|
+
| `outputFormat` | ready | HTML output with full section structure defined |
|
|
540
|
+
| `triggers` | ready | 3 triggers defined |
|
|
541
|
+
| `checkpoints` | ready | 7 checkpoints with actions |
|
|
542
|
+
| `validation` | ready | 10 validation criteria |
|
|
543
|
+
| `contextSources` | ready | 9 context source categories |
|
|
544
|
+
| `metadata` | ready | phase: "8", mode: "both", granularity: "global" |
|