specweave 1.0.338 → 1.0.339

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 (38) hide show
  1. package/dist/plugins/specweave-github/lib/github-batch-sync.js +27 -2
  2. package/dist/plugins/specweave-github/lib/github-batch-sync.js.map +1 -1
  3. package/dist/src/cli/helpers/init/quality-gates-config.d.ts +1 -0
  4. package/dist/src/cli/helpers/init/quality-gates-config.d.ts.map +1 -1
  5. package/dist/src/cli/helpers/init/quality-gates-config.js +9 -0
  6. package/dist/src/cli/helpers/init/quality-gates-config.js.map +1 -1
  7. package/dist/src/core/config/types.d.ts +11 -0
  8. package/dist/src/core/config/types.d.ts.map +1 -1
  9. package/dist/src/core/config/types.js.map +1 -1
  10. package/dist/src/core/increment/completion-validator.d.ts +17 -0
  11. package/dist/src/core/increment/completion-validator.d.ts.map +1 -1
  12. package/dist/src/core/increment/completion-validator.js +123 -1
  13. package/dist/src/core/increment/completion-validator.js.map +1 -1
  14. package/dist/src/core/increment/status-commands.js +2 -2
  15. package/dist/src/core/increment/status-commands.js.map +1 -1
  16. package/dist/src/core/living-docs/sync-helpers/parsers.d.ts.map +1 -1
  17. package/dist/src/core/living-docs/sync-helpers/parsers.js +33 -4
  18. package/dist/src/core/living-docs/sync-helpers/parsers.js.map +1 -1
  19. package/dist/src/core/skills/skill-judge.d.ts +9 -0
  20. package/dist/src/core/skills/skill-judge.d.ts.map +1 -1
  21. package/dist/src/core/skills/skill-judge.js +54 -0
  22. package/dist/src/core/skills/skill-judge.js.map +1 -1
  23. package/dist/src/metrics/utils/tier-classifier.js +3 -3
  24. package/dist/src/metrics/utils/tier-classifier.js.map +1 -1
  25. package/dist/src/utils/clean-env.d.ts +7 -4
  26. package/dist/src/utils/clean-env.d.ts.map +1 -1
  27. package/dist/src/utils/clean-env.js +12 -4
  28. package/dist/src/utils/clean-env.js.map +1 -1
  29. package/package.json +1 -1
  30. package/plugins/specweave/hooks/user-prompt-submit.sh +16 -0
  31. package/plugins/specweave/skills/do/SKILL.md +3 -1
  32. package/plugins/specweave/skills/done/SKILL.md +17 -10
  33. package/plugins/specweave/skills/grill/SKILL.md +29 -6
  34. package/plugins/specweave/skills/judge-llm/SKILL.md +37 -7
  35. package/plugins/specweave-github/lib/github-batch-sync.js +25 -2
  36. package/plugins/specweave-github/lib/github-batch-sync.ts +30 -2
  37. package/src/templates/AGENTS.md.template +8 -11
  38. package/src/templates/CLAUDE.md.template +7 -6
@@ -104,6 +104,10 @@ const US_HEADER_RE = /^###?\s+(US-\d{3,}E?):\s*(.+)$/;
104
104
  const AC_CHECKBOX_RE = /^-\s+\[([ xX])\]\s+\*\*(?<acId>AC-US\d+E?-\d{2})\*\*:\s*(?<desc>.+)$/;
105
105
  // Priority: **Priority**: P1
106
106
  const PRIORITY_RE = /\*\*Priority\*\*:\s*(P[0-3])/;
107
+ // Section headers that end description collection
108
+ const AC_SECTION_RE = /^\*\*(?:Acceptance Criteria|ACs?)\*\*:/i;
109
+ // Metadata lines to exclude from description
110
+ const METADATA_RE = /^\*\*(?:Project|Board|External)\*\*:/i;
107
111
 
108
112
  /**
109
113
  * Parse user stories from spec.md content.
@@ -112,11 +116,15 @@ function parseUserStoriesFromSpec(content: string): UserStoryForSync[] {
112
116
  const lines = content.split('\n');
113
117
  const userStories: UserStoryForSync[] = [];
114
118
  let current: UserStoryForSync | null = null;
119
+ let collectingDescription = false;
115
120
 
116
121
  for (const line of lines) {
117
122
  const usMatch = line.match(US_HEADER_RE);
118
123
  if (usMatch) {
119
- if (current) userStories.push(current);
124
+ if (current) {
125
+ current.description = current.description.trim();
126
+ userStories.push(current);
127
+ }
120
128
  current = {
121
129
  id: usMatch[1],
122
130
  title: usMatch[2],
@@ -125,6 +133,7 @@ function parseUserStoriesFromSpec(content: string): UserStoryForSync[] {
125
133
  status: 'planned',
126
134
  acceptanceCriteria: [],
127
135
  };
136
+ collectingDescription = true;
128
137
  continue;
129
138
  }
130
139
 
@@ -132,6 +141,7 @@ function parseUserStoriesFromSpec(content: string): UserStoryForSync[] {
132
141
 
133
142
  const acMatch = line.match(AC_CHECKBOX_RE);
134
143
  if (acMatch?.groups) {
144
+ collectingDescription = false;
135
145
  current.acceptanceCriteria.push({
136
146
  id: acMatch.groups.acId,
137
147
  description: acMatch.groups.desc.trim(),
@@ -142,11 +152,29 @@ function parseUserStoriesFromSpec(content: string): UserStoryForSync[] {
142
152
 
143
153
  const prioMatch = line.match(PRIORITY_RE);
144
154
  if (prioMatch) {
155
+ collectingDescription = false;
145
156
  current.priority = prioMatch[1];
157
+ continue;
158
+ }
159
+
160
+ if (AC_SECTION_RE.test(line)) {
161
+ collectingDescription = false;
162
+ continue;
163
+ }
164
+
165
+ // Collect description lines between US header and first AC/Priority
166
+ if (collectingDescription) {
167
+ if (METADATA_RE.test(line)) continue;
168
+ if (line.trim() !== '' || current.description.length > 0) {
169
+ current.description += line + '\n';
170
+ }
146
171
  }
147
172
  }
148
173
 
149
- if (current) userStories.push(current);
174
+ if (current) {
175
+ current.description = current.description.trim();
176
+ userStories.push(current);
177
+ }
150
178
 
151
179
  return userStories;
152
180
  }
@@ -51,11 +51,10 @@ See **Task Format** and **User Story Format** sections for templates.
51
51
 
52
52
  Never mark a task complete without proving it works:
53
53
  - Code compiles/builds successfully
54
- - Run tests: `npx vitest run` (unit) + `npx playwright test` (E2E) after every task
55
- - For critical paths: `/sw:grill` for quality, `/sw:judge-llm` for independent validation
56
- - Ask user to manually verify: new UI flows, auth, payments, data migrations
54
+ - Run tests after every task: `npx vitest run` + `npx playwright test`
55
+ - `/sw:grill` writes `grill-report.json` CLI blocks closure without it
56
+ - `/sw:judge-llm` writes `judge-llm-report.json` WAIVED if consent denied
57
57
  - Acceptance criteria actually satisfied
58
- - Ask: "Would a staff engineer approve this?"
59
58
 
60
59
  ### 3. Dependencies First
61
60
 
@@ -370,13 +369,11 @@ specweave context projects
370
369
  8. If 3 consecutive test failures: STOP, re-plan, ask user
371
370
 
372
371
  ### Closing Increment
373
- 1. Full test suite: `npx vitest run` (all unit + integration)
374
- 2. Full E2E suite: `npx playwright test` (all scenarios)
375
- 3. Coverage check: `npx vitest run --coverage` (must meet targets in config.json)
376
- 4. Ask user for manual acceptance: new UI, auth, payments, data migrations
377
- 5. `/sw:done 0001` — PM validates 3 gates (tasks, tests, docs)
378
- 6. Living docs synced automatically
379
- 7. GitHub/Jira issue closed if enabled
372
+ 1. Full test suite: `npx vitest run`
373
+ 2. Full E2E: `npx playwright test`
374
+ 3. `/sw:grill <id>` writes `grill-report.json` (CLI requires it)
375
+ 4. User acceptance for critical flows (UI, auth, payments)
376
+ 5. `/sw:done <id>`validates report files + PM 3 gates (tasks, tests, docs)
380
377
  <!-- /SECTION -->
381
378
 
382
379
  ---
@@ -77,9 +77,9 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
77
77
 
78
78
  ### 3. Verification Before Done
79
79
  - Never mark a task complete without proving it works
80
- - Run tests: `npx vitest run` (unit) + `npx playwright test` (E2E) after every task
81
- - For critical paths: `/sw:grill` for quality, `/sw:judge-llm` for independent validation
82
- - Ask user to manually verify: new UI flows, auth, payments, data migrations
80
+ - Run tests after every task: `npx vitest run` + `npx playwright test`
81
+ - `/sw:grill` writes `grill-report.json` CLI blocks closure without it
82
+ - `/sw:judge-llm` writes `judge-llm-report.json` WAIVED if consent denied
83
83
  - Ask yourself: **"Would a staff engineer approve this?"**
84
84
 
85
85
  ### 4. Think-Before-Act (Dependencies)
@@ -201,9 +201,10 @@ Primary: `/sw:progress-sync`. Individual: `/sw-github:push`, `/sw-github:close`.
201
201
  - Never mark a task `[x]` until its tests pass
202
202
 
203
203
  ### Before Closing (`/sw:done`)
204
- - `/sw:grill` + `/sw:validate` — code quality + 130+ rule checks
205
- - E2E with Playwright CLI: `npx playwright test` (blocking gate)
206
- - Ask user for manual acceptance testing when: new UI flows, auth changes, payment flows, data migrations
204
+ - `/sw:grill` writes `grill-report.json`CLI blocks closure without it
205
+ - `/sw:judge-llm` writes `judge-llm-report.json` WAIVED if consent denied
206
+ - `/sw:validate` 130+ rule checks
207
+ - E2E: `npx playwright test` (blocking gate)
207
208
 
208
209
  ### Test Stack
209
210
  - Unit/Integration: Vitest (`.test.ts`), ESM mocking with `vi.hoisted()` + `vi.mock()`