@makerkit/prd 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +78 -0
- package/.turbo/turbo-test.log +19 -0
- package/.turbo/turbo-typecheck.log +6 -0
- package/README.md +7 -1
- package/dist/README.md +71 -0
- package/dist/attachment-paths-BAhRGiib.js +112 -0
- package/dist/attachment-paths-C-SWgoSx.mjs +77 -0
- package/dist/index.d.ts +81 -0
- package/{index.js → dist/index.js} +155 -562
- package/{index.mjs → dist/index.mjs} +87 -497
- package/{mcp.d.ts → dist/mcp.d.ts} +2 -4
- package/{mcp.js → dist/mcp.js} +24 -24
- package/{mcp.mjs → dist/mcp.mjs} +24 -24
- package/{node.d.ts → dist/node.d.ts} +4 -4
- package/{node.js → dist/node.js} +28 -4
- package/{node.mjs → dist/node.mjs} +30 -6
- package/dist/operations.d.ts +141 -0
- package/dist/operations.js +22 -0
- package/dist/operations.mjs +1 -0
- package/dist/package.json +54 -0
- package/dist/prd-operations-BvFxo9bg.mjs +459 -0
- package/dist/prd-operations-CcahfbOy.js +584 -0
- package/dist/prd.service-CTwKZV-3.d.ts +114 -0
- package/{prompts-oI_6dxvx.js → dist/prompts-1qhax_dj.js} +113 -164
- package/{prompts-CPlFVutB.mjs → dist/prompts-BlsYD0gf.mjs} +96 -129
- package/{prd.service-CV0-aQHk.d.ts → dist/schema-BwTnt0B9.d.ts} +424 -336
- package/package.json +26 -2
- package/src/__tests__/agent-workflow.test.ts +417 -0
- package/src/__tests__/attachments.test.ts +505 -0
- package/src/__tests__/node.test.ts +199 -0
- package/src/__tests__/plan-check.test.ts +390 -0
- package/src/__tests__/planning.test.ts +1137 -0
- package/src/__tests__/prd-operations.test.ts +571 -0
- package/src/__tests__/prd.service.test.ts +652 -0
- package/src/__tests__/prd.tool.test.ts +282 -0
- package/src/__tests__/templates.test.ts +145 -0
- package/src/applicability.ts +73 -0
- package/src/attachment-paths.ts +83 -0
- package/src/attachments.ts +166 -0
- package/src/edge-cases.ts +61 -0
- package/src/index.ts +33 -0
- package/src/markdown.ts +297 -0
- package/src/mcp/index.ts +875 -0
- package/src/mcp/tool-response.ts +85 -0
- package/src/node.ts +184 -0
- package/src/open-questions.ts +98 -0
- package/src/plan-check.ts +385 -0
- package/src/planning-operations.ts +524 -0
- package/src/prd-operations.ts +769 -0
- package/src/prd.service.ts +1165 -0
- package/src/prompts.ts +161 -0
- package/src/safe-file-name.ts +42 -0
- package/src/schema.ts +1090 -0
- package/src/templates.ts +173 -0
- package/src/testing/fake-mcp-server.ts +81 -0
- package/src/types.ts +381 -0
- package/tsconfig.json +23 -0
- package/tsconfig.lib.json +8 -0
- package/tsconfig.spec.json +7 -0
- package/tsdown.config.mts +12 -0
- package/vitest.config.mts +8 -0
- package/index.d.ts +0 -233
- /package/{LICENSE → dist/LICENSE} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
$ tsdown && node ../../scripts/prepare-dist.mjs
|
|
2
|
+
[34mℹ[39m [34mtsdown v0.23.7[39m powered by [38;2;255;126;23mrolldown v1.3.2[39m
|
|
3
|
+
[34mℹ[39m config file: [4m/Users/giancarlo/Code/makerkit/packages/prd/tsdown.config.mts[24m
|
|
4
|
+
[34mℹ[39m entry: [34msrc/index.ts, src/prd-operations.ts, src/node.ts, src/mcp/index.ts[39m
|
|
5
|
+
[34mℹ[39m entry: [34msrc/index.ts, src/prd-operations.ts, src/node.ts, src/mcp/index.ts[39m
|
|
6
|
+
[34mℹ[39m tsconfig: [34mtsconfig.lib.json[39m
|
|
7
|
+
[34mℹ[39m tsconfig: [34mtsconfig.lib.json[39m
|
|
8
|
+
[34mℹ[39m Build start
|
|
9
|
+
[34mℹ[39m Cleaning 15 files
|
|
10
|
+
|
|
11
|
+
[43m WARN [49m The `tsgo` generator on TypeScript 7.0 is deprecated and will be removed in the next minor. Upgrade to TypeScript 7.1 or later.
|
|
12
|
+
|
|
13
|
+
[34mℹ[39m Emit types with [4mtypescript@7.0.2[24m
|
|
14
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mindex.mjs[22m [2m64.25 kB[22m [2m│ gzip: 16.66 kB[22m
|
|
15
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mmcp.mjs[22m [2m25.05 kB[22m [2m│ gzip: 5.63 kB[22m
|
|
16
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mnode.mjs[22m [2m 3.85 kB[22m [2m│ gzip: 1.54 kB[22m
|
|
17
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1moperations.mjs[22m [2m 0.48 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
18
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mprompts-BlsYD0gf.mjs [2m60.23 kB[22m [2m│ gzip: 17.91 kB[22m
|
|
19
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mprd-operations-BvFxo9bg.mjs [2m18.86 kB[22m [2m│ gzip: 5.81 kB[22m
|
|
20
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mattachment-paths-C-SWgoSx.mjs [2m 3.00 kB[22m [2m│ gzip: 1.24 kB[22m
|
|
21
|
+
[34mℹ[39m [34m[ESM][39m 7 files, total: 175.72 kB
|
|
22
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mindex.js[22m [2m68.23 kB[22m [2m│ gzip: 16.45 kB[22m
|
|
23
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mmcp.js[22m [2m24.70 kB[22m [2m│ gzip: 5.27 kB[22m
|
|
24
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mnode.js[22m [2m 4.21 kB[22m [2m│ gzip: 1.63 kB[22m
|
|
25
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1moperations.js[22m [2m 1.45 kB[22m [2m│ gzip: 0.39 kB[22m
|
|
26
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mprompts-1qhax_dj.js [2m72.56 kB[22m [2m│ gzip: 18.35 kB[22m
|
|
27
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mprd-operations-CcahfbOy.js [2m21.02 kB[22m [2m│ gzip: 5.93 kB[22m
|
|
28
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mattachment-paths-BAhRGiib.js [2m 3.62 kB[22m [2m│ gzip: 1.30 kB[22m
|
|
29
|
+
[34mℹ[39m [33m[CJS][39m 7 files, total: 195.79 kB
|
|
30
|
+
src/node.ts (5:27) [33m[UNRESOLVED_IMPORT] [0mCould not resolve 'node:crypto' in src/node.ts
|
|
31
|
+
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m src/node.ts:5:28 [38;5;246m][0m
|
|
32
|
+
[38;5;246m│[0m
|
|
33
|
+
[38;5;246m5 │[0m [38;5;249mi[0m[38;5;249mm[0m[38;5;249mp[0m[38;5;249mo[0m[38;5;249mr[0m[38;5;249mt[0m[38;5;249m [0m[38;5;249m{[0m[38;5;249m [0m[38;5;249mr[0m[38;5;249ma[0m[38;5;249mn[0m[38;5;249md[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249mU[0m[38;5;249mU[0m[38;5;249mI[0m[38;5;249mD[0m[38;5;249m [0m[38;5;249m}[0m[38;5;249m [0m[38;5;249mf[0m[38;5;249mr[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249m [0m'node:crypto'[38;5;249m;[0m
|
|
34
|
+
[38;5;240m │[0m ──────┬──────
|
|
35
|
+
[38;5;240m │[0m ╰──────── Module not found, treating it as an external dependency
|
|
36
|
+
[38;5;240m │[0m
|
|
37
|
+
[38;5;240m │[0m [38;5;115mHelp[0m: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
|
|
38
|
+
[38;5;246m───╯[0m
|
|
39
|
+
|
|
40
|
+
src/node.ts (16:7) [33m[UNRESOLVED_IMPORT] [0mCould not resolve 'node:fs/promises' in src/node.ts
|
|
41
|
+
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m src/node.ts:16:8 [38;5;246m][0m
|
|
42
|
+
[38;5;246m│[0m
|
|
43
|
+
[38;5;246m16 │[0m [38;5;249m}[0m[38;5;249m [0m[38;5;249mf[0m[38;5;249mr[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249m [0m'node:fs/promises'[38;5;249m;[0m
|
|
44
|
+
[38;5;240m │[0m ─────────┬────────
|
|
45
|
+
[38;5;240m │[0m ╰────────── Module not found, treating it as an external dependency
|
|
46
|
+
[38;5;240m │[0m
|
|
47
|
+
[38;5;240m │[0m [38;5;115mHelp[0m: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
|
|
48
|
+
[38;5;246m────╯[0m
|
|
49
|
+
|
|
50
|
+
src/node.ts (17:30) [33m[UNRESOLVED_IMPORT] [0mCould not resolve 'node:path' in src/node.ts
|
|
51
|
+
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m src/node.ts:17:31 [38;5;246m][0m
|
|
52
|
+
[38;5;246m│[0m
|
|
53
|
+
[38;5;246m17 │[0m [38;5;249mi[0m[38;5;249mm[0m[38;5;249mp[0m[38;5;249mo[0m[38;5;249mr[0m[38;5;249mt[0m[38;5;249m [0m[38;5;249m{[0m[38;5;249m [0m[38;5;249mj[0m[38;5;249mo[0m[38;5;249mi[0m[38;5;249mn[0m[38;5;249m,[0m[38;5;249m [0m[38;5;249mr[0m[38;5;249me[0m[38;5;249ms[0m[38;5;249mo[0m[38;5;249ml[0m[38;5;249mv[0m[38;5;249me[0m[38;5;249m [0m[38;5;249m}[0m[38;5;249m [0m[38;5;249mf[0m[38;5;249mr[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249m [0m'node:path'[38;5;249m;[0m
|
|
54
|
+
[38;5;240m │[0m ─────┬─────
|
|
55
|
+
[38;5;240m │[0m ╰─────── Module not found, treating it as an external dependency
|
|
56
|
+
[38;5;240m │[0m
|
|
57
|
+
[38;5;240m │[0m [38;5;115mHelp[0m: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
|
|
58
|
+
[38;5;246m────╯[0m
|
|
59
|
+
|
|
60
|
+
src/prd.service.ts (104:48) [33m[UNRESOLVED_IMPORT] [0mCould not resolve 'node:path' in src/prd.service.ts
|
|
61
|
+
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m src/prd.service.ts:104:49 [38;5;246m][0m
|
|
62
|
+
[38;5;246m│[0m
|
|
63
|
+
[38;5;246m104 │[0m [38;5;249mi[0m[38;5;249mm[0m[38;5;249mp[0m[38;5;249mo[0m[38;5;249mr[0m[38;5;249mt[0m[38;5;249m [0m[38;5;249m{[0m[38;5;249m [0m[38;5;249mi[0m[38;5;249ms[0m[38;5;249mA[0m[38;5;249mb[0m[38;5;249ms[0m[38;5;249mo[0m[38;5;249ml[0m[38;5;249mu[0m[38;5;249mt[0m[38;5;249me[0m[38;5;249m,[0m[38;5;249m [0m[38;5;249mj[0m[38;5;249mo[0m[38;5;249mi[0m[38;5;249mn[0m[38;5;249m,[0m[38;5;249m [0m[38;5;249mr[0m[38;5;249me[0m[38;5;249ml[0m[38;5;249ma[0m[38;5;249mt[0m[38;5;249mi[0m[38;5;249mv[0m[38;5;249me[0m[38;5;249m,[0m[38;5;249m [0m[38;5;249ms[0m[38;5;249me[0m[38;5;249mp[0m[38;5;249m [0m[38;5;249m}[0m[38;5;249m [0m[38;5;249mf[0m[38;5;249mr[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249m [0m'node:path'[38;5;249m;[0m
|
|
64
|
+
[38;5;240m │[0m ─────┬─────
|
|
65
|
+
[38;5;240m │[0m ╰─────── Module not found, treating it as an external dependency
|
|
66
|
+
[38;5;240m │[0m
|
|
67
|
+
[38;5;240m │[0m [38;5;115mHelp[0m: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
|
|
68
|
+
[38;5;246m─────╯[0m
|
|
69
|
+
|
|
70
|
+
[32m✔[39m Build complete in [32m48ms[39m
|
|
71
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m12.70 kB[22m [2m│ gzip: 3.33 kB[22m
|
|
72
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1moperations.d.ts[22m[39m [2m 5.62 kB[22m [2m│ gzip: 1.88 kB[22m
|
|
73
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mnode.d.ts[22m[39m [2m 0.99 kB[22m [2m│ gzip: 0.53 kB[22m
|
|
74
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mmcp.d.ts[22m[39m [2m 0.38 kB[22m [2m│ gzip: 0.27 kB[22m
|
|
75
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mschema-BwTnt0B9.d.ts[39m [2m85.41 kB[22m [2m│ gzip: 11.81 kB[22m
|
|
76
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mprd.service-CTwKZV-3.d.ts[39m [2m 7.05 kB[22m [2m│ gzip: 2.27 kB[22m
|
|
77
|
+
[34mℹ[39m [33m[CJS][39m 6 files, total: 112.15 kB
|
|
78
|
+
[32m✔[39m Build complete in [32m189ms[39m
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
$ vitest run
|
|
2
|
+
|
|
3
|
+
[1m[30m[46m RUN [49m[39m[22m [36mv5.0.4 [39m[90m/Users/giancarlo/Code/makerkit/packages/prd[39m
|
|
4
|
+
|
|
5
|
+
[32m✓[39m src/__tests__/templates.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
6
|
+
[32m✓[39m src/__tests__/prd.tool.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
7
|
+
[32m✓[39m src/__tests__/agent-workflow.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
8
|
+
[32m✓[39m src/__tests__/prd-operations.test.ts [2m([22m[2m30 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/__tests__/attachments.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
10
|
+
[32m✓[39m src/__tests__/plan-check.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
11
|
+
[32m✓[39m src/__tests__/prd.service.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
12
|
+
[32m✓[39m src/__tests__/planning.test.ts [2m([22m[2m41 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
13
|
+
[32m✓[39m src/__tests__/node.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 929[2mms[22m[39m
|
|
14
|
+
|
|
15
|
+
[2m Test Files [22m [1m[32m9 passed[39m[22m[90m (9)[39m
|
|
16
|
+
[2m Tests [22m [1m[32m157 passed[39m[22m[90m (157)[39m
|
|
17
|
+
[2m Start at [22m 16:21:58
|
|
18
|
+
[2m Duration [22m 1.06s[2m (tests 57%, transform 31%, import 11%, worker 2%)[22m
|
|
19
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
$ tsc --noEmit -p tsconfig.lib.json && tsc --noEmit -p tsconfig.spec.json
|
|
2
|
+
src/__tests__/planning.test.ts(443,27): error TS2339: Property 'story_notes' does not exist on type '{ guidance: string[]; decisions: { id: string; decision: string; rationale: string; }[]; }'.
|
|
3
|
+
src/__tests__/planning.test.ts(446,29): error TS2339: Property 'story_notes' does not exist on type '{ permissions: string[]; compliance: string[]; considerations: string[]; }'.
|
|
4
|
+
src/__tests__/planning.test.ts(480,27): error TS2339: Property 'story_notes' does not exist on type '{ guidance: string[]; decisions: { id: string; decision: string; rationale: string; }[]; }'.
|
|
5
|
+
src/__tests__/planning.test.ts(481,29): error TS2339: Property 'story_notes' does not exist on type '{ permissions: string[]; compliance: string[]; considerations: string[]; }'.
|
|
6
|
+
[ELIFECYCLE] Command failed with exit code 2.
|
package/README.md
CHANGED
|
@@ -7,7 +7,11 @@ Structured product requirements documents (PRDs) stored as JSON files in `.prds/
|
|
|
7
7
|
- **Completion gate**: a story can only be marked `completed` when the project's checks pass, so "done" means the code verifies.
|
|
8
8
|
- **MCP tools**: the same operations exposed to Claude Code, Codex, OpenCode or any MCP client.
|
|
9
9
|
- **Attachments**: files (mockups, screenshots, reference docs) live in a folder next to the PRD, `.prds/<prd name>/`, and links can be recorded too. Stories reference them by id, and `get_story` returns them with their paths.
|
|
10
|
-
- **Prompts**: `shape_prd` interviews you round by round (numbered questions, each with a recommended answer and its reason) and writes every decision into the PRD; `architect_prd` designs the shape all stories share (using the project's `architect` skill when it has one) and records it as an attachment the story agents build against; `implement_story`
|
|
10
|
+
- **Prompts**: `shape_prd` interviews you round by round (numbered questions, each with a recommended answer and its reason) and writes every decision into the PRD; `architect_prd` designs the shape all stories share (using the project's `architect` skill when it has one) and records it as an attachment the story agents build against; `implement_story` implements ready stories in sequence, with a single-story mode for parallel workers; `review_story` checks the result against the spec. The same text is exported (`shapePrdPrompt`, `architectPrdPrompt`, `implementStoryPrompt`, `reviewStoryPrompt`) for UIs and agents without MCP prompt support.
|
|
11
|
+
|
|
12
|
+
Pass `mode: "light"` to `shape_prd` for a shorter interview focused on scope, user-visible behaviour, and decisions that block stories. The default is `"detailed"`. In TypeScript, pass the mode as the third argument to `shapePrdPrompt`.
|
|
13
|
+
|
|
14
|
+
A PRD can have optional roadmap metadata in its top-level `roadmap` object. Set `order` (a non-negative integer), `criticality` (`critical`, `high`, `medium`, or `low`), and any of `plan`, `group`, and `section`. Supply it to `create_prd`, or patch it with `update_prd_section` using `section: "roadmap"`. Set a field to `null` in a patch to clear it. `list_prds` sorts explicit orders first, then higher criticality within each order. It returns the roadmap metadata with each PRD so clients can group the list.
|
|
11
15
|
|
|
12
16
|
## Install
|
|
13
17
|
|
|
@@ -23,6 +27,8 @@ import { createNodePrdDeps } from '@makerkit/prd/node';
|
|
|
23
27
|
|
|
24
28
|
const prds = createPrdService(createNodePrdDeps(process.cwd()));
|
|
25
29
|
|
|
30
|
+
// To use a different directory, pass { prdsDir: "docs/prds" } as the second argument.
|
|
31
|
+
|
|
26
32
|
const { prds: list } = await prds.list();
|
|
27
33
|
```
|
|
28
34
|
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @makerkit/prd
|
|
2
|
+
|
|
3
|
+
Structured product requirements documents (PRDs) stored as JSON files in `.prds/`, plus the tools to manage them from code or from a coding agent over MCP.
|
|
4
|
+
|
|
5
|
+
- **Format**: a typed `StructuredPRD` (stories, statuses, priorities, dependencies, phases, risks, decisions) with Zod schemas. Hand-written files are normalized on load. Text fields may use Markdown; list items (acceptance criteria, non-goals, ...) keep to inline Markdown, and raw HTML is not rendered.
|
|
6
|
+
- **Service**: create PRDs, add and update user stories, move stories through `not_started → research → in_progress → review → completed`, export markdown.
|
|
7
|
+
- **Completion gate**: a story can only be marked `completed` when the project's checks pass, so "done" means the code verifies.
|
|
8
|
+
- **MCP tools**: the same operations exposed to Claude Code, Codex, OpenCode or any MCP client.
|
|
9
|
+
- **Attachments**: files (mockups, screenshots, reference docs) live in a folder next to the PRD, `.prds/<prd name>/`, and links can be recorded too. Stories reference them by id, and `get_story` returns them with their paths.
|
|
10
|
+
- **Prompts**: `shape_prd` interviews you round by round (numbered questions, each with a recommended answer and its reason) and writes every decision into the PRD; `architect_prd` designs the shape all stories share (using the project's `architect` skill when it has one) and records it as an attachment the story agents build against; `implement_story` implements ready stories in sequence, with a single-story mode for parallel workers; `review_story` checks the result against the spec. The same text is exported (`shapePrdPrompt`, `architectPrdPrompt`, `implementStoryPrompt`, `reviewStoryPrompt`) for UIs and agents without MCP prompt support.
|
|
11
|
+
|
|
12
|
+
Pass `mode: "light"` to `shape_prd` for a shorter interview focused on scope, user-visible behaviour, and decisions that block stories. The default is `"detailed"`. In TypeScript, pass the mode as the third argument to `shapePrdPrompt`.
|
|
13
|
+
|
|
14
|
+
A PRD can have optional roadmap metadata in its top-level `roadmap` object. Set `order` (a non-negative integer), `criticality` (`critical`, `high`, `medium`, or `low`), and any of `plan`, `group`, and `section`. Supply it to `create_prd`, or patch it with `update_prd_section` using `section: "roadmap"`. Set a field to `null` in a patch to clear it. `list_prds` sorts explicit orders first, then higher criticality within each order. It returns the roadmap metadata with each PRD so clients can group the list.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add @makerkit/prd
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { createPrdService } from '@makerkit/prd';
|
|
26
|
+
import { createNodePrdDeps } from '@makerkit/prd/node';
|
|
27
|
+
|
|
28
|
+
const prds = createPrdService(createNodePrdDeps(process.cwd()));
|
|
29
|
+
|
|
30
|
+
// To use a different directory, pass { prdsDir: "docs/prds" } as the second argument.
|
|
31
|
+
|
|
32
|
+
const { prds: list } = await prds.list();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
By default, completing a story runs the project's `typecheck` and `lint` scripts with its package manager (scripts that do not exist are skipped). Pass your own check instead:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
createNodePrdDeps(root, {
|
|
39
|
+
verifyCompletion: async () => ({
|
|
40
|
+
passed: true,
|
|
41
|
+
checks: ['custom'],
|
|
42
|
+
errors: 0,
|
|
43
|
+
warnings: 0,
|
|
44
|
+
diagnostics: [],
|
|
45
|
+
messages: [],
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### MCP
|
|
51
|
+
|
|
52
|
+
Requires `@modelcontextprotocol/sdk`.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
56
|
+
import { createPrdService } from '@makerkit/prd';
|
|
57
|
+
import { registerPRDTools } from '@makerkit/prd/mcp';
|
|
58
|
+
import { createNodePrdDeps } from '@makerkit/prd/node';
|
|
59
|
+
|
|
60
|
+
const server = new McpServer({ name: 'prd', version: '1.0.0' });
|
|
61
|
+
|
|
62
|
+
registerPRDTools(server, createPrdService(createNodePrdDeps()));
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Credits
|
|
66
|
+
|
|
67
|
+
The `shape_prd` interview and the story-slicing rules are adapted from ideas in Matt Pocock's [skills](https://github.com/mattpocock/skills) (MIT), in particular grilling and to-tickets.
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// src/safe-file-name.ts
|
|
2
|
+
/**
|
|
3
|
+
* Accept only a bare file name. Anything that could escape the intended
|
|
4
|
+
* directory (path separators, parent references, hidden files) is rejected
|
|
5
|
+
* before the filesystem is touched.
|
|
6
|
+
*/
|
|
7
|
+
function assertSafeFileName(value, label = "file name") {
|
|
8
|
+
const name = value.trim();
|
|
9
|
+
if (name.length === 0 || name.includes("..") || name.includes("/") || name.includes("\\") || name.startsWith(".")) throw new Error(`Invalid ${label} "${value}"`);
|
|
10
|
+
return name;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Accept only a relative path that stays inside the directory it is joined
|
|
14
|
+
* to: no absolute paths, no `..`, no backslashes, no empty or hidden segments.
|
|
15
|
+
* This is a check on the text only; code that serves the file must still
|
|
16
|
+
* resolve symlinks before reading it.
|
|
17
|
+
*/
|
|
18
|
+
function assertSafeRelativePath(value, label = "path") {
|
|
19
|
+
const path = value.trim();
|
|
20
|
+
const segments = path.split("/");
|
|
21
|
+
if (path.length === 0 || path.includes("\\") || /^[a-zA-Z]:/.test(path) || segments.some((segment) => segment.length === 0 || segment.startsWith("."))) throw new Error(`Invalid ${label} "${value}"`);
|
|
22
|
+
return path;
|
|
23
|
+
}
|
|
24
|
+
// src/attachment-paths.ts
|
|
25
|
+
/**
|
|
26
|
+
* The folder for a PRD's files, relative to `.prds`: the PRD file name
|
|
27
|
+
* without `.json`, so `notes.json` keeps its files in `.prds/notes/`.
|
|
28
|
+
*/
|
|
29
|
+
function attachmentsFolder(filename) {
|
|
30
|
+
return filename.replace(/\.json$/, "");
|
|
31
|
+
}
|
|
32
|
+
/** An attachment's file relative to the project root, e.g. `.prds/notes/a.png`. */
|
|
33
|
+
function attachmentProjectPath(filename, path, prdsPath = ".prds") {
|
|
34
|
+
return `${prdsPath.replace(/\/$/, "")}/${attachmentsFolder(filename)}/${path}`;
|
|
35
|
+
}
|
|
36
|
+
/** Attachments as an agent needs them: file paths from the project root. */
|
|
37
|
+
function resolveAttachments(filename, attachments, prdsPath) {
|
|
38
|
+
return attachments.map(({ path, ...attachment }) => ({
|
|
39
|
+
...attachment,
|
|
40
|
+
...path ? { path: attachmentProjectPath(filename, path, prdsPath) } : {}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Attachments as stored, with hand-edited entries that would break readers
|
|
45
|
+
* or point outside the PRD folder dropped: each needs a string id and title
|
|
46
|
+
* and either a safe relative path or an http(s) url.
|
|
47
|
+
*/
|
|
48
|
+
function normalizeAttachments(value) {
|
|
49
|
+
if (!Array.isArray(value)) return [];
|
|
50
|
+
return value.flatMap((entry) => {
|
|
51
|
+
if (typeof entry !== "object" || entry === null) return [];
|
|
52
|
+
const { id, title, path, url, note } = entry;
|
|
53
|
+
if (typeof id !== "string" || typeof title !== "string") return [];
|
|
54
|
+
const base = {
|
|
55
|
+
id,
|
|
56
|
+
title,
|
|
57
|
+
...typeof note === "string" && note ? { note } : {}
|
|
58
|
+
};
|
|
59
|
+
if (typeof path === "string" && url === void 0 && isSafePath(path)) return [{
|
|
60
|
+
...base,
|
|
61
|
+
path
|
|
62
|
+
}];
|
|
63
|
+
if (typeof url === "string" && path === void 0 && /^https?:\/\//i.test(url)) return [{
|
|
64
|
+
...base,
|
|
65
|
+
url
|
|
66
|
+
}];
|
|
67
|
+
return [];
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function isSafePath(path) {
|
|
71
|
+
try {
|
|
72
|
+
return assertSafeRelativePath(path) === path;
|
|
73
|
+
} catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
Object.defineProperty(exports, "assertSafeFileName", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function() {
|
|
80
|
+
return assertSafeFileName;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(exports, "assertSafeRelativePath", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function() {
|
|
86
|
+
return assertSafeRelativePath;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "attachmentProjectPath", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function() {
|
|
92
|
+
return attachmentProjectPath;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(exports, "attachmentsFolder", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
get: function() {
|
|
98
|
+
return attachmentsFolder;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "normalizeAttachments", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function() {
|
|
104
|
+
return normalizeAttachments;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(exports, "resolveAttachments", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
get: function() {
|
|
110
|
+
return resolveAttachments;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// src/safe-file-name.ts
|
|
2
|
+
/**
|
|
3
|
+
* Accept only a bare file name. Anything that could escape the intended
|
|
4
|
+
* directory (path separators, parent references, hidden files) is rejected
|
|
5
|
+
* before the filesystem is touched.
|
|
6
|
+
*/
|
|
7
|
+
function assertSafeFileName(value, label = "file name") {
|
|
8
|
+
const name = value.trim();
|
|
9
|
+
if (name.length === 0 || name.includes("..") || name.includes("/") || name.includes("\\") || name.startsWith(".")) throw new Error(`Invalid ${label} "${value}"`);
|
|
10
|
+
return name;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Accept only a relative path that stays inside the directory it is joined
|
|
14
|
+
* to: no absolute paths, no `..`, no backslashes, no empty or hidden segments.
|
|
15
|
+
* This is a check on the text only; code that serves the file must still
|
|
16
|
+
* resolve symlinks before reading it.
|
|
17
|
+
*/
|
|
18
|
+
function assertSafeRelativePath(value, label = "path") {
|
|
19
|
+
const path = value.trim();
|
|
20
|
+
const segments = path.split("/");
|
|
21
|
+
if (path.length === 0 || path.includes("\\") || /^[a-zA-Z]:/.test(path) || segments.some((segment) => segment.length === 0 || segment.startsWith("."))) throw new Error(`Invalid ${label} "${value}"`);
|
|
22
|
+
return path;
|
|
23
|
+
}
|
|
24
|
+
// src/attachment-paths.ts
|
|
25
|
+
/**
|
|
26
|
+
* The folder for a PRD's files, relative to `.prds`: the PRD file name
|
|
27
|
+
* without `.json`, so `notes.json` keeps its files in `.prds/notes/`.
|
|
28
|
+
*/
|
|
29
|
+
function attachmentsFolder(filename) {
|
|
30
|
+
return filename.replace(/\.json$/, "");
|
|
31
|
+
}
|
|
32
|
+
/** An attachment's file relative to the project root, e.g. `.prds/notes/a.png`. */
|
|
33
|
+
function attachmentProjectPath(filename, path, prdsPath = ".prds") {
|
|
34
|
+
return `${prdsPath.replace(/\/$/, "")}/${attachmentsFolder(filename)}/${path}`;
|
|
35
|
+
}
|
|
36
|
+
/** Attachments as an agent needs them: file paths from the project root. */
|
|
37
|
+
function resolveAttachments(filename, attachments, prdsPath) {
|
|
38
|
+
return attachments.map(({ path, ...attachment }) => ({
|
|
39
|
+
...attachment,
|
|
40
|
+
...path ? { path: attachmentProjectPath(filename, path, prdsPath) } : {}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Attachments as stored, with hand-edited entries that would break readers
|
|
45
|
+
* or point outside the PRD folder dropped: each needs a string id and title
|
|
46
|
+
* and either a safe relative path or an http(s) url.
|
|
47
|
+
*/
|
|
48
|
+
function normalizeAttachments(value) {
|
|
49
|
+
if (!Array.isArray(value)) return [];
|
|
50
|
+
return value.flatMap((entry) => {
|
|
51
|
+
if (typeof entry !== "object" || entry === null) return [];
|
|
52
|
+
const { id, title, path, url, note } = entry;
|
|
53
|
+
if (typeof id !== "string" || typeof title !== "string") return [];
|
|
54
|
+
const base = {
|
|
55
|
+
id,
|
|
56
|
+
title,
|
|
57
|
+
...typeof note === "string" && note ? { note } : {}
|
|
58
|
+
};
|
|
59
|
+
if (typeof path === "string" && url === void 0 && isSafePath(path)) return [{
|
|
60
|
+
...base,
|
|
61
|
+
path
|
|
62
|
+
}];
|
|
63
|
+
if (typeof url === "string" && path === void 0 && /^https?:\/\//i.test(url)) return [{
|
|
64
|
+
...base,
|
|
65
|
+
url
|
|
66
|
+
}];
|
|
67
|
+
return [];
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function isSafePath(path) {
|
|
71
|
+
try {
|
|
72
|
+
return assertSafeRelativePath(path) === path;
|
|
73
|
+
} catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export { assertSafeFileName as a, resolveAttachments as i, attachmentsFolder as n, assertSafeRelativePath as o, normalizeAttachments as r, attachmentProjectPath as t };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { a as PrdVerificationResult, i as PrdVerificationDiagnostic, n as PrdRevisionConflictError, o as createPrdService, r as PrdService, s as normalizePrd, t as PrdDeps } from "./prd.service-CTwKZV-3.js";
|
|
2
|
+
import { appendChangeLog, appendStoryLog, assertCanEnterStatus, assignStoryToPhase, buildStoryContext, createPhase, deleteStory, findAttachment, findStory, incompleteDependencies, nextId, nextStoryId, pickNextStory, recomputeProgress, renderUserStory, splitUserStory, updateStory, validateAttachmentIds, validateDependencies, validateProofs } from "./operations.js";
|
|
3
|
+
import { $ as ExportPrdMarkdownInputSchema, $t as StoryAttachment, A as CreateCustomPhaseOutput, An as EdgeCase, At as MarkNotApplicableOutput, B as DecideEdgeCaseOutput, Bn as StoryStatus, Bt as PrdSummary, C as AssignStoryToPhaseOutput, Cn as UpdateUserStoryOutputSchema, Ct as ListPrdsOutput, D as CheckPlanOutputSchema, Dn as CrossDependency, Dt as ListTemplatesOutputSchema, E as CheckPlanOutput, En as CriterionProof, Et as ListTemplatesOutput, F as CreatePrdOutputSchema, Fn as ProofKind, Ft as PrdCriticalitySchema, G as DeletePrdInputSchema, Gt as RemoveAttachmentOutput, H as DeletePhaseInput, Hn as StoryVerification, Ht as ProofKindSchema, I as CriterionProofSchema, In as RiskItem, It as PrdRoadmapSchema, J as DeleteUserStoryInput, Jt as ReorderPhasesInputSchema, K as DeletePrdOutput, Kt as RemoveAttachmentOutputSchema, L as CustomPhaseSchema, Ln as StoryComplexity, Lt as PrdRoadmapUpdateSchema, M as CreatePrdInput, Mn as NotApplicableTopic, Mt as NotApplicableTopicSchema, N as CreatePrdInputSchema, Nn as OpenQuestion, Nt as PhasesOutput, O as CreateCustomPhaseInput, On as CustomPhase, Ot as MarkNotApplicableInput, P as CreatePrdOutput, Pn as PrdRoadmap, Pt as PhasesOutputSchema, Q as ExportPrdMarkdownInput, Qt as ResolveOpenQuestionOutputSchema, R as DecideEdgeCaseInput, Rn as StoryLogEntry, Rt as PrdSection, S as AssignStoryToPhaseInputSchema, Sn as UpdateUserStoryOutput, St as ListPrdsInputSchema, T as CheckPlanInputSchema, Tn as Attachment, Tt as ListTemplatesInputSchema, U as DeletePhaseInputSchema, Un as StructuredPRD, Ut as RemoveAttachmentInput, V as DecideEdgeCaseOutputSchema, Vn as StoryTraceabilityMap, Vt as PrdSummarySchema, W as DeletePrdInput, Wn as UserStory, Wt as RemoveAttachmentInputSchema, X as DeleteUserStoryOutput, Xt as ResolveOpenQuestionInputSchema, Y as DeleteUserStoryInputSchema, Yt as ResolveOpenQuestionInput, Z as DeleteUserStoryOutputSchema, Zt as ResolveOpenQuestionOutput, _ as AddUserStoryInput, _n as UpdateStoryStatusInputSchema, _t as GetProjectStatusOutputSchema, a as AddDecisionInput, an as StoryVerificationSchema, at as GetImprovementSuggestionsInputSchema, b as AddUserStoryOutputSchema, bn as UpdateUserStoryInput, bt as GetStoryOutput, c as AddDecisionOutputSchema, cn as UpdateAttachmentOutput, ct as GetNextStoryInputSchema, d as AddGlossaryTermOutput, dn as UpdatePhaseInputSchema, dt as GetPrdInput, en as StoryAttachmentSchema, et as ExportPrdMarkdownOutput, f as AddGlossaryTermOutputSchema, fn as UpdatePrdSectionInput, ft as GetPrdInputSchema, g as AddStoryLogOutputSchema, gn as UpdateStoryStatusInput, gt as GetProjectStatusOutput, h as AddStoryLogOutput, hn as UpdatePrdSectionOutputSchema, ht as GetProjectStatusInputSchema, i as AddAttachmentOutputSchema, in as StoryStatusSchema, it as GetImplementationPromptsOutputSchema, j as CreateCustomPhaseOutputSchema, jn as GlossaryTerm, jt as MarkNotApplicableOutputSchema, k as CreateCustomPhaseInputSchema, kn as DecisionLogEntry, kt as MarkNotApplicableInputSchema, l as AddGlossaryTermInput, ln as UpdateAttachmentOutputSchema, lt as GetNextStoryOutput, m as AddStoryLogInputSchema, mn as UpdatePrdSectionOutput, mt as GetPrdOutputSchema, n as AddAttachmentInputSchema, nn as StoryLogEntrySchema, nt as GetImplementationPromptsInputSchema, o as AddDecisionInputSchema, on as UpdateAttachmentInput, ot as GetImprovementSuggestionsOutput, p as AddStoryLogInput, pn as UpdatePrdSectionInputSchema, pt as GetPrdOutput, q as DeletePrdOutputSchema, qt as ReorderPhasesInput, r as AddAttachmentOutput, rn as StoryPrioritySchema, rt as GetImplementationPromptsOutput, s as AddDecisionOutput, sn as UpdateAttachmentInputSchema, st as GetImprovementSuggestionsOutputSchema, t as AddAttachmentInput, tn as StoryComplexitySchema, tt as ExportPrdMarkdownOutputSchema, u as AddGlossaryTermInputSchema, un as UpdatePhaseInput, ut as GetNextStoryOutputSchema, v as AddUserStoryInputSchema, vn as UpdateStoryStatusOutput, vt as GetStoryInput, w as AssignStoryToPhaseOutputSchema, wn as AgentTaskPacket, wt as ListPrdsOutputSchema, x as AssignStoryToPhaseInput, xn as UpdateUserStoryInputSchema, xt as GetStoryOutputSchema, y as AddUserStoryOutput, yn as UpdateStoryStatusOutputSchema, yt as GetStoryInputSchema, z as DecideEdgeCaseInputSchema, zn as StoryPriority, zt as PrdSectionValueSchemas } from "./schema-BwTnt0B9.js";
|
|
4
|
+
/**
|
|
5
|
+
* The folder for a PRD's files, relative to `.prds`: the PRD file name
|
|
6
|
+
* without `.json`, so `notes.json` keeps its files in `.prds/notes/`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function attachmentsFolder(filename: string): string;
|
|
9
|
+
/** An attachment's file relative to the project root, e.g. `.prds/notes/a.png`. */
|
|
10
|
+
export declare function attachmentProjectPath(filename: string, path: string, prdsPath?: string): string;
|
|
11
|
+
/** Attachments as an agent needs them: file paths from the project root. */
|
|
12
|
+
export declare function resolveAttachments(filename: string, attachments: Attachment[], prdsPath?: string): StoryAttachment[];
|
|
13
|
+
/**
|
|
14
|
+
* Parts of a PRD that can be marked "not applicable" (e.g. no rollout plan
|
|
15
|
+
* for an internal tool), so the plan check stops asking for them and agents
|
|
16
|
+
* do not invent them. The core (overview, problem, solution, scope, stories)
|
|
17
|
+
* always applies.
|
|
18
|
+
*/
|
|
19
|
+
export declare const NOT_APPLICABLE_TOPICS: readonly ["dataModel", "outsideServices", "security", "design", "qualityBar", "edgeCases", "rollout", "measurement", "glossary", "risks"];
|
|
20
|
+
export declare function isNotApplicable(prd: StructuredPRD, topic: NotApplicableTopic): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Pass the PRD file name to link attachment files relative to `.prds/`, where
|
|
23
|
+
* the markdown export is written.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatPrdMarkdown(prd: StructuredPRD, filename?: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* The instructions behind the MCP prompts, exported so other tools (e.g. a
|
|
28
|
+
* UI that shows what to ask the agent) give exactly the same text.
|
|
29
|
+
*/
|
|
30
|
+
export declare function shapePrdPrompt(overview?: string, filename?: string, mode?: 'light' | 'detailed', prdsPath?: string): string;
|
|
31
|
+
export declare function architectPrdPrompt(filename: string, prdsPath?: string): string;
|
|
32
|
+
export declare function reviewStoryPrompt(filename: string, storyId: string, base?: string): string;
|
|
33
|
+
export declare function implementStoryPrompt(filename: string, storyId?: string, singleStory?: boolean): string;
|
|
34
|
+
/**
|
|
35
|
+
* What a plan is still missing, as items a UI can render as a checklist and an
|
|
36
|
+
* agent can act on. `required` items mean the plan is not ready to build;
|
|
37
|
+
* `recommended` items make it better but do not block.
|
|
38
|
+
*/
|
|
39
|
+
interface PlanCheckItem {
|
|
40
|
+
/** Stable key, e.g. `stories` or `vague-stories`. */
|
|
41
|
+
id: string;
|
|
42
|
+
/** The PRD section to change, matching `update_prd_section` where possible. */
|
|
43
|
+
section: string;
|
|
44
|
+
message: string;
|
|
45
|
+
severity: 'required' | 'recommended';
|
|
46
|
+
/** Stories the item is about, when it is about specific stories. */
|
|
47
|
+
storyIds?: string[];
|
|
48
|
+
}
|
|
49
|
+
export declare function checkPlan(prd: StructuredPRD): {
|
|
50
|
+
ready_to_build: boolean;
|
|
51
|
+
items: PlanCheckItem[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Starting points for new PRDs. A template fills sections the author would
|
|
55
|
+
* otherwise start empty, and gives `shape_prd` extra questions that matter for
|
|
56
|
+
* that kind of work. Everything it adds can be edited or removed afterwards.
|
|
57
|
+
*/
|
|
58
|
+
interface PrdTemplate {
|
|
59
|
+
id: TemplateId;
|
|
60
|
+
name: string;
|
|
61
|
+
description: string;
|
|
62
|
+
/** Sentence an agent can use to pick the right template. */
|
|
63
|
+
whenToUse: string;
|
|
64
|
+
defaults: {
|
|
65
|
+
nonGoals?: string[];
|
|
66
|
+
outOfScope?: string[];
|
|
67
|
+
openQuestions?: string[];
|
|
68
|
+
globalAcceptanceCriteria?: string[];
|
|
69
|
+
qualityStandards?: string[];
|
|
70
|
+
technicalConstraints?: string[];
|
|
71
|
+
rolloutPhases?: string[];
|
|
72
|
+
rollbackConditions?: string[];
|
|
73
|
+
};
|
|
74
|
+
/** Extra questions for the shaping interview. */
|
|
75
|
+
interviewFocus: string[];
|
|
76
|
+
}
|
|
77
|
+
export declare const TEMPLATE_IDS: readonly ['saas-feature', 'internal-tool', 'integration', 'mvp'];
|
|
78
|
+
type TemplateId = (typeof TEMPLATE_IDS)[number];
|
|
79
|
+
export declare const PRD_TEMPLATES: readonly PrdTemplate[];
|
|
80
|
+
export declare function getTemplate(id: TemplateId): PrdTemplate;
|
|
81
|
+
export { AddAttachmentInput, AddAttachmentInputSchema, AddAttachmentOutput, AddAttachmentOutputSchema, AddDecisionInput, AddDecisionInputSchema, AddDecisionOutput, AddDecisionOutputSchema, AddGlossaryTermInput, AddGlossaryTermInputSchema, AddGlossaryTermOutput, AddGlossaryTermOutputSchema, AddStoryLogInput, AddStoryLogInputSchema, AddStoryLogOutput, AddStoryLogOutputSchema, AddUserStoryInput, AddUserStoryInputSchema, AddUserStoryOutput, AddUserStoryOutputSchema, type AgentTaskPacket, AssignStoryToPhaseInput, AssignStoryToPhaseInputSchema, AssignStoryToPhaseOutput, AssignStoryToPhaseOutputSchema, type Attachment, CheckPlanInputSchema, CheckPlanOutput, CheckPlanOutputSchema, CreateCustomPhaseInput, CreateCustomPhaseInputSchema, CreateCustomPhaseOutput, CreateCustomPhaseOutputSchema, CreatePrdInput, CreatePrdInputSchema, CreatePrdOutput, CreatePrdOutputSchema, type CriterionProof, CriterionProofSchema, type CrossDependency, type CustomPhase, CustomPhaseSchema, DecideEdgeCaseInput, DecideEdgeCaseInputSchema, DecideEdgeCaseOutput, DecideEdgeCaseOutputSchema, type DecisionLogEntry, DeletePhaseInput, DeletePhaseInputSchema, DeletePrdInput, DeletePrdInputSchema, DeletePrdOutput, DeletePrdOutputSchema, DeleteUserStoryInput, DeleteUserStoryInputSchema, DeleteUserStoryOutput, DeleteUserStoryOutputSchema, type EdgeCase, ExportPrdMarkdownInput, ExportPrdMarkdownInputSchema, ExportPrdMarkdownOutput, ExportPrdMarkdownOutputSchema, GetImplementationPromptsInputSchema, GetImplementationPromptsOutput, GetImplementationPromptsOutputSchema, GetImprovementSuggestionsInputSchema, GetImprovementSuggestionsOutput, GetImprovementSuggestionsOutputSchema, GetNextStoryInputSchema, GetNextStoryOutput, GetNextStoryOutputSchema, GetPrdInput, GetPrdInputSchema, GetPrdOutput, GetPrdOutputSchema, GetProjectStatusInputSchema, GetProjectStatusOutput, GetProjectStatusOutputSchema, GetStoryInput, GetStoryInputSchema, GetStoryOutput, GetStoryOutputSchema, type GlossaryTerm, ListPrdsInputSchema, ListPrdsOutput, ListPrdsOutputSchema, ListTemplatesInputSchema, ListTemplatesOutput, ListTemplatesOutputSchema, MarkNotApplicableInput, MarkNotApplicableInputSchema, MarkNotApplicableOutput, MarkNotApplicableOutputSchema, type NotApplicableTopic, NotApplicableTopicSchema, type OpenQuestion, PhasesOutput, PhasesOutputSchema, type PlanCheckItem, PrdCriticalitySchema, type PrdDeps, PrdRevisionConflictError, type PrdRoadmap, PrdRoadmapSchema, PrdRoadmapUpdateSchema, PrdSection, PrdSectionValueSchemas, PrdService, PrdSummary, PrdSummarySchema, type PrdTemplate, type PrdVerificationDiagnostic, type PrdVerificationResult, type ProofKind, ProofKindSchema, RemoveAttachmentInput, RemoveAttachmentInputSchema, RemoveAttachmentOutput, RemoveAttachmentOutputSchema, ReorderPhasesInput, ReorderPhasesInputSchema, ResolveOpenQuestionInput, ResolveOpenQuestionInputSchema, ResolveOpenQuestionOutput, ResolveOpenQuestionOutputSchema, type RiskItem, StoryAttachment, StoryAttachmentSchema, type StoryComplexity, StoryComplexitySchema, type StoryLogEntry, StoryLogEntrySchema, type StoryPriority, StoryPrioritySchema, type StoryStatus, StoryStatusSchema, type StoryTraceabilityMap, type StoryVerification, StoryVerificationSchema, type StructuredPRD, type TemplateId, UpdateAttachmentInput, UpdateAttachmentInputSchema, UpdateAttachmentOutput, UpdateAttachmentOutputSchema, UpdatePhaseInput, UpdatePhaseInputSchema, UpdatePrdSectionInput, UpdatePrdSectionInputSchema, UpdatePrdSectionOutput, UpdatePrdSectionOutputSchema, UpdateStoryStatusInput, UpdateStoryStatusInputSchema, UpdateStoryStatusOutput, UpdateStoryStatusOutputSchema, UpdateUserStoryInput, UpdateUserStoryInputSchema, UpdateUserStoryOutput, UpdateUserStoryOutputSchema, type UserStory, appendChangeLog, appendStoryLog, assertCanEnterStatus, assignStoryToPhase, buildStoryContext, createPhase, createPrdService, deleteStory, findAttachment, findStory, incompleteDependencies, nextId, nextStoryId, normalizePrd, pickNextStory, recomputeProgress, renderUserStory, splitUserStory, updateStory, validateAttachmentIds, validateDependencies, validateProofs };
|