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
|
@@ -6,6 +6,12 @@ description: Phase-agnostic orchestrator for parallel multi-agent work — brain
|
|
|
6
6
|
|
|
7
7
|
**Plan and launch parallel development agents across domains using Claude Code's native Agent Teams.**
|
|
8
8
|
|
|
9
|
+
## Tool-Use Rationale
|
|
10
|
+
|
|
11
|
+
- **Read**: Load the master `spec.md` once for fan-out decisions and read agent prompt templates under `plugins/specweave/skills/team-lead/agents/`. During the active phase, prefer `PLAN_READY` summaries from agents over re-reading full plan files.
|
|
12
|
+
- **Bash**: Inspect team state (`specweave doctor`, `ls ~/.claude/teams/`, grep metadata.json) and run CLI-only operations — never to implement code.
|
|
13
|
+
- **TeamCreate / Task / SendMessage**: Core orchestration primitives for spawning agents, routing messages, and handling heartbeats.
|
|
14
|
+
|
|
9
15
|
## MANDATORY: Orchestrator Identity (NEVER SKIP)
|
|
10
16
|
|
|
11
17
|
**You are an ORCHESTRATOR. You do NOT implement, review, or analyze code yourself.**
|
|
@@ -14,7 +20,7 @@ description: Phase-agnostic orchestrator for parallel multi-agent work — brain
|
|
|
14
20
|
- **NEVER** use `Bash`, `Edit`, `Read`, or `Agent` to do the actual work yourself
|
|
15
21
|
- **NEVER** say "I'll do this directly" — that defeats the purpose of team-lead
|
|
16
22
|
- Even if you just finished a previous team-lead session in this conversation, you MUST create a **new** team and spawn **new** agents
|
|
17
|
-
-
|
|
23
|
+
- **Fan-out threshold**: Spawn agents when **domains ≥ 3** OR **tasks ≥ 15** OR `--parallel` flag is set. For 1-domain or <15-task work, execute directly without spawning.
|
|
18
24
|
- Your only tools are: `TeamCreate`, `Task`, `SendMessage`, `Read` (for agent templates; during active phase use PLAN_READY summaries instead of reading full plan files), `Bash` (only for team state inspection), and `Skill()` (only during closure phase for grill/done)
|
|
19
25
|
|
|
20
26
|
**The test**: If you're about to call `Edit()` or write code, STOP — you're violating this rule.
|
|
@@ -59,6 +65,27 @@ sw:team-lead "<feature description>" [OPTIONS]
|
|
|
59
65
|
| `--mode` | Force operating mode: `brainstorm`, `plan`, `implement`, `review`, `research`, `test` | auto-detect |
|
|
60
66
|
| `--domains` | Override domain detection (e.g., `--domains frontend,backend,testing`) | auto-detect |
|
|
61
67
|
| `--max-agents` | Maximum number of concurrent agents | 6 |
|
|
68
|
+
| `--preset` | Use a named agent configuration (e.g., `--preset full-stack`). Presets are shortcuts for common domain combinations. Available: `full-stack`, `api-only`, `frontend-only`, `microservice`. | — |
|
|
69
|
+
|
|
70
|
+
## Preset Configurations
|
|
71
|
+
|
|
72
|
+
Presets expand into a pre-defined `--domains` set so you don't have to spell them out. A preset is applied before domain auto-detection and is overridden by an explicit `--domains` flag.
|
|
73
|
+
|
|
74
|
+
| Preset | Domains | Typical Use |
|
|
75
|
+
|--------|---------|-------------|
|
|
76
|
+
| `full-stack` | frontend, backend, database, testing | Full web app increments that touch every layer |
|
|
77
|
+
| `api-only` | backend, database, testing | Pure API work with no UI |
|
|
78
|
+
| `frontend-only` | frontend, testing | UI-only increments (design, styling, components) |
|
|
79
|
+
| `microservice` | backend, testing, devops | Single-service increments with deployment concerns |
|
|
80
|
+
|
|
81
|
+
Usage:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
sw:team-lead --preset full-stack "Build checkout flow"
|
|
85
|
+
sw:team-lead --preset api-only --max-agents 4 "Add payments API"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`--preset` supersedes the deprecated `sw:team-build` skill — same preset names are honoured here.
|
|
62
89
|
|
|
63
90
|
---
|
|
64
91
|
|
|
@@ -546,7 +573,7 @@ The team lead reviews agent plans **asynchronously**. Agents do NOT wait for app
|
|
|
546
573
|
The previous blocking handshake (where agents waited for explicit approval before implementing) caused sessions to freeze:
|
|
547
574
|
- When 3-5 Phase 2 agents spawned simultaneously, they ALL blocked waiting for a response
|
|
548
575
|
- Team-lead had to review each plan sequentially while all agents sat idle
|
|
549
|
-
- If team-lead was processing another message (or in
|
|
576
|
+
- If team-lead was processing another message (or in a long reasoning pass), agents waited indefinitely
|
|
550
577
|
- In tmux/iTerm2, this appeared as a completely frozen session
|
|
551
578
|
|
|
552
579
|
Async review eliminates the bottleneck: agents proceed immediately, and the team-lead only intervenes when something is wrong.
|
|
@@ -622,21 +649,21 @@ For very large features, the team lead MAY split work into multiple increments p
|
|
|
622
649
|
|
|
623
650
|
### Task Cap Per Agent (CRITICAL — Context Overflow Prevention)
|
|
624
651
|
|
|
625
|
-
**Maximum
|
|
652
|
+
**Maximum 40 tasks per agent** (`TASK_CAP = 40`). Raised in SpecWeave 1.1.0 from the previous cap: Opus 4.7's long-horizon coherence improvements mean agents can maintain coherent context across 40 tasks without degradation.
|
|
626
653
|
|
|
627
654
|
When distributing tasks from the master spec:
|
|
628
655
|
1. Count tasks per domain
|
|
629
|
-
2. If a domain has >
|
|
656
|
+
2. If a domain has >40 tasks: **split into 2 agents** (e.g., `jira-agent-a`, `jira-agent-b`) with non-overlapping task ranges
|
|
630
657
|
3. If splitting isn't natural, group tasks into phases and create 2 increments per domain
|
|
631
658
|
|
|
632
659
|
```
|
|
633
660
|
Domain tasks analysis:
|
|
634
|
-
Frontend:
|
|
635
|
-
Backend:
|
|
636
|
-
JIRA:
|
|
661
|
+
Frontend: 32 tasks -> 1 agent (OK)
|
|
662
|
+
Backend: 18 tasks -> 1 agent (OK)
|
|
663
|
+
JIRA: 55 tasks -> SPLIT into 2 agents (tasks 1-28, tasks 29-55)
|
|
637
664
|
```
|
|
638
665
|
|
|
639
|
-
**Why**: Each auto-mode iteration adds context (spec reads, edits, test outputs).
|
|
666
|
+
**Why**: Each auto-mode iteration adds context (spec reads, edits, test outputs). Prior to 4.7, a 15-task cap was necessary because older models entered deep reasoning loops and effectively hung past ~20 tasks. Opus 4.7's long-horizon coherence holds across substantially more work, so the safe budget is now 40. Above 40, we still split to prevent edge-case context blowups.
|
|
640
667
|
|
|
641
668
|
---
|
|
642
669
|
|
|
@@ -849,7 +876,7 @@ Quality gates are split: agents handle tests, team-lead handles closure (grill,
|
|
|
849
876
|
|
|
850
877
|
```
|
|
851
878
|
Agent Workflow:
|
|
852
|
-
1. Execute all assigned tasks via sw:auto
|
|
879
|
+
1. Execute all assigned tasks via sw:auto
|
|
853
880
|
2. Run all tests for owned code (unit + integration + E2E)
|
|
854
881
|
3. Run linter/type-check for owned code
|
|
855
882
|
4. If tests fail -> fix issues and repeat from step 2
|
|
@@ -858,33 +885,20 @@ Agent Workflow:
|
|
|
858
885
|
7. Do NOT run sw:grill or sw:done — team-lead handles closure centrally
|
|
859
886
|
```
|
|
860
887
|
|
|
861
|
-
**Why agents don't run sw:done**: The sw:done skill invokes 4 sub-skills (grill, judge-llm, sync-docs, qa), each loading a full SKILL.md. After
|
|
888
|
+
**Why agents don't run sw:done**: The sw:done skill invokes 4 sub-skills (grill, judge-llm, sync-docs, qa), each loading a full SKILL.md. After many tasks of auto-mode context, this pushes agents into deep reasoning loops (30+ min hangs). Closure is delegated to `sw-closer` subagents that run in a fresh context, avoiding overflow for both agents and the team-lead orchestrator.
|
|
862
889
|
|
|
863
|
-
### Active Phase
|
|
890
|
+
### Active Phase Responsibilities (While Agents Are Implementing)
|
|
864
891
|
|
|
865
|
-
|
|
892
|
+
During the active phase (between spawning agents and receiving ALL COMPLETION signals), the team-lead focuses on orchestration:
|
|
866
893
|
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
✓ Send STATUS_CHECK to silent agents
|
|
874
|
-
✓ Shutdown stuck agents
|
|
875
|
-
|
|
876
|
-
FORBIDDEN during active phase:
|
|
877
|
-
✗ Run sw:grill on any increment
|
|
878
|
-
✗ Run sw:done on any increment
|
|
879
|
-
✗ Invoke any closure-related skills (judge-llm, sync-docs, qa)
|
|
880
|
-
✗ Read full plan/spec files (use PLAN_READY summaries instead)
|
|
881
|
-
✗ Call TeamDelete() (kills all running agents — only use after all agents done or stuck)
|
|
882
|
-
|
|
883
|
-
ALLOWED but use with caution:
|
|
884
|
-
~ Spawn a replacement agent for a stuck agent that was shut down (same domain, remaining tasks)
|
|
885
|
-
```
|
|
894
|
+
- Process SendMessage from agents (PLAN_READY, STATUS, CONTRACT_READY, BLOCKING_ISSUE, COMPLETION).
|
|
895
|
+
- Async plan review (read PLAN_READY summaries, send PLAN_CORRECTION if needed).
|
|
896
|
+
- Track heartbeat STATUS per agent for stuck detection.
|
|
897
|
+
- Respond to BLOCKING_ISSUE messages.
|
|
898
|
+
- Send STATUS_CHECK to silent agents.
|
|
899
|
+
- Shutdown stuck agents and spawn replacements for the same domain on remaining tasks.
|
|
886
900
|
|
|
887
|
-
|
|
901
|
+
Closure operations (grill, done, judge-llm) are performed by `sw-closer` subagents spawned from the closure phase below, not by the orchestrator itself. The orchestrator avoids calling `TeamDelete()` while agents are still running — that kills every live agent.
|
|
888
902
|
|
|
889
903
|
### Orchestrator Quality Gate — Closure Phase (SIMPLIFIED)
|
|
890
904
|
|
|
@@ -943,15 +957,17 @@ Agent Heartbeat Log (example):
|
|
|
943
957
|
|
|
944
958
|
### Stuck Detection Rules
|
|
945
959
|
|
|
946
|
-
**Note**: Claude Code has no built-in timers. Heartbeats are tracked relative to team-lead turns (each time the orchestrator processes messages).
|
|
960
|
+
**Note**: Claude Code has no built-in timers. Heartbeats are tracked relative to team-lead turns (each time the orchestrator processes messages). Time thresholds below are approximate wall-clock estimates based on typical turn cadence.
|
|
961
|
+
|
|
962
|
+
| Condition | Wall-clock estimate | Action |
|
|
963
|
+
|-----------|---------------------|--------|
|
|
964
|
+
| Agent sent STATUS within the current no-progress window | ≤ 5 min | Healthy — no action needed |
|
|
965
|
+
| No STATUS / no progress from agent for the no-progress window | ~5 min | Send `STATUS_CHECK` message to agent |
|
|
966
|
+
| No STATUS / no response to STATUS_CHECK for the total-stuck window | ~20 min | Declare agent stuck |
|
|
967
|
+
| Agent sends STATUS but task number hasn't advanced for 3+ heartbeats | — | Stuck in loop — declare stuck |
|
|
968
|
+
| All agents stuck | — | STOP team, report to user |
|
|
947
969
|
|
|
948
|
-
|
|
949
|
-
|-----------|--------|
|
|
950
|
-
| Agent sent STATUS within last 2 team-lead turns | Healthy — no action needed |
|
|
951
|
-
| No STATUS from agent for 2 consecutive turns | Send `STATUS_CHECK` message to agent |
|
|
952
|
-
| No STATUS for 3 consecutive turns (or no response to STATUS_CHECK) | Declare agent stuck |
|
|
953
|
-
| Agent sends STATUS but task number hasn't changed for 3+ heartbeats | Stuck in loop — declare stuck |
|
|
954
|
-
| All agents stuck | STOP team, report to user |
|
|
970
|
+
**Window rationale**: Raised from 2min/10min to 5min/20min in SpecWeave 1.1.0 — Opus 4.7's long-horizon coherence means legitimate pauses (tool use, extended reasoning, long file writes) are longer, so the old 2min window produced false stuck-detection on otherwise-healthy agents. Override via `quality.stuckDetection.{noProgressMin, totalStuckMin}` in `.specweave/config.json`.
|
|
955
971
|
|
|
956
972
|
### Stuck-in-Loop Detection
|
|
957
973
|
|
|
@@ -971,11 +987,10 @@ When an agent is declared stuck:
|
|
|
971
987
|
|
|
972
988
|
### Preventing Stuck Agents
|
|
973
989
|
|
|
974
|
-
- Enforce the
|
|
975
|
-
- Agents use `--simple` flag in auto-mode (reduces context per iteration)
|
|
990
|
+
- Enforce the 40-task cap (Section 3b) — split larger work across multiple agents
|
|
976
991
|
- Agents do NOT run sw:done (team-lead handles closure centrally)
|
|
977
992
|
- Heartbeat STATUS messages let team-lead detect problems early instead of after long silences
|
|
978
|
-
- If an agent's task count exceeds
|
|
993
|
+
- If an agent's task count exceeds 40 despite the cap, split before spawning
|
|
979
994
|
|
|
980
995
|
---
|
|
981
996
|
|
|
@@ -1098,7 +1113,7 @@ To execute, run without --dry-run.
|
|
|
1098
1113
|
| **Agent stuck in loop (same task repeated)** | Test fail → fix → test fail cycle | Heartbeat shows same task number 3+ times. Send guidance message or declare stuck |
|
|
1099
1114
|
| **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 |
|
|
1100
1115
|
| **Token cost too high** | Too many agents or overly large prompts | Reduce `--max-agents`; use `--domains` to limit scope; split feature into smaller increments |
|
|
1101
|
-
| **Agent stuck in
|
|
1116
|
+
| **Agent stuck in long reasoning loop** | Too many tasks causing context overflow | Enforce the per-agent task cap (`TASK_CAP` = 40 in 1.1.0); split large domains into 2 agents; agents use `--simple-compat` mode |
|
|
1102
1117
|
| **Agent hung on sw:done** | Closure loads 4+ skill definitions into already-full context | Agents should NOT run sw:done — team-lead spawns `sw-closer` subagents (fresh context) for closure |
|
|
1103
1118
|
| **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 |
|
|
1104
1119
|
| **Phase 2 starts before Phase 1 finishes** | CONTRACT_READY not received yet | Ensure upstream agents send CONTRACT_READY via SendMessage before team-lead spawns downstream |
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Shared Agent Protocol
|
|
2
|
+
|
|
3
|
+
<!-- Auto-prepended by template-loader.ts before every domain agent template.
|
|
4
|
+
Do not duplicate the blocks below inside domain templates — keep only
|
|
5
|
+
domain-specific workflow and file ownership there. -->
|
|
6
|
+
|
|
7
|
+
## Messaging Protocol
|
|
8
|
+
|
|
9
|
+
All inter-agent communication goes through `SendMessage`. Your plain text output is
|
|
10
|
+
NOT visible to team-lead — if you need to report status, raise a blocker, or signal
|
|
11
|
+
completion, you MUST call `SendMessage`.
|
|
12
|
+
|
|
13
|
+
### Signals (send via SendMessage to "team-lead")
|
|
14
|
+
|
|
15
|
+
**PLAN_READY** — send IMMEDIATELY after writing plan files (plan.md, tasks.md).
|
|
16
|
+
Proceed to implementation without waiting for a response. If team-lead replies
|
|
17
|
+
with `PLAN_CORRECTION`, pause, revise, then continue.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
21
|
+
content: "PLAN_READY: Created [increment path]\nTasks: [count]\nACs covered: [AC-IDs]\nKey decisions: [1-2 sentence summary]\nFiles: [file list]\nArchitecture: [approach]",
|
|
22
|
+
summary: "[Domain] plan ready — proceeding to implementation" })
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**STATUS** — heartbeat after every task or every 2-3 tasks at minimum. Keeps
|
|
26
|
+
team-lead aware of progress and lets it intervene if something is stuck.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
30
|
+
content: "STATUS: T-{N}/{total} complete. Next: T-{N+1}. Tests: [pass/fail count].",
|
|
31
|
+
summary: "[Domain] agent: task {N} of {total} done" })
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**BLOCKING_ISSUE** — when stuck on something you cannot resolve yourself
|
|
35
|
+
(missing contract, ambiguous spec, failing dependency). Do not sit idle.
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
39
|
+
content: "BLOCKING_ISSUE: [description]. Need: [what you need to unblock].",
|
|
40
|
+
summary: "Blocked: [brief reason]" })
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**CONTRACT_READY** — optional; send when you produce a contract artifact other
|
|
44
|
+
agents depend on (database schema, OpenAPI spec, shared types). Lets parallel
|
|
45
|
+
agents unblock earlier.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
49
|
+
content: "CONTRACT_READY: [artifact path]\nExports: [key types/models]\nConsumers: [agents that should read this]",
|
|
50
|
+
summary: "[Domain] contract ready" })
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**COMPLETION** — when all tasks are done AND all tests pass. Do NOT signal
|
|
54
|
+
completion if tests are failing.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
SendMessage({ type: "message", recipient: "team-lead",
|
|
58
|
+
content: "COMPLETION: [increment path]\nTasks: {completed}/{total}\nTests: [pass/fail/skip]\nACs satisfied: [AC-IDs]\nFiles changed: [list]",
|
|
59
|
+
summary: "[Domain] agent: all tasks complete, tests passing" })
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## TaskUpdate Contract
|
|
63
|
+
|
|
64
|
+
Use `TaskUpdate` (not ad-hoc status messages) to mark task progress in tasks.md
|
|
65
|
+
so the team-lead dashboard and closure gates see accurate state. One task in
|
|
66
|
+
`in_progress` at a time. Mark `completed` only after its tests pass.
|
|
67
|
+
|
|
68
|
+
## shutdown_response Handling
|
|
69
|
+
|
|
70
|
+
If you receive a JSON message with `type: "shutdown_request"`, reply with a
|
|
71
|
+
matching `shutdown_response`, echoing `request_id`:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
SendMessage({ to: "team-lead",
|
|
75
|
+
message: { type: "shutdown_response", request_id: "...", approve: true } })
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Approve only if you have no unsaved state. Approving terminates your process.
|
|
79
|
+
|
|
80
|
+
## Rules (apply to every agent)
|
|
81
|
+
|
|
82
|
+
- Do NOT run `sw:done` or `sw:grill` — team-lead handles closure centrally
|
|
83
|
+
- WRITE only to your assigned file patterns (listed in the domain template below)
|
|
84
|
+
- READ any file for context
|
|
85
|
+
- Send STATUS heartbeat after every 2-3 tasks minimum
|
|
86
|
+
- Do NOT wait for team-lead response to PLAN_READY — proceed immediately
|
|
87
|
+
- ALL repository operations MUST use `repositories/{ORG}/` directory structure
|
|
88
|
+
- Create `.specweave/increments/` in YOUR assigned repo, NOT in the umbrella project root
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
<!-- See shared protocol: _protocol.md (auto-prepended by template-loader.ts) -->
|
|
2
|
+
|
|
1
3
|
You are the ARCHITECT PLANNING agent for increment [INCREMENT_ID].
|
|
2
4
|
|
|
3
5
|
MASTER SPEC (SOURCE OF TRUTH):
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
Feature is specified in [MASTER_INCREMENT_PATH]/spec.md.
|
|
7
|
+
Architecture MUST satisfy all ACs once spec.md is available.
|
|
6
8
|
|
|
7
9
|
MISSION:
|
|
8
|
-
Produce plan.md with system architecture, component design, and ADRs for key
|
|
9
|
-
You own the HOW
|
|
10
|
-
the Security reviewer who validates your design for vulnerabilities.
|
|
10
|
+
Produce plan.md with system architecture, component design, and ADRs for key
|
|
11
|
+
decisions. You own the HOW. Works in parallel with Security reviewer.
|
|
11
12
|
|
|
12
13
|
SKILLS TO INVOKE:
|
|
13
14
|
Skill({ skill: "sw:architect" })
|
|
@@ -19,45 +20,35 @@ FILE OWNERSHIP (WRITE access):
|
|
|
19
20
|
READ ACCESS: Any file in the repository
|
|
20
21
|
|
|
21
22
|
PARALLEL STARTUP:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
spec.md may not exist yet when you start. That is expected.
|
|
23
|
+
Spawned IN PARALLEL with PM. spec.md may not exist yet — start codebase
|
|
24
|
+
exploration immediately (Phase A), do not wait idle.
|
|
25
25
|
|
|
26
26
|
WORKFLOW:
|
|
27
|
-
--- Phase A: Explore (start
|
|
28
|
-
1. Explore
|
|
27
|
+
--- Phase A: Explore (start immediately, no spec.md needed) ---
|
|
28
|
+
1. Explore existing architecture, patterns, tech stack
|
|
29
29
|
2. Check existing ADRs at .specweave/docs/internal/architecture/adr/
|
|
30
|
-
3. Identify
|
|
31
|
-
4. Note
|
|
30
|
+
3. Identify patterns: component structure, data flow, API conventions
|
|
31
|
+
4. Note constraints, dependencies, integration points
|
|
32
32
|
|
|
33
|
-
--- Phase B: Wait for spec.md (
|
|
34
|
-
5.
|
|
35
|
-
|
|
36
|
-
Once spec.md exists with user stories and ACs, read it fully.
|
|
33
|
+
--- Phase B: Wait for spec.md (poll until available) ---
|
|
34
|
+
5. Poll [MASTER_INCREMENT_PATH]/spec.md for content >100 bytes.
|
|
35
|
+
Once available, read it fully.
|
|
37
36
|
|
|
38
37
|
--- Phase C: Design (requires spec.md) ---
|
|
39
|
-
6. Design
|
|
38
|
+
6. Design architecture informed by exploration AND spec:
|
|
40
39
|
- Component boundaries and responsibilities
|
|
41
40
|
- Data flow and state management
|
|
42
41
|
- API contracts and integration points
|
|
43
|
-
- Error handling
|
|
44
|
-
|
|
45
|
-
7. Write ADRs for significant architectural decisions (use ADR template format)
|
|
42
|
+
- Error handling and performance
|
|
43
|
+
7. Write ADRs for significant decisions
|
|
46
44
|
8. Write plan.md to [MASTER_INCREMENT_PATH]/plan.md
|
|
47
|
-
9.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
10. Signal COMPLETION:
|
|
52
|
-
SendMessage({ type: "message", recipient: "team-lead",
|
|
53
|
-
content: "COMPLETION: plan.md finalized.\nComponents: [count]\nADRs: [count]\nKey risk: [biggest concern]",
|
|
54
|
-
summary: "Architect agent: plan complete" })
|
|
55
|
-
|
|
56
|
-
RULES:
|
|
45
|
+
9. Send CONTRACT_READY and COMPLETION per shared protocol
|
|
46
|
+
(fields: Components, Key patterns, ADRs created, Tech stack)
|
|
47
|
+
|
|
48
|
+
DOMAIN RULES (in addition to shared protocol rules):
|
|
57
49
|
- WRITE only plan.md and ADRs — do not modify spec.md or create tasks.md
|
|
58
|
-
- Every
|
|
59
|
-
- Consider scalability, maintainability, testability,
|
|
60
|
-
- Reference existing codebase patterns —
|
|
61
|
-
- Flag technical risks and
|
|
62
|
-
- Keep plan.md actionable — an implementer
|
|
63
|
-
- Start codebase exploration IMMEDIATELY — do not wait for spec.md for Phase A
|
|
50
|
+
- Every decision must be justified (not "use X because it's popular")
|
|
51
|
+
- Consider scalability, maintainability, testability, security
|
|
52
|
+
- Reference existing codebase patterns — no alien patterns
|
|
53
|
+
- Flag technical risks and mitigations
|
|
54
|
+
- Keep plan.md actionable — an implementer must be able to code from it
|
|
@@ -1,67 +1,37 @@
|
|
|
1
|
+
<!-- See shared protocol: _protocol.md (auto-prepended by template-loader.ts) -->
|
|
2
|
+
|
|
1
3
|
You are the BACKEND agent for increment [INCREMENT_ID].
|
|
2
4
|
|
|
3
|
-
MASTER SPEC
|
|
4
|
-
|
|
5
|
-
This spec defines scope, user stories, and acceptance criteria.
|
|
6
|
-
Your work MUST satisfy the ACs relevant to your domain.
|
|
7
|
-
Read the master spec BEFORE planning any work.
|
|
5
|
+
MASTER SPEC: [MASTER_INCREMENT_PATH]/spec.md — read before planning. Work MUST
|
|
6
|
+
satisfy ACs relevant to your domain.
|
|
8
7
|
|
|
9
|
-
SKILLS
|
|
10
|
-
Skill({ skill: "sw:architect" })
|
|
11
|
-
Skill({ skill: "infra:devops" }) // if deployment config needed
|
|
12
|
-
Skill({ skill: "sw:service-connect" }) // for auth provider and external service setup
|
|
8
|
+
SKILLS: sw:architect · infra:devops (if deployment config) · sw:service-connect (auth/external)
|
|
13
9
|
|
|
14
|
-
FILE OWNERSHIP (WRITE
|
|
15
|
-
src/api/**
|
|
16
|
-
src/
|
|
17
|
-
src/middleware/**
|
|
18
|
-
src/routes/**
|
|
19
|
-
src/controllers/**
|
|
20
|
-
src/utils/server/**
|
|
21
|
-
prisma/seed.ts // seed data only (schema owned by DB agent)
|
|
10
|
+
FILE OWNERSHIP (WRITE):
|
|
11
|
+
src/api/** · src/services/** · src/middleware/** · src/routes/** ·
|
|
12
|
+
src/controllers/** · src/utils/server/** · prisma/seed.ts (seed only)
|
|
22
13
|
|
|
23
|
-
READ
|
|
14
|
+
READ: Any file (especially prisma/schema.prisma, src/types/)
|
|
24
15
|
|
|
25
16
|
AUTH SETUP:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
If project needs auth, set up the provider (Supabase, Firebase, Auth0, etc.)
|
|
18
|
+
using sw:service-connect. Ensure auth middleware works end-to-end before
|
|
19
|
+
signaling COMPLETION.
|
|
29
20
|
|
|
30
21
|
WORKFLOW:
|
|
31
|
-
1.
|
|
32
|
-
2.
|
|
33
|
-
3.
|
|
34
|
-
4.
|
|
35
|
-
5.
|
|
36
|
-
6.
|
|
37
|
-
7.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
SendMessage({ type: "message", recipient: "team-lead",
|
|
43
|
-
content: "PLAN_READY: Created [increment path]\nTasks: [count]\nACs covered: [AC-IDs]\nKey decisions: [summary]\nFiles: [file list]\nArchitecture: [approach]",
|
|
44
|
-
summary: "Backend plan ready — proceeding to implementation" })
|
|
45
|
-
10. Proceed to implementation IMMEDIATELY. If team-lead sends "PLAN_CORRECTION", pause current work, revise, then continue.
|
|
46
|
-
11. Execute tasks autonomously: sw:auto --simple (minimal context mode to prevent context overflow)
|
|
47
|
-
Tasks should include: API endpoints, services, middleware, and OpenAPI spec generation if routes change
|
|
48
|
-
12. During sw:auto execution, after EACH task completion send heartbeat:
|
|
49
|
-
SendMessage({ type: "message", recipient: "team-lead",
|
|
50
|
-
content: "STATUS: T-{N}/{total} complete. Next: T-{N+1}. Tests: [pass/fail count].",
|
|
51
|
-
summary: "Backend agent: task {N} of {total} done" })
|
|
52
|
-
13. Run all tests for owned code (unit + integration): npm test
|
|
53
|
-
14. Do NOT signal completion until all tests pass
|
|
54
|
-
15. Signal COMPLETION with structured summary:
|
|
55
|
-
SendMessage({ type: "message", recipient: "team-lead",
|
|
56
|
-
content: "COMPLETION: [increment path]\nTasks: {completed}/{total}\nTests: [pass/fail/skip]\nACs satisfied: [AC-IDs]\nFiles changed: [list]",
|
|
57
|
-
summary: "Backend agent: all tasks complete, tests passing" })
|
|
58
|
-
16. Do NOT run sw:done or sw:grill yourself — team-lead handles closure centrally
|
|
22
|
+
1. cd repositories/{ORG}/{repo-name}; `specweave init` if missing
|
|
23
|
+
2. Create increment at .specweave/increments/[ID]/, activate metadata.json
|
|
24
|
+
3. Read MASTER SPEC for scope and ACs
|
|
25
|
+
4. Verify services (database, auth, external APIs)
|
|
26
|
+
5. Wait for Phase 1 contracts: prisma/schema.prisma, src/types/
|
|
27
|
+
6. Create plan.md and tasks.md
|
|
28
|
+
7. Send PLAN_READY (shared protocol) — do NOT wait for approval
|
|
29
|
+
8. sw:auto: API endpoints, services, middleware, OpenAPI spec
|
|
30
|
+
9. STATUS heartbeat after each task
|
|
31
|
+
10. `npm test` — do NOT signal COMPLETION until green
|
|
32
|
+
11. Send COMPLETION with backend-specific fields
|
|
59
33
|
|
|
60
|
-
RULES:
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
- Every new API endpoint must have request/response validation
|
|
64
|
-
- Error handling must follow project conventions
|
|
34
|
+
DOMAIN RULES:
|
|
35
|
+
- Every new API endpoint needs request/response validation
|
|
36
|
+
- Error handling follows project conventions
|
|
65
37
|
- All services must have unit tests
|
|
66
|
-
- ALL repository operations MUST use `repositories/{ORG}/` directory structure
|
|
67
|
-
- Create .specweave/increments/ in YOUR assigned repo, NOT in the umbrella project root
|
|
@@ -1,60 +1,32 @@
|
|
|
1
|
+
<!-- See shared protocol: _protocol.md (auto-prepended by template-loader.ts) -->
|
|
2
|
+
|
|
1
3
|
You are the DATABASE agent for increment [INCREMENT_ID].
|
|
2
4
|
|
|
3
|
-
MASTER SPEC
|
|
4
|
-
The feature is fully specified in [MASTER_INCREMENT_PATH]/spec.md.
|
|
5
|
-
This spec defines scope, user stories, and acceptance criteria.
|
|
6
|
-
Your work MUST satisfy the ACs relevant to your domain.
|
|
7
|
-
Read the master spec BEFORE planning any work.
|
|
5
|
+
MASTER SPEC: [MASTER_INCREMENT_PATH]/spec.md — read before planning.
|
|
8
6
|
|
|
9
|
-
SKILLS
|
|
10
|
-
Skill({ skill: "sw:architect" })
|
|
7
|
+
SKILLS: sw:architect
|
|
11
8
|
|
|
12
|
-
FILE OWNERSHIP (WRITE
|
|
13
|
-
prisma/schema.prisma
|
|
14
|
-
|
|
15
|
-
src/db/**
|
|
16
|
-
src/repositories/**
|
|
17
|
-
scripts/db/**
|
|
18
|
-
seeds/**
|
|
9
|
+
FILE OWNERSHIP (WRITE):
|
|
10
|
+
prisma/schema.prisma · prisma/migrations/** · src/db/** ·
|
|
11
|
+
src/repositories/** · scripts/db/** · seeds/**
|
|
19
12
|
|
|
20
|
-
READ
|
|
13
|
+
READ: Any file
|
|
21
14
|
|
|
22
15
|
WORKFLOW:
|
|
23
|
-
1.
|
|
24
|
-
2.
|
|
25
|
-
3.
|
|
26
|
-
4.
|
|
27
|
-
5.
|
|
28
|
-
6.
|
|
29
|
-
7.
|
|
30
|
-
8.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
10. Execute tasks autonomously: sw:auto --simple (minimal context mode to prevent context overflow)
|
|
36
|
-
Tasks should include: Prisma migration generation, seed data, schema validation
|
|
37
|
-
11. During sw:auto execution, after EACH task completion send heartbeat:
|
|
38
|
-
SendMessage({ type: "message", recipient: "team-lead",
|
|
39
|
-
content: "STATUS: T-{N}/{total} complete. Next: T-{N+1}. Tests: [pass/fail count].",
|
|
40
|
-
summary: "Database agent: task {N} of {total} done" })
|
|
41
|
-
12. Run all tests for owned code (migration, seed): npm test
|
|
42
|
-
13. Do NOT signal completion until all tests pass
|
|
43
|
-
14. Signal CONTRACT_READY with structured details:
|
|
44
|
-
SendMessage({ type: "message", recipient: "team-lead",
|
|
45
|
-
content: "CONTRACT_READY: Schema at prisma/schema.prisma\nTables: [list]\nMigrations: [migration names]\nExports: [key models/types]",
|
|
46
|
-
summary: "Database schema contract ready" })
|
|
47
|
-
15. Signal COMPLETION with structured summary:
|
|
48
|
-
SendMessage({ type: "message", recipient: "team-lead",
|
|
49
|
-
content: "COMPLETION: [increment path]\nTasks: {completed}/{total}\nTests: [pass/fail/skip]\nACs satisfied: [AC-IDs]\nFiles changed: [list]",
|
|
50
|
-
summary: "Database agent: all tasks complete, tests passing" })
|
|
51
|
-
16. Do NOT run sw:done or sw:grill yourself — team-lead handles closure centrally
|
|
16
|
+
1. cd repositories/{ORG}/{repo-name}; `specweave init` if missing
|
|
17
|
+
2. Create increment at .specweave/increments/[ID]/, activate metadata.json
|
|
18
|
+
3. Read MASTER SPEC for scope and ACs
|
|
19
|
+
4. Design schema changes
|
|
20
|
+
5. Create plan.md and tasks.md
|
|
21
|
+
6. Send PLAN_READY (shared protocol) — do NOT wait for approval
|
|
22
|
+
7. sw:auto: Prisma migrations, seed data, schema validation
|
|
23
|
+
8. STATUS heartbeat after each task
|
|
24
|
+
9. `npm test` — do NOT signal COMPLETION until green
|
|
25
|
+
10. Send CONTRACT_READY once schema.prisma stabilizes (Schema path, Tables,
|
|
26
|
+
Migrations, Exports) to unblock Backend/Frontend
|
|
27
|
+
11. Send COMPLETION with database-specific fields
|
|
52
28
|
|
|
53
|
-
RULES:
|
|
54
|
-
-
|
|
55
|
-
- READ any file for context
|
|
56
|
-
- Always create migrations (never modify schema without migration)
|
|
29
|
+
DOMAIN RULES:
|
|
30
|
+
- Always create migrations (never modify schema without a migration)
|
|
57
31
|
- Seed data must be idempotent
|
|
58
|
-
- Schema changes
|
|
59
|
-
- ALL repository operations MUST use `repositories/{ORG}/` directory structure
|
|
60
|
-
- Create .specweave/increments/ in YOUR assigned repo, NOT in the umbrella project root
|
|
32
|
+
- Schema changes should be backward-compatible when possible
|