specweave 1.0.310 → 1.0.312
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/bin/specweave.js +11 -2
- package/dist/dashboard/assets/index-DgSCJ-tE.js +11 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/src/cli/commands/docs.d.ts +32 -1
- package/dist/src/cli/commands/docs.d.ts.map +1 -1
- package/dist/src/cli/commands/docs.js +117 -36
- package/dist/src/cli/commands/docs.js.map +1 -1
- package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/directory-structure.js +2 -1
- package/dist/src/cli/helpers/init/directory-structure.js.map +1 -1
- package/dist/src/cli/helpers/init/smart-defaults.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/smart-defaults.js +1 -0
- package/dist/src/cli/helpers/init/smart-defaults.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +2 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
- package/dist/src/cli/workers/marketplace-scanner-worker.js +8 -1
- package/dist/src/cli/workers/marketplace-scanner-worker.js.map +1 -1
- package/dist/src/core/config/types.d.ts +1 -0
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js +4 -0
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/hooks/LifecycleHookDispatcher.d.ts +3 -4
- package/dist/src/core/hooks/LifecycleHookDispatcher.d.ts.map +1 -1
- package/dist/src/core/hooks/LifecycleHookDispatcher.js +45 -13
- package/dist/src/core/hooks/LifecycleHookDispatcher.js.map +1 -1
- package/dist/src/core/hooks/feature-id-resolver.d.ts +16 -0
- package/dist/src/core/hooks/feature-id-resolver.d.ts.map +1 -0
- package/dist/src/core/hooks/feature-id-resolver.js +60 -0
- package/dist/src/core/hooks/feature-id-resolver.js.map +1 -0
- package/dist/src/core/hooks/github-project-sync.d.ts +16 -0
- package/dist/src/core/hooks/github-project-sync.d.ts.map +1 -0
- package/dist/src/core/hooks/github-project-sync.js +37 -0
- package/dist/src/core/hooks/github-project-sync.js.map +1 -0
- package/dist/src/core/increment/status-commands.d.ts.map +1 -1
- package/dist/src/core/increment/status-commands.js +9 -11
- package/dist/src/core/increment/status-commands.js.map +1 -1
- package/dist/src/dashboard/server/dashboard-server.d.ts +12 -0
- package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -1
- package/dist/src/dashboard/server/dashboard-server.js +39 -4
- package/dist/src/dashboard/server/dashboard-server.js.map +1 -1
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts +10 -5
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts.map +1 -1
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.js +77 -46
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.js.map +1 -1
- package/dist/src/dashboard/server/data/marketplace-aggregator.d.ts +11 -0
- package/dist/src/dashboard/server/data/marketplace-aggregator.d.ts.map +1 -1
- package/dist/src/dashboard/server/data/marketplace-aggregator.js +14 -0
- package/dist/src/dashboard/server/data/marketplace-aggregator.js.map +1 -1
- package/dist/src/dashboard/types.d.ts +7 -0
- package/dist/src/dashboard/types.d.ts.map +1 -1
- package/dist/src/sync/external-issue-auto-creator.d.ts.map +1 -1
- package/dist/src/sync/external-issue-auto-creator.js +17 -0
- package/dist/src/sync/external-issue-auto-creator.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +14 -5
- package/plugins/specweave/skills/docs/SKILL.md +47 -3
- package/plugins/specweave/skills/done/SKILL.md +26 -28
- package/plugins/specweave/skills/sync-docs/SKILL.md +68 -0
- package/plugins/specweave/skills/team-lead/SKILL.md +117 -65
- package/plugins/specweave-github/hooks/github-auto-create-handler.sh +9 -6
- package/src/templates/config.json.template +2 -1
- package/dist/dashboard/assets/index-8JtB0x7k.js +0 -11
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Sync living docs for an increment. Generates or updates spec files in .specweave/docs/internal/specs/. Use when saying "sync docs", "update living docs", or "sync-docs".
|
|
3
|
+
argument-hint: "<increment-id> [--review]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sync Living Docs
|
|
7
|
+
|
|
8
|
+
## Project Overrides
|
|
9
|
+
|
|
10
|
+
!`s="sync-docs"; for d in .specweave/skill-memories .claude/skill-memories "$HOME/.claude/skill-memories"; do p="$d/$s.md"; [ -f "$p" ] && awk '/^## Learnings$/{ok=1;next}/^## /{ok=0}ok' "$p" && break; done 2>/dev/null; true`
|
|
11
|
+
|
|
12
|
+
Sync living documentation for an increment. This generates or updates feature specs and user story files under `.specweave/docs/internal/specs/`.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
/sw:sync-docs <increment-id> # Sync living docs for increment
|
|
18
|
+
/sw:sync-docs <increment-id> --review # Dry-run: validate sync without modifying files
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
### Step 1: Resolve Increment
|
|
24
|
+
|
|
25
|
+
1. Parse the increment ID argument (required)
|
|
26
|
+
2. Find the increment directory: `.specweave/increments/NNNN-*/`
|
|
27
|
+
3. Load `spec.md` and `metadata.json`
|
|
28
|
+
|
|
29
|
+
### Step 2: Detect Mode
|
|
30
|
+
|
|
31
|
+
- If `--review` argument present: set `dryRun = true`
|
|
32
|
+
- Otherwise: set `dryRun = false`
|
|
33
|
+
|
|
34
|
+
### Step 3: Execute Sync
|
|
35
|
+
|
|
36
|
+
Run the living docs sync via CLI:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Normal mode
|
|
40
|
+
specweave sync-living-docs <increment-id>
|
|
41
|
+
|
|
42
|
+
# If CLI command not available, use Node.js directly:
|
|
43
|
+
node -e "
|
|
44
|
+
const { LivingDocsSync } = require('./dist/src/core/living-docs/living-docs-sync.js');
|
|
45
|
+
const sync = new LivingDocsSync(process.cwd());
|
|
46
|
+
sync.syncIncrement('<increment-id>').then(r => console.log(JSON.stringify(r, null, 2)));
|
|
47
|
+
"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Step 4: Report Results
|
|
51
|
+
|
|
52
|
+
Display a summary:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Living Docs Sync Results:
|
|
56
|
+
- Feature spec: created/updated/unchanged
|
|
57
|
+
- User story files: N created, M updated, K unchanged
|
|
58
|
+
- Total files affected: X
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
In review mode, prefix with: `[DRY RUN] No files were modified.`
|
|
62
|
+
|
|
63
|
+
### Step 5: Error Handling
|
|
64
|
+
|
|
65
|
+
If sync fails:
|
|
66
|
+
- Display the error message
|
|
67
|
+
- Suggest: "Check that spec.md has valid frontmatter and user stories are properly formatted"
|
|
68
|
+
- Suggest: "Run `/sw:progress-sync` for full external tool sync"
|
|
@@ -27,9 +27,7 @@ description: Orchestrate multi-agent parallel development with domain-specialize
|
|
|
27
27
|
| Action | Tool | Parameters |
|
|
28
28
|
|--------|------|------------|
|
|
29
29
|
| Create team | `TeamCreate` | `team_name`, `description` |
|
|
30
|
-
| Spawn agent | `Task` | `team_name`, `name`, `subagent_type`, `prompt`, `mode` |
|
|
31
|
-
| Spawn agent (plan mode) | `Task` | `mode: "plan"` — agent must submit plan for team lead review |
|
|
32
|
-
| Approve/reject plan | `SendMessage` | `type: "plan_approval_response"`, `request_id`, `recipient`, `approve`, `content` |
|
|
30
|
+
| Spawn agent | `Task` | `team_name`, `name`, `subagent_type`, `prompt`, `mode: "bypassPermissions"` |
|
|
33
31
|
| Send message | `SendMessage` | `type`, `recipient`, `content`, `summary` |
|
|
34
32
|
| Shutdown agent | `SendMessage` | `type: "shutdown_request"`, `recipient` |
|
|
35
33
|
|
|
@@ -201,37 +199,60 @@ The team lead acts as **architectural reviewer** for all sub-agent plans. Do NOT
|
|
|
201
199
|
|
|
202
200
|
Without review, agents may duplicate work across domains, misinterpret scope, make conflicting architectural decisions, or produce plans misaligned with the spec.
|
|
203
201
|
|
|
204
|
-
###
|
|
202
|
+
### Permission Mode: bypassPermissions (CRITICAL)
|
|
205
203
|
|
|
206
|
-
**
|
|
204
|
+
**All agents MUST be spawned with `mode: "bypassPermissions"`.** This is required because:
|
|
205
|
+
- Agents run as separate processes that encounter folder trust prompts
|
|
206
|
+
- Trust prompts require interactive input that agents CANNOT provide
|
|
207
|
+
- Without `bypassPermissions`, agents get STUCK waiting for trust confirmation and never execute
|
|
208
|
+
- This applies to ALL agent spawns — upstream and downstream
|
|
207
209
|
|
|
208
|
-
|
|
210
|
+
**NEVER use `mode: "plan"` for agent spawns** — it causes agents to block on the trust-folder prompt.
|
|
209
211
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
+
### Protocol (SendMessage-Based)
|
|
213
|
+
|
|
214
|
+
Since agents use `bypassPermissions` (not `plan` mode), plan review uses an explicit SendMessage protocol:
|
|
215
|
+
|
|
216
|
+
**Agent side** (built into every agent prompt template):
|
|
217
|
+
1. Read the increment spec and explore the codebase
|
|
218
|
+
2. Create plan files (spec.md, plan.md, tasks.md) in the increment directory
|
|
219
|
+
3. Send plan summary to team-lead:
|
|
220
|
+
```
|
|
221
|
+
SendMessage({
|
|
222
|
+
type: "message",
|
|
223
|
+
recipient: "team-lead",
|
|
224
|
+
content: "PLAN_READY: Created spec.md, plan.md, tasks.md at .specweave/increments/[ID]/. Summary: [key decisions, file list, task count]. Ready for review.",
|
|
225
|
+
summary: "Plan ready for review"
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
4. **WAIT for PLAN_APPROVED message** before starting implementation. Do NOT proceed without approval.
|
|
229
|
+
|
|
230
|
+
**Team-lead side**:
|
|
231
|
+
1. Receive `PLAN_READY` message from agent
|
|
232
|
+
2. Read the agent's plan files (spec.md, plan.md, tasks.md)
|
|
233
|
+
3. Evaluate:
|
|
212
234
|
- Does it align with the feature spec and ACs?
|
|
213
235
|
- Is the architecture consistent with existing codebase patterns?
|
|
214
236
|
- Does the agent stay within its file ownership boundaries?
|
|
215
237
|
- Are there conflicts with other agents' plans?
|
|
216
238
|
- Is scope correct — not too broad, not too narrow?
|
|
217
|
-
|
|
239
|
+
4. Approve or reject:
|
|
218
240
|
|
|
219
241
|
```
|
|
220
242
|
// Approve
|
|
221
243
|
SendMessage({
|
|
222
|
-
type: "
|
|
223
|
-
request_id: "<from plan_approval_request>",
|
|
244
|
+
type: "message",
|
|
224
245
|
recipient: "database-agent",
|
|
225
|
-
|
|
246
|
+
content: "PLAN_APPROVED: Go ahead with implementation.",
|
|
247
|
+
summary: "Plan approved"
|
|
226
248
|
});
|
|
227
249
|
|
|
228
250
|
// Reject with feedback
|
|
229
251
|
SendMessage({
|
|
230
|
-
type: "
|
|
231
|
-
request_id: "<from plan_approval_request>",
|
|
252
|
+
type: "message",
|
|
232
253
|
recipient: "database-agent",
|
|
233
|
-
|
|
234
|
-
|
|
254
|
+
content: "PLAN_REJECTED: Revise: 1) Add index on user_id for sessions. 2) Missing migration for AC-US1-03.",
|
|
255
|
+
summary: "Plan needs revision"
|
|
235
256
|
});
|
|
236
257
|
```
|
|
237
258
|
|
|
@@ -286,12 +307,18 @@ WORKFLOW:
|
|
|
286
307
|
6. Wait for contract artifacts if Phase 1 is active:
|
|
287
308
|
- Read src/types/ for shared interfaces
|
|
288
309
|
- Read openapi.yaml for API endpoints (if backend produces one)
|
|
289
|
-
7.
|
|
290
|
-
8.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
310
|
+
7. Create plan files (plan.md, tasks.md) for your increment
|
|
311
|
+
8. Send plan to team-lead and WAIT for approval:
|
|
312
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
313
|
+
content: "PLAN_READY: [increment path]. [summary of planned tasks and files].",
|
|
314
|
+
summary: "Frontend plan ready for review" })
|
|
315
|
+
9. WAIT for "PLAN_APPROVED" message. If "PLAN_REJECTED", revise and re-submit.
|
|
316
|
+
10. Execute tasks autonomously: prefer /sw:auto for autonomous execution
|
|
317
|
+
11. Run all tests for owned code (unit + integration): npm test
|
|
318
|
+
12. Run quality gate: /sw:grill
|
|
319
|
+
13. Do NOT signal completion until all tests pass
|
|
320
|
+
14. After auto completes, attempt closure via /sw:done
|
|
321
|
+
15. Signal completion via SendMessage to team-lead
|
|
295
322
|
|
|
296
323
|
RULES:
|
|
297
324
|
- WRITE only to files you own (listed above)
|
|
@@ -338,13 +365,19 @@ WORKFLOW:
|
|
|
338
365
|
6. Wait for contract artifacts if Phase 1 is active:
|
|
339
366
|
- Read prisma/schema.prisma for database schema
|
|
340
367
|
- Read src/types/ for shared interfaces
|
|
341
|
-
7.
|
|
342
|
-
8.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
368
|
+
7. Create plan files (plan.md, tasks.md) for your increment
|
|
369
|
+
8. Send plan to team-lead and WAIT for approval:
|
|
370
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
371
|
+
content: "PLAN_READY: [increment path]. [summary of planned tasks and files].",
|
|
372
|
+
summary: "Backend plan ready for review" })
|
|
373
|
+
9. WAIT for "PLAN_APPROVED" message. If "PLAN_REJECTED", revise and re-submit.
|
|
374
|
+
10. Execute tasks autonomously: prefer /sw:auto for autonomous execution
|
|
375
|
+
11. Generate or update OpenAPI spec if API routes change
|
|
376
|
+
12. Run all tests for owned code (unit + integration): npm test
|
|
377
|
+
13. Run quality gate: /sw:grill
|
|
378
|
+
14. Do NOT signal completion until all tests pass
|
|
379
|
+
15. After auto completes, attempt closure via /sw:done
|
|
380
|
+
16. Signal completion via SendMessage to team-lead
|
|
348
381
|
|
|
349
382
|
RULES:
|
|
350
383
|
- WRITE only to files you own (listed above)
|
|
@@ -380,15 +413,21 @@ WORKFLOW:
|
|
|
380
413
|
3. Create YOUR increment in YOUR repo: .specweave/increments/[ID]/
|
|
381
414
|
4. Read the increment spec and tasks
|
|
382
415
|
5. Design database schema changes
|
|
383
|
-
6.
|
|
384
|
-
7.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
416
|
+
6. Create plan files (plan.md, tasks.md) for your increment
|
|
417
|
+
7. Send plan to team-lead and WAIT for approval:
|
|
418
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
419
|
+
content: "PLAN_READY: [increment path]. [summary of schema changes, migrations, seed data].",
|
|
420
|
+
summary: "Database plan ready for review" })
|
|
421
|
+
8. WAIT for "PLAN_APPROVED" message. If "PLAN_REJECTED", revise and re-submit.
|
|
422
|
+
9. Generate Prisma migration: npx prisma migrate dev --name <migration-name>
|
|
423
|
+
10. Write seed data if needed
|
|
424
|
+
11. Execute tasks autonomously: prefer /sw:auto for autonomous execution
|
|
425
|
+
12. Run all tests for owned code (migration, seed): npm test
|
|
426
|
+
13. Run quality gate: /sw:grill
|
|
427
|
+
14. Do NOT signal completion until all tests pass
|
|
428
|
+
15. Signal CONTRACT_READY with schema details via SendMessage to team-lead
|
|
429
|
+
16. After auto completes, attempt closure via /sw:done
|
|
430
|
+
17. Signal completion via SendMessage to team-lead
|
|
392
431
|
|
|
393
432
|
RULES:
|
|
394
433
|
- WRITE only to files you own (listed above)
|
|
@@ -430,15 +469,21 @@ WORKFLOW:
|
|
|
430
469
|
3. Create YOUR increment in YOUR repo: .specweave/increments/[ID]/
|
|
431
470
|
4. Read the increment spec and tasks
|
|
432
471
|
5. Wait for ALL other agents to produce initial code
|
|
433
|
-
6.
|
|
434
|
-
7.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
472
|
+
6. Create plan files (plan.md, tasks.md) for your increment
|
|
473
|
+
7. Send plan to team-lead and WAIT for approval:
|
|
474
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
475
|
+
content: "PLAN_READY: [increment path]. [summary of test strategy, coverage plan].",
|
|
476
|
+
summary: "Testing plan ready for review" })
|
|
477
|
+
8. WAIT for "PLAN_APPROVED" message. If "PLAN_REJECTED", revise and re-submit.
|
|
478
|
+
9. Write unit tests for new services/components
|
|
479
|
+
10. Write integration tests for API endpoints
|
|
480
|
+
11. Write E2E tests for user journeys
|
|
481
|
+
12. Execute tasks autonomously: prefer /sw:auto for autonomous execution
|
|
482
|
+
13. Run all tests (unit + integration + E2E): npm test && npx playwright test
|
|
483
|
+
14. Do NOT signal completion until all tests pass -- if tests fail, fix and repeat
|
|
484
|
+
15. Run quality gate: /sw:grill
|
|
485
|
+
16. After auto completes, attempt closure via /sw:done
|
|
486
|
+
17. Signal completion via SendMessage to team-lead
|
|
442
487
|
|
|
443
488
|
RULES:
|
|
444
489
|
- WRITE only to test files (listed above)
|
|
@@ -476,15 +521,21 @@ WORKFLOW:
|
|
|
476
521
|
3. Create YOUR increment in YOUR repo: .specweave/increments/[ID]/
|
|
477
522
|
4. Read the increment spec and tasks
|
|
478
523
|
5. Audit code produced by other agents for security issues
|
|
479
|
-
6.
|
|
480
|
-
7.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
524
|
+
6. Create plan files (plan.md, tasks.md) for your increment
|
|
525
|
+
7. Send plan to team-lead and WAIT for approval:
|
|
526
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
527
|
+
content: "PLAN_READY: [increment path]. [summary of security findings, hardening plan].",
|
|
528
|
+
summary: "Security plan ready for review" })
|
|
529
|
+
8. WAIT for "PLAN_APPROVED" message. If "PLAN_REJECTED", revise and re-submit.
|
|
530
|
+
9. Implement auth/authz middleware if needed
|
|
531
|
+
10. Add input validation and sanitization
|
|
532
|
+
11. Execute tasks autonomously: prefer /sw:auto for autonomous execution
|
|
533
|
+
12. Run all tests for owned code (security tests): npm test
|
|
534
|
+
13. Run security audit tools (npm audit, dependency check)
|
|
535
|
+
14. Run quality gate: /sw:grill
|
|
536
|
+
15. Do NOT signal completion until all tests pass
|
|
537
|
+
16. After auto completes, attempt closure via /sw:done
|
|
538
|
+
17. Signal completion with security findings summary via SendMessage to team-lead
|
|
488
539
|
|
|
489
540
|
RULES:
|
|
490
541
|
- WRITE only to files you own (listed above)
|
|
@@ -582,14 +633,14 @@ TeamCreate({
|
|
|
582
633
|
|
|
583
634
|
### Step 2: Spawn Upstream Agents (Phase 1)
|
|
584
635
|
|
|
585
|
-
All agents are spawned with `mode: "
|
|
636
|
+
All agents are spawned with `mode: "bypassPermissions"` to prevent blocking on trust-folder prompts. Plan review is enforced via the SendMessage PLAN_READY/PLAN_APPROVED protocol (see Section 3b).
|
|
586
637
|
|
|
587
638
|
```typescript
|
|
588
639
|
Task({
|
|
589
640
|
team_name: "feature-checkout",
|
|
590
641
|
name: "database-agent",
|
|
591
642
|
subagent_type: "general-purpose",
|
|
592
|
-
mode: "
|
|
643
|
+
mode: "bypassPermissions",
|
|
593
644
|
prompt: `[DATABASE AGENT PROMPT - see template in Section 4c]`,
|
|
594
645
|
});
|
|
595
646
|
|
|
@@ -597,7 +648,7 @@ Task({
|
|
|
597
648
|
team_name: "feature-checkout",
|
|
598
649
|
name: "shared-types-agent",
|
|
599
650
|
subagent_type: "general-purpose",
|
|
600
|
-
mode: "
|
|
651
|
+
mode: "bypassPermissions",
|
|
601
652
|
prompt: `[SHARED/TYPES AGENT PROMPT]`,
|
|
602
653
|
});
|
|
603
654
|
```
|
|
@@ -613,7 +664,7 @@ Task({
|
|
|
613
664
|
team_name: "feature-checkout",
|
|
614
665
|
name: "backend-agent",
|
|
615
666
|
subagent_type: "general-purpose",
|
|
616
|
-
mode: "
|
|
667
|
+
mode: "bypassPermissions",
|
|
617
668
|
prompt: `[BACKEND AGENT PROMPT - see template in Section 4b]`,
|
|
618
669
|
});
|
|
619
670
|
|
|
@@ -621,7 +672,7 @@ Task({
|
|
|
621
672
|
team_name: "feature-checkout",
|
|
622
673
|
name: "frontend-agent",
|
|
623
674
|
subagent_type: "general-purpose",
|
|
624
|
-
mode: "
|
|
675
|
+
mode: "bypassPermissions",
|
|
625
676
|
prompt: `[FRONTEND AGENT PROMPT - see template in Section 4a]`,
|
|
626
677
|
});
|
|
627
678
|
|
|
@@ -629,7 +680,7 @@ Task({
|
|
|
629
680
|
team_name: "feature-checkout",
|
|
630
681
|
name: "testing-agent",
|
|
631
682
|
subagent_type: "general-purpose",
|
|
632
|
-
mode: "
|
|
683
|
+
mode: "bypassPermissions",
|
|
633
684
|
prompt: `[TESTING AGENT PROMPT - see template in Section 4d]`,
|
|
634
685
|
});
|
|
635
686
|
```
|
|
@@ -691,12 +742,12 @@ Orchestrator Final Check:
|
|
|
691
742
|
├── Step 1: Analyze feature -> identify domains -> decide increment split
|
|
692
743
|
├── Step 2: Create team via TeamCreate
|
|
693
744
|
├── Step 3: Create per-domain increments
|
|
694
|
-
├── Step 4: Contract-first spawning (all agents with mode: "
|
|
745
|
+
├── Step 4: Contract-first spawning (all agents with mode: "bypassPermissions")
|
|
695
746
|
│ ├── Phase 1: Spawn shared + database
|
|
696
|
-
│ │ └──
|
|
747
|
+
│ │ └── Receive PLAN_READY, review & approve via SendMessage (Section 3b)
|
|
697
748
|
│ │ └── Wait for CONTRACT_READY after approval
|
|
698
749
|
│ └── Phase 2: Spawn backend + frontend + testing
|
|
699
|
-
│ └──
|
|
750
|
+
│ └── Receive PLAN_READY, review & approve via SendMessage
|
|
700
751
|
├── Step 5: Monitor progress via SendMessage
|
|
701
752
|
├── Step 6: Quality gates (each agent runs /sw:grill)
|
|
702
753
|
└── Step 7: Merge and close (/sw:team-merge)
|
|
@@ -729,6 +780,7 @@ To execute, run without --dry-run.
|
|
|
729
780
|
|
|
730
781
|
| Issue | Cause | Fix |
|
|
731
782
|
|-------|-------|-----|
|
|
783
|
+
| **Agent stuck on trust folder** | Agent spawned without `bypassPermissions` | ALWAYS use `mode: "bypassPermissions"` — NEVER `mode: "plan"`. Trust prompts require interactive input agents cannot provide |
|
|
732
784
|
| **Agents editing same files** | Overlapping file ownership patterns | Review ownership map; reassign conflicting files to a single owner; use `--dry-run` to validate before launch |
|
|
733
785
|
| **Token cost too high** | Too many agents or overly large prompts | Reduce `--max-agents`; use `--domains` to limit scope; split feature into smaller increments |
|
|
734
786
|
| **Contract agent takes too long** | Large schema or complex type system | Set a timeout in the agent prompt; if stuck >15 min, check agent output and consider splitting the contract work |
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# Features:
|
|
8
8
|
# - Idempotent: checks existing issues before creating
|
|
9
9
|
# - Updates metadata.json with external links
|
|
10
|
-
# - Debounce (
|
|
10
|
+
# - Debounce (30s window to batch rapid spec edits)
|
|
11
11
|
# - Circuit breaker (3 consecutive failures → auto-disable)
|
|
12
12
|
# - Non-blocking (all errors → exit 0)
|
|
13
13
|
#
|
|
@@ -51,6 +51,9 @@ log() {
|
|
|
51
51
|
[[ ! -f "$SPEC_PATH" ]] && exit 0
|
|
52
52
|
[[ ! -f "$CONFIG_PATH" ]] && exit 0
|
|
53
53
|
|
|
54
|
+
# Template guard: skip if spec.md still contains placeholder markers
|
|
55
|
+
grep -q '\[Story Title\]' "$SPEC_PATH" && { log "Skipping: spec.md still contains [Story Title] template markers"; exit 0; }
|
|
56
|
+
|
|
54
57
|
command -v gh &>/dev/null || { log "gh CLI not found"; exit 0; }
|
|
55
58
|
command -v jq &>/dev/null || { log "jq not found"; exit 0; }
|
|
56
59
|
|
|
@@ -106,26 +109,26 @@ if [[ -f "$CB_FILE" ]]; then
|
|
|
106
109
|
fi
|
|
107
110
|
|
|
108
111
|
# ============================================================================
|
|
109
|
-
# DEBOUNCE (
|
|
112
|
+
# DEBOUNCE (30s window — spec.md may be written multiple times during planning)
|
|
110
113
|
# ============================================================================
|
|
111
114
|
|
|
112
115
|
if [[ "${SPECWEAVE_SKIP_DEBOUNCE:-0}" != "1" ]]; then
|
|
113
116
|
DEBOUNCE_FILE="$STATE_DIR/.github-auto-create-pending-$INC_ID"
|
|
114
117
|
if [[ -f "$DEBOUNCE_FILE" ]]; then
|
|
115
118
|
SIGNAL_AGE=$(($(date +%s) - $(stat -f "%m" "$DEBOUNCE_FILE" 2>/dev/null || echo 0)))
|
|
116
|
-
if (( SIGNAL_AGE <
|
|
117
|
-
log "Debounce: signal age ${SIGNAL_AGE}s <
|
|
119
|
+
if (( SIGNAL_AGE < 30 )); then
|
|
120
|
+
log "Debounce: signal age ${SIGNAL_AGE}s < 30s. Deferring."
|
|
118
121
|
exit 0
|
|
119
122
|
fi
|
|
120
123
|
fi
|
|
121
124
|
echo "$(date +%s)" > "$DEBOUNCE_FILE" 2>/dev/null || true
|
|
122
|
-
sleep
|
|
125
|
+
sleep 30
|
|
123
126
|
# Check if a newer invocation took over
|
|
124
127
|
if [[ -f "$DEBOUNCE_FILE" ]]; then
|
|
125
128
|
CURRENT_SIGNAL=$(cat "$DEBOUNCE_FILE" 2>/dev/null || echo 0)
|
|
126
129
|
NOW=$(date +%s)
|
|
127
130
|
SIGNAL_AGE=$((NOW - CURRENT_SIGNAL))
|
|
128
|
-
if (( SIGNAL_AGE >
|
|
131
|
+
if (( SIGNAL_AGE > 32 )); then
|
|
129
132
|
log "Debounce: newer invocation detected. Exiting."
|
|
130
133
|
exit 0
|
|
131
134
|
fi
|