forge-cc 0.1.41 → 1.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.
Files changed (203) hide show
  1. package/README.md +454 -338
  2. package/dist/cli.js +194 -935
  3. package/dist/cli.js.map +1 -1
  4. package/dist/config/loader.d.ts +1 -1
  5. package/dist/config/loader.js +49 -56
  6. package/dist/config/loader.js.map +1 -1
  7. package/dist/config/schema.d.ts +37 -125
  8. package/dist/config/schema.js +13 -28
  9. package/dist/config/schema.js.map +1 -1
  10. package/dist/doctor.d.ts +10 -0
  11. package/dist/doctor.js +148 -0
  12. package/dist/doctor.js.map +1 -0
  13. package/dist/gates/index.d.ts +14 -12
  14. package/dist/gates/index.js +53 -105
  15. package/dist/gates/index.js.map +1 -1
  16. package/dist/gates/lint-gate.d.ts +2 -2
  17. package/dist/gates/lint-gate.js +60 -66
  18. package/dist/gates/lint-gate.js.map +1 -1
  19. package/dist/gates/tests-gate.d.ts +2 -4
  20. package/dist/gates/tests-gate.js +75 -203
  21. package/dist/gates/tests-gate.js.map +1 -1
  22. package/dist/gates/types-gate.d.ts +2 -2
  23. package/dist/gates/types-gate.js +53 -59
  24. package/dist/gates/types-gate.js.map +1 -1
  25. package/dist/linear/client.d.ts +31 -108
  26. package/dist/linear/client.js +88 -388
  27. package/dist/linear/client.js.map +1 -1
  28. package/dist/linear/sync.d.ts +15 -0
  29. package/dist/linear/sync.js +102 -0
  30. package/dist/linear/sync.js.map +1 -0
  31. package/dist/runner/loop.d.ts +4 -0
  32. package/dist/runner/loop.js +168 -0
  33. package/dist/runner/loop.js.map +1 -0
  34. package/dist/runner/prompt.d.ts +14 -0
  35. package/dist/runner/prompt.js +59 -0
  36. package/dist/runner/prompt.js.map +1 -0
  37. package/dist/runner/update.d.ts +1 -0
  38. package/dist/runner/update.js +72 -0
  39. package/dist/runner/update.js.map +1 -0
  40. package/dist/server.d.ts +6 -2
  41. package/dist/server.js +43 -101
  42. package/dist/server.js.map +1 -1
  43. package/dist/setup.d.ts +5 -0
  44. package/dist/setup.js +208 -0
  45. package/dist/setup.js.map +1 -0
  46. package/dist/state/cache.d.ts +3 -0
  47. package/dist/state/cache.js +23 -0
  48. package/dist/state/cache.js.map +1 -0
  49. package/dist/state/status.d.ts +66 -0
  50. package/dist/state/status.js +96 -0
  51. package/dist/state/status.js.map +1 -0
  52. package/dist/types.d.ts +46 -114
  53. package/dist/worktree/manager.d.ts +6 -103
  54. package/dist/worktree/manager.js +25 -296
  55. package/dist/worktree/manager.js.map +1 -1
  56. package/hooks/pre-commit-verify.js +109 -109
  57. package/package.json +5 -3
  58. package/skills/forge-go.md +20 -13
  59. package/skills/forge-setup.md +149 -388
  60. package/skills/forge-spec.md +367 -342
  61. package/skills/forge-triage.md +179 -133
  62. package/skills/forge-update.md +87 -93
  63. package/dist/gates/codex-gate.d.ts +0 -51
  64. package/dist/gates/codex-gate.js +0 -121
  65. package/dist/gates/codex-gate.js.map +0 -1
  66. package/dist/gates/prd-gate.d.ts +0 -7
  67. package/dist/gates/prd-gate.js +0 -193
  68. package/dist/gates/prd-gate.js.map +0 -1
  69. package/dist/gates/remediation.d.ts +0 -46
  70. package/dist/gates/remediation.js +0 -423
  71. package/dist/gates/remediation.js.map +0 -1
  72. package/dist/gates/review-gate.d.ts +0 -16
  73. package/dist/gates/review-gate.js +0 -479
  74. package/dist/gates/review-gate.js.map +0 -1
  75. package/dist/gates/runtime-gate.d.ts +0 -5
  76. package/dist/gates/runtime-gate.js +0 -99
  77. package/dist/gates/runtime-gate.js.map +0 -1
  78. package/dist/gates/test-analysis.d.ts +0 -21
  79. package/dist/gates/test-analysis.js +0 -394
  80. package/dist/gates/test-analysis.js.map +0 -1
  81. package/dist/gates/visual-capture.d.ts +0 -24
  82. package/dist/gates/visual-capture.js +0 -144
  83. package/dist/gates/visual-capture.js.map +0 -1
  84. package/dist/gates/visual-gate.d.ts +0 -18
  85. package/dist/gates/visual-gate.js +0 -234
  86. package/dist/gates/visual-gate.js.map +0 -1
  87. package/dist/gates/visual-reviewer.d.ts +0 -11
  88. package/dist/gates/visual-reviewer.js +0 -211
  89. package/dist/gates/visual-reviewer.js.map +0 -1
  90. package/dist/go/auto-chain.d.ts +0 -136
  91. package/dist/go/auto-chain.js +0 -389
  92. package/dist/go/auto-chain.js.map +0 -1
  93. package/dist/go/executor.d.ts +0 -137
  94. package/dist/go/executor.js +0 -447
  95. package/dist/go/executor.js.map +0 -1
  96. package/dist/go/finalize.d.ts +0 -108
  97. package/dist/go/finalize.js +0 -331
  98. package/dist/go/finalize.js.map +0 -1
  99. package/dist/go/linear-sync-cli.d.ts +0 -55
  100. package/dist/go/linear-sync-cli.js +0 -192
  101. package/dist/go/linear-sync-cli.js.map +0 -1
  102. package/dist/go/linear-sync.d.ts +0 -112
  103. package/dist/go/linear-sync.js +0 -375
  104. package/dist/go/linear-sync.js.map +0 -1
  105. package/dist/go/prd-queue.d.ts +0 -43
  106. package/dist/go/prd-queue.js +0 -67
  107. package/dist/go/prd-queue.js.map +0 -1
  108. package/dist/go/prd-selector.d.ts +0 -57
  109. package/dist/go/prd-selector.js +0 -101
  110. package/dist/go/prd-selector.js.map +0 -1
  111. package/dist/go/verify-loop.d.ts +0 -64
  112. package/dist/go/verify-loop.js +0 -327
  113. package/dist/go/verify-loop.js.map +0 -1
  114. package/dist/hooks/pre-commit.d.ts +0 -5
  115. package/dist/hooks/pre-commit.js +0 -75
  116. package/dist/hooks/pre-commit.js.map +0 -1
  117. package/dist/linear/issues.d.ts +0 -22
  118. package/dist/linear/issues.js +0 -51
  119. package/dist/linear/issues.js.map +0 -1
  120. package/dist/linear/milestones.d.ts +0 -11
  121. package/dist/linear/milestones.js +0 -32
  122. package/dist/linear/milestones.js.map +0 -1
  123. package/dist/linear/projects.d.ts +0 -16
  124. package/dist/linear/projects.js +0 -51
  125. package/dist/linear/projects.js.map +0 -1
  126. package/dist/reporter/human.d.ts +0 -7
  127. package/dist/reporter/human.js +0 -93
  128. package/dist/reporter/human.js.map +0 -1
  129. package/dist/reporter/json.d.ts +0 -2
  130. package/dist/reporter/json.js +0 -4
  131. package/dist/reporter/json.js.map +0 -1
  132. package/dist/setup/structural-templates.d.ts +0 -12
  133. package/dist/setup/structural-templates.js +0 -288
  134. package/dist/setup/structural-templates.js.map +0 -1
  135. package/dist/setup/templates.d.ts +0 -17
  136. package/dist/setup/templates.js +0 -109
  137. package/dist/setup/templates.js.map +0 -1
  138. package/dist/setup/test-planner.d.ts +0 -38
  139. package/dist/setup/test-planner.js +0 -91
  140. package/dist/setup/test-planner.js.map +0 -1
  141. package/dist/setup/test-scaffold.d.ts +0 -31
  142. package/dist/setup/test-scaffold.js +0 -209
  143. package/dist/setup/test-scaffold.js.map +0 -1
  144. package/dist/setup/test-templates.d.ts +0 -37
  145. package/dist/setup/test-templates.js +0 -313
  146. package/dist/setup/test-templates.js.map +0 -1
  147. package/dist/spec/generator.d.ts +0 -34
  148. package/dist/spec/generator.js +0 -227
  149. package/dist/spec/generator.js.map +0 -1
  150. package/dist/spec/interview.d.ts +0 -142
  151. package/dist/spec/interview.js +0 -287
  152. package/dist/spec/interview.js.map +0 -1
  153. package/dist/spec/linear-sync.d.ts +0 -48
  154. package/dist/spec/linear-sync.js +0 -125
  155. package/dist/spec/linear-sync.js.map +0 -1
  156. package/dist/spec/scanner.d.ts +0 -79
  157. package/dist/spec/scanner.js +0 -566
  158. package/dist/spec/scanner.js.map +0 -1
  159. package/dist/spec/templates.d.ts +0 -375
  160. package/dist/spec/templates.js +0 -95
  161. package/dist/spec/templates.js.map +0 -1
  162. package/dist/state/prd-status.d.ts +0 -62
  163. package/dist/state/prd-status.js +0 -122
  164. package/dist/state/prd-status.js.map +0 -1
  165. package/dist/state/reader.d.ts +0 -7
  166. package/dist/state/reader.js +0 -43
  167. package/dist/state/reader.js.map +0 -1
  168. package/dist/state/writer.d.ts +0 -21
  169. package/dist/state/writer.js +0 -106
  170. package/dist/state/writer.js.map +0 -1
  171. package/dist/team/consensus.d.ts +0 -28
  172. package/dist/team/consensus.js +0 -130
  173. package/dist/team/consensus.js.map +0 -1
  174. package/dist/team/index.d.ts +0 -4
  175. package/dist/team/index.js +0 -5
  176. package/dist/team/index.js.map +0 -1
  177. package/dist/team/lifecycle.d.ts +0 -37
  178. package/dist/team/lifecycle.js +0 -92
  179. package/dist/team/lifecycle.js.map +0 -1
  180. package/dist/team/reviewer.d.ts +0 -10
  181. package/dist/team/reviewer.js +0 -345
  182. package/dist/team/reviewer.js.map +0 -1
  183. package/dist/team/types.d.ts +0 -269
  184. package/dist/team/types.js +0 -70
  185. package/dist/team/types.js.map +0 -1
  186. package/dist/utils/browser.d.ts +0 -10
  187. package/dist/utils/browser.js +0 -96
  188. package/dist/utils/browser.js.map +0 -1
  189. package/dist/utils/platform.d.ts +0 -29
  190. package/dist/utils/platform.js +0 -90
  191. package/dist/utils/platform.js.map +0 -1
  192. package/dist/worktree/identity.d.ts +0 -9
  193. package/dist/worktree/identity.js +0 -32
  194. package/dist/worktree/identity.js.map +0 -1
  195. package/dist/worktree/parallel.d.ts +0 -87
  196. package/dist/worktree/parallel.js +0 -328
  197. package/dist/worktree/parallel.js.map +0 -1
  198. package/dist/worktree/session.d.ts +0 -67
  199. package/dist/worktree/session.js +0 -194
  200. package/dist/worktree/session.js.map +0 -1
  201. package/dist/worktree/state-merge.d.ts +0 -43
  202. package/dist/worktree/state-merge.js +0 -162
  203. package/dist/worktree/state-merge.js.map +0 -1
@@ -1,313 +0,0 @@
1
- // ── Test Templates ──────────────────────────────────────────────────
2
- // Framework-aware unit test template generators.
3
- // Each function takes a source file path and returns a complete test file string.
4
- import { basename, dirname, extname, relative, sep } from "node:path";
5
- // ---------------------------------------------------------------------------
6
- // Helpers
7
- // ---------------------------------------------------------------------------
8
- /**
9
- * Extract a PascalCase or camelCase module name from a file path.
10
- * e.g. "src/utils/parse-config.ts" -> "parseConfig"
11
- */
12
- function extractModuleName(sourcePath) {
13
- const base = basename(sourcePath);
14
- const name = base.replace(/\.(ts|tsx|js|jsx)$/, "");
15
- // Convert kebab-case to camelCase
16
- return name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
17
- }
18
- /**
19
- * Compute the relative import path from a test file to its source file.
20
- * Assumes test files live in __tests__/ adjacent to source, or co-located.
21
- * Returns a path with no extension (for TS imports).
22
- */
23
- export function computeRelativeImport(testFilePath, sourceFilePath) {
24
- const testDir = dirname(testFilePath);
25
- let rel = relative(testDir, sourceFilePath).replace(/\\/g, "/");
26
- // Strip the file extension for TypeScript imports
27
- rel = rel.replace(/\.(ts|tsx|js|jsx)$/, "");
28
- // Ensure it starts with ./
29
- if (!rel.startsWith(".")) {
30
- rel = "./" + rel;
31
- }
32
- return rel;
33
- }
34
- /**
35
- * Derive a default test file path from a source path (co-located pattern).
36
- * e.g. "src/utils/helpers.ts" -> "src/utils/helpers.test.ts"
37
- */
38
- function deriveTestPath(sourcePath) {
39
- const dir = dirname(sourcePath);
40
- const base = basename(sourcePath);
41
- const ext = extname(base);
42
- const nameWithoutExt = base.replace(/\.(ts|tsx|js|jsx)$/, "");
43
- const testExt = ext === ".tsx" || ext === ".jsx" ? ext : ".ts";
44
- return `${dir}${sep}${nameWithoutExt}.test${testExt}`.replace(/\\/g, "/");
45
- }
46
- // ---------------------------------------------------------------------------
47
- // Templates
48
- // ---------------------------------------------------------------------------
49
- /**
50
- * Test stub for Next.js App Router API route handlers.
51
- * Tests GET/POST/PUT/DELETE handler functions with mocked NextRequest/NextResponse.
52
- */
53
- export function nextjsApiRouteTemplate(sourcePath) {
54
- const moduleName = extractModuleName(sourcePath);
55
- const testPath = deriveTestPath(sourcePath);
56
- const importPath = computeRelativeImport(testPath, sourcePath);
57
- return `import { describe, it, expect } from "vitest";
58
- import { NextRequest } from "next/server";
59
-
60
- // TODO: Update imports to match the actual exports from the source module
61
- import { GET, POST } from "${importPath}.js";
62
-
63
- describe("${moduleName} API route", () => {
64
- describe("GET handler", () => {
65
- it("should return a successful response", async () => {
66
- const request = new NextRequest("http://localhost:3000/api/${moduleName}");
67
-
68
- const response = await GET(request);
69
-
70
- expect(response.status).toBe(200);
71
- const body = await response.json();
72
- expect(body).toBeDefined();
73
- });
74
-
75
- it("should handle errors gracefully", async () => {
76
- const request = new NextRequest("http://localhost:3000/api/${moduleName}");
77
-
78
- // TODO: Mock a dependency to trigger an error
79
- const response = await GET(request);
80
-
81
- expect(response.status).toBeDefined();
82
- });
83
- });
84
-
85
- describe("POST handler", () => {
86
- it("should accept valid input and return success", async () => {
87
- const request = new NextRequest("http://localhost:3000/api/${moduleName}", {
88
- method: "POST",
89
- body: JSON.stringify({ /* TODO: add valid request body */ }),
90
- headers: { "Content-Type": "application/json" },
91
- });
92
-
93
- const response = await POST(request);
94
-
95
- expect(response.status).toBe(200);
96
- });
97
-
98
- it("should reject invalid input", async () => {
99
- const request = new NextRequest("http://localhost:3000/api/${moduleName}", {
100
- method: "POST",
101
- body: JSON.stringify({}),
102
- headers: { "Content-Type": "application/json" },
103
- });
104
-
105
- const response = await POST(request);
106
-
107
- // TODO: Assert the expected error status code
108
- expect(response.status).toBeDefined();
109
- });
110
- });
111
- });
112
- `;
113
- }
114
- /**
115
- * Test stub for React components using React Testing Library patterns.
116
- * Includes render test and basic interaction test.
117
- */
118
- export function reactComponentTemplate(sourcePath) {
119
- const moduleName = extractModuleName(sourcePath);
120
- // Capitalize first letter for component name convention
121
- const componentName = moduleName.charAt(0).toUpperCase() + moduleName.slice(1);
122
- const testPath = deriveTestPath(sourcePath);
123
- const importPath = computeRelativeImport(testPath, sourcePath);
124
- return `import { describe, it, expect } from "vitest";
125
- import { render, screen } from "@testing-library/react";
126
- import userEvent from "@testing-library/user-event";
127
-
128
- // TODO: Update import to match the actual default/named export
129
- import { ${componentName} } from "${importPath}.js";
130
-
131
- describe("${componentName} component", () => {
132
- it("should render without crashing", () => {
133
- render(<${componentName} />);
134
-
135
- // TODO: Replace with an actual text or role query from the component
136
- expect(screen.getByRole("heading")).toBeDefined();
137
- });
138
-
139
- it("should display expected content", () => {
140
- render(<${componentName} />);
141
-
142
- // TODO: Assert on the expected text or elements
143
- expect(document.body.textContent).toBeTruthy();
144
- });
145
-
146
- it("should handle user interaction", async () => {
147
- const user = userEvent.setup();
148
- render(<${componentName} />);
149
-
150
- // TODO: Replace with an actual interactive element and expected outcome
151
- const button = screen.queryByRole("button");
152
- if (button) {
153
- await user.click(button);
154
- // TODO: Assert the expected state change after interaction
155
- }
156
- });
157
- });
158
- `;
159
- }
160
- /**
161
- * Test stub for pure utility/helper functions.
162
- * Input/output pattern with describe blocks.
163
- */
164
- export function utilityTemplate(sourcePath) {
165
- const moduleName = extractModuleName(sourcePath);
166
- const testPath = deriveTestPath(sourcePath);
167
- const importPath = computeRelativeImport(testPath, sourcePath);
168
- return `import { describe, it, expect } from "vitest";
169
-
170
- // TODO: Update imports to match the actual exports from the source module
171
- import { ${moduleName} } from "${importPath}.js";
172
-
173
- describe("${moduleName}", () => {
174
- describe("when given valid input", () => {
175
- it("should return the expected output", () => {
176
- // TODO: Replace with actual input and expected output
177
- const input = undefined;
178
- const result = ${moduleName}(input);
179
-
180
- expect(result).toBeDefined();
181
- });
182
- });
183
-
184
- describe("when given edge-case input", () => {
185
- it("should handle empty input", () => {
186
- // TODO: Replace with actual edge-case input
187
- const result = ${moduleName}(undefined);
188
-
189
- expect(result).toBeDefined();
190
- });
191
-
192
- it("should handle null or undefined", () => {
193
- // TODO: Test null/undefined handling if applicable
194
- expect(() => ${moduleName}(null as never)).not.toThrow();
195
- });
196
- });
197
-
198
- describe("when given invalid input", () => {
199
- it("should throw or return an error indicator", () => {
200
- // TODO: Replace with actual invalid input
201
- const invalidInput = undefined;
202
-
203
- // TODO: Assert either a throw or an error return value
204
- expect(() => ${moduleName}(invalidInput)).toBeDefined();
205
- });
206
- });
207
- });
208
- `;
209
- }
210
- /**
211
- * Test stub for Express routes using supertest patterns.
212
- * Tests GET and POST endpoints.
213
- */
214
- export function expressRouteTemplate(sourcePath) {
215
- const moduleName = extractModuleName(sourcePath);
216
- const testPath = deriveTestPath(sourcePath);
217
- const importPath = computeRelativeImport(testPath, sourcePath);
218
- return `import { describe, it, expect, beforeAll, afterAll } from "vitest";
219
- import request from "supertest";
220
- import express from "express";
221
-
222
- // TODO: Update import to match the actual export (router or route handler)
223
- import { router } from "${importPath}.js";
224
-
225
- describe("${moduleName} routes", () => {
226
- const app = express();
227
- app.use(express.json());
228
- // TODO: Update the mount path to match the actual route prefix
229
- app.use("/${moduleName}", router);
230
-
231
- describe("GET /${moduleName}", () => {
232
- it("should return 200 and a valid response", async () => {
233
- const res = await request(app).get("/${moduleName}");
234
-
235
- expect(res.status).toBe(200);
236
- expect(res.body).toBeDefined();
237
- });
238
-
239
- it("should return the expected data structure", async () => {
240
- const res = await request(app).get("/${moduleName}");
241
-
242
- // TODO: Assert the shape of the response body
243
- expect(res.body).toBeDefined();
244
- });
245
- });
246
-
247
- describe("POST /${moduleName}", () => {
248
- it("should accept valid input and return 201", async () => {
249
- const res = await request(app)
250
- .post("/${moduleName}")
251
- .send({ /* TODO: add valid request body */ });
252
-
253
- expect(res.status).toBe(201);
254
- });
255
-
256
- it("should reject invalid input with 400", async () => {
257
- const res = await request(app)
258
- .post("/${moduleName}")
259
- .send({});
260
-
261
- // TODO: Assert the expected error response
262
- expect(res.status).toBe(400);
263
- });
264
- });
265
- });
266
- `;
267
- }
268
- // ---------------------------------------------------------------------------
269
- // Dispatcher
270
- // ---------------------------------------------------------------------------
271
- /**
272
- * Select the right template based on the file category and detected app framework.
273
- *
274
- * @param sourcePath - Path to the source file being tested
275
- * @param category - From TestCategory.name: "api-routes", "components", "utils",
276
- * "middleware", "models", "other"
277
- * @param appFramework - From TestAnalysisReport.framework.appFramework:
278
- * "nextjs-app", "nextjs-pages", "react-vite", "express",
279
- * "plain-ts", "unknown"
280
- */
281
- export function generateTestTemplate(sourcePath, category, appFramework) {
282
- // API routes: pick template based on the app framework
283
- if (category === "api-routes") {
284
- if (appFramework === "nextjs-app" || appFramework === "nextjs-pages") {
285
- return nextjsApiRouteTemplate(sourcePath);
286
- }
287
- if (appFramework === "express") {
288
- return expressRouteTemplate(sourcePath);
289
- }
290
- // Fallback: use utility template for unknown API route frameworks
291
- return utilityTemplate(sourcePath);
292
- }
293
- // Components: React component template for React-based frameworks
294
- if (category === "components") {
295
- if (appFramework === "nextjs-app" ||
296
- appFramework === "nextjs-pages" ||
297
- appFramework === "react-vite") {
298
- return reactComponentTemplate(sourcePath);
299
- }
300
- // Non-React components fall back to utility template
301
- return utilityTemplate(sourcePath);
302
- }
303
- // Middleware: Express middleware uses express template, others use utility
304
- if (category === "middleware") {
305
- if (appFramework === "express") {
306
- return expressRouteTemplate(sourcePath);
307
- }
308
- return utilityTemplate(sourcePath);
309
- }
310
- // Utils, models, other: all use the utility template
311
- return utilityTemplate(sourcePath);
312
- }
313
- //# sourceMappingURL=test-templates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-templates.js","sourceRoot":"","sources":["../../src/setup/test-templates.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,iDAAiD;AACjD,kFAAkF;AAElF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEtE,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;GAGG;AACH,SAAS,iBAAiB,CAAC,UAAkB;IAC3C,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACpD,kCAAkC;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACtE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,YAAoB,EACpB,cAAsB;IAEtB,MAAM,OAAO,GAAG,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AAC,CAAC;IACrC,CAAC;IAED,qDAAqD;IACrD,OAAO,eAAe,CAAC,UAAU,CAAC,CAAC;AACrC,CAAC"}
@@ -1,34 +0,0 @@
1
- import type { PRDData } from "./templates.js";
2
- /**
3
- * Generates a complete PRD markdown document from validated PRD data.
4
- */
5
- export declare function generatePRD(data: PRDData): string;
6
- /**
7
- * Generates a partial PRD from incomplete data (for incremental updates during interview).
8
- * Fills missing fields with placeholders.
9
- */
10
- export declare function generateDraftPRD(data: Partial<PRDData>): string;
11
- /**
12
- * Validates PRD data, generates markdown, and writes to disk.
13
- */
14
- export declare function writePRDToFile(data: PRDData, outputPath: string): void;
15
- export interface WorktreePRDResult {
16
- /** Absolute path where the PRD was written in the worktree. */
17
- prdPath: string;
18
- /** Relative path from the worktree root (used for merging back). */
19
- relativePath: string;
20
- }
21
- /**
22
- * Write a PRD to a worktree directory.
23
- *
24
- * Validates and generates the PRD markdown, then writes it to
25
- * `<worktreePath>/<relativePrdPath>`. Returns both the absolute path
26
- * and the relative path so callers can locate the file or merge it
27
- * back to the main working tree.
28
- *
29
- * @param data - The PRD data to generate and write.
30
- * @param worktreePath - Absolute path to the worktree root.
31
- * @param relativePrdPath - Path relative to the worktree root where
32
- * the PRD should be written (e.g. "tasks/prd.md").
33
- */
34
- export declare function writePRDToWorktree(data: PRDData, worktreePath: string, relativePrdPath: string): WorktreePRDResult;
@@ -1,227 +0,0 @@
1
- import { writeFileSync, mkdirSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
- import { validatePRD } from "./templates.js";
4
- // ── Section Generators ───────────────────────────────────────────────
5
- function renderHeader(data) {
6
- const lines = [
7
- `# ${data.project} — Specification`,
8
- "",
9
- `**Project:** ${data.project}`,
10
- `**Status:** ${data.status}`,
11
- `**Branch:** ${data.branch}`,
12
- `**Created:** ${data.created}`,
13
- `**Assigned To:** ${data.assignedTo}`,
14
- ];
15
- if (data.linearProject) {
16
- lines.push(`**Linear Project:** ${data.linearProject}`);
17
- }
18
- return lines.join("\n");
19
- }
20
- function renderOverview(overview) {
21
- return `## Overview\n\n${overview}`;
22
- }
23
- function renderProblemStatement(problemStatement) {
24
- return `## Problem Statement\n\n${problemStatement}`;
25
- }
26
- function renderScope(scope) {
27
- const sections = ["## Scope"];
28
- sections.push("\n### In Scope");
29
- for (const item of scope.inScope) {
30
- sections.push(`- ${item}`);
31
- }
32
- sections.push("\n### Out of Scope");
33
- for (const item of scope.outOfScope) {
34
- sections.push(`- ${item}`);
35
- }
36
- sections.push("\n### Sacred / Do NOT Touch");
37
- for (const item of scope.sacred) {
38
- sections.push(`- ${item}`);
39
- }
40
- return sections.join("\n");
41
- }
42
- function renderUserStory(story) {
43
- const lines = [
44
- `### US-${story.id}: ${story.title}`,
45
- `**Description:** ${story.description}`,
46
- "**Acceptance Criteria:**",
47
- ];
48
- for (const criterion of story.acceptanceCriteria) {
49
- lines.push(`- [ ] ${criterion}`);
50
- }
51
- return lines.join("\n");
52
- }
53
- function renderUserStories(stories) {
54
- const sections = ["## User Stories", ""];
55
- for (const story of stories) {
56
- sections.push(renderUserStory(story));
57
- sections.push("");
58
- }
59
- return sections.join("\n").trimEnd();
60
- }
61
- function renderTechnicalDesign(design) {
62
- const sections = ["## Technical Design"];
63
- if (design.projectStructure) {
64
- sections.push(`\n### Project Structure\n${design.projectStructure}`);
65
- }
66
- if (design.keyTypes) {
67
- sections.push(`\n### Key Types\n${design.keyTypes}`);
68
- }
69
- if (design.dependencies && design.dependencies.length > 0) {
70
- sections.push("\n### Dependencies");
71
- for (const dep of design.dependencies) {
72
- sections.push(`- ${dep}`);
73
- }
74
- }
75
- if (design.existingCode) {
76
- sections.push(`\n### Existing Code\n${design.existingCode}`);
77
- }
78
- return sections.join("\n");
79
- }
80
- function renderMilestone(milestone) {
81
- const lines = [
82
- `### Milestone ${milestone.number}: ${milestone.name}`,
83
- `**Assigned To:** ${milestone.assignedTo}`,
84
- `**Goal:** ${milestone.goal}`,
85
- ];
86
- if (milestone.dependsOn && milestone.dependsOn.length > 0) {
87
- lines.push(`**dependsOn:** ${milestone.dependsOn.join(", ")}`);
88
- }
89
- lines.push("");
90
- for (const wave of milestone.waves) {
91
- const agentCount = wave.agents.length;
92
- lines.push(`**Wave ${wave.waveNumber} (${agentCount} agent${agentCount !== 1 ? "s" : ""} parallel):**`);
93
- for (let i = 0; i < wave.agents.length; i++) {
94
- const agent = wave.agents[i];
95
- lines.push(`${i + 1}. **${agent.name}**: ${agent.task}`);
96
- if (agent.files.length > 0) {
97
- lines.push(` - Files: ${agent.files.join(", ")}`);
98
- }
99
- }
100
- lines.push("");
101
- }
102
- if (milestone.verificationCommands.length > 0) {
103
- lines.push("**Verification:**");
104
- lines.push("```bash");
105
- for (const cmd of milestone.verificationCommands) {
106
- lines.push(cmd);
107
- }
108
- lines.push("```");
109
- }
110
- return lines.join("\n");
111
- }
112
- function renderMilestones(milestones) {
113
- const sections = ["## Implementation Milestones", ""];
114
- for (const milestone of milestones) {
115
- sections.push(renderMilestone(milestone));
116
- sections.push("");
117
- sections.push("---");
118
- sections.push("");
119
- }
120
- // Remove trailing separator
121
- if (sections.length > 2) {
122
- sections.pop(); // empty line
123
- sections.pop(); // ---
124
- }
125
- return sections.join("\n").trimEnd();
126
- }
127
- function renderVerification(verification) {
128
- const sections = ["## Verification"];
129
- sections.push("\n### Per-Milestone");
130
- for (const item of verification.perMilestone) {
131
- sections.push(`- ${item}`);
132
- }
133
- sections.push("\n### Overall");
134
- for (const item of verification.overall) {
135
- sections.push(`- ${item}`);
136
- }
137
- return sections.join("\n");
138
- }
139
- // ── Public API ───────────────────────────────────────────────────────
140
- /**
141
- * Generates a complete PRD markdown document from validated PRD data.
142
- */
143
- export function generatePRD(data) {
144
- const sections = [
145
- renderHeader(data),
146
- renderOverview(data.overview),
147
- renderProblemStatement(data.problemStatement),
148
- renderScope(data.scope),
149
- renderUserStories(data.userStories),
150
- renderTechnicalDesign(data.technicalDesign),
151
- renderMilestones(data.milestones),
152
- renderVerification(data.verification),
153
- ];
154
- return sections.join("\n\n") + "\n";
155
- }
156
- /**
157
- * Generates a partial PRD from incomplete data (for incremental updates during interview).
158
- * Fills missing fields with placeholders.
159
- */
160
- export function generateDraftPRD(data) {
161
- const sections = [];
162
- // Header — always present
163
- const project = data.project ?? "Untitled Project";
164
- const headerLines = [
165
- `# ${project} — Specification`,
166
- "",
167
- `**Project:** ${project}`,
168
- `**Status:** ${data.status ?? "Draft"}`,
169
- `**Branch:** ${data.branch ?? "TBD"}`,
170
- `**Created:** ${data.created ?? new Date().toISOString().split("T")[0]}`,
171
- `**Assigned To:** ${data.assignedTo ?? "TBD"}`,
172
- ];
173
- if (data.linearProject) {
174
- headerLines.push(`**Linear Project:** ${data.linearProject}`);
175
- }
176
- sections.push(headerLines.join("\n"));
177
- if (data.overview) {
178
- sections.push(renderOverview(data.overview));
179
- }
180
- if (data.problemStatement) {
181
- sections.push(renderProblemStatement(data.problemStatement));
182
- }
183
- if (data.scope) {
184
- sections.push(renderScope(data.scope));
185
- }
186
- if (data.userStories && data.userStories.length > 0) {
187
- sections.push(renderUserStories(data.userStories));
188
- }
189
- if (data.technicalDesign) {
190
- sections.push(renderTechnicalDesign(data.technicalDesign));
191
- }
192
- if (data.milestones && data.milestones.length > 0) {
193
- sections.push(renderMilestones(data.milestones));
194
- }
195
- if (data.verification) {
196
- sections.push(renderVerification(data.verification));
197
- }
198
- return sections.join("\n\n") + "\n";
199
- }
200
- /**
201
- * Validates PRD data, generates markdown, and writes to disk.
202
- */
203
- export function writePRDToFile(data, outputPath) {
204
- const validated = validatePRD(data);
205
- const markdown = generatePRD(validated);
206
- mkdirSync(dirname(outputPath), { recursive: true });
207
- writeFileSync(outputPath, markdown, "utf-8");
208
- }
209
- /**
210
- * Write a PRD to a worktree directory.
211
- *
212
- * Validates and generates the PRD markdown, then writes it to
213
- * `<worktreePath>/<relativePrdPath>`. Returns both the absolute path
214
- * and the relative path so callers can locate the file or merge it
215
- * back to the main working tree.
216
- *
217
- * @param data - The PRD data to generate and write.
218
- * @param worktreePath - Absolute path to the worktree root.
219
- * @param relativePrdPath - Path relative to the worktree root where
220
- * the PRD should be written (e.g. "tasks/prd.md").
221
- */
222
- export function writePRDToWorktree(data, worktreePath, relativePrdPath) {
223
- const prdPath = join(worktreePath, relativePrdPath);
224
- writePRDToFile(data, prdPath);
225
- return { prdPath, relativePath: relativePrdPath };
226
- }
227
- //# sourceMappingURL=generator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/spec/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,wEAAwE;AAExE,SAAS,YAAY,CAAC,IAAa;IACjC,MAAM,KAAK,GAAG;QACZ,KAAK,IAAI,CAAC,OAAO,kBAAkB;QACnC,EAAE;QACF,gBAAgB,IAAI,CAAC,OAAO,EAAE;QAC9B,eAAe,IAAI,CAAC,MAAM,EAAE;QAC5B,eAAe,IAAI,CAAC,MAAM,EAAE;QAC5B,gBAAgB,IAAI,CAAC,OAAO,EAAE;QAC9B,oBAAoB,IAAI,CAAC,UAAU,EAAE;KACtC,CAAC;IACF,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,QAAgB;IACtC,OAAO,kBAAkB,QAAQ,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,sBAAsB,CAAC,gBAAwB;IACtD,OAAO,2BAA2B,gBAAgB,EAAE,CAAC;AACvD,CAAC;AAED,SAAS,WAAW,CAAC,KAAuB;IAC1C,M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