specweave 1.0.577 → 1.0.579
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/README.md +29 -0
- package/bin/specweave.js +1 -0
- package/dist/src/cli/commands/auto.d.ts +28 -0
- package/dist/src/cli/commands/auto.d.ts.map +1 -1
- package/dist/src/cli/commands/auto.js +73 -0
- package/dist/src/cli/commands/auto.js.map +1 -1
- package/dist/src/cli/commands/create-increment.d.ts +8 -0
- package/dist/src/cli/commands/create-increment.d.ts.map +1 -1
- package/dist/src/cli/commands/create-increment.js +2 -1
- package/dist/src/cli/commands/create-increment.js.map +1 -1
- package/dist/src/cli/dispatcher.d.ts +29 -0
- package/dist/src/cli/dispatcher.d.ts.map +1 -0
- package/dist/src/cli/dispatcher.js +53 -0
- package/dist/src/cli/dispatcher.js.map +1 -0
- package/dist/src/core/cache/static-context-loader.d.ts +39 -0
- package/dist/src/core/cache/static-context-loader.d.ts.map +1 -0
- package/dist/src/core/cache/static-context-loader.js +49 -0
- package/dist/src/core/cache/static-context-loader.js.map +1 -0
- package/dist/src/core/config/types.d.ts +61 -0
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js +16 -0
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/doctor/checkers/configuration-checker.d.ts +1 -0
- package/dist/src/core/doctor/checkers/configuration-checker.d.ts.map +1 -1
- package/dist/src/core/doctor/checkers/configuration-checker.js +50 -0
- package/dist/src/core/doctor/checkers/configuration-checker.js.map +1 -1
- package/dist/src/core/hooks/pretooluse-guard.d.ts +37 -0
- package/dist/src/core/hooks/pretooluse-guard.d.ts.map +1 -0
- package/dist/src/core/hooks/pretooluse-guard.js +64 -0
- package/dist/src/core/hooks/pretooluse-guard.js.map +1 -0
- package/dist/src/core/increment/template-creator.d.ts +7 -0
- package/dist/src/core/increment/template-creator.d.ts.map +1 -1
- package/dist/src/core/increment/template-creator.js +2 -1
- package/dist/src/core/increment/template-creator.js.map +1 -1
- package/dist/src/core/skills/skill-judge.d.ts +56 -0
- package/dist/src/core/skills/skill-judge.d.ts.map +1 -1
- package/dist/src/core/skills/skill-judge.js +95 -8
- package/dist/src/core/skills/skill-judge.js.map +1 -1
- package/dist/src/core/team-lead/template-loader.d.ts +19 -0
- package/dist/src/core/team-lead/template-loader.d.ts.map +1 -0
- package/dist/src/core/team-lead/template-loader.js +33 -0
- package/dist/src/core/team-lead/template-loader.js.map +1 -0
- package/dist/src/core/telemetry/cache-metrics.d.ts +38 -0
- package/dist/src/core/telemetry/cache-metrics.d.ts.map +1 -0
- package/dist/src/core/telemetry/cache-metrics.js +65 -0
- package/dist/src/core/telemetry/cache-metrics.js.map +1 -0
- package/dist/src/core/validators/resource-base.d.ts +29 -0
- package/dist/src/core/validators/resource-base.d.ts.map +1 -0
- package/dist/src/core/validators/resource-base.js +52 -0
- package/dist/src/core/validators/resource-base.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/.lint/skill-lint.test.ts +91 -0
- package/plugins/specweave/.lint/skill-lint.ts +51 -0
- package/plugins/specweave/marketplace.json +114 -0
- package/plugins/specweave/skills/ado-multi-project/SKILL.md +9 -1
- package/plugins/specweave/skills/ado-sync/SKILL.md +16 -1
- package/plugins/specweave/skills/analytics/SKILL.md +45 -0
- package/plugins/specweave/skills/architect/SKILL.md +5 -19
- package/plugins/specweave/skills/auto/SKILL.md +41 -10
- package/plugins/specweave/skills/brainstorm/SKILL.md +15 -15
- package/plugins/specweave/skills/close-all/SKILL.md +21 -51
- package/plugins/specweave/skills/code-reviewer/SKILL.md +114 -57
- package/plugins/specweave/skills/do/SKILL.md +14 -5
- package/plugins/specweave/skills/done/SKILL.md +36 -1
- package/plugins/specweave/skills/github-issue-standard/SKILL.md +8 -224
- package/plugins/specweave/skills/github-multi-project/SKILL.md +9 -1
- package/plugins/specweave/skills/github-sync/SKILL.md +16 -1
- package/plugins/specweave/skills/grill/SKILL.md +56 -9
- package/plugins/specweave/skills/help/SKILL.md +32 -4
- package/plugins/specweave/skills/increment/SKILL.md +41 -8
- package/plugins/specweave/skills/jira-sync/SKILL.md +16 -1
- package/plugins/specweave/skills/judge-llm/SKILL.md +46 -14
- package/plugins/specweave/skills/multi-project/SKILL.md +370 -0
- package/plugins/specweave/skills/plan/SKILL.md +16 -1
- package/plugins/specweave/skills/pm/SKILL.md +12 -47
- package/plugins/specweave/skills/tdd-cycle/SKILL.md +38 -0
- package/plugins/specweave/skills/tdd-green/SKILL.md +16 -1
- package/plugins/specweave/skills/tdd-red/SKILL.md +16 -1
- package/plugins/specweave/skills/tdd-refactor/SKILL.md +16 -1
- package/plugins/specweave/skills/team-build/SKILL.md +16 -462
- package/plugins/specweave/skills/team-lead/SKILL.md +59 -44
- package/plugins/specweave/skills/team-lead/agents/_protocol.md +88 -0
- package/plugins/specweave/skills/team-lead/agents/architect.md +27 -36
- package/plugins/specweave/skills/team-lead/agents/backend.md +26 -56
- package/plugins/specweave/skills/team-lead/agents/database.md +23 -51
- package/plugins/specweave/skills/team-lead/agents/frontend.md +27 -57
- package/plugins/specweave/skills/team-lead/agents/pm.md +7 -11
- package/plugins/specweave/skills/team-lead/agents/researcher.md +29 -55
- package/plugins/specweave/skills/team-lead/agents/reviewer-security.md +43 -59
- package/plugins/specweave/skills/team-lead/agents/security.md +22 -48
- package/plugins/specweave/skills/team-lead/agents/testing.md +26 -53
- package/plugins/specweave/skills/team-merge/SKILL.md +13 -10
- package/plugins/specweave/skills/team-lead/agents/reviewer-logic.md +0 -82
- package/plugins/specweave/skills/team-lead/agents/reviewer-performance.md +0 -83
|
@@ -1,474 +1,28 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
name: sw/team-build
|
|
3
|
+
description: "[DEPRECATED] Use sw:team-lead --preset <name> instead."
|
|
4
|
+
allowed-tools: Read
|
|
3
5
|
---
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
> Deprecated: `sw:team-build` is deprecated. Use `sw:team-lead --preset <name>` instead.
|
|
8
|
+
> This skill will be removed in SpecWeave v1.3.0.
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
## Migration
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
sw:team-build --preset full-stack "Build checkout flow"
|
|
13
|
-
sw:team-build --preset review "Review auth module"
|
|
14
|
-
sw:team-build --preset brainstorm "Brainstorm payment architecture"
|
|
15
|
-
sw:team-build --preset testing "Test payment service"
|
|
16
|
-
sw:team-build --preset tdd "Implement rate limiter"
|
|
17
|
-
sw:team-build --preset migration "Migrate users to v2 schema"
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
**Note:** For the complete mode documentation and 9-domain skill mapping, see `sw:team-lead`.
|
|
21
|
-
|
|
22
|
-
## How It Works
|
|
23
|
-
|
|
24
|
-
1. Parse the `--preset` flag to select a team configuration
|
|
25
|
-
2. Determine team mode from preset (implementation vs review vs brainstorm)
|
|
26
|
-
3. For implementation presets (`full-stack`, `testing`, `tdd`, `migration`): read the active increment
|
|
27
|
-
4. For non-implementation presets (`review`, `brainstorm`): proceed without increment
|
|
28
|
-
5. Spawn agents with assigned roles and dependencies
|
|
29
|
-
6. Coordinate execution order (sequential gates or parallel fan-out)
|
|
30
|
-
|
|
31
|
-
### Preset-to-Mode Mapping
|
|
32
|
-
|
|
33
|
-
| Preset | Mode | Increment Required? | team_name prefix |
|
|
34
|
-
|--------|------|-------------------|-----------------|
|
|
35
|
-
| `full-stack` | implementation | Yes* | `impl-*` or any |
|
|
36
|
-
| `review` | review | **No** | `review-*` |
|
|
37
|
-
| `brainstorm` | brainstorm | **No** | `brainstorm-*` |
|
|
38
|
-
| `testing` | implementation | Yes* | `impl-*` or any |
|
|
39
|
-
| `tdd` | implementation | Yes* | `impl-*` or any |
|
|
40
|
-
| `migration` | implementation | Yes* | `impl-*` or any |
|
|
41
|
-
|
|
42
|
-
\* Bypassed when `SPECWEAVE_NO_INCREMENT=1` is set (e.g. `specweave team --no-increment`). In free-form mode, agents work from natural language descriptions without spec.md.
|
|
43
|
-
|
|
44
|
-
**CRITICAL**: `review` and `brainstorm` presets MUST use their mode-prefixed team_name to bypass the spec-first guard.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Presets
|
|
49
|
-
|
|
50
|
-
### 1. `full-stack` — Contract-First Full-Stack Development
|
|
51
|
-
|
|
52
|
-
**Agents**: 3
|
|
53
|
-
**Execution order**: Sequential gate then parallel fan-out
|
|
54
|
-
|
|
55
|
-
Build features end-to-end with a shared-types-first contract approach. Agent 1 establishes the contract (types, shared utilities, interfaces) before backend and frontend agents work in parallel against that contract.
|
|
56
|
-
|
|
57
|
-
#### Agent Composition
|
|
58
|
-
|
|
59
|
-
| # | Role | Skill(s) | Owns | Responsibility |
|
|
60
|
-
|---|------|----------|------|----------------|
|
|
61
|
-
| 1 | Shared/Types | `sw:architect` | `src/types/`, `src/utils/`, `src/shared/` | Define TypeScript interfaces, shared validators, utility functions, and API contracts |
|
|
62
|
-
| 2 | Backend | `sw:architect` + `infra:devops` | `src/api/`, `src/services/` | Implement API endpoints, service layer, database queries, and infrastructure config |
|
|
63
|
-
| 3 | Frontend | `sw:architect` | `src/components/`, `src/pages/` | Build UI components, pages, state management, and client-side logic |
|
|
64
|
-
|
|
65
|
-
#### Execution Chain
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
Agent 1 (Shared/Types)
|
|
69
|
-
|
|
|
70
|
-
v
|
|
71
|
-
GATE — types and contracts must compile
|
|
72
|
-
|
|
|
73
|
-
+-------+-------+
|
|
74
|
-
| |
|
|
75
|
-
v v
|
|
76
|
-
Agent 2 Agent 3
|
|
77
|
-
(Backend) (Frontend)
|
|
78
|
-
| |
|
|
79
|
-
v v
|
|
80
|
-
sw:grill sw:grill
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**Why contract-first**: Backend and frontend agents import from `src/types/` and `src/shared/`. By resolving the contract first, both downstream agents work against stable interfaces — no integration surprises.
|
|
84
|
-
|
|
85
|
-
#### Example
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
sw:team-build --preset full-stack "Build user profile page with avatar upload"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
This spawns:
|
|
92
|
-
- **Shared/Types** agent defines `UserProfile`, `AvatarUploadRequest`, `AvatarUploadResponse` types
|
|
93
|
-
- **Backend** agent implements `/api/users/:id/profile` and `/api/users/:id/avatar` endpoints
|
|
94
|
-
- **Frontend** agent builds `<ProfilePage>`, `<AvatarUploader>` components consuming those types
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
### 2. `review` — Parallel Multi-Perspective Code Review
|
|
99
|
-
|
|
100
|
-
**Agents**: 3
|
|
101
|
-
**Execution order**: All parallel (independent, no dependencies)
|
|
102
|
-
**Mode**: review (NO increment required)
|
|
103
|
-
**team_name**: MUST use `review-*` prefix (e.g., `review-auth-module`)
|
|
104
|
-
|
|
105
|
-
Three specialized reviewers examine the codebase simultaneously from different angles. Each agent produces findings independently — no agent blocks another. Uses agent templates from `agents/reviewer-*.md`.
|
|
106
|
-
|
|
107
|
-
#### Agent Composition
|
|
108
|
-
|
|
109
|
-
| # | Role | Agent Template | Focus | Responsibility |
|
|
110
|
-
|---|------|---------------|-------|----------------|
|
|
111
|
-
| 1 | Security Reviewer | `agents/reviewer-security.md` | All files (read-only) | Vulnerabilities, injection, auth flaws, secrets, OWASP Top 10 |
|
|
112
|
-
| 2 | Logic Reviewer | `agents/reviewer-logic.md` | All files (read-only) | Correctness, edge cases, error handling, race conditions, logic bugs |
|
|
113
|
-
| 3 | Performance Reviewer | `agents/reviewer-performance.md` | All files (read-only) | N+1 queries, memory leaks, algorithmic complexity, scalability |
|
|
114
|
-
|
|
115
|
-
#### Execution Chain
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
+-------------------+-------------------+-------------------+
|
|
119
|
-
| | | |
|
|
120
|
-
v v v |
|
|
121
|
-
Agent 1 Agent 2 Agent 3 |
|
|
122
|
-
(Security) (Logic) (Performance) |
|
|
123
|
-
| | | |
|
|
124
|
-
v v v |
|
|
125
|
-
REVIEW_COMPLETE REVIEW_COMPLETE REVIEW_COMPLETE |
|
|
126
|
-
+-------------------+-------------------+-------------------+
|
|
127
|
-
|
|
|
128
|
-
v
|
|
129
|
-
Merged review summary
|
|
130
|
-
(Must Fix / Should Fix / Consider)
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
**All agents run in parallel.** Each uses its agent template and signals `REVIEW_COMPLETE:`. Team-lead merges, deduplicates, and prioritizes by severity.
|
|
134
|
-
|
|
135
|
-
#### Example
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
sw:team-build --preset review "Review auth module before release"
|
|
139
|
-
sw:team-build --preset review "Review PR #63"
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
This spawns three parallel reviewers:
|
|
143
|
-
- **Security** reviewer checks for token leakage, CSRF, injection, and insecure defaults
|
|
144
|
-
- **Logic** reviewer verifies correctness, edge cases, and error handling
|
|
145
|
-
- **Performance** reviewer identifies N+1 queries, memory leaks, and scalability issues
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
### 3. `testing` — Parallel Test Suite Generation
|
|
150
|
-
|
|
151
|
-
**Agents**: 3
|
|
152
|
-
**Execution order**: All parallel (independent, no dependencies)
|
|
153
|
-
|
|
154
|
-
Generate comprehensive test coverage across all test levels simultaneously. Each agent focuses on a different testing layer and operates independently.
|
|
155
|
-
|
|
156
|
-
> **Note:** SpecWeave testing skills (`sw:tdd-red`, `sw:e2e`, `sw:validate`) provide the testing workflows. This preset splits responsibilities into specialized agents for parallel execution.
|
|
157
|
-
|
|
158
|
-
#### Agent Composition
|
|
159
|
-
|
|
160
|
-
| # | Role | Skill(s) | Owns | Responsibility |
|
|
161
|
-
|---|------|----------|------|----------------|
|
|
162
|
-
| 1 | Unit | `sw:tdd-red` | `tests/unit/` | Write unit tests for individual functions, classes, and modules with proper mocking |
|
|
163
|
-
| 2 | E2E | `sw:e2e` | `tests/e2e/` | Write end-to-end tests for user flows, API sequences, and cross-service interactions |
|
|
164
|
-
| 3 | Coverage | `sw:validate` | `tests/` (analysis scope) | Analyze coverage gaps, generate missing test cases, ensure threshold compliance |
|
|
165
|
-
|
|
166
|
-
#### Execution Chain
|
|
167
|
-
|
|
168
|
-
```
|
|
169
|
-
+---------------+---------------+---------------+
|
|
170
|
-
| | | |
|
|
171
|
-
v v v |
|
|
172
|
-
Agent 1 Agent 2 Agent 3 |
|
|
173
|
-
(Unit) (E2E) (Coverage) |
|
|
174
|
-
| | | |
|
|
175
|
-
v v v |
|
|
176
|
-
unit tests e2e tests coverage report |
|
|
177
|
-
+---------------+---------------+---------------+
|
|
178
|
-
|
|
|
179
|
-
v
|
|
180
|
-
All tests pass + coverage met
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
**All agents run in parallel.** Unit and E2E agents write tests while the Coverage agent analyzes gaps and generates supplementary tests for uncovered paths.
|
|
184
|
-
|
|
185
|
-
#### Example
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
sw:team-build --preset testing "Test payment service end to end"
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
This spawns:
|
|
192
|
-
- **Unit** agent writes tests for `PaymentService`, `InvoiceCalculator`, `TaxResolver`
|
|
193
|
-
- **E2E** agent writes flow tests: checkout -> payment -> confirmation -> receipt
|
|
194
|
-
- **Coverage** agent identifies untested edge cases and generates additional tests
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
### 4. `tdd` — Strict Sequential TDD Cycle
|
|
199
|
-
|
|
200
|
-
**Agents**: 3
|
|
201
|
-
**Execution order**: Strict sequential (Agent 1 -> Agent 2 -> Agent 3)
|
|
202
|
-
|
|
203
|
-
Enforce the RED-GREEN-REFACTOR discipline with dedicated agents for each phase. Each agent must complete before the next begins — no shortcuts, no phase skipping.
|
|
204
|
-
|
|
205
|
-
#### Agent Composition
|
|
206
|
-
|
|
207
|
-
| # | Role | Skill(s) | Owns | Responsibility |
|
|
208
|
-
|---|------|----------|------|----------------|
|
|
209
|
-
| 1 | Red | `sw:tdd-red` | `tests/` | Write failing tests that define the expected behavior. Tests MUST fail before proceeding. |
|
|
210
|
-
| 2 | Green | `sw:tdd-green` | `src/` | Write the minimal implementation to make all failing tests pass. No extra features. |
|
|
211
|
-
| 3 | Refactor | `sw:tdd-refactor` | `src/`, `tests/` | Improve code quality, extract abstractions, reduce duplication — all tests must stay green. |
|
|
212
|
-
|
|
213
|
-
#### Execution Chain
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
Agent 1 (Red)
|
|
217
|
-
|
|
|
218
|
-
v
|
|
219
|
-
GATE — tests must exist AND fail
|
|
220
|
-
|
|
|
221
|
-
v
|
|
222
|
-
Agent 2 (Green)
|
|
223
|
-
|
|
|
224
|
-
v
|
|
225
|
-
GATE — all tests must pass
|
|
226
|
-
|
|
|
227
|
-
v
|
|
228
|
-
Agent 3 (Refactor)
|
|
229
|
-
|
|
|
230
|
-
v
|
|
231
|
-
GATE — all tests still pass + sw:grill
|
|
12
|
+
Replace:
|
|
232
13
|
```
|
|
233
|
-
|
|
234
|
-
**Strict sequential execution.** Agent 2 cannot start until Agent 1's tests are verified failing. Agent 3 cannot start until Agent 2's implementation passes all tests. This enforces true TDD discipline.
|
|
235
|
-
|
|
236
|
-
#### TDD Integration
|
|
237
|
-
|
|
238
|
-
When `testing.defaultTestMode: "TDD"` is set in `.specweave/config.json`, this preset automatically enables strict enforcement (`testing.tddEnforcement: "strict"`). Tasks in `tasks.md` are tagged with `[RED]`, `[GREEN]`, `[REFACTOR]` phase markers.
|
|
239
|
-
|
|
240
|
-
#### Example
|
|
241
|
-
|
|
14
|
+
/sw:team-build <preset-name>
|
|
242
15
|
```
|
|
243
|
-
|
|
16
|
+
With:
|
|
244
17
|
```
|
|
245
|
-
|
|
246
|
-
This spawns sequentially:
|
|
247
|
-
- **Red** agent writes tests: `rateLimiter.allows(100, '1m')`, `rateLimiter.rejects(101, '1m')`, sliding window decay tests
|
|
248
|
-
- **Green** agent implements `RateLimiter` class with minimal sliding window logic to pass
|
|
249
|
-
- **Refactor** agent extracts `SlidingWindow` abstraction, adds TimeProvider injection, cleans up
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
### 5. `migration` — Contract-First Data Migration
|
|
254
|
-
|
|
255
|
-
**Agents**: 3
|
|
256
|
-
**Execution order**: Sequential gate then parallel fan-out
|
|
257
|
-
|
|
258
|
-
Migrate data schemas safely with a schema-first approach. The schema agent defines the new structure and writes migration scripts before backend and frontend agents adapt to the changes in parallel.
|
|
259
|
-
|
|
260
|
-
#### Agent Composition
|
|
261
|
-
|
|
262
|
-
| # | Role | Skill(s) | Owns | Responsibility |
|
|
263
|
-
|---|------|----------|------|----------------|
|
|
264
|
-
| 1 | Schema | `sw:architect` | `src/types/`, `migrations/`, `prisma/`, `drizzle/` | Define new schema, write migration scripts, update type definitions, ensure backward compatibility |
|
|
265
|
-
| 2 | Backend | `sw:architect` | `src/api/`, `src/services/` | Update API endpoints, service logic, queries, and serializers to work with new schema |
|
|
266
|
-
| 3 | Frontend | `sw:architect` | `src/components/`, `src/pages/` | Update UI components, forms, and state to reflect schema changes |
|
|
267
|
-
|
|
268
|
-
#### Execution Chain
|
|
269
|
-
|
|
270
|
-
```
|
|
271
|
-
Agent 1 (Schema)
|
|
272
|
-
|
|
|
273
|
-
v
|
|
274
|
-
GATE — migration runs, types compile, rollback tested
|
|
275
|
-
|
|
|
276
|
-
+-------+-------+
|
|
277
|
-
| |
|
|
278
|
-
v v
|
|
279
|
-
Agent 2 Agent 3
|
|
280
|
-
(Backend) (Frontend)
|
|
281
|
-
| |
|
|
282
|
-
v v
|
|
283
|
-
sw:grill sw:grill
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
**Schema-first ensures safety.** The migration and new types must be validated before downstream agents modify application code. Both backend and frontend work against the finalized schema in parallel.
|
|
287
|
-
|
|
288
|
-
#### Example
|
|
289
|
-
|
|
290
|
-
```
|
|
291
|
-
sw:team-build --preset migration "Migrate users to v2 schema with address normalization"
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
This spawns:
|
|
295
|
-
- **Schema** agent creates `migrations/20240315_users_v2.sql`, updates `UserV2` type, writes rollback
|
|
296
|
-
- **Backend** agent updates `/api/users` endpoints to read/write `UserV2`, adds address normalization service
|
|
297
|
-
- **Frontend** agent updates `<UserForm>`, `<AddressInput>` components to use new address fields
|
|
298
|
-
|
|
299
|
-
---
|
|
300
|
-
|
|
301
|
-
### 6. `brainstorm` — Multi-Perspective Ideation
|
|
302
|
-
|
|
303
|
-
**Agents**: 3
|
|
304
|
-
**Execution order**: All parallel (independent, no dependencies)
|
|
305
|
-
**Mode**: brainstorm (NO increment required)
|
|
306
|
-
**team_name**: MUST use `brainstorm-*` prefix (e.g., `brainstorm-arch-decision`)
|
|
307
|
-
|
|
308
|
-
Three perspective agents explore a question simultaneously from different angles. Uses agent templates from `agents/brainstorm-*.md`.
|
|
309
|
-
|
|
310
|
-
#### Agent Composition
|
|
311
|
-
|
|
312
|
-
| # | Role | Agent Template | Perspective | Responsibility |
|
|
313
|
-
|---|------|---------------|-------------|----------------|
|
|
314
|
-
| 1 | Advocate | `agents/brainstorm-advocate.md` | Innovation | Champions the most ambitious approach, pushes boundaries |
|
|
315
|
-
| 2 | Critic | `agents/brainstorm-critic.md` | Risk | Devil's advocate — finds failure modes, hidden costs, red lines |
|
|
316
|
-
| 3 | Pragmatist | `agents/brainstorm-pragmatist.md` | Feasibility | Practical realist — timelines, team skills, maintenance burden |
|
|
317
|
-
|
|
318
|
-
#### Execution Chain
|
|
319
|
-
|
|
320
|
-
```
|
|
321
|
-
+-------------------+-------------------+-------------------+
|
|
322
|
-
| | | |
|
|
323
|
-
v v v |
|
|
324
|
-
Agent 1 Agent 2 Agent 3 |
|
|
325
|
-
(Advocate) (Critic) (Pragmatist) |
|
|
326
|
-
| | | |
|
|
327
|
-
v v v |
|
|
328
|
-
PERSPECTIVE_COMPLETE PERSPECTIVE_COMPLETE PERSPECTIVE_COMPLETE|
|
|
329
|
-
+-------------------+-------------------+-------------------+
|
|
330
|
-
|
|
|
331
|
-
v
|
|
332
|
-
Decision matrix + recommendation
|
|
333
|
-
→ sw:increment if proceeding
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
**All agents run in parallel.** Each signals `PERSPECTIVE_COMPLETE:`. Team-lead synthesizes into a decision matrix with scored options.
|
|
337
|
-
|
|
338
|
-
#### Example
|
|
339
|
-
|
|
18
|
+
/sw:team-lead --preset <preset-name>
|
|
340
19
|
```
|
|
341
|
-
sw:team-build --preset brainstorm "Microservices vs monolith for our growing app"
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
This spawns:
|
|
345
|
-
- **Advocate** champions microservices — independent scaling, team autonomy, polyglot support
|
|
346
|
-
- **Critic** warns about distributed complexity, network latency, operational overhead
|
|
347
|
-
- **Pragmatist** evaluates team size, current traffic, migration cost, and timeline
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## Flags
|
|
352
|
-
|
|
353
|
-
| Flag | Required | Description |
|
|
354
|
-
|------|----------|-------------|
|
|
355
|
-
| `--preset` | Yes | One of: `full-stack`, `review`, `brainstorm`, `testing`, `tdd`, `migration` |
|
|
356
|
-
| `--increment` | No | Increment ID to operate on (defaults to active increment; ignored for review/brainstorm) |
|
|
357
|
-
| `--dry-run` | No | Show what agents would be spawned without actually spawning them |
|
|
358
|
-
| `--max-agents` | No | Override max concurrent agents (default: 3) |
|
|
359
|
-
|
|
360
|
-
## Execution Order Summary
|
|
361
|
-
|
|
362
|
-
| Preset | Order | Pattern | Increment? |
|
|
363
|
-
|--------|-------|---------|-----------|
|
|
364
|
-
| `full-stack` | Sequential gate + parallel | Agent 1 first, then [Agent 2 + Agent 3] in parallel | Yes |
|
|
365
|
-
| `review` | All parallel | [Agent 1 + Agent 2 + Agent 3] simultaneously | **No** |
|
|
366
|
-
| `brainstorm` | All parallel | [Agent 1 + Agent 2 + Agent 3] simultaneously | **No** |
|
|
367
|
-
| `testing` | All parallel | [Agent 1 + Agent 2 + Agent 3] simultaneously | Yes |
|
|
368
|
-
| `tdd` | Strict sequential | Agent 1 -> Agent 2 -> Agent 3 (no parallelism) | Yes |
|
|
369
|
-
| `migration` | Sequential gate + parallel | Agent 1 first, then [Agent 2 + Agent 3] in parallel | Yes |
|
|
370
|
-
|
|
371
|
-
## SpecWeave Workflow Integration
|
|
372
|
-
|
|
373
|
-
### Implementation Presets (full-stack, testing, tdd, migration)
|
|
374
|
-
|
|
375
|
-
Each spawned agent integrates with the standard SpecWeave workflow:
|
|
376
|
-
|
|
377
|
-
1. **Increment context** — agents read `spec.md` and `tasks.md` from the active increment
|
|
378
|
-
2. **Task execution** — agents use `sw:do` or `sw:auto` to work through their assigned tasks
|
|
379
|
-
3. **Quality gates** — agents run `sw:grill` before marking tasks complete
|
|
380
|
-
4. **Progress tracking** — task status updates flow back to `tasks.md` with AC linkage
|
|
381
|
-
5. **Ownership boundaries** — agents only modify files within their assigned directories
|
|
382
|
-
6. **Conflict prevention** — ownership scopes are non-overlapping to prevent merge conflicts
|
|
383
|
-
|
|
384
|
-
### Non-Implementation Presets (review, brainstorm)
|
|
385
|
-
|
|
386
|
-
These presets operate without increments:
|
|
387
|
-
|
|
388
|
-
1. **Read-only analysis** — agents examine code but do not modify it
|
|
389
|
-
2. **Independent reports** — each agent produces findings independently
|
|
390
|
-
3. **Team-lead synthesis** — team-lead merges and deduplicates agent outputs
|
|
391
|
-
4. **No closure needed** — no `sw:done` or `sw:grill` required
|
|
392
|
-
5. **Follow-up bridge** — if actionable items found, suggest `sw:increment` to formalize
|
|
393
|
-
|
|
394
|
-
### Organization Discovery (resolve BEFORE spawning agents)
|
|
395
|
-
|
|
396
|
-
Resolve the `{ORG}` placeholder from `.specweave/config.json` (in priority order):
|
|
397
|
-
1. `repository.organization` field
|
|
398
|
-
2. `sync.profiles[*].config.owner` (GitHub) or `.config.organization` (ADO)
|
|
399
|
-
3. Parse from `umbrella.childRepos[0].path` (strip `repositories/` prefix, take first segment)
|
|
400
|
-
4. Check filesystem: `ls repositories/*/` and use the org folder name
|
|
401
|
-
5. If all fail, ask the user. **NEVER use .env files for org.**
|
|
402
|
-
|
|
403
|
-
### Multi-Repo Increment Placement
|
|
404
|
-
|
|
405
|
-
**In umbrella projects with a `repositories/` folder:**
|
|
406
|
-
- Each agent MUST create its increment in its assigned repo's `.specweave/increments/`
|
|
407
|
-
- The umbrella root `.specweave/` is for config ONLY, not for agent increments
|
|
408
|
-
- Run `specweave init` in each repo if `.specweave/` doesn't exist
|
|
409
|
-
- Agent working directory = `repositories/{ORG}/{repo-name}/` (replace `{ORG}` with discovered value)
|
|
410
|
-
|
|
411
|
-
### Agent Lifecycle
|
|
412
|
-
|
|
413
|
-
```
|
|
414
|
-
Spawn → Load increment context → Claim tasks → sw:do or sw:auto → sw:grill → Report completion
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
### Error Handling
|
|
418
|
-
|
|
419
|
-
- If a gate agent (Agent 1 in `full-stack`, `migration`, or `tdd`) fails, downstream agents are NOT spawned
|
|
420
|
-
- If a parallel agent fails, other parallel agents continue — failures are collected and reported
|
|
421
|
-
- Agents retry transient failures (build errors, flaky tests) up to 2 times before reporting failure
|
|
422
|
-
- On failure, the agent produces a diagnostic report explaining what went wrong and suggested fixes
|
|
423
|
-
|
|
424
|
-
#### Invalid Preset Name
|
|
425
|
-
|
|
426
|
-
If user provides an unknown preset name:
|
|
427
|
-
|
|
428
|
-
```
|
|
429
|
-
Error: Unknown preset "xyz". Available presets: full-stack, review, brainstorm, testing, tdd, migration.
|
|
430
|
-
Use sw:team-build --help to see preset details.
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
## Custom Presets
|
|
434
|
-
|
|
435
|
-
To define custom presets, add a `teamPresets` section to `.specweave/config.json`:
|
|
436
|
-
|
|
437
|
-
```json
|
|
438
|
-
{
|
|
439
|
-
"teamPresets": {
|
|
440
|
-
"my-preset": {
|
|
441
|
-
"agents": [
|
|
442
|
-
{
|
|
443
|
-
"role": "Analyst",
|
|
444
|
-
"skills": ["sw:architect"],
|
|
445
|
-
"owns": ["src/analysis/"],
|
|
446
|
-
"dependsOn": []
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
"role": "Implementer",
|
|
450
|
-
"skills": ["sw:architect"],
|
|
451
|
-
"owns": ["src/core/"],
|
|
452
|
-
"dependsOn": ["Analyst"]
|
|
453
|
-
}
|
|
454
|
-
]
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
Custom presets follow the same execution rules: agents with no `dependsOn` run in parallel; agents with dependencies wait for their predecessors to complete.
|
|
461
|
-
|
|
462
|
-
## Troubleshooting
|
|
463
20
|
|
|
464
|
-
|
|
465
|
-
|-------|-----|
|
|
466
|
-
| Agent fails to spawn | Check that required skills are installed: `claude plugin list` |
|
|
467
|
-
| Gate agent blocks forever | Kill the stuck agent and check its output for errors |
|
|
468
|
-
| Ownership conflict | Ensure no two agents in the same preset share directory ownership |
|
|
469
|
-
| TDD gate rejects Green | Agent 1 (Red) tests must genuinely fail — check for accidentally passing tests |
|
|
470
|
-
| Agents out of sync | Run `sw:progress` to see per-agent task status and identify blockers |
|
|
21
|
+
## Supported Presets
|
|
471
22
|
|
|
472
|
-
|
|
23
|
+
The same preset names from team-build are available via `--preset`:
|
|
473
24
|
|
|
474
|
-
-
|
|
25
|
+
- `full-stack` — frontend + backend + database + testing agents
|
|
26
|
+
- `api-only` — backend + database + testing agents
|
|
27
|
+
- `frontend-only` — frontend + testing agents
|
|
28
|
+
- `microservice` — backend + testing + devops agents
|