specweave 1.0.577 → 1.0.578

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 (94) hide show
  1. package/README.md +29 -0
  2. package/bin/specweave.js +1 -0
  3. package/dist/src/cli/commands/auto.d.ts +28 -0
  4. package/dist/src/cli/commands/auto.d.ts.map +1 -1
  5. package/dist/src/cli/commands/auto.js +73 -0
  6. package/dist/src/cli/commands/auto.js.map +1 -1
  7. package/dist/src/cli/commands/create-increment.d.ts +8 -0
  8. package/dist/src/cli/commands/create-increment.d.ts.map +1 -1
  9. package/dist/src/cli/commands/create-increment.js +2 -1
  10. package/dist/src/cli/commands/create-increment.js.map +1 -1
  11. package/dist/src/cli/dispatcher.d.ts +29 -0
  12. package/dist/src/cli/dispatcher.d.ts.map +1 -0
  13. package/dist/src/cli/dispatcher.js +53 -0
  14. package/dist/src/cli/dispatcher.js.map +1 -0
  15. package/dist/src/core/cache/static-context-loader.d.ts +39 -0
  16. package/dist/src/core/cache/static-context-loader.d.ts.map +1 -0
  17. package/dist/src/core/cache/static-context-loader.js +49 -0
  18. package/dist/src/core/cache/static-context-loader.js.map +1 -0
  19. package/dist/src/core/config/types.d.ts +61 -0
  20. package/dist/src/core/config/types.d.ts.map +1 -1
  21. package/dist/src/core/config/types.js +16 -0
  22. package/dist/src/core/config/types.js.map +1 -1
  23. package/dist/src/core/doctor/checkers/configuration-checker.d.ts +1 -0
  24. package/dist/src/core/doctor/checkers/configuration-checker.d.ts.map +1 -1
  25. package/dist/src/core/doctor/checkers/configuration-checker.js +50 -0
  26. package/dist/src/core/doctor/checkers/configuration-checker.js.map +1 -1
  27. package/dist/src/core/hooks/pretooluse-guard.d.ts +37 -0
  28. package/dist/src/core/hooks/pretooluse-guard.d.ts.map +1 -0
  29. package/dist/src/core/hooks/pretooluse-guard.js +64 -0
  30. package/dist/src/core/hooks/pretooluse-guard.js.map +1 -0
  31. package/dist/src/core/increment/template-creator.d.ts +7 -0
  32. package/dist/src/core/increment/template-creator.d.ts.map +1 -1
  33. package/dist/src/core/increment/template-creator.js +2 -1
  34. package/dist/src/core/increment/template-creator.js.map +1 -1
  35. package/dist/src/core/skills/skill-judge.d.ts +56 -0
  36. package/dist/src/core/skills/skill-judge.d.ts.map +1 -1
  37. package/dist/src/core/skills/skill-judge.js +95 -8
  38. package/dist/src/core/skills/skill-judge.js.map +1 -1
  39. package/dist/src/core/team-lead/template-loader.d.ts +19 -0
  40. package/dist/src/core/team-lead/template-loader.d.ts.map +1 -0
  41. package/dist/src/core/team-lead/template-loader.js +33 -0
  42. package/dist/src/core/team-lead/template-loader.js.map +1 -0
  43. package/dist/src/core/telemetry/cache-metrics.d.ts +38 -0
  44. package/dist/src/core/telemetry/cache-metrics.d.ts.map +1 -0
  45. package/dist/src/core/telemetry/cache-metrics.js +65 -0
  46. package/dist/src/core/telemetry/cache-metrics.js.map +1 -0
  47. package/dist/src/core/validators/resource-base.d.ts +29 -0
  48. package/dist/src/core/validators/resource-base.d.ts.map +1 -0
  49. package/dist/src/core/validators/resource-base.js +52 -0
  50. package/dist/src/core/validators/resource-base.js.map +1 -0
  51. package/package.json +1 -1
  52. package/plugins/specweave/.lint/skill-lint.test.ts +91 -0
  53. package/plugins/specweave/.lint/skill-lint.ts +51 -0
  54. package/plugins/specweave/marketplace.json +114 -0
  55. package/plugins/specweave/skills/ado-multi-project/SKILL.md +9 -1
  56. package/plugins/specweave/skills/ado-sync/SKILL.md +16 -1
  57. package/plugins/specweave/skills/analytics/SKILL.md +45 -0
  58. package/plugins/specweave/skills/architect/SKILL.md +5 -19
  59. package/plugins/specweave/skills/auto/SKILL.md +41 -10
  60. package/plugins/specweave/skills/brainstorm/SKILL.md +15 -15
  61. package/plugins/specweave/skills/close-all/SKILL.md +21 -51
  62. package/plugins/specweave/skills/code-reviewer/SKILL.md +114 -57
  63. package/plugins/specweave/skills/do/SKILL.md +14 -5
  64. package/plugins/specweave/skills/done/SKILL.md +36 -1
  65. package/plugins/specweave/skills/github-issue-standard/SKILL.md +8 -224
  66. package/plugins/specweave/skills/github-multi-project/SKILL.md +9 -1
  67. package/plugins/specweave/skills/github-sync/SKILL.md +16 -1
  68. package/plugins/specweave/skills/grill/SKILL.md +56 -9
  69. package/plugins/specweave/skills/help/SKILL.md +32 -4
  70. package/plugins/specweave/skills/increment/SKILL.md +41 -8
  71. package/plugins/specweave/skills/jira-sync/SKILL.md +16 -1
  72. package/plugins/specweave/skills/judge-llm/SKILL.md +46 -14
  73. package/plugins/specweave/skills/multi-project/SKILL.md +370 -0
  74. package/plugins/specweave/skills/plan/SKILL.md +16 -1
  75. package/plugins/specweave/skills/pm/SKILL.md +12 -47
  76. package/plugins/specweave/skills/tdd-cycle/SKILL.md +38 -0
  77. package/plugins/specweave/skills/tdd-green/SKILL.md +16 -1
  78. package/plugins/specweave/skills/tdd-red/SKILL.md +16 -1
  79. package/plugins/specweave/skills/tdd-refactor/SKILL.md +16 -1
  80. package/plugins/specweave/skills/team-build/SKILL.md +16 -462
  81. package/plugins/specweave/skills/team-lead/SKILL.md +59 -44
  82. package/plugins/specweave/skills/team-lead/agents/_protocol.md +88 -0
  83. package/plugins/specweave/skills/team-lead/agents/architect.md +27 -36
  84. package/plugins/specweave/skills/team-lead/agents/backend.md +26 -56
  85. package/plugins/specweave/skills/team-lead/agents/database.md +23 -51
  86. package/plugins/specweave/skills/team-lead/agents/frontend.md +27 -57
  87. package/plugins/specweave/skills/team-lead/agents/pm.md +7 -11
  88. package/plugins/specweave/skills/team-lead/agents/researcher.md +29 -55
  89. package/plugins/specweave/skills/team-lead/agents/reviewer-security.md +43 -59
  90. package/plugins/specweave/skills/team-lead/agents/security.md +22 -48
  91. package/plugins/specweave/skills/team-lead/agents/testing.md +26 -53
  92. package/plugins/specweave/skills/team-merge/SKILL.md +13 -10
  93. package/plugins/specweave/skills/team-lead/agents/reviewer-logic.md +0 -82
  94. package/plugins/specweave/skills/team-lead/agents/reviewer-performance.md +0 -83
@@ -0,0 +1,370 @@
1
+ ---
2
+ name: sw/multi-project
3
+ description: Unified multi-project management skill for GitHub, Azure DevOps, and Jira. Organizes specs and splits tasks across multiple repositories or projects for monorepo, polyrepo, project-per-team, and area-path architectures. Use `--tool github|ado|jira` to select the target integration.
4
+ user-invokable: true
5
+ allowed-tools: Read, Write, Edit, Glob
6
+ ---
7
+
8
+ # Multi-Project Management Skill
9
+
10
+ Unified skill for organizing SpecWeave specs and increments across multiple projects or repositories. Supersedes the tool-specific `sw:github-multi-project` and `sw:ado-multi-project` skills, and adds Jira multi-project support.
11
+
12
+ ## `--tool` Flag
13
+
14
+ Select the target integration via the `--tool` flag:
15
+
16
+ | Value | Backend | Use When |
17
+ |-------|---------|----------|
18
+ | `--tool github` | GitHub repositories | Multi-repo and monorepo GitHub projects |
19
+ | `--tool ado` | Azure DevOps projects / area paths | Project-per-team, area-path-based, or team-based ADO organizations |
20
+ | `--tool jira` | Jira projects / components | Multi-project Jira instances with Epics/Stories |
21
+
22
+ Example invocations:
23
+
24
+ ```bash
25
+ sw:multi-project --tool github
26
+ sw:multi-project --tool ado
27
+ sw:multi-project --tool jira
28
+ ```
29
+
30
+ If `--tool` is omitted, the skill reads `integrations.primary` from `.specweave/config.json` and falls back to `github` when unset.
31
+
32
+ ## Core Capabilities (All Tools)
33
+
34
+ 1. **Spec Organization** — organizes specs in `.specweave/docs/internal/projects/{project-id}/`
35
+ 2. **Task Splitting** — analyzes `tasks.md` and splits work into project-specific tasks
36
+ 3. **Cross-project Coordination** — tracks dependencies between projects
37
+ 4. **Bidirectional Sync** — keeps local specs and remote work items in sync
38
+
39
+ ## Architectures
40
+
41
+ ### Single Repository / Single Project
42
+
43
+ ```
44
+ my-app/
45
+ ├── .specweave/
46
+ │ └── docs/internal/projects/default/
47
+ └── src/
48
+ ```
49
+
50
+ ### Multi-Repository (Polyrepo — GitHub)
51
+
52
+ ```
53
+ my-app-frontend/ my-app-backend/ my-app-shared/
54
+ ├── .git ├── .git ├── .git
55
+ └── src/ └── src/ └── src/
56
+ ```
57
+
58
+ ### Parent Repository (Recommended for GitHub multi-repo)
59
+
60
+ ```
61
+ my-app-parent/ # Parent repo holds .specweave
62
+ ├── .specweave/
63
+ │ └── docs/internal/projects/
64
+ │ ├── frontend/
65
+ │ ├── backend/
66
+ │ └── shared/
67
+ └── services/
68
+ ├── frontend/
69
+ ├── backend/
70
+ └── shared/
71
+ ```
72
+
73
+ ### Monorepo (GitHub / Jira / ADO)
74
+
75
+ ```
76
+ my-app/
77
+ ├── .specweave/
78
+ │ └── docs/internal/projects/
79
+ │ ├── frontend/
80
+ │ ├── backend/
81
+ │ └── shared/
82
+ └── packages/
83
+ ```
84
+
85
+ ### Project-per-team (ADO / Jira recommended)
86
+
87
+ ```
88
+ Organization: mycompany
89
+ ├── AuthService
90
+ ├── UserService
91
+ ├── PaymentService
92
+ └── NotificationService
93
+
94
+ .specweave/docs/internal/specs/
95
+ ├── AuthService/
96
+ ├── UserService/
97
+ ├── PaymentService/
98
+ └── NotificationService/
99
+ ```
100
+
101
+ ### Area-path-based (ADO) / Component-based (Jira)
102
+
103
+ ```
104
+ Organization: enterprise
105
+ └── ERP (Project)
106
+ ├── Finance
107
+ ├── HR
108
+ ├── Inventory
109
+ └── Sales
110
+
111
+ .specweave/docs/internal/specs/ERP/
112
+ ├── Finance/
113
+ ├── HR/
114
+ ├── Inventory/
115
+ └── Sales/
116
+ ```
117
+
118
+ ---
119
+
120
+ ## GitHub (`--tool github`)
121
+
122
+ Merges the logic of the deprecated `sw:github-multi-project` skill.
123
+
124
+ ### Task Splitting Example
125
+
126
+ **Increment**: Add shopping cart functionality
127
+
128
+ | Repository | Tasks |
129
+ |------------|-------|
130
+ | `my-app-frontend` | T-001 CartItem component, T-002 cart state, T-003 cart UI |
131
+ | `my-app-backend` | T-004 schema, T-005 API endpoints, T-006 validation |
132
+ | `my-app-shared` | T-007 types, T-008 utilities |
133
+
134
+ ### Creating Repo-Specific Issues
135
+
136
+ ```typescript
137
+ async function createRepoSpecificIssues(
138
+ increment: Increment,
139
+ distribution: Map<string, Task[]>
140
+ ) {
141
+ for (const [repo, tasks] of distribution) {
142
+ const issue = await createGitHubIssue({
143
+ repo,
144
+ title: `[${increment.id}] ${increment.name} - ${repo}`,
145
+ body: formatTasksAsChecklist(tasks),
146
+ labels: ['specweave', 'increment', repo],
147
+ });
148
+ }
149
+ }
150
+ ```
151
+
152
+ ### GitHub Projects Integration
153
+
154
+ - Org-level Project spanning multiple repos (preferred)
155
+ - Or per-repo Projects (Frontend / Backend / Shared)
156
+
157
+ ### GitHub Actions Sync
158
+
159
+ ```yaml
160
+ name: SpecWeave Multi-Repo Sync
161
+ on:
162
+ workflow_dispatch:
163
+ schedule: [{ cron: '0 */6 * * *' }]
164
+
165
+ jobs:
166
+ sync:
167
+ runs-on: ubuntu-latest
168
+ steps:
169
+ - uses: actions/checkout@v3
170
+ - name: Sync to repositories
171
+ run: |
172
+ gh issue create --repo myorg/frontend ...
173
+ gh issue create --repo myorg/backend ...
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Azure DevOps (`--tool ado`)
179
+
180
+ Merges the logic of the deprecated `sw:ado-multi-project` skill.
181
+
182
+ ### Intelligent Project Detection
183
+
184
+ ```typescript
185
+ const projectPatterns = {
186
+ AuthService: {
187
+ keywords: ['authentication', 'login', 'oauth', 'jwt', 'session'],
188
+ filePatterns: ['auth/', 'login/', 'security/'],
189
+ },
190
+ UserService: {
191
+ keywords: ['user', 'profile', 'account', 'registration'],
192
+ filePatterns: ['users/', 'profiles/'],
193
+ },
194
+ PaymentService: {
195
+ keywords: ['payment', 'stripe', 'billing', 'invoice'],
196
+ filePatterns: ['payment/', 'billing/', 'checkout/'],
197
+ },
198
+ };
199
+ ```
200
+
201
+ **Confidence scoring**: keyword +0.2, file pattern +0.3, explicit mention +1.0, team mention +0.5. Threshold > 0.7 auto-assigns; otherwise prompts the user.
202
+
203
+ ### Area-path Strategy
204
+
205
+ ```bash
206
+ AZURE_DEVOPS_STRATEGY=area-path-based
207
+ AZURE_DEVOPS_PROJECT=ERP
208
+ AZURE_DEVOPS_AREA_PATHS=Finance,HR,Inventory
209
+ ```
210
+
211
+ Creates `.specweave/docs/internal/specs/ERP/{AreaPath}/` folders and maps increments to `ERP\{AreaPath}`.
212
+
213
+ ### Multi-project Work Items
214
+
215
+ A single increment spanning three ADO projects:
216
+
217
+ ```
218
+ PaymentService → Epic "Checkout Payment Processing" (primary)
219
+ UserService → Feature "User Cart Management" (linked)
220
+ NotificationService → Feature "Order Notifications" (linked)
221
+ ```
222
+
223
+ ### metadata.yml example
224
+
225
+ ```yaml
226
+ projects:
227
+ primary: PaymentService
228
+ dependencies:
229
+ - UserService: [T-001, T-004]
230
+ - NotificationService: [T-003]
231
+
232
+ ado_mappings:
233
+ PaymentService:
234
+ epic: 12345
235
+ work_items: [12346, 12347]
236
+ UserService:
237
+ feature: 12348
238
+ work_items: [12349, 12350]
239
+ ```
240
+
241
+ ### Sync Commands
242
+
243
+ ```bash
244
+ sw:multi-project --tool ado sync-increment 0014
245
+ sw:multi-project --tool ado sync-spec AuthService/spec-001
246
+ sw:multi-project --tool ado sync-all
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Jira (`--tool jira`)
252
+
253
+ New in v1.2. Provides Jira-specific multi-project support using the `sw-jira` plugin.
254
+
255
+ ### Jira Project Topologies
256
+
257
+ | Topology | Structure | Mapping |
258
+ |----------|-----------|---------|
259
+ | **Project-per-team** | Each team owns a Jira project | Increment → Epic in owning project |
260
+ | **Shared project + components** | One Jira project, many components | Increment → Epic tagged with component(s) |
261
+ | **Board-per-squad** | Multiple Scrum boards in one project | Increment → Epic linked to squad board |
262
+
263
+ ### Creating Jira Epics and Stories
264
+
265
+ Use the `sw-jira` plugin. The skill coordinates which project/component the Epic lands in:
266
+
267
+ ```bash
268
+ # Epic for an increment (primary project)
269
+ sw:jira-create --type epic --project PAY --summary "Checkout payment processing"
270
+
271
+ # Stories for each user story in the increment
272
+ sw:jira-create --type story --project PAY --epic-link PAY-101 --summary "US-001 Shopping cart API"
273
+ sw:jira-create --type story --project USR --epic-link PAY-101 --summary "US-002 User cart state"
274
+ sw:jira-create --type story --project NOT --epic-link PAY-101 --summary "US-003 Order notification email"
275
+ ```
276
+
277
+ Each Story becomes a Jira issue in the right project; `--epic-link` preserves the cross-project relationship.
278
+
279
+ ### metadata.yml example
280
+
281
+ ```yaml
282
+ projects:
283
+ primary: PAY
284
+ dependencies:
285
+ - USR: [T-001, T-004]
286
+ - NOT: [T-003]
287
+
288
+ jira_mappings:
289
+ PAY:
290
+ epic: PAY-101
291
+ stories: [PAY-102, PAY-103]
292
+ USR:
293
+ stories: [USR-045, USR-046]
294
+ NOT:
295
+ stories: [NOT-012]
296
+ ```
297
+
298
+ ### Component vs Project Decision
299
+
300
+ - **Separate projects** when teams have distinct workflows, permissions, or release cadence
301
+ - **Components in a single project** when teams share a board and backlog but need filtering
302
+
303
+ ### Cross-project Epic Linking
304
+
305
+ Jira supports cross-project Epic links when the instance has the "Advanced Roadmaps" / "Jira Portfolio" add-on enabled. The skill detects availability and falls back to "related to" issue links when not present.
306
+
307
+ ### Sync Commands
308
+
309
+ ```bash
310
+ sw:multi-project --tool jira sync-increment 0014
311
+ sw:multi-project --tool jira sync-spec PaymentService/spec-001
312
+ sw:multi-project --tool jira sync-all
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Configuration
318
+
319
+ ### `.specweave/config.json`
320
+
321
+ ```json
322
+ {
323
+ "integrations": {
324
+ "primary": "github",
325
+ "github": {
326
+ "repositories": ["myorg/frontend", "myorg/backend", "myorg/shared"]
327
+ },
328
+ "ado": {
329
+ "strategy": "project-per-team",
330
+ "projects": ["AuthService", "UserService", "PaymentService"]
331
+ },
332
+ "jira": {
333
+ "strategy": "project-per-team",
334
+ "projects": ["PAY", "USR", "NOT"]
335
+ }
336
+ }
337
+ }
338
+ ```
339
+
340
+ ## Cross-project Queries
341
+
342
+ ```typescript
343
+ async function getIncrementWorkItems(incrementId: string, tool: 'github' | 'ado' | 'jira') {
344
+ const metadata = await readMetadata(incrementId);
345
+ const key = `${tool}_mappings`;
346
+ const workItems: unknown[] = [];
347
+ for (const mapping of Object.values(metadata[key] ?? {})) {
348
+ workItems.push(...(await fetchWorkItems(tool, mapping)));
349
+ }
350
+ return workItems;
351
+ }
352
+ ```
353
+
354
+ ## Best Practices
355
+
356
+ 1. **Consistent naming** — `spec-001-oauth-authentication.md` across all tools
357
+ 2. **Clear project boundaries** — document what each project owns and does not own
358
+ 3. **Link related specs** — when an increment spans projects, include cross-links
359
+ 4. **Use project prefixes** — `sw:increment "payment-stripe-integration"`
360
+
361
+ ## Related Skills
362
+
363
+ - `sw:github-sync`, `sw:ado-sync`, `sw:jira-sync` — per-tool sync engines
364
+ - `sw:github-issue-standard` — GitHub issue formatting
365
+ - `sw:ado-mapper`, `sw:jira-mapper` — ID mapping utilities
366
+
367
+ ---
368
+
369
+ **Skill Version**: 2.0.0 — unified multi-project skill (replaces `sw:github-multi-project` and `sw:ado-multi-project`)
370
+ **Introduced**: SpecWeave v1.2.0 (0669 Wave 4)
@@ -1,9 +1,24 @@
1
1
  ---
2
- description: Generate plan.md and tasks.md for increment. Use when saying "create plan", "generate tasks", or "plan the increment".
2
+ description: "[DEPRECATED] Standalone `sw:plan` is deprecated. Use `sw:increment --regenerate-plan` to regenerate plan.md for an existing increment."
3
3
  ---
4
4
 
5
5
  # sw:plan - Generate Implementation Plan
6
6
 
7
+ ## Migration
8
+
9
+ > Standalone `sw:plan` is deprecated. Use `sw:increment --regenerate-plan` to regenerate `plan.md` and `tasks.md` for an existing increment.
10
+
11
+ The standalone plan skill has been folded into `sw:increment` via the `--regenerate-plan` flag. This avoids two near-identical entry points and centralises planning logic. The old workflow still works during the deprecation window but will be removed in SpecWeave v1.3.0.
12
+
13
+ Replace:
14
+ ```
15
+ /sw:plan 0014
16
+ ```
17
+ With:
18
+ ```
19
+ /sw:increment --regenerate-plan 0014
20
+ ```
21
+
7
22
  **⚠️ FOR EXISTING INCREMENTS ONLY - NOT for creating new increments!**
8
23
 
9
24
  **When to use `sw:plan`:**
@@ -15,27 +15,11 @@ model: opus
15
15
 
16
16
  You are a Product Manager with expertise in spec-driven development. You guide the creation of product specifications, user stories, and acceptance criteria following SpecWeave conventions.
17
17
 
18
- ## STEP 0: Register Skill Chain Marker (MANDATORY - DO THIS FIRST)
18
+ ## Tool-Use Rationale
19
19
 
20
- **Before any other work**, register your invocation so the skill-chain-enforcement-guard allows spec.md writes.
21
-
22
- Extract the increment ID from your args (e.g., "Write spec for increment 0323-feature-name: ...").
23
- Then write the marker file:
24
-
25
- ```bash
26
- mkdir -p .specweave/state
27
- # If state file exists, merge; otherwise create
28
- STATE_FILE=".specweave/state/skill-chain-XXXX-name.json"
29
- if [ -f "$STATE_FILE" ]; then
30
- jq '.pm_invoked=true | .pm_invoked_at="'$(date -Iseconds)'"' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
31
- else
32
- echo '{"pm_invoked":true,"pm_invoked_at":"'$(date -Iseconds)'"}' > "$STATE_FILE"
33
- fi
34
- ```
35
-
36
- Replace `XXXX-name` with the actual increment ID. **This unblocks the guard for spec.md writes.**
37
-
38
- **If you skip this step, your Write to spec.md will be BLOCKED by the PreToolUse guard.**
20
+ - **Read**: Load `.specweave/config.json`, the increment's existing `spec.md` (if any), `phases/*.md`, and `templates/spec-template.md` before drafting.
21
+ - **Write**: Produce `spec.md` inside the increment directory once requirements are clear.
22
+ - **Edit**: Refine specific user stories and acceptance criteria during validation.
39
23
 
40
24
  ## Progressive Disclosure
41
25
 
@@ -70,30 +54,9 @@ If `true`:
70
54
  4. Cover relevant categories (skip those that don't apply)
71
55
  5. Only proceed to Research phase after sufficient clarity
72
56
 
73
- ### Writing Interview State to Disk (CRITICAL)
57
+ ### In-Memory Interview State
74
58
 
75
- **When invoked via subagent (sw:sw-pm), this runs in an isolated context, but file writes persist.**
76
-
77
- When invoked from `sw:increment` with an increment ID (e.g., "Deep interview for increment 0266-foo: ..."),
78
- you MUST write the interview state file to disk so the enforcement guard can find it:
79
-
80
- ```bash
81
- # Extract increment ID from the args (e.g., "Deep interview for increment 0266-foo: ...")
82
- # Initialize interview state file BEFORE starting questions
83
- mkdir -p .specweave/state
84
- echo '{"incrementId":"XXXX-name","startedAt":"'$(date -Iseconds)'","coveredCategories":{}}' \
85
- > .specweave/state/interview-XXXX-name.json
86
- ```
87
-
88
- After covering each category, update the state file:
89
- ```bash
90
- jq '.coveredCategories.architecture = {"coveredAt": "'$(date -Iseconds)'", "summary": "..."}' \
91
- .specweave/state/interview-XXXX-name.json > tmp && mv tmp .specweave/state/interview-XXXX-name.json
92
- ```
93
-
94
- **Why this matters**: The `interview-enforcement-guard.sh` (PreToolUse hook on Write) checks
95
- `.specweave/state/interview-{increment-id}.json` before allowing spec.md writes. If this file
96
- is missing or incomplete, spec.md creation is BLOCKED in strict mode.
59
+ Interview state lives in memory for the duration of the planning session — no state files are written to disk. Track covered categories in your working context and proceed to the Research phase once the complexity-appropriate question count is reached.
97
60
 
98
61
  ## Project Field (Mandatory on Every User Story)
99
62
 
@@ -161,11 +124,13 @@ Every user story MUST have exactly one `**Project**:` field. This is uncondition
161
124
 
162
125
  ## Token Budget Per Response
163
126
 
164
- - **Research phase**: < 500 tokens
165
- - **Spec creation**: < 600 tokens per chunk
166
- - **Validation**: < 400 tokens
127
+ - **Research phase**: < 1500 tokens
128
+ - **Spec creation**: < 1800 tokens per chunk
129
+ - **Validation**: < 1200 tokens
130
+
131
+ Override via `quality.tokenBudgets` in `.specweave/config.json` (keys: `research`, `specCreation`, `validation`). Budgets were raised 3× in SpecWeave 1.1.0 to take advantage of Opus 4.7's long-horizon coherence — smaller caps forced premature summarization and lost nuance on complex specs.
167
132
 
168
- **NEVER exceed 2000 tokens in a single response!**
133
+ **Aim to stay under 6000 tokens in a single response** — beyond that, split the work into another phase/chunk.
169
134
 
170
135
  ## When This Skill Activates
171
136
 
@@ -4,6 +4,44 @@ description: Execute full TDD red-green-refactor cycle with validation gates. Us
4
4
 
5
5
  # TDD Cycle - Comprehensive Test-Driven Development
6
6
 
7
+ ## --phase Flag (v1.1.0+)
8
+
9
+ `sw:tdd-cycle` supports a `--phase` flag to run a single phase of the RED → GREEN → REFACTOR cycle. Omitting the flag (or passing `--phase all`) runs the full cycle.
10
+
11
+ | Flag | Behavior |
12
+ |------|----------|
13
+ | `--phase all` (default) | Full RED → GREEN → REFACTOR cycle. Same as omitting the flag. |
14
+ | `--phase red` | Runs only the RED phase — write failing tests. See Phase 2 below. |
15
+ | `--phase green` | Runs only the GREEN phase — write minimal code to make tests pass. See Phase 3 below. |
16
+ | `--phase refactor` | Runs only the REFACTOR phase — improve code quality with tests as safety net. See Phase 4 below. |
17
+
18
+ ### Alias routing from deprecated skills
19
+
20
+ The following deprecated single-phase skills are aliased in `marketplace.json` to route through `sw:tdd-cycle --phase <x>`:
21
+
22
+ - `/sw:tdd-red` → `/sw:tdd-cycle --phase red`
23
+ - `/sw:tdd-green` → `/sw:tdd-cycle --phase green`
24
+ - `/sw:tdd-refactor` → `/sw:tdd-cycle --phase refactor`
25
+
26
+ The aliases emit a one-time migration warning pointing users to the canonical `--phase` form. The three `tdd-*` skills are scheduled for removal in v1.3.0 — see `.specweave/docs/internal/specs/skill-deprecation-policy.md`.
27
+
28
+ ### Examples
29
+
30
+ ```bash
31
+ # Full cycle (default)
32
+ sw:tdd-cycle "user authentication"
33
+
34
+ # Single phases
35
+ sw:tdd-cycle --phase red "user authentication"
36
+ sw:tdd-cycle --phase green "user authentication"
37
+ sw:tdd-cycle --phase refactor "user authentication"
38
+
39
+ # Same as default — explicit
40
+ sw:tdd-cycle --phase all "user authentication"
41
+ ```
42
+
43
+ ---
44
+
7
45
  ## Project Overrides
8
46
 
9
47
  **Skill Memories**: If `.specweave/skill-memories/tdd-cycle.md` exists, read and apply its learnings.
@@ -1,5 +1,20 @@
1
1
  ---
2
- description: Write minimal code to make failing tests pass. Use when saying "TDD green", "make tests pass", or "implement for tests".
2
+ description: "[DEPRECATED] Write minimal code to make failing tests pass. Use when saying \"TDD green\", \"make tests pass\", or \"implement for tests\"."
3
+ deprecated: true
4
+ ---
5
+
6
+ > ⚠️ DEPRECATED: Use `sw:tdd-cycle --phase green` instead. This skill will be removed in v1.3.0.
7
+
8
+ ## Migration
9
+
10
+ This skill has been deprecated as part of the Opus 4.7 framework alignment (increment 0669).
11
+
12
+ - **Use instead**: `sw:tdd-cycle --phase green` runs only the GREEN phase (write minimal code to make tests pass)
13
+ - **Removal**: Scheduled for v1.3.0 (2 minor releases after v1.1.0)
14
+ - **Why**: The three TDD phase skills (tdd-red, tdd-green, tdd-refactor) were consolidated into `sw:tdd-cycle` with a `--phase` flag. Alias routing in `marketplace.json` redirects `/sw:tdd-green` → `/sw:tdd-cycle --phase green` automatically.
15
+
16
+ For the migration policy, see `.specweave/docs/internal/specs/skill-deprecation-policy.md`.
17
+
3
18
  ---
4
19
 
5
20
  # TDD Green Phase - Make Tests Pass
@@ -1,5 +1,20 @@
1
1
  ---
2
- description: Write failing tests that define expected behavior. Use when saying "TDD red", "write failing tests", or "test first".
2
+ description: "[DEPRECATED] Write failing tests that define expected behavior. Use when saying \"TDD red\", \"write failing tests\", or \"test first\"."
3
+ deprecated: true
4
+ ---
5
+
6
+ > ⚠️ DEPRECATED: Use `sw:tdd-cycle --phase red` instead. This skill will be removed in v1.3.0.
7
+
8
+ ## Migration
9
+
10
+ This skill has been deprecated as part of the Opus 4.7 framework alignment (increment 0669).
11
+
12
+ - **Use instead**: `sw:tdd-cycle --phase red` runs only the RED phase (write failing tests)
13
+ - **Removal**: Scheduled for v1.3.0 (2 minor releases after v1.1.0)
14
+ - **Why**: The three TDD phase skills (tdd-red, tdd-green, tdd-refactor) were consolidated into `sw:tdd-cycle` with a `--phase` flag. Alias routing in `marketplace.json` redirects `/sw:tdd-red` → `/sw:tdd-cycle --phase red` automatically.
15
+
16
+ For the migration policy, see `.specweave/docs/internal/specs/skill-deprecation-policy.md`.
17
+
3
18
  ---
4
19
 
5
20
  # TDD Red Phase - Write Failing Tests
@@ -1,5 +1,20 @@
1
1
  ---
2
- description: Refactor code with test safety net to improve quality. Use when saying "TDD refactor", "refactor with tests", or "improve code quality".
2
+ description: "[DEPRECATED] Refactor code with test safety net to improve quality. Use when saying \"TDD refactor\", \"refactor with tests\", or \"improve code quality\"."
3
+ deprecated: true
4
+ ---
5
+
6
+ > ⚠️ DEPRECATED: Use `sw:tdd-cycle --phase refactor` instead. This skill will be removed in v1.3.0.
7
+
8
+ ## Migration
9
+
10
+ This skill has been deprecated as part of the Opus 4.7 framework alignment (increment 0669).
11
+
12
+ - **Use instead**: `sw:tdd-cycle --phase refactor` runs only the REFACTOR phase (improve code quality with test safety net)
13
+ - **Removal**: Scheduled for v1.3.0 (2 minor releases after v1.1.0)
14
+ - **Why**: The three TDD phase skills (tdd-red, tdd-green, tdd-refactor) were consolidated into `sw:tdd-cycle` with a `--phase` flag. Alias routing in `marketplace.json` redirects `/sw:tdd-refactor` → `/sw:tdd-cycle --phase refactor` automatically.
15
+
16
+ For the migration policy, see `.specweave/docs/internal/specs/skill-deprecation-policy.md`.
17
+
3
18
  ---
4
19
 
5
20
  # TDD Refactor Phase - Improve Code Quality