specweave 0.28.17 → 0.28.19
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/plugins/specweave-ado/lib/ado-board-resolver.d.ts +94 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.js +219 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts +6 -11
- package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.js +6 -11
- package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-increment-sync-cli.d.ts +19 -0
- package/dist/plugins/specweave-github/lib/github-increment-sync-cli.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-increment-sync-cli.js +380 -0
- package/dist/plugins/specweave-github/lib/github-increment-sync-cli.js.map +1 -0
- package/dist/plugins/specweave-github/lib/increment-issue-builder.d.ts +92 -0
- package/dist/plugins/specweave-github/lib/increment-issue-builder.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/increment-issue-builder.js +349 -0
- package/dist/plugins/specweave-github/lib/increment-issue-builder.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.d.ts +50 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.js +84 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.js.map +1 -0
- package/dist/src/cli/commands/import-external.d.ts.map +1 -1
- package/dist/src/cli/commands/import-external.js +12 -7
- package/dist/src/cli/commands/import-external.js.map +1 -1
- package/dist/src/cli/helpers/init/external-import.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/external-import.js +122 -17
- package/dist/src/cli/helpers/init/external-import.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado-area-selection.d.ts +65 -0
- package/dist/src/cli/helpers/issue-tracker/ado-area-selection.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-area-selection.js +278 -0
- package/dist/src/cli/helpers/issue-tracker/ado-area-selection.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/jira-board-selection.d.ts +64 -0
- package/dist/src/cli/helpers/issue-tracker/jira-board-selection.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/jira-board-selection.js +251 -0
- package/dist/src/cli/helpers/issue-tracker/jira-board-selection.js.map +1 -0
- package/dist/src/core/ac-test-validator-cli.js +4 -1
- package/dist/src/core/ac-test-validator-cli.js.map +1 -1
- package/dist/src/core/ac-test-validator.d.ts.map +1 -1
- package/dist/src/core/ac-test-validator.js +4 -1
- package/dist/src/core/ac-test-validator.js.map +1 -1
- package/dist/src/core/types/increment-metadata.d.ts +75 -0
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
- package/dist/src/core/types/sync-profile.d.ts +137 -5
- package/dist/src/core/types/sync-profile.d.ts.map +1 -1
- package/dist/src/core/types/sync-profile.js +63 -0
- package/dist/src/core/types/sync-profile.js.map +1 -1
- package/dist/src/importers/external-importer.d.ts +25 -0
- package/dist/src/importers/external-importer.d.ts.map +1 -1
- package/dist/src/importers/github-importer.d.ts.map +1 -1
- package/dist/src/importers/github-importer.js +5 -3
- package/dist/src/importers/github-importer.js.map +1 -1
- package/dist/src/importers/item-converter.d.ts +51 -0
- package/dist/src/importers/item-converter.d.ts.map +1 -1
- package/dist/src/importers/item-converter.js +39 -12
- package/dist/src/importers/item-converter.js.map +1 -1
- package/dist/src/init/repo/types.d.ts +1 -1
- package/dist/src/living-docs/fs-id-allocator.d.ts +72 -3
- package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
- package/dist/src/living-docs/fs-id-allocator.js +142 -16
- package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
- package/dist/src/locales/de/cli.json +14 -0
- package/dist/src/locales/es/cli.json +14 -0
- package/dist/src/locales/fr/cli.json +14 -0
- package/dist/src/locales/ja/cli.json +14 -0
- package/dist/src/locales/ko/cli.json +14 -0
- package/dist/src/locales/pt/cli.json +14 -0
- package/dist/src/locales/ru/cli.json +14 -0
- package/dist/src/locales/zh/cli.json +14 -0
- package/dist/src/utils/chalk-fallback.d.ts +38 -0
- package/dist/src/utils/chalk-fallback.d.ts.map +1 -0
- package/dist/src/utils/chalk-fallback.js +118 -0
- package/dist/src/utils/chalk-fallback.js.map +1 -0
- package/dist/src/utils/project-id-generator.d.ts +127 -0
- package/dist/src/utils/project-id-generator.d.ts.map +1 -0
- package/dist/src/utils/project-id-generator.js +228 -0
- package/dist/src/utils/project-id-generator.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/agents/pm/AGENT.md +202 -0
- package/plugins/specweave/commands/specweave-import-external.md +5 -3
- package/plugins/specweave/commands/specweave-sync-docs.md +6 -2
- package/plugins/specweave/hooks/pre-task-completion.sh +35 -17
- package/plugins/specweave/lib/vendor/core/ac-test-validator-cli.d.ts +16 -0
- package/plugins/specweave/lib/vendor/core/ac-test-validator-cli.js +121 -0
- package/plugins/specweave/lib/vendor/core/ac-test-validator-cli.js.map +1 -0
- package/plugins/specweave/lib/vendor/core/ac-test-validator.d.ts +111 -0
- package/plugins/specweave/lib/vendor/core/ac-test-validator.js +295 -0
- package/plugins/specweave/lib/vendor/core/ac-test-validator.js.map +1 -0
- package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +75 -0
- package/plugins/specweave/lib/vendor/utils/chalk-fallback.d.ts +38 -0
- package/plugins/specweave/lib/vendor/utils/chalk-fallback.js +118 -0
- package/plugins/specweave/lib/vendor/utils/chalk-fallback.js.map +1 -0
- package/plugins/specweave/lib/vendor/utils/fs-native.d.ts +179 -0
- package/plugins/specweave/lib/vendor/utils/fs-native.js +319 -0
- package/plugins/specweave/lib/vendor/utils/fs-native.js.map +1 -0
- package/plugins/specweave/skills/code-reviewer/SKILL.md +1 -1
- package/plugins/specweave/skills/docs-updater/SKILL.md +61 -0
- package/plugins/specweave/skills/increment-planner/SKILL.md +10 -335
- package/plugins/specweave/skills/increment-planner/templates/metadata.json +13 -0
- package/plugins/specweave/skills/increment-planner/templates/plan.md +50 -0
- package/plugins/specweave/skills/increment-planner/templates/spec-multi-project.md +86 -0
- package/plugins/specweave/skills/increment-planner/templates/spec-single-project.md +50 -0
- package/plugins/specweave/skills/increment-planner/templates/tasks-multi-project.md +86 -0
- package/plugins/specweave/skills/increment-planner/templates/tasks-single-project.md +48 -0
- package/plugins/specweave-ado/commands/specweave-ado-import-areas.md +358 -0
- package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +1 -0
- package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +1 -0
- package/plugins/specweave-core/skills/code-quality/SKILL.md +1 -0
- package/plugins/specweave-core/skills/design-patterns/SKILL.md +1 -0
- package/plugins/specweave-core/skills/software-architecture/SKILL.md +1 -0
- package/plugins/specweave-github/commands/specweave-github-cleanup-duplicates.md +14 -10
- package/plugins/specweave-github/commands/specweave-github-sync.md +57 -0
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +68 -0
- package/plugins/specweave-github/lib/github-feature-sync.ts +6 -11
- package/plugins/specweave-github/lib/github-increment-sync-cli.js +343 -0
- package/plugins/specweave-github/lib/github-increment-sync-cli.ts +484 -0
- package/plugins/specweave-github/lib/increment-issue-builder.js +368 -0
- package/plugins/specweave-github/lib/increment-issue-builder.ts +471 -0
- package/plugins/specweave-github/skills/github-issue-standard/SKILL.md +19 -24
- package/plugins/specweave-infrastructure/agents/observability-engineer/AGENT.md +15 -23
- package/plugins/specweave-jira/commands/specweave-jira-import-boards.md +331 -0
- package/plugins/specweave-ml/agents/data-scientist/AGENT.md +16 -20
- package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +18 -19
- package/plugins/specweave-ml/skills/{ml-pipeline-workflow → mlops-dag-builder}/SKILL.md +18 -14
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +102 -0
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +1 -1
- package/plugins/specweave-ui/skills/ui-testing/SKILL.md +10 -122
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts +0 -70
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts.map +0 -1
- package/dist/plugins/specweave-github/lib/epic-content-builder.js +0 -258
- package/dist/plugins/specweave-github/lib/epic-content-builder.js.map +0 -1
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts +0 -83
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts.map +0 -1
- package/dist/plugins/specweave-github/lib/github-epic-sync.js +0 -466
- package/dist/plugins/specweave-github/lib/github-epic-sync.js.map +0 -1
- package/plugins/specweave-github/lib/epic-content-builder.js +0 -265
- package/plugins/specweave-github/lib/epic-content-builder.ts +0 -376
- package/plugins/specweave-github/lib/github-epic-sync.js +0 -488
- package/plugins/specweave-github/lib/github-epic-sync.ts +0 -715
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { readFile } from "fs/promises";
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
import * as yaml from "yaml";
|
|
5
|
+
class IncrementIssueBuilder {
|
|
6
|
+
constructor(incrementPath, projectRoot) {
|
|
7
|
+
this.incrementPath = incrementPath;
|
|
8
|
+
this.projectRoot = projectRoot;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parse increment spec.md and extract all data
|
|
12
|
+
*/
|
|
13
|
+
async parse() {
|
|
14
|
+
const specPath = path.join(this.incrementPath, "spec.md");
|
|
15
|
+
if (!existsSync(specPath)) {
|
|
16
|
+
throw new Error(`spec.md not found at ${specPath}`);
|
|
17
|
+
}
|
|
18
|
+
const content = await readFile(specPath, "utf-8");
|
|
19
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
20
|
+
if (!frontmatterMatch) {
|
|
21
|
+
throw new Error("spec.md missing YAML frontmatter");
|
|
22
|
+
}
|
|
23
|
+
const frontmatter = yaml.parse(frontmatterMatch[1]);
|
|
24
|
+
const bodyContent = content.slice(frontmatterMatch[0].length).trim();
|
|
25
|
+
const titleMatch = bodyContent.match(/^#\s+(.+)$/m);
|
|
26
|
+
const title = titleMatch ? titleMatch[1].trim() : frontmatter.increment;
|
|
27
|
+
const problemStatement = this.extractSection(bodyContent, "Problem Statement");
|
|
28
|
+
const userStories = this.extractUserStories(bodyContent);
|
|
29
|
+
const outOfScopeSection = this.extractSection(bodyContent, "Out of Scope");
|
|
30
|
+
const outOfScope = outOfScopeSection.split("\n").filter((line) => line.startsWith("-")).map((line) => line.replace(/^-\s*/, "").trim());
|
|
31
|
+
const tasks = await this.extractTasks();
|
|
32
|
+
return {
|
|
33
|
+
frontmatter,
|
|
34
|
+
title,
|
|
35
|
+
problemStatement,
|
|
36
|
+
userStories,
|
|
37
|
+
tasks,
|
|
38
|
+
outOfScope
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Extract tasks from tasks.md
|
|
43
|
+
*/
|
|
44
|
+
async extractTasks() {
|
|
45
|
+
const tasksPath = path.join(this.incrementPath, "tasks.md");
|
|
46
|
+
if (!existsSync(tasksPath)) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const content = await readFile(tasksPath, "utf-8");
|
|
51
|
+
const tasks = [];
|
|
52
|
+
const taskBlocks = content.split(/(?=###\s+T-\d+)/);
|
|
53
|
+
for (const block of taskBlocks) {
|
|
54
|
+
const headerMatch = block.match(/###\s+(T-\d+):\s*(.+)/);
|
|
55
|
+
if (!headerMatch) continue;
|
|
56
|
+
const id = headerMatch[1];
|
|
57
|
+
const title = headerMatch[2].trim();
|
|
58
|
+
const statusMatch = block.match(/\*\*Status\*\*:\s*\[([x\s])\]/i);
|
|
59
|
+
const completed = statusMatch ? statusMatch[1].toLowerCase() === "x" : false;
|
|
60
|
+
const userStoryMatch = block.match(/\*\*User Story\*\*:\s*([^\n]+)/i);
|
|
61
|
+
const satisfiesMatch = block.match(/\*\*Satisfies ACs?\*\*:\s*([^\n]+)/i);
|
|
62
|
+
let userStories = [];
|
|
63
|
+
if (userStoryMatch) {
|
|
64
|
+
userStories = userStoryMatch[1].split(",").map((s) => s.trim());
|
|
65
|
+
} else if (satisfiesMatch) {
|
|
66
|
+
const acIds = satisfiesMatch[1].split(",").map((s) => s.trim());
|
|
67
|
+
const usIds = /* @__PURE__ */ new Set();
|
|
68
|
+
for (const ac of acIds) {
|
|
69
|
+
const usMatch = ac.match(/AC-(US\d+)-/i);
|
|
70
|
+
if (usMatch) {
|
|
71
|
+
usIds.add(usMatch[1]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
userStories = Array.from(usIds);
|
|
75
|
+
}
|
|
76
|
+
const priorityMatch = block.match(/\*\*Priority\*\*:\s*(P\d)/i);
|
|
77
|
+
const priority = priorityMatch ? priorityMatch[1] : void 0;
|
|
78
|
+
tasks.push({
|
|
79
|
+
id,
|
|
80
|
+
title,
|
|
81
|
+
completed,
|
|
82
|
+
userStories,
|
|
83
|
+
priority
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return tasks;
|
|
87
|
+
} catch {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Extract a section by heading
|
|
93
|
+
*/
|
|
94
|
+
extractSection(content, heading) {
|
|
95
|
+
const regex = new RegExp(`##\\s+${heading}\\s*\\n([\\s\\S]*?)(?=\\n##\\s|$)`, "i");
|
|
96
|
+
const match = content.match(regex);
|
|
97
|
+
return match ? match[1].trim() : "";
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Extract user stories from spec.md
|
|
101
|
+
*/
|
|
102
|
+
extractUserStories(content) {
|
|
103
|
+
const stories = [];
|
|
104
|
+
const userStoriesSection = this.extractSection(content, "User Stories");
|
|
105
|
+
if (!userStoriesSection) {
|
|
106
|
+
return stories;
|
|
107
|
+
}
|
|
108
|
+
const storyBlocks = userStoriesSection.split(/(?=###\s+US-\d+)/);
|
|
109
|
+
for (const block of storyBlocks) {
|
|
110
|
+
const headerMatch = block.match(/###\s+(US-\d+):\s*(.+)/);
|
|
111
|
+
if (!headerMatch) continue;
|
|
112
|
+
const id = headerMatch[1];
|
|
113
|
+
const title = headerMatch[2].trim();
|
|
114
|
+
const asAMatch = block.match(/\*\*As a\*\*\s+([^\n]+)/i);
|
|
115
|
+
const iWantMatch = block.match(/\*\*I want\*\*\s+([^\n]+)/i);
|
|
116
|
+
const soThatMatch = block.match(/\*\*So that\*\*\s+([^\n]+)/i);
|
|
117
|
+
const acceptanceCriteria = this.extractAcceptanceCriteria(block, id);
|
|
118
|
+
stories.push({
|
|
119
|
+
id,
|
|
120
|
+
title,
|
|
121
|
+
asA: asAMatch ? asAMatch[1].trim().replace(/,$/, "") : "",
|
|
122
|
+
iWant: iWantMatch ? iWantMatch[1].trim().replace(/,$/, "") : "",
|
|
123
|
+
soThat: soThatMatch ? soThatMatch[1].trim().replace(/\.$/, "") : "",
|
|
124
|
+
acceptanceCriteria
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return stories;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Extract acceptance criteria from a user story block
|
|
131
|
+
*/
|
|
132
|
+
extractAcceptanceCriteria(block, userStoryId) {
|
|
133
|
+
const criteria = [];
|
|
134
|
+
const acPattern = /-\s*\[([ x])\]\s*\*\*AC-(US\d+)-(\d+)\*\*:\s*(.+)/gi;
|
|
135
|
+
let match;
|
|
136
|
+
while ((match = acPattern.exec(block)) !== null) {
|
|
137
|
+
const completed = match[1].toLowerCase() === "x";
|
|
138
|
+
const usNum = match[2];
|
|
139
|
+
const acNum = match[3];
|
|
140
|
+
const description = match[4].trim();
|
|
141
|
+
criteria.push({
|
|
142
|
+
id: `AC-${usNum}-${acNum}`,
|
|
143
|
+
description,
|
|
144
|
+
completed
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return criteria;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Build GitHub issue for a single user story
|
|
151
|
+
*/
|
|
152
|
+
buildUserStoryIssue(story, incrementData, githubRepo) {
|
|
153
|
+
const featureId = incrementData.frontmatter.feature_id || this.generateFeatureId(incrementData);
|
|
154
|
+
const incrementId = incrementData.frontmatter.increment;
|
|
155
|
+
const title = `[${featureId}][${story.id}] ${story.title}`;
|
|
156
|
+
let body = "";
|
|
157
|
+
body += `**Feature**: ${featureId}
|
|
158
|
+
`;
|
|
159
|
+
body += `**Status**: ${incrementData.frontmatter.status || "planning"}
|
|
160
|
+
`;
|
|
161
|
+
body += `**Priority**: P1
|
|
162
|
+
`;
|
|
163
|
+
body += `
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
`;
|
|
167
|
+
body += `## User Story
|
|
168
|
+
|
|
169
|
+
`;
|
|
170
|
+
if (story.asA && story.iWant && story.soThat) {
|
|
171
|
+
body += `**As a** ${story.asA}
|
|
172
|
+
`;
|
|
173
|
+
body += `**I want** ${story.iWant}
|
|
174
|
+
`;
|
|
175
|
+
body += `**So that** ${story.soThat}
|
|
176
|
+
|
|
177
|
+
`;
|
|
178
|
+
} else {
|
|
179
|
+
body += `${story.title}
|
|
180
|
+
|
|
181
|
+
`;
|
|
182
|
+
}
|
|
183
|
+
body += `---
|
|
184
|
+
|
|
185
|
+
`;
|
|
186
|
+
body += `## Acceptance Criteria
|
|
187
|
+
|
|
188
|
+
`;
|
|
189
|
+
if (story.acceptanceCriteria.length > 0) {
|
|
190
|
+
const completed = story.acceptanceCriteria.filter((ac) => ac.completed).length;
|
|
191
|
+
const total = story.acceptanceCriteria.length;
|
|
192
|
+
const percentage = total > 0 ? Math.round(completed / total * 100) : 0;
|
|
193
|
+
body += `Progress: ${completed}/${total} criteria met (${percentage}%)
|
|
194
|
+
|
|
195
|
+
`;
|
|
196
|
+
for (const ac of story.acceptanceCriteria) {
|
|
197
|
+
const checkbox = ac.completed ? "[x]" : "[ ]";
|
|
198
|
+
body += `- ${checkbox} **${ac.id}**: ${ac.description}
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
body += "\n";
|
|
202
|
+
} else {
|
|
203
|
+
body += `*No acceptance criteria defined*
|
|
204
|
+
|
|
205
|
+
`;
|
|
206
|
+
}
|
|
207
|
+
body += `---
|
|
208
|
+
|
|
209
|
+
`;
|
|
210
|
+
body += `## Implementation
|
|
211
|
+
|
|
212
|
+
`;
|
|
213
|
+
if (githubRepo) {
|
|
214
|
+
body += `**Increment**: [${incrementId}](https://github.com/${githubRepo}/tree/develop/.specweave/increments/${incrementId})
|
|
215
|
+
|
|
216
|
+
`;
|
|
217
|
+
} else {
|
|
218
|
+
body += `**Increment**: ${incrementId}
|
|
219
|
+
|
|
220
|
+
`;
|
|
221
|
+
}
|
|
222
|
+
body += `---
|
|
223
|
+
|
|
224
|
+
`;
|
|
225
|
+
body += `\u{1F916} Auto-synced by SpecWeave Increment Sync`;
|
|
226
|
+
const labels = ["specweave", "user-story"];
|
|
227
|
+
if (incrementData.frontmatter.type) {
|
|
228
|
+
labels.push(incrementData.frontmatter.type);
|
|
229
|
+
}
|
|
230
|
+
return { title, body, labels };
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Build GitHub issue for the entire increment (epic-style)
|
|
234
|
+
*/
|
|
235
|
+
buildIncrementIssue(incrementData, githubRepo) {
|
|
236
|
+
const featureId = incrementData.frontmatter.feature_id || this.generateFeatureId(incrementData);
|
|
237
|
+
const incrementId = incrementData.frontmatter.increment;
|
|
238
|
+
const title = `[${featureId}] ${incrementData.title}`;
|
|
239
|
+
let body = "";
|
|
240
|
+
body += `**Increment**: ${incrementId}
|
|
241
|
+
`;
|
|
242
|
+
body += `**Status**: ${incrementData.frontmatter.status || "planning"}
|
|
243
|
+
`;
|
|
244
|
+
body += `**Priority**: P0 (Critical)
|
|
245
|
+
`;
|
|
246
|
+
const totalACs = incrementData.userStories.reduce((sum, us) => sum + us.acceptanceCriteria.length, 0);
|
|
247
|
+
const completedACs = incrementData.userStories.reduce(
|
|
248
|
+
(sum, us) => sum + us.acceptanceCriteria.filter((ac) => ac.completed).length,
|
|
249
|
+
0
|
|
250
|
+
);
|
|
251
|
+
const percentage = totalACs > 0 ? Math.round(completedACs / totalACs * 100) : 0;
|
|
252
|
+
body += `**Progress**: ${completedACs}/${totalACs} ACs (${percentage}%)
|
|
253
|
+
`;
|
|
254
|
+
body += `
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
`;
|
|
258
|
+
body += `## Overview
|
|
259
|
+
|
|
260
|
+
`;
|
|
261
|
+
body += incrementData.problemStatement || incrementData.title;
|
|
262
|
+
body += `
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
`;
|
|
267
|
+
body += `## User Stories
|
|
268
|
+
|
|
269
|
+
`;
|
|
270
|
+
for (const story of incrementData.userStories) {
|
|
271
|
+
const usCompleted = story.acceptanceCriteria.filter((ac) => ac.completed).length;
|
|
272
|
+
const usTotal = story.acceptanceCriteria.length;
|
|
273
|
+
const usCheckbox = usCompleted === usTotal && usTotal > 0 ? "[x]" : "[ ]";
|
|
274
|
+
body += `### ${usCheckbox} ${story.id}: ${story.title}
|
|
275
|
+
|
|
276
|
+
`;
|
|
277
|
+
if (story.asA && story.iWant && story.soThat) {
|
|
278
|
+
body += `> **As a** ${story.asA}, **I want** ${story.iWant}, **So that** ${story.soThat}
|
|
279
|
+
|
|
280
|
+
`;
|
|
281
|
+
}
|
|
282
|
+
body += `**Acceptance Criteria:**
|
|
283
|
+
`;
|
|
284
|
+
for (const ac of story.acceptanceCriteria) {
|
|
285
|
+
const checkbox = ac.completed ? "[x]" : "[ ]";
|
|
286
|
+
body += `- ${checkbox} **${ac.id}**: ${ac.description}
|
|
287
|
+
`;
|
|
288
|
+
}
|
|
289
|
+
body += "\n";
|
|
290
|
+
}
|
|
291
|
+
body += `---
|
|
292
|
+
|
|
293
|
+
`;
|
|
294
|
+
if (incrementData.tasks.length > 0) {
|
|
295
|
+
body += `## Tasks
|
|
296
|
+
|
|
297
|
+
`;
|
|
298
|
+
const completedTasks = incrementData.tasks.filter((t) => t.completed).length;
|
|
299
|
+
const totalTasks = incrementData.tasks.length;
|
|
300
|
+
const taskPercentage = totalTasks > 0 ? Math.round(completedTasks / totalTasks * 100) : 0;
|
|
301
|
+
body += `Progress: ${completedTasks}/${totalTasks} tasks (${taskPercentage}%)
|
|
302
|
+
|
|
303
|
+
`;
|
|
304
|
+
for (const task of incrementData.tasks) {
|
|
305
|
+
const checkbox = task.completed ? "[x]" : "[ ]";
|
|
306
|
+
body += `- ${checkbox} **${task.id}**: ${task.title}
|
|
307
|
+
`;
|
|
308
|
+
if (task.priority || task.userStories.length > 0) {
|
|
309
|
+
const parts = [];
|
|
310
|
+
if (task.priority) parts.push(`Priority: ${task.priority}`);
|
|
311
|
+
if (task.userStories.length > 0) parts.push(`User ${task.userStories.length === 1 ? "Story" : "Stories"}: ${task.userStories.join(", ")}`);
|
|
312
|
+
body += ` - ${parts.join(" | ")}
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
body += "\n---\n\n";
|
|
317
|
+
}
|
|
318
|
+
body += `## SpecWeave Increment
|
|
319
|
+
|
|
320
|
+
`;
|
|
321
|
+
if (githubRepo) {
|
|
322
|
+
body += `- **Spec**: [\`spec.md\`](https://github.com/${githubRepo}/blob/develop/.specweave/increments/${incrementId}/spec.md)
|
|
323
|
+
`;
|
|
324
|
+
body += `- **Plan**: [\`plan.md\`](https://github.com/${githubRepo}/blob/develop/.specweave/increments/${incrementId}/plan.md)
|
|
325
|
+
`;
|
|
326
|
+
body += `- **Tasks**: [\`tasks.md\`](https://github.com/${githubRepo}/blob/develop/.specweave/increments/${incrementId}/tasks.md)
|
|
327
|
+
`;
|
|
328
|
+
} else {
|
|
329
|
+
body += `- **Spec**: \`spec.md\`
|
|
330
|
+
`;
|
|
331
|
+
body += `- **Plan**: \`plan.md\`
|
|
332
|
+
`;
|
|
333
|
+
body += `- **Tasks**: \`tasks.md\`
|
|
334
|
+
`;
|
|
335
|
+
}
|
|
336
|
+
body += `
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
`;
|
|
340
|
+
body += `\u{1F916} Auto-synced by SpecWeave Increment Sync`;
|
|
341
|
+
const labels = ["specweave", "increment", "enhancement"];
|
|
342
|
+
if (incrementData.frontmatter.type) {
|
|
343
|
+
labels.push(incrementData.frontmatter.type);
|
|
344
|
+
}
|
|
345
|
+
return { title, body, labels };
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Generate a feature ID if not present in frontmatter
|
|
349
|
+
* Uses date-based format: FS-YY-MM-DD
|
|
350
|
+
*/
|
|
351
|
+
generateFeatureId(incrementData) {
|
|
352
|
+
const incrementNum = incrementData.frontmatter.increment.match(/^(\d+)/)?.[1];
|
|
353
|
+
if (incrementNum) {
|
|
354
|
+
return `FS-${incrementNum.padStart(3, "0")}`;
|
|
355
|
+
}
|
|
356
|
+
const created = incrementData.frontmatter.created;
|
|
357
|
+
if (created) {
|
|
358
|
+
const match = created.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
359
|
+
if (match) {
|
|
360
|
+
return `FS-${match[1].slice(2)}-${match[2]}-${match[3]}`;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return "FS-UNKNOWN";
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
export {
|
|
367
|
+
IncrementIssueBuilder
|
|
368
|
+
};
|