@wrongstack/sdd 0.286.0 → 0.289.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.
- package/dist/index.js +85 -0
- package/dist/index.js.map +2 -2
- package/dist/task-generator.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -242,6 +242,91 @@ var TaskGenerator = class {
|
|
|
242
242
|
opts;
|
|
243
243
|
async generateFromSpec(spec) {
|
|
244
244
|
const graph = await this.opts.taskTracker.createGraph(spec.id, spec.title);
|
|
245
|
+
const overviewSection = spec.sections?.find((s) => s.type === "overview");
|
|
246
|
+
if (overviewSection?.content) {
|
|
247
|
+
this.opts.taskTracker.addNode({
|
|
248
|
+
title: `Implement: ${spec.title}`,
|
|
249
|
+
description: overviewSection.content,
|
|
250
|
+
type: "feature",
|
|
251
|
+
priority: "high",
|
|
252
|
+
status: "pending",
|
|
253
|
+
estimateHours: 4
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
257
|
+
const sorted = [...spec.requirements ?? []].sort(
|
|
258
|
+
(a, b) => (priorityOrder[a.priority] ?? 9) - (priorityOrder[b.priority] ?? 9)
|
|
259
|
+
);
|
|
260
|
+
for (const req of sorted) {
|
|
261
|
+
const estimateHours = req.priority === "critical" ? 8 : req.priority === "high" ? 4 : req.priority === "medium" ? 2 : 1;
|
|
262
|
+
const tags = [req.type, req.priority];
|
|
263
|
+
const acLines = (req.acceptanceCriteria ?? []).map((ac) => `- ${ac}`).join("\n");
|
|
264
|
+
const blockedLine = req.blockedBy?.length ? `
|
|
265
|
+
|
|
266
|
+
**Blocked by:** ${req.blockedBy.join(", ")}` : "";
|
|
267
|
+
const description = `${req.description}
|
|
268
|
+
|
|
269
|
+
**Type:** ${req.type}` + (acLines ? `
|
|
270
|
+
|
|
271
|
+
**Acceptance Criteria:**
|
|
272
|
+
${acLines}` : "") + blockedLine;
|
|
273
|
+
const metadata = {};
|
|
274
|
+
if (this.opts.verificationFromAcceptance) {
|
|
275
|
+
const cmd = extractVerificationCommand(req.acceptanceCriteria ?? []);
|
|
276
|
+
if (cmd) metadata.verificationCommand = cmd;
|
|
277
|
+
}
|
|
278
|
+
this.opts.taskTracker.addNode({
|
|
279
|
+
title: req.description,
|
|
280
|
+
description,
|
|
281
|
+
type: "feature",
|
|
282
|
+
priority: req.priority,
|
|
283
|
+
status: "pending",
|
|
284
|
+
estimateHours,
|
|
285
|
+
tags,
|
|
286
|
+
specRequirementId: req.id,
|
|
287
|
+
...Object.keys(metadata).length > 0 ? { metadata } : {}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
if (spec.apiEndpoints?.length) {
|
|
291
|
+
const apiParent = this.opts.taskTracker.addNode({
|
|
292
|
+
title: "API Implementation",
|
|
293
|
+
description: "Implement API endpoints as specified in the spec.",
|
|
294
|
+
type: "feature",
|
|
295
|
+
priority: "high",
|
|
296
|
+
status: "pending",
|
|
297
|
+
estimateHours: 0
|
|
298
|
+
});
|
|
299
|
+
for (const ep of spec.apiEndpoints) {
|
|
300
|
+
const baseHours = 2;
|
|
301
|
+
const authHours = ep.auth ? 1 : 0;
|
|
302
|
+
const reqHours = ep.request ? 1 : 0;
|
|
303
|
+
this.opts.taskTracker.addNode({
|
|
304
|
+
title: `${ep.method} ${ep.path} \u2014 ${ep.description}`,
|
|
305
|
+
description: `${ep.method} ${ep.path}: ${ep.description}`,
|
|
306
|
+
type: "feature",
|
|
307
|
+
priority: "medium",
|
|
308
|
+
status: "pending",
|
|
309
|
+
estimateHours: baseHours + authHours + reqHours,
|
|
310
|
+
parentId: apiParent.id
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
this.opts.taskTracker.addNode({
|
|
315
|
+
title: "Write Tests",
|
|
316
|
+
description: "Write comprehensive tests for the implemented features.",
|
|
317
|
+
type: "test",
|
|
318
|
+
priority: "high",
|
|
319
|
+
status: "pending",
|
|
320
|
+
estimateHours: 4
|
|
321
|
+
});
|
|
322
|
+
this.opts.taskTracker.addNode({
|
|
323
|
+
title: "Update Documentation",
|
|
324
|
+
description: "Update project documentation to reflect the changes.",
|
|
325
|
+
type: "docs",
|
|
326
|
+
priority: "low",
|
|
327
|
+
status: "pending",
|
|
328
|
+
estimateHours: 2
|
|
329
|
+
});
|
|
245
330
|
return graph;
|
|
246
331
|
}
|
|
247
332
|
async generateSubtasks(parentTaskId, spec) {
|