@makerkit/prd 0.0.0-stage → 0.0.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.
Files changed (54) hide show
  1. package/.turbo/turbo-build.log +46 -0
  2. package/.turbo/turbo-test.log +21 -0
  3. package/.turbo/turbo-typecheck.log +1 -0
  4. package/README.md +64 -2
  5. package/dist/LICENSE +21 -0
  6. package/dist/README.md +65 -0
  7. package/dist/index.d.ts +227 -0
  8. package/dist/index.js +1897 -0
  9. package/dist/index.mjs +1791 -0
  10. package/dist/mcp.d.ts +9 -0
  11. package/dist/mcp.js +532 -0
  12. package/dist/mcp.mjs +531 -0
  13. package/dist/node.d.ts +19 -0
  14. package/dist/node.js +94 -0
  15. package/dist/node.mjs +92 -0
  16. package/dist/package.json +49 -0
  17. package/dist/prd.service-DSBp8sMl.d.ts +2327 -0
  18. package/dist/prompts-Bber0S1Z.mjs +778 -0
  19. package/dist/prompts-CIX8IeAx.js +1233 -0
  20. package/package.json +66 -4
  21. package/src/__tests__/agent-workflow.test.ts +377 -0
  22. package/src/__tests__/attachments.test.ts +475 -0
  23. package/src/__tests__/node.test.ts +141 -0
  24. package/src/__tests__/plan-check.test.ts +229 -0
  25. package/src/__tests__/planning.test.ts +1059 -0
  26. package/src/__tests__/prd-operations.test.ts +423 -0
  27. package/src/__tests__/prd.service.test.ts +477 -0
  28. package/src/__tests__/prd.tool.test.ts +282 -0
  29. package/src/__tests__/templates.test.ts +141 -0
  30. package/src/applicability.ts +73 -0
  31. package/src/attachment-paths.ts +78 -0
  32. package/src/attachments.ts +160 -0
  33. package/src/edge-cases.ts +52 -0
  34. package/src/index.ts +35 -0
  35. package/src/markdown.ts +268 -0
  36. package/src/mcp/index.ts +839 -0
  37. package/src/mcp/tool-response.ts +85 -0
  38. package/src/node.ts +146 -0
  39. package/src/open-questions.ts +93 -0
  40. package/src/plan-check.ts +282 -0
  41. package/src/planning-operations.ts +429 -0
  42. package/src/prd-operations.ts +690 -0
  43. package/src/prd.service.ts +1051 -0
  44. package/src/prompts.ts +110 -0
  45. package/src/safe-file-name.ts +42 -0
  46. package/src/schema.ts +976 -0
  47. package/src/templates.ts +173 -0
  48. package/src/testing/fake-mcp-server.ts +81 -0
  49. package/src/types.ts +333 -0
  50. package/tsconfig.json +23 -0
  51. package/tsconfig.lib.json +8 -0
  52. package/tsconfig.spec.json +7 -0
  53. package/tsdown.config.mts +11 -0
  54. package/vitest.config.mts +8 -0
@@ -0,0 +1,778 @@
1
+ import { z } from "zod/v3";
2
+ //#region src/templates.ts
3
+ const TEMPLATE_IDS = [
4
+ "saas-feature",
5
+ "internal-tool",
6
+ "integration",
7
+ "mvp"
8
+ ];
9
+ const PRD_TEMPLATES = [
10
+ {
11
+ id: "saas-feature",
12
+ name: "SaaS feature",
13
+ description: "A new feature in a multi-tenant SaaS: data scoped to accounts or teams, roles and permissions, and possibly plan limits.",
14
+ whenToUse: "Customers of an existing SaaS will use it, and its data belongs to an account or team.",
15
+ defaults: {
16
+ openQuestions: [
17
+ "Does the data belong to a personal account, a team account, or both?",
18
+ "Which roles can view, create, edit and delete it?",
19
+ "Is it limited by billing plan, and what happens when a limit is reached?"
20
+ ],
21
+ globalAcceptanceCriteria: [
22
+ "Members of one account cannot read or change another account’s data, including through the database API directly.",
23
+ "Every action respects the role permissions agreed in this PRD.",
24
+ "Empty, loading and error states are handled on every new screen."
25
+ ],
26
+ qualityStandards: ["Access rules are enforced in the database (e.g. row-level security), not only in the UI.", "New database changes ship as migrations with tests for the access rules."],
27
+ technicalConstraints: ["Follow the existing project conventions for data access, server actions and UI components."],
28
+ rolloutPhases: ["Release behind a feature flag to internal accounts", "Enable for all accounts"],
29
+ rollbackConditions: ["Errors or data-access problems reported after release: turn the flag off"]
30
+ },
31
+ interviewFocus: [
32
+ "Who owns the data: a personal account, a team, or both?",
33
+ "Which roles can do what, and is anything limited by plan?",
34
+ "What does a new account see before any data exists?"
35
+ ]
36
+ },
37
+ {
38
+ id: "internal-tool",
39
+ name: "Internal tool",
40
+ description: "A tool for yourself or your own team, where speed matters more than configurability.",
41
+ whenToUse: "Only you or your team will use it; it will not be sold to other organisations.",
42
+ defaults: {
43
+ nonGoals: ["Settings screens for things that can be hard-coded for our own use", "Support for other organisations or tenants"],
44
+ openQuestions: ["Who exactly will use it, and how often?", "What is hard-coded (stages, categories, fields) rather than configurable?"],
45
+ globalAcceptanceCriteria: ["Works on the devices the team actually uses (desktop and phone if needed).", "Only signed-in team members can access it."],
46
+ qualityStandards: ["Prefer the simplest working version; no configuration UI unless asked for."]
47
+ },
48
+ interviewFocus: ["What can be hard-coded because only we use it?", "Which existing tool or spreadsheet does this replace, and what annoys us about it?"]
49
+ },
50
+ {
51
+ id: "integration",
52
+ name: "Third-party integration",
53
+ description: "Connecting to an external service: an API, webhooks, OAuth, or a data sync.",
54
+ whenToUse: "The work depends on an external service you do not control.",
55
+ defaults: {
56
+ openQuestions: [
57
+ "Which direction does data flow: we call them, they call us (webhooks), or both?",
58
+ "How do users connect their account (API key, OAuth), and where are credentials stored?",
59
+ "What happens when the service is down, slow or rate-limits us?"
60
+ ],
61
+ globalAcceptanceCriteria: [
62
+ "Credentials and tokens are stored encrypted or in secrets, never in client code or logs.",
63
+ "Incoming webhooks are verified (signature) and safe to receive twice.",
64
+ "Failures are retried or surfaced to the user; nothing fails silently."
65
+ ],
66
+ qualityStandards: ["The external service is called through one module, so it can be faked in tests."],
67
+ technicalConstraints: ["Respect the service’s rate limits and terms of use."],
68
+ rollbackConditions: ["The integration can be disconnected without losing the user’s own data"]
69
+ },
70
+ interviewFocus: [
71
+ "What exactly do we read from and write to the service?",
72
+ "What does the user see while the service is unavailable?",
73
+ "How is the integration disconnected, and what happens to synced data?"
74
+ ]
75
+ },
76
+ {
77
+ id: "mvp",
78
+ name: "First version (MVP)",
79
+ description: "The first version of a new product, cut down to what proves the idea.",
80
+ whenToUse: "The product does not exist yet and the goal is to learn whether it works.",
81
+ defaults: {
82
+ openQuestions: [
83
+ "What is the one thing a first user must be able to do?",
84
+ "How will we know it works (a number or a behaviour we can observe)?",
85
+ "What is the deadline or budget for this first version?"
86
+ ],
87
+ outOfScope: ["Features that are not needed to prove the main idea"],
88
+ globalAcceptanceCriteria: ["A new user can sign up and reach the main action without help."],
89
+ qualityStandards: ["Cut scope before cutting quality on the main flow."]
90
+ },
91
+ interviewFocus: ["What is the smallest version that proves the idea?", "Which features can wait until after the first users try it?"]
92
+ }
93
+ ];
94
+ function getTemplate(id) {
95
+ const template = PRD_TEMPLATES.find((candidate) => candidate.id === id);
96
+ if (!template) throw new Error(`Unknown template "${id}". Templates: ${TEMPLATE_IDS.join(", ")}.`);
97
+ return template;
98
+ }
99
+ //#endregion
100
+ //#region src/schema.ts
101
+ const FilenameSchema = z.string().min(1).describe("PRD file name inside .prds, e.g. notes-feature.json");
102
+ const StoryStatusSchema = z.enum([
103
+ "not_started",
104
+ "research",
105
+ "in_progress",
106
+ "review",
107
+ "completed",
108
+ "blocked"
109
+ ]);
110
+ const StoryPrioritySchema = z.enum([
111
+ "P0",
112
+ "P1",
113
+ "P2",
114
+ "P3"
115
+ ]);
116
+ const StoryComplexitySchema = z.enum([
117
+ "XS",
118
+ "S",
119
+ "M",
120
+ "L",
121
+ "XL"
122
+ ]);
123
+ const PrdSummarySchema = z.object({
124
+ filename: z.string(),
125
+ title: z.string(),
126
+ last_updated: z.string(),
127
+ progress: z.number().int().min(0).max(100),
128
+ total_stories: z.number().int().min(0),
129
+ completed_stories: z.number().int().min(0),
130
+ blocked_stories: z.number().int().min(0)
131
+ });
132
+ const ListPrdsInputSchema = z.object({});
133
+ const ListPrdsOutputSchema = z.object({
134
+ prds: z.array(PrdSummarySchema),
135
+ total: z.number().int().min(0),
136
+ prds_dir: z.string(),
137
+ /** Files that could not be read or parsed and were skipped. */
138
+ warnings: z.array(z.string())
139
+ });
140
+ const GetPrdInputSchema = z.object({ filename: FilenameSchema });
141
+ const GetPrdOutputSchema = z.object({
142
+ filename: z.string(),
143
+ path: z.string(),
144
+ /** Full normalised PRD document. */
145
+ prd: z.custom((value) => typeof value === "object" && value !== null)
146
+ });
147
+ const CreatePrdInputSchema = z.object({
148
+ title: z.string().min(1),
149
+ overview: z.string(),
150
+ problemStatement: z.string(),
151
+ marketOpportunity: z.string(),
152
+ targetUsers: z.array(z.string()),
153
+ solutionDescription: z.string(),
154
+ keyFeatures: z.array(z.string()),
155
+ successMetrics: z.array(z.string()),
156
+ nonGoals: z.array(z.string()).optional(),
157
+ outOfScope: z.array(z.string()).optional(),
158
+ assumptions: z.array(z.string()).optional(),
159
+ openQuestions: z.array(z.string()).optional(),
160
+ template: z.enum(TEMPLATE_IDS).optional().describe("Start from a template (see list_templates). Values given here win.")
161
+ });
162
+ const CreatePrdOutputSchema = z.object({
163
+ status: z.literal("success"),
164
+ filename: z.string(),
165
+ path: z.string()
166
+ });
167
+ const DeletePrdInputSchema = z.object({ filename: FilenameSchema });
168
+ const DeletePrdOutputSchema = z.object({
169
+ status: z.literal("success"),
170
+ filename: z.string()
171
+ });
172
+ const AddUserStoryInputSchema = z.object({
173
+ filename: FilenameSchema,
174
+ userType: z.string().min(1),
175
+ action: z.string().min(1),
176
+ benefit: z.string().min(1),
177
+ acceptanceCriteria: z.array(z.string()),
178
+ priority: StoryPrioritySchema.default("P2"),
179
+ /** Defaults to the first few words of `action`, which is rarely what you want. */
180
+ title: z.string().min(1).optional(),
181
+ /**
182
+ * Defaults to a guess from the number of acceptance criteria — a measure of
183
+ * how verbose the story is, not how hard it is. Set it explicitly.
184
+ */
185
+ estimatedComplexity: StoryComplexitySchema.optional(),
186
+ testSeams: z.array(z.string().min(1)).optional().describe("Public entry points the tests exercise, e.g. a route or server action"),
187
+ dependencies: z.array(z.string().min(1)).optional().describe("Ids of stories that must be completed first, e.g. [\"US001\"]"),
188
+ phaseId: z.string().min(1).optional().describe("Phase to put the story in, e.g. \"PHASE002\""),
189
+ attachmentIds: z.array(z.string().min(1)).optional().describe("Ids of PRD attachments this story uses, e.g. [\"ATT001\"]"),
190
+ designNotes: z.array(z.string().min(1)).optional().describe("Design notes for this story only (layout, empty/loading/error states, copy) beyond the PRD design guidance"),
191
+ securityNotes: z.array(z.string().min(1)).optional().describe("Security notes for this story only: each specific way it could be abused and the defence, beyond the PRD security considerations")
192
+ });
193
+ const AddUserStoryOutputSchema = z.object({
194
+ story_id: z.string(),
195
+ title: z.string(),
196
+ complexity: z.enum([
197
+ "XS",
198
+ "S",
199
+ "M",
200
+ "L",
201
+ "XL"
202
+ ]),
203
+ total_stories: z.number().int().min(0)
204
+ });
205
+ const UpdateStoryStatusInputSchema = z.object({
206
+ filename: FilenameSchema,
207
+ storyId: z.string().min(1),
208
+ status: StoryStatusSchema,
209
+ notes: z.string().optional(),
210
+ expectedRevision: z.number().int().min(0).optional().describe("The PRD revision (metadata.revision) the change is based on, checked before the project checks run. When the PRD changed since, the change is rejected: read it again and retry.")
211
+ });
212
+ const StoryVerificationSchema = z.object({
213
+ verified_at: z.string(),
214
+ checks: z.array(z.string()),
215
+ passed: z.literal(true)
216
+ });
217
+ const UpdateStoryStatusOutputSchema = z.object({
218
+ story_id: z.string(),
219
+ title: z.string(),
220
+ status: StoryStatusSchema,
221
+ progress: z.number().int().min(0).max(100),
222
+ /** Present only when the story was marked completed and checks ran. */
223
+ verification: StoryVerificationSchema.nullable()
224
+ });
225
+ const UpdateUserStoryInputSchema = z.object({
226
+ filename: FilenameSchema,
227
+ storyId: z.string().min(1),
228
+ /** Every field is optional: only the ones supplied are changed. */
229
+ title: z.string().min(1).optional(),
230
+ userType: z.string().min(1).optional(),
231
+ action: z.string().min(1).optional(),
232
+ benefit: z.string().min(1).optional(),
233
+ businessValue: z.string().min(1).optional(),
234
+ acceptanceCriteria: z.array(z.string()).optional(),
235
+ priority: StoryPrioritySchema.optional(),
236
+ estimatedComplexity: StoryComplexitySchema.optional(),
237
+ dependencies: z.array(z.string()).optional(),
238
+ notes: z.string().optional(),
239
+ testSeams: z.array(z.string().min(1)).optional().describe("Public entry points the tests exercise, e.g. a route or server action"),
240
+ attachmentIds: z.array(z.string().min(1)).optional().describe("Ids of PRD attachments this story uses, e.g. [\"ATT001\"]"),
241
+ designNotes: z.array(z.string().min(1)).optional().describe("Design notes for this story only (layout, empty/loading/error states, copy) beyond the PRD design guidance"),
242
+ securityNotes: z.array(z.string().min(1)).optional().describe("Security notes for this story only: each specific way it could be abused and the defence, beyond the PRD security considerations"),
243
+ phaseId: z.string().min(1).nullable().optional().describe("Move the story to this phase; null removes it from every phase"),
244
+ expectedRevision: z.number().int().min(0).optional().describe("The PRD revision (metadata.revision) this change is based on. When given and the PRD changed since, the change is rejected: read it again and retry.")
245
+ });
246
+ const UpdateUserStoryOutputSchema = z.object({
247
+ story_id: z.string(),
248
+ title: z.string(),
249
+ updated_fields: z.array(z.string()),
250
+ story: z.record(z.string(), z.unknown())
251
+ });
252
+ const DeleteUserStoryInputSchema = z.object({
253
+ filename: FilenameSchema,
254
+ storyId: z.string().min(1)
255
+ });
256
+ const DeleteUserStoryOutputSchema = z.object({
257
+ story_id: z.string(),
258
+ title: z.string(),
259
+ total_stories: z.number().int().min(0),
260
+ progress: z.number().int().min(0).max(100),
261
+ /** Stories that listed the deleted one as a dependency, now cleaned up. */
262
+ dependency_references_removed: z.array(z.string()),
263
+ phases_updated: z.array(z.string())
264
+ });
265
+ const CreateCustomPhaseInputSchema = z.object({
266
+ filename: FilenameSchema,
267
+ name: z.string().min(1),
268
+ description: z.string().default(""),
269
+ color: z.string().regex(/^#[0-9a-fA-F]{6}$/, "Expected a hex colour such as #4f46e5").default("#4f46e5")
270
+ });
271
+ const CustomPhaseSchema = z.object({
272
+ id: z.string(),
273
+ name: z.string(),
274
+ description: z.string(),
275
+ color: z.string(),
276
+ order: z.number().int().min(0),
277
+ user_story_ids: z.array(z.string())
278
+ });
279
+ const CreateCustomPhaseOutputSchema = z.object({
280
+ phase: CustomPhaseSchema,
281
+ total_phases: z.number().int().min(0)
282
+ });
283
+ const AssignStoryToPhaseInputSchema = z.object({
284
+ filename: FilenameSchema,
285
+ storyId: z.string().min(1),
286
+ /** Omit to remove the story from every phase. */
287
+ phaseId: z.string().min(1).nullable().default(null)
288
+ });
289
+ const AssignStoryToPhaseOutputSchema = z.object({
290
+ story_id: z.string(),
291
+ phase_id: z.string().nullable(),
292
+ phase_name: z.string().nullable(),
293
+ moved_from: z.string().nullable()
294
+ });
295
+ const ExportPrdMarkdownInputSchema = z.object({ filename: FilenameSchema });
296
+ const ExportPrdMarkdownOutputSchema = z.object({
297
+ markdown_file: z.string(),
298
+ path: z.string()
299
+ });
300
+ const GetImplementationPromptsInputSchema = z.object({ filename: FilenameSchema });
301
+ const GetImplementationPromptsOutputSchema = z.object({
302
+ prompts: z.array(z.string()),
303
+ total: z.number().int().min(0)
304
+ });
305
+ const GetImprovementSuggestionsInputSchema = z.object({ filename: FilenameSchema });
306
+ const GetImprovementSuggestionsOutputSchema = z.object({
307
+ suggestions: z.array(z.string()),
308
+ total: z.number().int().min(0)
309
+ });
310
+ const GetProjectStatusInputSchema = z.object({ filename: FilenameSchema });
311
+ const GetProjectStatusOutputSchema = z.object({
312
+ progress: z.number().int().min(0).max(100),
313
+ summary: z.string(),
314
+ next_steps: z.array(z.string()),
315
+ blockers: z.array(z.object({
316
+ id: z.string(),
317
+ title: z.string(),
318
+ notes: z.string().nullable()
319
+ })),
320
+ open_questions: z.array(z.string()),
321
+ high_risks: z.array(z.object({
322
+ id: z.string(),
323
+ description: z.string(),
324
+ mitigation: z.string(),
325
+ owner: z.string()
326
+ }))
327
+ });
328
+ const StoryObjectSchema = z.custom((value) => typeof value === "object" && value !== null);
329
+ const StoryLogEntrySchema = z.object({
330
+ at: z.string(),
331
+ whatsNew: z.array(z.string()),
332
+ technicalNotes: z.array(z.string()),
333
+ deviations: z.array(z.string()).optional()
334
+ });
335
+ const GetNextStoryInputSchema = z.object({ filename: FilenameSchema });
336
+ const GetNextStoryOutputSchema = z.object({
337
+ /** Null when nothing is ready: all done, in progress, or waiting. */
338
+ story: StoryObjectSchema.nullable(),
339
+ ready_count: z.number().int().min(0),
340
+ in_progress: z.array(z.string()),
341
+ waiting: z.array(z.object({
342
+ id: z.string(),
343
+ title: z.string(),
344
+ waiting_on: z.array(z.string())
345
+ }))
346
+ });
347
+ const GetStoryInputSchema = z.object({
348
+ filename: FilenameSchema,
349
+ storyId: z.string().min(1)
350
+ });
351
+ const StoryLogsSchema = z.array(StoryLogEntrySchema);
352
+ /** An attachment with its file path relative to the project root. */
353
+ const StoryAttachmentSchema = z.object({
354
+ id: z.string(),
355
+ title: z.string(),
356
+ path: z.string().optional(),
357
+ url: z.string().optional(),
358
+ note: z.string().optional()
359
+ });
360
+ const GetStoryOutputSchema = z.object({
361
+ prd: z.object({
362
+ title: z.string(),
363
+ overview: z.string(),
364
+ non_goals: z.array(z.string()),
365
+ out_of_scope: z.array(z.string()),
366
+ global_acceptance_criteria: z.array(z.string()),
367
+ /** Every attachment in the PRD, for references shared across stories. */
368
+ attachments: z.array(StoryAttachmentSchema)
369
+ }),
370
+ story: StoryObjectSchema,
371
+ /** The attachments this story uses. */
372
+ attachments: z.array(StoryAttachmentSchema),
373
+ phase: z.object({
374
+ id: z.string(),
375
+ name: z.string()
376
+ }).nullable(),
377
+ /**
378
+ * Edge cases for this story (linked to it, or to the whole PRD). Decided
379
+ * ones are binding behaviour; open ones must be asked about, not assumed.
380
+ */
381
+ edge_cases: z.array(z.object({
382
+ id: z.string(),
383
+ case: z.string(),
384
+ expectedBehavior: z.string(),
385
+ status: z.enum(["open", "decided"]),
386
+ storyIds: z.array(z.string()).optional()
387
+ })),
388
+ /** Open questions that block this story: ask, do not guess. */
389
+ open_questions: z.array(z.object({
390
+ id: z.string(),
391
+ question: z.string(),
392
+ why: z.string().optional(),
393
+ options: z.array(z.string()).optional(),
394
+ recommended: z.string().optional(),
395
+ storyIds: z.array(z.string()).optional()
396
+ })),
397
+ /** Who can do what, sensitive data and standing security rules. Binding. */
398
+ security: z.object({
399
+ permissions: z.array(z.string()),
400
+ compliance: z.array(z.string()),
401
+ considerations: z.array(z.string())
402
+ }),
403
+ /** Parts of the PRD that do not apply, with the reason: do not invent them. */
404
+ not_applicable: z.record(z.string(), z.string()),
405
+ /** Standing design rules and accepted design decisions. */
406
+ design: z.object({
407
+ guidance: z.array(z.string()),
408
+ decisions: z.array(z.object({
409
+ id: z.string(),
410
+ decision: z.string(),
411
+ rationale: z.string()
412
+ }))
413
+ }),
414
+ dependencies: z.array(z.object({
415
+ id: z.string(),
416
+ title: z.string().nullable(),
417
+ status: z.string().nullable(),
418
+ log: StoryLogsSchema
419
+ })),
420
+ previous_story: z.object({
421
+ id: z.string(),
422
+ title: z.string(),
423
+ log: StoryLogsSchema
424
+ }).nullable()
425
+ });
426
+ const AddStoryLogInputSchema = z.object({
427
+ filename: FilenameSchema,
428
+ storyId: z.string().min(1),
429
+ whatsNew: z.array(z.string().min(1)).min(1).describe("What a person can now try, in plain language"),
430
+ technicalNotes: z.array(z.string().min(1)).default([]).describe("Decisions, gotchas and file locations for the next agent"),
431
+ deviations: z.array(z.string().min(1)).optional().describe("Where the work departed from the PRD and why: changed criteria, extra or skipped scope, a different approach")
432
+ });
433
+ const AddStoryLogOutputSchema = z.object({
434
+ story_id: z.string(),
435
+ entries: z.number().int().min(1)
436
+ });
437
+ const StringList = z.array(z.string().min(1));
438
+ /**
439
+ * Accepted `value` for each `update_prd_section` section. Object sections are
440
+ * merged (only the keys supplied change); list sections are replaced.
441
+ */
442
+ const PrdSectionValueSchemas = {
443
+ introduction: z.object({
444
+ title: z.string().min(1),
445
+ overview: z.string()
446
+ }).partial().strict(),
447
+ problemStatement: z.object({
448
+ problem: z.string(),
449
+ marketOpportunity: z.string(),
450
+ targetUsers: StringList
451
+ }).partial().strict(),
452
+ solutionOverview: z.object({
453
+ description: z.string(),
454
+ keyFeatures: StringList,
455
+ successMetrics: StringList
456
+ }).partial().strict(),
457
+ nonGoals: StringList,
458
+ outOfScope: StringList,
459
+ assumptions: StringList,
460
+ openQuestions: z.array(z.union([z.string().min(1), z.object({
461
+ id: z.string().optional(),
462
+ question: z.string().min(1),
463
+ why: z.string().optional(),
464
+ options: z.array(z.string().min(1)).optional(),
465
+ recommended: z.string().optional(),
466
+ storyIds: z.array(z.string().min(1)).optional()
467
+ })])),
468
+ technicalRequirements: z.object({
469
+ constraints: StringList,
470
+ integrationNeeds: StringList,
471
+ complianceRequirements: StringList
472
+ }).partial().strict(),
473
+ technicalContracts: z.object({
474
+ apis: StringList,
475
+ dataModels: StringList,
476
+ permissions: StringList,
477
+ integrationBoundaries: StringList
478
+ }).partial().strict(),
479
+ acceptanceCriteria: z.object({
480
+ global: StringList,
481
+ qualityStandards: StringList
482
+ }).partial().strict(),
483
+ constraints: z.object({
484
+ timeline: z.string(),
485
+ budget: z.string(),
486
+ resources: StringList,
487
+ nonNegotiables: StringList
488
+ }).partial().strict(),
489
+ rolloutPlan: z.object({
490
+ featureFlags: StringList,
491
+ migrationPlan: StringList,
492
+ rolloutPhases: StringList,
493
+ rollbackConditions: StringList
494
+ }).partial().strict(),
495
+ measurementPlan: z.object({
496
+ events: StringList,
497
+ dashboards: StringList,
498
+ baselineMetrics: StringList,
499
+ targetMetrics: StringList,
500
+ guardrailMetrics: StringList
501
+ }).partial().strict(),
502
+ risks: z.array(z.object({
503
+ id: z.string().optional(),
504
+ description: z.string().min(1),
505
+ mitigation: z.string(),
506
+ owner: z.string(),
507
+ severity: z.enum([
508
+ "low",
509
+ "medium",
510
+ "high"
511
+ ])
512
+ })),
513
+ dependencies: z.array(z.object({
514
+ id: z.string().optional(),
515
+ name: z.string().min(1),
516
+ description: z.string(),
517
+ blocking: z.boolean(),
518
+ owner: z.string().optional()
519
+ })),
520
+ edgeCases: z.array(z.object({
521
+ id: z.string().optional(),
522
+ case: z.string().min(1),
523
+ expectedBehavior: z.string().default(""),
524
+ status: z.enum(["open", "decided"]).default("open"),
525
+ storyIds: z.array(z.string().min(1)).optional()
526
+ }).refine((edgeCase) => edgeCase.status === "open" || edgeCase.expectedBehavior.trim().length > 0, {
527
+ message: "A decided edge case needs its expectedBehavior",
528
+ path: ["expectedBehavior"]
529
+ })),
530
+ designGuidance: StringList,
531
+ securityConsiderations: StringList
532
+ };
533
+ const PRD_SECTIONS = Object.keys(PrdSectionValueSchemas);
534
+ const UpdatePrdSectionInputSchema = z.object({
535
+ filename: FilenameSchema,
536
+ section: z.enum(PRD_SECTIONS),
537
+ expectedRevision: z.number().int().min(0).optional().describe("The PRD revision (metadata.revision) this change is based on. When given and the PRD changed since, the update is rejected: read it again and retry."),
538
+ value: z.unknown().describe("Object sections (introduction, problemStatement, solutionOverview, technicalRequirements, technicalContracts, acceptanceCriteria, constraints, rolloutPlan, measurementPlan) take an object and only the keys given change. List sections (nonGoals, outOfScope, assumptions, designGuidance, securityConsiderations) take a string array and replace the list. openQuestions takes an array of { question, why, options, recommended, storyIds } (a plain string is accepted too) and replaces the list; keep the ids of existing questions. risks, dependencies and edgeCases take an array of items and replace the list; items without an id get one. An edge case is { case, expectedBehavior, status: \"open\" | \"decided\", storyIds? }; a decided one needs expectedBehavior, and storyIds must name existing stories.")
539
+ });
540
+ const UpdatePrdSectionOutputSchema = z.object({
541
+ section: z.string(),
542
+ updated: z.array(z.string())
543
+ });
544
+ const NotApplicableTopicSchema = z.enum([
545
+ "dataModel",
546
+ "outsideServices",
547
+ "security",
548
+ "design",
549
+ "qualityBar",
550
+ "edgeCases",
551
+ "rollout",
552
+ "measurement",
553
+ "glossary",
554
+ "risks"
555
+ ]);
556
+ const MarkNotApplicableInputSchema = z.object({
557
+ filename: FilenameSchema,
558
+ topic: NotApplicableTopicSchema,
559
+ notApplicable: z.boolean().default(true).describe("false marks it applicable again"),
560
+ reason: z.string().optional().describe("Why it does not apply, e.g. \"Internal tool: no rollout\""),
561
+ expectedRevision: z.number().int().min(0).optional().describe("The PRD revision (metadata.revision) this change is based on. When given and the PRD changed since, the change is rejected: read it again and retry.")
562
+ });
563
+ const MarkNotApplicableOutputSchema = z.object({
564
+ topic: NotApplicableTopicSchema,
565
+ not_applicable: z.boolean(),
566
+ reason: z.string().nullable()
567
+ });
568
+ const AddDecisionInputSchema = z.object({
569
+ filename: FilenameSchema,
570
+ decision: z.string().min(1),
571
+ rationale: z.string().min(1),
572
+ owner: z.string().optional(),
573
+ topic: z.string().optional().describe("What it is about, e.g. \"story:US003\" or \"billing\""),
574
+ status: z.enum(["proposed", "accepted"]).default("accepted"),
575
+ supersedes: z.string().optional().describe("Id of an earlier decision this one replaces")
576
+ });
577
+ const AddDecisionOutputSchema = z.object({
578
+ decision_id: z.string(),
579
+ superseded: z.string().nullable(),
580
+ total_decisions: z.number().int().min(1)
581
+ });
582
+ const ExpectedRevisionSchema = z.number().int().min(0).optional().describe("The PRD revision (metadata.revision) this change is based on. When given and the PRD changed since, the change is rejected: read it again and retry.");
583
+ const AddAttachmentInputSchema = z.object({
584
+ filename: FilenameSchema,
585
+ title: z.string().min(1).describe("What it is, e.g. \"Approve view mockup\""),
586
+ path: z.string().min(1).optional().describe("File inside the PRD folder (.prds/<prd name>/), relative to it, e.g. \"mockups/approve.png\". Save the file there first. Give path or url, not both."),
587
+ url: z.string().url().optional().describe("A web page or document link. Give path or url, not both."),
588
+ note: z.string().min(1).optional().describe("What to take from it, e.g. \"Layout only; colours are placeholders\""),
589
+ storyIds: z.array(z.string().min(1)).optional().describe("Stories that use it, e.g. [\"US003\"]"),
590
+ expectedRevision: ExpectedRevisionSchema
591
+ });
592
+ const AddAttachmentOutputSchema = z.object({
593
+ attachment_id: z.string(),
594
+ /** The file relative to the project root, or null for a link. */
595
+ path: z.string().nullable(),
596
+ stories_updated: z.array(z.string()),
597
+ total_attachments: z.number().int().min(1)
598
+ });
599
+ const RemoveAttachmentInputSchema = z.object({
600
+ filename: FilenameSchema,
601
+ attachmentId: z.string().min(1),
602
+ expectedRevision: ExpectedRevisionSchema
603
+ });
604
+ const UpdateAttachmentInputSchema = z.object({
605
+ filename: FilenameSchema,
606
+ attachmentId: z.string().min(1),
607
+ title: z.string().min(1).optional(),
608
+ note: z.string().optional().describe("An empty string removes the note"),
609
+ storyIds: z.array(z.string().min(1)).optional().describe("The stories that use it: links are added and removed to match"),
610
+ expectedRevision: ExpectedRevisionSchema
611
+ });
612
+ const UpdateAttachmentOutputSchema = z.object({
613
+ attachment_id: z.string(),
614
+ stories_updated: z.array(z.string())
615
+ });
616
+ const RemoveAttachmentOutputSchema = z.object({
617
+ attachment_id: z.string(),
618
+ stories_updated: z.array(z.string()),
619
+ total_attachments: z.number().int().min(0)
620
+ });
621
+ const ResolveOpenQuestionInputSchema = z.object({
622
+ filename: FilenameSchema,
623
+ questionId: z.string().min(1).optional().describe("The question id, e.g. Q003"),
624
+ question: z.string().min(1).optional().describe("The question text, exactly as listed (when there is no id)"),
625
+ answer: z.string().min(1),
626
+ recordDecision: z.boolean().default(true).describe("Also add the answer to the decision log"),
627
+ expectedRevision: ExpectedRevisionSchema
628
+ }).refine((input) => input.questionId || input.question, { message: "Pass questionId or question" });
629
+ const DecideEdgeCaseInputSchema = z.object({
630
+ filename: FilenameSchema,
631
+ edgeCaseId: z.string().min(1),
632
+ expectedBehavior: z.string().min(1).describe("What should happen"),
633
+ expectedRevision: ExpectedRevisionSchema
634
+ });
635
+ const DecideEdgeCaseOutputSchema = z.object({
636
+ edge_case_id: z.string(),
637
+ open_edge_cases: z.number().int().min(0)
638
+ });
639
+ const ResolveOpenQuestionOutputSchema = z.object({
640
+ remaining_questions: z.number().int().min(0),
641
+ decision_id: z.string().nullable()
642
+ });
643
+ const AddGlossaryTermInputSchema = z.object({
644
+ filename: FilenameSchema,
645
+ term: z.string().min(1),
646
+ definition: z.string().min(1),
647
+ avoid: z.array(z.string().min(1)).default([]).describe("Synonyms that should not be used for this concept")
648
+ });
649
+ const AddGlossaryTermOutputSchema = z.object({
650
+ term: z.string(),
651
+ replaced: z.boolean(),
652
+ total_terms: z.number().int().min(1)
653
+ });
654
+ const UpdatePhaseInputSchema = z.object({
655
+ filename: FilenameSchema,
656
+ phaseId: z.string().min(1),
657
+ name: z.string().min(1).optional(),
658
+ description: z.string().optional(),
659
+ color: z.string().regex(/^#[0-9a-fA-F]{6}$/, "Expected a hex colour such as #4f46e5").optional()
660
+ });
661
+ const DeletePhaseInputSchema = z.object({
662
+ filename: FilenameSchema,
663
+ phaseId: z.string().min(1)
664
+ });
665
+ const ReorderPhasesInputSchema = z.object({
666
+ filename: FilenameSchema,
667
+ phaseIds: z.array(z.string().min(1)).min(1).describe("Every phase id, in the new order")
668
+ });
669
+ const PhasesOutputSchema = z.object({ phases: z.array(z.object({
670
+ id: z.string(),
671
+ name: z.string(),
672
+ order: z.number().int().min(0),
673
+ user_story_ids: z.array(z.string())
674
+ })) });
675
+ const CheckPlanInputSchema = z.object({ filename: FilenameSchema });
676
+ const CheckPlanOutputSchema = z.object({
677
+ /** False while any required item is open. */
678
+ ready_to_build: z.boolean(),
679
+ items: z.array(z.object({
680
+ id: z.string(),
681
+ section: z.string(),
682
+ message: z.string(),
683
+ severity: z.enum(["required", "recommended"]),
684
+ storyIds: z.array(z.string()).optional()
685
+ }))
686
+ });
687
+ const ListTemplatesInputSchema = z.object({});
688
+ const ListTemplatesOutputSchema = z.object({ templates: z.array(z.object({
689
+ id: z.string(),
690
+ name: z.string(),
691
+ description: z.string(),
692
+ when_to_use: z.string()
693
+ })) });
694
+ //#endregion
695
+ //#region src/prompts.ts
696
+ /**
697
+ * The instructions behind the MCP prompts, exported so other tools (e.g. a
698
+ * UI that shows what to ask the agent) give exactly the same text.
699
+ */
700
+ function shapePrdPrompt(idea, filename, templateId) {
701
+ const template = templateId ? getTemplate(templateId) : null;
702
+ return [
703
+ `We are shaping a product requirements document before any code is written. ${filename ? `Keep shaping the PRD "${filename}". Read it with get_prd first and continue from its open questions.` : idea ? `The idea: ${idea}` : "Start by asking what we are building, in a sentence or two."}`,
704
+ "",
705
+ "How to run the interview:",
706
+ "- Think of the plan as a tree of decisions. In each round, ask only the questions that can be answered now, i.e. whose prerequisites are already decided. Number them.",
707
+ "- Give a recommended answer for every question, with a one-line reason, worded so that replying \"yes\" accepts it. The user can accept, change or discuss each one.",
708
+ "- Look up facts yourself (the codebase, existing PRDs, docs) instead of asking. Only decisions go to the user.",
709
+ "- PRD text may use Markdown. Keep list items (criteria, non-goals, open questions) to one line of inline Markdown: bold, code, links. No raw HTML.",
710
+ "- Before the first round, read CLAUDE.md, AGENTS.md and package.json to learn the stack and whether the project starts from a kit or starter. Do not plan stories for what it already provides (e.g. sign-in, billing, teams); add those to assumptions instead (update_prd_section replaces the list, so pass the existing items too).",
711
+ "- After each round, record what was decided before asking the next round.",
712
+ "- Stop when no undecided questions remain, and confirm with the user before slicing the work.",
713
+ "",
714
+ template ? `This is a "${template.name}" (${template.description}) Create the PRD with template "${template.id}", and make sure the interview covers: ${template.interviewFocus.join(" ")}` : "If you are unsure what kind of work this is, call list_templates and suggest one.",
715
+ "",
716
+ "Order of the rounds, broad to detailed:",
717
+ "1. What we are building and for whom (create_prd once this is clear, if there is no PRD yet).",
718
+ "2. Main features, then what we are explicitly NOT building (update_prd_section with nonGoals and outOfScope). Be explicit: anything unlisted is likely to be invented later.",
719
+ "3. Whether this is an internal tool or a product for many customers or tenants. It changes what should be configurable versus hard-coded.",
720
+ "4. The main entities and the words for them (add_glossary_term, including words to avoid). Describe each entity, what it holds and how it relates to the others in plain language, e.g. \"Bookmark: a saved link. Belongs to one account; has many tags.\" Record them with update_prd_section, section \"technicalContracts\", value { dataModels: [...] }. The list replaces the previous one, so always pass every entity.",
721
+ "5. Outside services (email, payments, storage, AI, SMS, maps...): for each feature that needs one, recommend a provider and list the credentials or environment variables the user must get. Record them with update_prd_section, section \"technicalRequirements\", value { integrationNeeds: [...] }, one entry per service, e.g. \"Payments: Stripe. Needs STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET.\" The list replaces the previous one, so always pass every service.",
722
+ "6. For each feature: what is in and out of scope, and what a person must be able to do (acceptance criteria).",
723
+ "7. What can go wrong. Take an adversarial view: assume users make mistakes, data is messy, networks and outside services fail, and two people act at once. Go through each feature and find the failure modes before the user has to think of them: missing or invalid input, empty and very large data, partial success and retries, duplicates and double submits, concurrent edits, time zones and dates, limits and quotas, outside services failing or slow, deleting and undoing. For each one, recommend what should happen. Record them with update_prd_section, section \"edgeCases\", value [{ case, expectedBehavior, status, storyIds }]: \"decided\" once the user agreed, \"open\" while it needs an answer. The list replaces the previous one, so always pass every case. Do not slice the work while any edge case is open.",
724
+ "8. Security. Switch to an attacker's mindset: for each feature, ask how a malicious user, a curious user of another account or tenant, or a compromised integration would abuse it, and assume they will try. Probe at least: changing ids in URLs and requests to reach other people's data; acting above one's role; hostile input (SQL, HTML and script, prompt injection into AI features, path traversal, oversized payloads); hostile file uploads; forged or replayed webhooks; brute force and account or email enumeration; abuse of costly actions (spam, quotas, paid APIs); secrets reaching the browser, logs or error messages; server requests to user-supplied URLs. Recommend a defence for each one that applies, then record: who can see and change what in update_prd_section \"technicalContracts\" { permissions: [...] }; sensitive data and legal duties (personal data, payments, retention, deletion) in \"technicalRequirements\" { complianceRequirements: [...] }; the standing rules that prevent abuse in \"securityConsiderations\"; and each concrete attack as an edge case with the safe behaviour (e.g. \"User opens another account's invoice by changing the id\" -> \"404, nothing about it is revealed\"). These lists replace the previous ones, so pass every item.",
725
+ "9. Risks. Run a pre-mortem: assume the feature shipped and failed badly six months later, and work out why (data loss, a security incident, cost running away, an outside dependency changing, nobody using it, legal trouble, the team unable to maintain it). Record specific risks, not generic ones, with severity, mitigation and owner via update_prd_section \"risks\".",
726
+ "10. Design: how it should look and feel. Ask for or suggest standing rules (which components and layout to use, tone of copy, mobile, how empty, loading and error states look) and record them with update_prd_section, section \"designGuidance\". Save mockups as attachments. Record individual design choices with add_decision and a topic starting with \"design:\", e.g. \"design:navigation\".",
727
+ "11. Hard-to-reverse choices (add_decision). A question the user cannot answer now goes to update_prd_section \"openQuestions\" as { question, why, options, recommended, storyIds }: why says what goes wrong if an agent guesses, options are the real choices, recommended is your suggestion, and storyIds are the stories it blocks. Write it so a person can answer it later without this conversation. Keep the ids of existing questions (the list replaces the previous one). Answers are recorded with resolve_open_question.",
728
+ "12. If a part genuinely does not apply (no outside services; no rollout plan for an internal tool), mark it with mark_not_applicable and a reason instead of leaving it empty. Never mark security or edge cases as not applicable for a feature that takes input from people or stores their data.",
729
+ "",
730
+ "Then slice the work:",
731
+ "- Each story is a thin slice through every layer that a person can try once it is done, and that fits in one agent session. Put refactoring needed by later stories in its own earlier story.",
732
+ "- Create the phases first (create_custom_phase), in the order they should be built. Each phase should end with something a person can try (a page in the app, an API call, a command); say what in its description.",
733
+ "- Add each story with add_user_story in one call: testSeams (the public entry points the tests will exercise), dependencies (stories that must be completed first) and phaseId. Add designNotes when the story has a screen or states the PRD design guidance does not settle, and securityNotes for each way this story in particular could be abused (whose ids it accepts, what input it trusts, what it costs to repeat) with the defence. Do not repeat the PRD-wide guidance or considerations there.",
734
+ "- When the user shares mockups, screenshots or reference docs, save each file in the PRD folder (.prds/<prd file name without .json>/) and record it with add_attachment, linking the stories that use it. Record links to outside docs with a url instead.",
735
+ "- Confirm the breakdown with the user, then fix anything with update_user_story or assign_story_to_phase."
736
+ ].join("\n");
737
+ }
738
+ function reviewStoryPrompt(filename, storyId, base) {
739
+ const diff = base ? `git diff ${base}` : "git diff HEAD (plus untracked files from git status)";
740
+ return [
741
+ `Review the work done for story ${storyId} in the PRD "${filename}". You are checking it against its spec, not reviewing code style: a separate review covers code quality.`,
742
+ "",
743
+ `1. Call get_story for the acceptance criteria, non-goals, out-of-scope items, test seams and the story log. Read the changes with ${diff}.`,
744
+ "2. For each acceptance criterion, decide met, partly met or not met, and cite the file or test that shows it.",
745
+ "3. Scope: list changes the story did not ask for, especially anything in non-goals or out of scope.",
746
+ "4. Tests: check that tests exercise the listed test seams and cover the criteria and the decided edge cases through public behaviour.",
747
+ "5. Security, as an attacker: for every new route, action or query, try to reach another user's or tenant's data by changing ids, act above your role, send hostile or oversized input, and repeat or replay requests. Check that the permissions and security rules in get_story are enforced on the server and tested. List each hole you find with the file and how to exploit it.",
748
+ "6. Check that the story log matches what changed. Flag claims in whatsNew that the changes do not support, and departures from the spec that are not listed in deviations.",
749
+ "",
750
+ "Report:",
751
+ "- Verdict: \"approve\" or \"send back\".",
752
+ "- Criteria: one line per criterion with its result and evidence.",
753
+ "- Scope: extra or missing work, or \"none\".",
754
+ "- Deviations: whether each one listed in the log is acceptable, or \"none\".",
755
+ "- Security: holes found, or \"none\".",
756
+ "- Tests: gaps, or \"none\".",
757
+ "- If sending back: a short list of specific fixes, written for the agent that will make them.",
758
+ "",
759
+ "Do not change the story status and do not edit code. A person decides."
760
+ ].join("\n");
761
+ }
762
+ function implementStoryPrompt(filename, storyId) {
763
+ return [
764
+ `You are implementing a story from the PRD "${filename}". ${storyId ? `Work on story ${storyId}.` : "Call get_next_story. If a story is already in progress (for example one sent back from review), finish that one first; otherwise take the story it returns. If none is ready, report why and stop."}`,
765
+ "",
766
+ "1. Call get_story. If the story has notes, read them first: a story sent back from review carries the reviewer's feedback there, and addressing it comes before anything else. Read the acceptance criteria, the non-goals and out-of-scope items, and the logs of its dependencies and of the previous story. Open the files and links in its attachments (mockups, reference docs); they show what is meant, but the acceptance criteria decide what is done. Build only what this story asks for.",
767
+ " Its edge_cases are part of the spec: implement and test each decided case as stated. If a case is still open, ask the user what should happen before building that part; never pick a behaviour yourself. Follow the design guidance, design decisions and the story's own design.story_notes for anything a person sees.",
768
+ " If open_questions lists questions that block this story, ask the user, record the answer with resolve_open_question, and only then build the part it affects.",
769
+ " The security rules are binding, including the story's own security.story_notes: enforce the permissions on the server for every read and write, never trust input from the browser, and keep secrets out of the client and logs. Before finishing, attack your own change: try another user's ids, a lower role, hostile input and repeated requests, and add tests for what you find. Parts listed in not_applicable do not apply: do not build them.",
770
+ "2. Call update_story_status with status \"in_progress\".",
771
+ "3. Plan the change, then implement it with tests that cover the acceptance criteria.",
772
+ "4. Run the project checks and fix what fails.",
773
+ "5. Call add_story_log: whatsNew lists what a person can now try, in plain language; technicalNotes lists decisions, gotchas and files the next agent should know about; deviations lists where the work departed from the PRD (a criterion changed or skipped, extra scope, a different approach) and why. Leave deviations empty if there were none.",
774
+ "6. Call update_story_status with status \"review\". Do not mark the story completed; a person approves it."
775
+ ].join("\n");
776
+ }
777
+ //#endregion
778
+ export { PrdSummarySchema as $, ExportPrdMarkdownInputSchema as A, GetProjectStatusInputSchema as B, DecideEdgeCaseInputSchema as C, DeletePrdOutputSchema as D, DeletePrdInputSchema as E, GetImprovementSuggestionsOutputSchema as F, ListPrdsOutputSchema as G, GetStoryInputSchema as H, GetNextStoryInputSchema as I, MarkNotApplicableInputSchema as J, ListTemplatesInputSchema as K, GetNextStoryOutputSchema as L, GetImplementationPromptsInputSchema as M, GetImplementationPromptsOutputSchema as N, DeleteUserStoryInputSchema as O, GetImprovementSuggestionsInputSchema as P, PrdSectionValueSchemas as Q, GetPrdInputSchema as R, CustomPhaseSchema as S, getTemplate as St, DeletePhaseInputSchema as T, GetStoryOutputSchema as U, GetProjectStatusOutputSchema as V, ListPrdsInputSchema as W, NotApplicableTopicSchema as X, MarkNotApplicableOutputSchema as Y, PhasesOutputSchema as Z, CheckPlanOutputSchema as _, UpdateStoryStatusOutputSchema as _t, AddAttachmentOutputSchema as a, StoryAttachmentSchema as at, CreatePrdInputSchema as b, PRD_TEMPLATES as bt, AddGlossaryTermInputSchema as c, StoryPrioritySchema as ct, AddStoryLogOutputSchema as d, UpdateAttachmentInputSchema as dt, RemoveAttachmentInputSchema as et, AddUserStoryInputSchema as f, UpdateAttachmentOutputSchema as ft, CheckPlanInputSchema as g, UpdateStoryStatusInputSchema as gt, AssignStoryToPhaseOutputSchema as h, UpdatePrdSectionOutputSchema as ht, AddAttachmentInputSchema as i, ResolveOpenQuestionOutputSchema as it, ExportPrdMarkdownOutputSchema as j, DeleteUserStoryOutputSchema as k, AddGlossaryTermOutputSchema as l, StoryStatusSchema as lt, AssignStoryToPhaseInputSchema as m, UpdatePrdSectionInputSchema as mt, reviewStoryPrompt as n, ReorderPhasesInputSchema as nt, AddDecisionInputSchema as o, StoryComplexitySchema as ot, AddUserStoryOutputSchema as p, UpdatePhaseInputSchema as pt, ListTemplatesOutputSchema as q, shapePrdPrompt as r, ResolveOpenQuestionInputSchema as rt, AddDecisionOutputSchema as s, StoryLogEntrySchema as st, implementStoryPrompt as t, RemoveAttachmentOutputSchema as tt, AddStoryLogInputSchema as u, StoryVerificationSchema as ut, CreateCustomPhaseInputSchema as v, UpdateUserStoryInputSchema as vt, DecideEdgeCaseOutputSchema as w, CreatePrdOutputSchema as x, TEMPLATE_IDS as xt, CreateCustomPhaseOutputSchema as y, UpdateUserStoryOutputSchema as yt, GetPrdOutputSchema as z };