specweave 1.0.363 → 1.0.367
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 +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +33 -0
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/sync-progress.d.ts.map +1 -1
- package/dist/src/cli/commands/sync-progress.js +1 -0
- package/dist/src/cli/commands/sync-progress.js.map +1 -1
- package/dist/src/core/config/config-manager.d.ts.map +1 -1
- package/dist/src/core/config/config-manager.js +6 -0
- package/dist/src/core/config/config-manager.js.map +1 -1
- package/dist/src/core/config/types.d.ts +0 -2
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js +69 -0
- package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
- package/dist/src/core/migration/umbrella-migrator.d.ts.map +1 -1
- package/dist/src/core/migration/umbrella-migrator.js +17 -1
- package/dist/src/core/migration/umbrella-migrator.js.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 +13 -1
- package/dist/src/sync/external-issue-auto-creator.js.map +1 -1
- package/dist/src/sync/sync-target-resolver.d.ts +2 -2
- package/dist/src/sync/sync-target-resolver.js +6 -6
- package/dist/src/sync/sync-target-resolver.js.map +1 -1
- package/package.json +1 -1
- package/plugins/SKILLS-VS-AGENTS.md +212 -119
- package/plugins/specweave/agents/sw-architect.md +8 -67
- package/plugins/specweave/agents/sw-planner.md +10 -82
- package/plugins/specweave/agents/sw-pm.md +9 -103
- package/plugins/specweave/hooks/.specweave/logs/auto-iterations.log +1 -0
- package/plugins/specweave/hooks/.specweave/logs/auto-stop-reasons.log +1 -0
- package/plugins/specweave/skills/.specweave/logs/reflect/auto-reflect.log +15 -0
- package/plugins/specweave/skills/.specweave/logs/reflect/reflect.log +3 -0
- package/plugins/specweave/skills/.specweave/logs/stop-auto.log +1 -0
- package/plugins/specweave/skills/brainstorm/SKILL.md +128 -26
- package/plugins/specweave/skills/increment/SKILL.md +50 -32
- package/plugins/specweave/skills/pm/SKILL.md +28 -1
- package/plugins/specweave/skills/pm/phases/02-spec-creation.md +17 -0
- package/plugins/specweave/skills/test-aware-planner/SKILL.md +1 -1
- package/plugins/specweave-ado/lib/ado-multi-project-sync.js +0 -1
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +180 -0
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +1266 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.js +249 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +150 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1260 -0
|
@@ -1,176 +1,269 @@
|
|
|
1
|
-
# Skills
|
|
1
|
+
# Skills and Subagents: SpecWeave's Architecture
|
|
2
2
|
|
|
3
3
|
> Based on official Claude Code documentation: https://code.claude.com/docs/en/skills and https://code.claude.com/docs/en/sub-agents
|
|
4
4
|
|
|
5
|
+
## Claude Code Extensibility Overview
|
|
6
|
+
|
|
7
|
+
Before diving into SpecWeave-specific architecture, here's the full landscape of Claude Code's extension mechanisms — AI and non-AI alike.
|
|
8
|
+
|
|
9
|
+
### All Extension Points
|
|
10
|
+
|
|
11
|
+
| Mechanism | What It Is | AI-Powered? | Docs |
|
|
12
|
+
|-----------|-----------|-------------|------|
|
|
13
|
+
| **Skills** | Markdown instructions Claude follows (reference, tasks, `/commands`) | Yes (LLM reads them) | [skills](https://code.claude.com/docs/en/skills) |
|
|
14
|
+
| **Custom Subagents** | Isolated AI workers with own context, memory, model | Yes (separate LLM context) | [sub-agents](https://code.claude.com/docs/en/sub-agents) |
|
|
15
|
+
| **Agent Teams** | Multiple agents working in parallel, communicating via messages | Yes (multiple LLM sessions) | [agent-teams](https://code.claude.com/docs/en/agent-teams) |
|
|
16
|
+
| **Hooks** | Shell scripts triggered by tool events (PreToolUse, PostToolUse, etc.) | No (pure shell) | [hooks](https://code.claude.com/docs/en/hooks) |
|
|
17
|
+
| **MCP Servers** | External tool servers (databases, APIs, Slack, Figma, etc.) | No (tool providers) | [mcp](https://code.claude.com/docs/en/mcp) |
|
|
18
|
+
| **Plugins** | Packages that bundle skills + agents + hooks + commands | Mixed | [plugins](https://code.claude.com/docs/en/plugins) |
|
|
19
|
+
| **CLAUDE.md** | Persistent project/user instructions loaded every session | No (static text) | [memory](https://code.claude.com/docs/en/memory) |
|
|
20
|
+
| **Permissions** | Allow/deny rules for tools, skills, agents | No (configuration) | [permissions](https://code.claude.com/docs/en/permissions) |
|
|
21
|
+
| **Settings** | JSON config for models, tools, environment | No (configuration) | [settings](https://code.claude.com/docs/en/settings) |
|
|
22
|
+
|
|
23
|
+
### How They Compose
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
User Request
|
|
27
|
+
↓
|
|
28
|
+
Claude Code (main conversation)
|
|
29
|
+
├── Reads: CLAUDE.md, settings, permissions
|
|
30
|
+
├── Has: Skills (loaded by keyword or /command)
|
|
31
|
+
├── Uses: MCP Servers (external tools)
|
|
32
|
+
├── Spawns: Custom Subagents (isolated workers)
|
|
33
|
+
│ └── Subagent preloads: Skills (injected at startup)
|
|
34
|
+
│ └── Subagent uses: MCP Servers, Hooks
|
|
35
|
+
├── Spawns: Built-in Subagents (Explore, Plan, general-purpose)
|
|
36
|
+
├── Orchestrates: Agent Teams (parallel multi-agent work)
|
|
37
|
+
└── Triggers: Hooks (shell scripts on tool events)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Non-AI Tools in SpecWeave
|
|
41
|
+
|
|
42
|
+
SpecWeave uses several non-AI extension points:
|
|
43
|
+
|
|
44
|
+
| Tool | Type | Purpose |
|
|
45
|
+
|------|------|---------|
|
|
46
|
+
| **Guard hooks** (skill-chain, interview, spec-template) | Hooks (shell) | Enforce delegation rules — block writes unless correct agent registered |
|
|
47
|
+
| **`specweave` CLI** | External tool (Node.js) | Create increments, validate specs, manage lifecycle |
|
|
48
|
+
| **`!`command`` injection** | Shell preprocessing | Inject dynamic context (config, project info) into skills before Claude sees them |
|
|
49
|
+
| **State files** (`.specweave/state/`) | File system | Coordination between agents via marker files |
|
|
50
|
+
| **MCP servers** (Figma, Gmail, etc.) | MCP | External integrations Claude can use during any phase |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
5
54
|
## TL;DR
|
|
6
55
|
|
|
7
|
-
**SpecWeave uses Skills
|
|
56
|
+
**SpecWeave uses both Skills AND Custom Subagents — each for what it's best at.**
|
|
57
|
+
|
|
58
|
+
- **Skills** = reusable instructions (reference knowledge, standalone tasks, user-invocable `/commands`)
|
|
59
|
+
- **Custom Subagents** = persistent, isolated workers that preload skills (memory, resumability, background execution)
|
|
60
|
+
- **The pattern**: Subagents preload skills via the `skills:` field — subagent owns isolation + memory, skill owns domain logic
|
|
61
|
+
|
|
62
|
+
## When to Use What
|
|
8
63
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
64
|
+
| Use Case | Mechanism | Why |
|
|
65
|
+
|----------|-----------|-----|
|
|
66
|
+
| **Orchestrated agent** (PM, Architect, Planner) | Custom subagent + preloaded skill | Memory, resumability, auto-compaction, guaranteed skill injection |
|
|
67
|
+
| **Standalone heavy task** (grill, brainstorm) | Skill with `context: fork` | Self-contained, user-invocable, no memory needed |
|
|
68
|
+
| **Reference knowledge** (api-conventions, style guide) | Skill, NO `context: fork` | Must run inline to enrich main conversation |
|
|
69
|
+
| **Quick research** | Built-in subagent (Explore, Plan, general-purpose) | Read-only, disposable, no custom setup |
|
|
14
70
|
|
|
15
|
-
|
|
71
|
+
### Decision Flowchart
|
|
16
72
|
|
|
17
|
-
|
|
73
|
+
```
|
|
74
|
+
Does the agent need persistent memory or resumability?
|
|
75
|
+
YES → Custom subagent (with skills: preloading)
|
|
76
|
+
NO →
|
|
77
|
+
Is it a standalone task producing output?
|
|
78
|
+
YES → Skill with context: fork
|
|
79
|
+
NO →
|
|
80
|
+
Is it reference/knowledge for the main conversation?
|
|
81
|
+
YES → Skill, NO context: fork (runs inline)
|
|
82
|
+
NO → Built-in subagent (Explore/Plan/general-purpose)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## The Core Pattern: Subagents Preloading Skills
|
|
18
86
|
|
|
19
|
-
|
|
20
|
-
|---------|-------------------------|---------------|
|
|
21
|
-
| **Auto-activation** | ✅ By keywords | ❌ Must be explicitly spawned |
|
|
22
|
-
| **Isolated context** | ✅ With `context: fork` | ✅ Always isolated |
|
|
23
|
-
| **User-invocable** | ✅ `/skill-name` | ❌ Only via Task tool |
|
|
24
|
-
| **Discovery** | ✅ Works with subfolder structure | ❌ Requires flat files |
|
|
25
|
-
| **Token efficient** | ✅ Loads on-demand | ❌ Same |
|
|
26
|
-
| **Maintenance** | ✅ Simple SKILL.md format | ❌ Stricter requirements |
|
|
87
|
+
This is the recommended architecture for SpecWeave's orchestrated agents:
|
|
27
88
|
|
|
28
|
-
|
|
89
|
+
```
|
|
90
|
+
plugins/specweave/
|
|
91
|
+
├── agents/
|
|
92
|
+
│ ├── sw-pm.md # Subagent definition (model, memory, skills)
|
|
93
|
+
│ ├── sw-architect.md # Each preloads its corresponding skill
|
|
94
|
+
│ └── sw-planner.md
|
|
95
|
+
├── skills/
|
|
96
|
+
│ ├── pm/
|
|
97
|
+
│ │ ├── SKILL.md # Domain logic, phases, templates
|
|
98
|
+
│ │ ├── phases/ # Supporting files loaded on demand
|
|
99
|
+
│ │ └── templates/
|
|
100
|
+
│ ├── architect/
|
|
101
|
+
│ │ └── SKILL.md
|
|
102
|
+
│ └── test-aware-planner/
|
|
103
|
+
│ └── SKILL.md
|
|
104
|
+
```
|
|
29
105
|
|
|
30
|
-
|
|
106
|
+
### How It Works
|
|
31
107
|
|
|
108
|
+
**Subagent file** (`agents/sw-pm.md`):
|
|
32
109
|
```yaml
|
|
33
110
|
---
|
|
34
|
-
name:
|
|
35
|
-
description:
|
|
36
|
-
context: fork # <-- Runs in isolated subagent context
|
|
111
|
+
name: sw-pm
|
|
112
|
+
description: Product Manager for writing spec.md...
|
|
37
113
|
model: opus
|
|
38
|
-
|
|
114
|
+
memory: project
|
|
115
|
+
skills:
|
|
116
|
+
- sw:pm # Preloads the PM skill content at startup
|
|
39
117
|
---
|
|
40
118
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
You are an expert frontend architect...
|
|
119
|
+
You are a Product Manager specializing in spec-driven development.
|
|
44
120
|
```
|
|
45
121
|
|
|
46
|
-
**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
122
|
+
**Skill file** (`skills/pm/SKILL.md`):
|
|
123
|
+
```yaml
|
|
124
|
+
---
|
|
125
|
+
description: Product Manager for spec-driven development...
|
|
126
|
+
context: fork
|
|
127
|
+
model: opus
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
# Product Manager Skill
|
|
131
|
+
...full domain logic, phases, templates...
|
|
132
|
+
```
|
|
51
133
|
|
|
52
|
-
|
|
134
|
+
> **Note**: Skills have `context: fork` and `model` for standalone invocation (e.g., `/sw:pm`). When preloaded by a subagent, the subagent's isolation takes precedence — `context: fork` doesn't cause "double-forking".
|
|
53
135
|
|
|
54
|
-
|
|
136
|
+
**Why this works**:
|
|
137
|
+
- The **subagent** owns: isolation, memory, model, resumability, background execution
|
|
138
|
+
- The **skill** owns: domain logic, supporting files (phases, templates), user-invocable `/sw:pm`
|
|
139
|
+
- The `skills:` field **guarantees** skill content is injected at startup (no discovery step needed)
|
|
140
|
+
- Users can still run `/sw:pm` directly for ad-hoc spec work outside increment flow
|
|
55
141
|
|
|
56
|
-
|
|
57
|
-
|----------|----------|---------|
|
|
58
|
-
| **Explore** | Codebase exploration, finding files | "Find all API endpoints" |
|
|
59
|
-
| **Plan** | Architecture planning, design | "Design auth system" |
|
|
60
|
-
| **general-purpose** | Open-ended research | "Research Stripe vs PayPal for Israel" |
|
|
142
|
+
### Invocation from the Increment Orchestrator
|
|
61
143
|
|
|
62
|
-
**Example usage:**
|
|
63
144
|
```typescript
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
Task({
|
|
71
|
-
subagent_type: "general-purpose",
|
|
72
|
-
prompt: "Research best payment providers for businesses in Israel",
|
|
73
|
-
description: "Payment provider research"
|
|
74
|
-
})
|
|
145
|
+
// The increment skill spawns subagents (NOT skills):
|
|
146
|
+
Agent({ subagent_type: "sw:sw-pm", prompt: "Write spec for increment XXXX-name: ..." })
|
|
147
|
+
Agent({ subagent_type: "sw:sw-architect", prompt: "Design architecture for increment XXXX-name..." })
|
|
148
|
+
Agent({ subagent_type: "sw:sw-planner", prompt: "Generate tasks for increment XXXX-name..." })
|
|
75
149
|
```
|
|
76
150
|
|
|
77
|
-
|
|
151
|
+
## Feature Comparison
|
|
78
152
|
|
|
79
|
-
|
|
153
|
+
| Feature | Skill (`context: fork`) | Custom Subagent |
|
|
154
|
+
|---------|------------------------|-----------------|
|
|
155
|
+
| **Isolated context** | Yes | Yes |
|
|
156
|
+
| **Auto-activation by keywords** | Yes | No (must be explicitly spawned) |
|
|
157
|
+
| **User-invocable** (`/name`) | Yes | No (only via Agent tool) |
|
|
158
|
+
| **Persistent memory** | No | Yes (`memory: project/user/local`) |
|
|
159
|
+
| **Resumable** (by agent ID) | No | Yes |
|
|
160
|
+
| **Background execution** | No (blocks caller) | Yes (`run_in_background: true` or Ctrl+B) |
|
|
161
|
+
| **Auto-compaction** | No | Yes (at ~95% capacity) |
|
|
162
|
+
| **Permission mode override** | No | Yes (`permissionMode:`) |
|
|
163
|
+
| **Skills preloading** | No | Yes (`skills:` field) |
|
|
164
|
+
| **Hooks** | Yes | Yes |
|
|
165
|
+
| **Custom model** | Yes (`model:`) | Yes (`model:`) |
|
|
166
|
+
| **Distributed via plugins** | `plugins/X/skills/` | `plugins/X/agents/` |
|
|
167
|
+
| **Supporting files** | Yes (phases/, templates/) | No (but preloaded skills can have them) |
|
|
80
168
|
|
|
81
|
-
|
|
169
|
+
## When NOT to Use `context: fork`
|
|
82
170
|
|
|
83
|
-
|
|
84
|
-
|--------|-------|--------------------------|
|
|
85
|
-
| **Frontend** | `frontend:architect` | React, Vue, Next.js, dashboard, component, UI |
|
|
86
|
-
| **Backend** | `backend:database-optimizer` | API, database, SQL, PostgreSQL, optimization |
|
|
87
|
-
| **Payments** | `payments:payment-integration` | Stripe, PayPal, checkout, billing, subscriptions |
|
|
88
|
-
| **Testing** | `testing:qa` | E2E, Playwright, Vitest, Jest, TDD, QA |
|
|
89
|
-
| **Kubernetes** | `k8s:kubernetes-architect` | K8s, pods, deployments, Helm, GitOps |
|
|
90
|
-
| **Infrastructure** | `infra:devops` | Terraform, Docker, CI/CD, AWS, Azure |
|
|
91
|
-
| **Mobile** | `mobile:react-native-expert` | React Native, iOS, Android, Expo |
|
|
92
|
-
| **ML/AI** | `ml:ml-engineer` | ML, model, training, TensorFlow, PyTorch |
|
|
93
|
-
| **Diagrams** | `sw-diagrams:diagrams` | Mermaid, C4, architecture diagram, flowchart |
|
|
94
|
-
| **Release** | `sw-release:release-expert` | release, version, changelog, npm publish |
|
|
171
|
+
A skill should **not** have `context: fork` when:
|
|
95
172
|
|
|
96
|
-
|
|
173
|
+
1. **A subagent preloads it** — the subagent already provides isolation. Adding `context: fork` would double-fork (skill forks inside already-forked subagent = wasted tokens)
|
|
174
|
+
2. **It provides reference knowledge** — conventions, patterns, style guides that Claude needs in the main conversation context
|
|
175
|
+
3. **It needs conversation history** — `context: fork` creates a fresh context; the skill won't see prior messages
|
|
97
176
|
|
|
98
|
-
|
|
177
|
+
**DO use `context: fork`** when:
|
|
178
|
+
- The skill is a **standalone task** producing output (grill, brainstorm, code-simplifier)
|
|
179
|
+
- No custom subagent wraps it
|
|
180
|
+
- You want isolation without creating a full subagent definition
|
|
99
181
|
|
|
100
|
-
**
|
|
182
|
+
**SpecWeave validator note**: The SpecWeave skill validator does NOT recognize `context`, `model`, `agent`, or `allowed-tools` in frontmatter — these are Claude Code attributes. SpecWeave only supports: `argument-hint`, `compatibility`, `description`, `disable-model-invocation`, `license`, `metadata`, `name`, `user-invokable`. For skills preloaded by subagents, put `model` and `context` on the **subagent**, not the skill.
|
|
183
|
+
|
|
184
|
+
## Built-in Subagents for Research
|
|
101
185
|
|
|
102
|
-
|
|
103
|
-
1. Claude detects keywords: "React", "dashboard", "Stripe", "checkout"
|
|
104
|
-
2. Skills auto-activate (primary mechanism):
|
|
105
|
-
- `frontend:architect` (React, dashboard)
|
|
106
|
-
- `payments:payment-integration` (Stripe, checkout)
|
|
107
|
-
3. Each skill runs in isolated context (`context: fork`)
|
|
108
|
-
4. Results return to main conversation
|
|
186
|
+
For explicit research/exploration, use Claude Code's built-in subagents:
|
|
109
187
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
188
|
+
| Subagent | Model | Tools | Use Case |
|
|
189
|
+
|----------|-------|-------|----------|
|
|
190
|
+
| **Explore** | Haiku | Read-only | Fast codebase search, file discovery |
|
|
191
|
+
| **Plan** | Inherited | Read-only | Architecture planning, design research |
|
|
192
|
+
| **general-purpose** | Inherited | All | Complex multi-step research + modification |
|
|
113
193
|
|
|
114
194
|
```typescript
|
|
115
|
-
|
|
116
|
-
|
|
195
|
+
Agent({ subagent_type: "Explore", prompt: "Find all API endpoints", description: "API exploration" })
|
|
196
|
+
Agent({ subagent_type: "general-purpose", prompt: "Research Stripe integration patterns", description: "Stripe research" })
|
|
117
197
|
```
|
|
118
198
|
|
|
119
|
-
##
|
|
199
|
+
## SpecWeave Agent Catalog
|
|
120
200
|
|
|
121
|
-
|
|
201
|
+
### Core Orchestration Agents (Subagent + Skill)
|
|
122
202
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
└── AGENT.md # NOT discovered by Claude Code!
|
|
129
|
-
```
|
|
203
|
+
| Agent | Subagent | Preloads Skill | Writes | Model |
|
|
204
|
+
|-------|----------|---------------|--------|-------|
|
|
205
|
+
| **PM** | `sw-pm` | `sw:pm` | spec.md | Opus |
|
|
206
|
+
| **Architect** | `sw-architect` | `sw:architect` | plan.md | Opus |
|
|
207
|
+
| **Planner** | `sw-planner` | `sw:test-aware-planner` | tasks.md | Sonnet |
|
|
130
208
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
209
|
+
### Standalone Skills (context: fork)
|
|
210
|
+
|
|
211
|
+
| Skill | Purpose | Why not a subagent? |
|
|
212
|
+
|-------|---------|-------------------|
|
|
213
|
+
| `sw:grill` | Code review before ship | No memory needed, one-shot |
|
|
214
|
+
| `sw:brainstorm` | Multi-perspective ideation | Spawns parallel lenses, disposable |
|
|
215
|
+
| `sw:judge-llm` | Deep validation | One-shot evaluation |
|
|
138
216
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
217
|
+
### Reference Skills (inline, no fork)
|
|
218
|
+
|
|
219
|
+
| Skill | Purpose |
|
|
220
|
+
|-------|---------|
|
|
221
|
+
| `api-conventions` | API design patterns |
|
|
222
|
+
| `error-handling-patterns` | Error handling standards |
|
|
144
223
|
|
|
145
224
|
## FAQ
|
|
146
225
|
|
|
147
|
-
### Q:
|
|
148
|
-
**A
|
|
226
|
+
### Q: When should I create a custom subagent vs a skill with `context: fork`?
|
|
227
|
+
**A:** If the agent needs **persistent memory**, **resumability**, or **background execution** — make it a custom subagent. If it's a **one-shot task** or **user-invocable command** — make it a skill with `context: fork`. If it's **reference knowledge** — skill without fork.
|
|
149
228
|
|
|
150
|
-
### Q:
|
|
151
|
-
**A:**
|
|
229
|
+
### Q: Can a skill work both standalone AND preloaded by a subagent?
|
|
230
|
+
**A:** Yes. Remove `context: fork` from the skill. Users invoke it directly via `/sw:pm` (runs inline). The subagent preloads it via `skills: [sw:pm]` (runs in subagent's isolated context). Same logic, two execution modes.
|
|
152
231
|
|
|
153
|
-
### Q:
|
|
154
|
-
**A:**
|
|
155
|
-
1. **User**: Type `/frontend:architect` in chat
|
|
156
|
-
2. **Claude**: Use `Skill({ skill: "frontend:architect" })` when auto-activation didn't trigger
|
|
232
|
+
### Q: What happens if the skills: preloading fails?
|
|
233
|
+
**A:** The subagent still runs — it just won't have the skill content injected. The subagent's own markdown body (system prompt) is always available. To guard against this, keep critical instructions in the subagent body and use skills for detailed/phase logic.
|
|
157
234
|
|
|
158
|
-
|
|
235
|
+
### Q: Can subagents spawn other subagents?
|
|
236
|
+
**A:** No. Subagents cannot nest. If you need chained delegation, the **main conversation** (or orchestrator skill) spawns each subagent sequentially.
|
|
159
237
|
|
|
160
|
-
### Q:
|
|
161
|
-
**A:**
|
|
238
|
+
### Q: Why did custom agents fail before?
|
|
239
|
+
**A:** SpecWeave originally used subfolder structure (`agents/<name>/AGENT.md`). Claude Code expected flat files (`agents/<name>.md`). This was fixed — flat `.md` files in `agents/` now work correctly.
|
|
162
240
|
|
|
163
241
|
## Official Documentation
|
|
164
242
|
|
|
243
|
+
### AI Extension Points
|
|
165
244
|
- **Skills**: https://code.claude.com/docs/en/skills
|
|
166
245
|
- **Subagents**: https://code.claude.com/docs/en/sub-agents
|
|
167
|
-
- **
|
|
168
|
-
|
|
246
|
+
- **Agent Teams**: https://code.claude.com/docs/en/agent-teams
|
|
247
|
+
|
|
248
|
+
### Non-AI Extension Points
|
|
249
|
+
- **Hooks**: https://code.claude.com/docs/en/hooks
|
|
250
|
+
- **MCP Servers**: https://code.claude.com/docs/en/mcp
|
|
251
|
+
- **Permissions**: https://code.claude.com/docs/en/permissions
|
|
252
|
+
- **Settings**: https://code.claude.com/docs/en/settings
|
|
253
|
+
- **Memory (CLAUDE.md)**: https://code.claude.com/docs/en/memory
|
|
254
|
+
|
|
255
|
+
### Distribution
|
|
256
|
+
- **Plugins**: https://code.claude.com/docs/en/plugins
|
|
257
|
+
- **Plugin Components Reference**: https://code.claude.com/docs/en/plugins-reference
|
|
258
|
+
|
|
259
|
+
### Full Index
|
|
260
|
+
- **All docs**: https://code.claude.com/docs/llms.txt
|
|
169
261
|
|
|
170
262
|
## Summary
|
|
171
263
|
|
|
172
|
-
1. **
|
|
173
|
-
2. **`context: fork`**
|
|
174
|
-
3. **
|
|
175
|
-
4. **
|
|
176
|
-
5. **
|
|
264
|
+
1. **Subagents + Skills together** — subagent owns isolation/memory, skill owns domain logic
|
|
265
|
+
2. **`context: fork`** for standalone tasks only (grill, brainstorm, judge)
|
|
266
|
+
3. **No `context: fork`** on skills preloaded by subagents (avoids double-fork)
|
|
267
|
+
4. **No `context: fork`** on reference/knowledge skills (need inline context)
|
|
268
|
+
5. **Built-in subagents** (Explore, Plan, general-purpose) for ad-hoc research
|
|
269
|
+
6. **Agent()** to invoke custom subagents, **Skill()** for standalone skills
|
|
@@ -3,79 +3,20 @@ name: sw-architect
|
|
|
3
3
|
description: System Architect for writing plan.md with architecture decisions and component design. Use for increment technical planning during /sw:increment orchestration.
|
|
4
4
|
model: opus
|
|
5
5
|
memory: project
|
|
6
|
+
skills:
|
|
7
|
+
- sw:architect
|
|
6
8
|
---
|
|
7
9
|
|
|
8
|
-
# Architect
|
|
9
|
-
|
|
10
|
-
## Project Overrides
|
|
11
|
-
|
|
12
|
-
!`s="architect"; 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`
|
|
13
|
-
|
|
14
|
-
## Identity
|
|
10
|
+
# Architect Subagent
|
|
15
11
|
|
|
16
12
|
You are a System Architect specializing in scalable technical designs. You create plan.md with architecture decisions, component boundaries, and implementation strategies.
|
|
17
13
|
|
|
18
14
|
Your prompt will contain: increment ID, increment path, and spec.md location. Always read spec.md first.
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Design system architecture with focus on:
|
|
23
|
-
|
|
24
|
-
1. **ADRs** — Check existing decisions at `.specweave/docs/internal/architecture/adr/` before designing
|
|
25
|
-
2. **Component design** — Define boundaries, APIs, data flow
|
|
26
|
-
3. **Trade-off analysis** — Evaluate options with clear pros/cons
|
|
27
|
-
4. **Technology selection** — Choose stack based on project constraints
|
|
28
|
-
|
|
29
|
-
## Key Architectural Patterns
|
|
30
|
-
|
|
31
|
-
### Code Mode for API-Heavy Services (ADR-0140)
|
|
32
|
-
|
|
33
|
-
When a service exposes 50+ API endpoints to AI agents, avoid exposing each as a separate MCP tool. Instead, use the **Code Mode pattern**: expose a typed schema (OpenAPI/JSON Schema) and let the agent write code to discover and call endpoints.
|
|
34
|
-
|
|
35
|
-
**Apply when**: designing agent-facing APIs, MCP servers, or any system where AI agents consume a large surface area.
|
|
36
|
-
|
|
37
|
-
## Markdown Preview Guidelines
|
|
38
|
-
|
|
39
|
-
When presenting **2+ architectural approaches** for the user to choose between, use `AskUserQuestion` with the `markdown` preview field to show ASCII diagrams.
|
|
40
|
-
|
|
41
|
-
**When to use**: Any decision point with 2+ options that have structural differences (service layout, schema design, component boundaries, data flow).
|
|
42
|
-
|
|
43
|
-
**When NOT to use**: Simple yes/no questions, single-option confirmations, or text-only trade-offs.
|
|
44
|
-
|
|
45
|
-
Example:
|
|
46
|
-
```
|
|
47
|
-
AskUserQuestion({
|
|
48
|
-
questions: [{
|
|
49
|
-
question: "Which service architecture should we use?",
|
|
50
|
-
header: "Architecture",
|
|
51
|
-
multiSelect: false,
|
|
52
|
-
options: [
|
|
53
|
-
{
|
|
54
|
-
label: "Gateway Pattern (Recommended)",
|
|
55
|
-
description: "Single API gateway routes to microservices.",
|
|
56
|
-
markdown: "<ASCII diagram showing gateway pattern>"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: "Direct Service Mesh",
|
|
60
|
-
description: "Services communicate directly via mesh.",
|
|
61
|
-
markdown: "<ASCII diagram showing mesh pattern>"
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}]
|
|
65
|
-
})
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Delegation
|
|
69
|
-
|
|
70
|
-
After architecture is ready, delegate to domain skills if applicable:
|
|
71
|
-
- Frontend: `frontend:architect`
|
|
72
|
-
- Backend: `backend:*` (dotnet, nodejs, python, go, java-spring, rust)
|
|
16
|
+
The `sw:architect` skill is preloaded with full domain logic including design patterns, ADR checks, and trade-off analysis. Follow its instructions for plan.md creation.
|
|
73
17
|
|
|
74
|
-
##
|
|
18
|
+
## Critical Reminders
|
|
75
19
|
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
- Data flow and API contracts
|
|
80
|
-
- Technology stack justification
|
|
81
|
-
- Risk assessment
|
|
20
|
+
- **Register skill-chain marker** (STEP 0 in preloaded skill) before writing plan.md
|
|
21
|
+
- **Check ADRs first** at `.specweave/docs/internal/architecture/adr/`
|
|
22
|
+
- **Domain delegation** — after plan.md, recommend domain skills (frontend:architect, backend:*)
|
|
@@ -2,94 +2,22 @@
|
|
|
2
2
|
name: sw-planner
|
|
3
3
|
description: Test-Aware Planner for generating tasks.md with BDD test plans. Reads spec.md and plan.md to produce implementation tasks with Given/When/Then scenarios. Use during /sw:increment orchestration.
|
|
4
4
|
model: sonnet
|
|
5
|
+
memory: project
|
|
6
|
+
skills:
|
|
7
|
+
- sw:test-aware-planner
|
|
5
8
|
---
|
|
6
9
|
|
|
7
|
-
# Test-Aware Planner
|
|
8
|
-
|
|
9
|
-
## Identity
|
|
10
|
+
# Test-Aware Planner Subagent
|
|
10
11
|
|
|
11
12
|
You generate `tasks.md` with embedded test plans for each task. No separate tests.md — tests are inline with tasks.
|
|
12
13
|
|
|
13
14
|
Your prompt will contain: increment ID, increment path, spec.md and plan.md locations. Always read both before generating tasks.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
1. **ONE user story per response** — Never generate all tasks at once (prevents crashes from large writes)
|
|
18
|
-
2. **Embedded tests** — Test plans inline with tasks
|
|
19
|
-
3. **AC coverage** — Every AC-ID from spec.md must be covered by at least one task
|
|
20
|
-
|
|
21
|
-
## Task Format
|
|
22
|
-
|
|
23
|
-
```markdown
|
|
24
|
-
## User Story: US-001 - Title
|
|
25
|
-
|
|
26
|
-
**Linked ACs**: AC-US1-01, AC-US1-02
|
|
27
|
-
**Tasks**: X total, 0 completed
|
|
28
|
-
|
|
29
|
-
### T-001: Task Title
|
|
30
|
-
|
|
31
|
-
**User Story**: US-001
|
|
32
|
-
**Satisfies ACs**: AC-US1-01
|
|
33
|
-
**Status**: [ ] pending
|
|
34
|
-
|
|
35
|
-
**Test Plan**:
|
|
36
|
-
- **Given** precondition
|
|
37
|
-
- **When** action
|
|
38
|
-
- **Then** expected result
|
|
39
|
-
|
|
40
|
-
**Test Cases**:
|
|
41
|
-
1. **Unit**: `tests/unit/feature.test.ts`
|
|
42
|
-
- testFeatureSuccess(): Description
|
|
43
|
-
- **Coverage Target**: 90%
|
|
44
|
-
|
|
45
|
-
2. **Integration**: `tests/integration/flow.test.ts`
|
|
46
|
-
- testFullFlow(): Description
|
|
47
|
-
- **Coverage Target**: 85%
|
|
48
|
-
|
|
49
|
-
**Implementation**:
|
|
50
|
-
1. Create file
|
|
51
|
-
2. Implement function
|
|
52
|
-
3. Run tests
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Coverage Targets
|
|
56
|
-
|
|
57
|
-
| Code Type | Target |
|
|
58
|
-
|-----------|--------|
|
|
59
|
-
| Core logic | 90-95% |
|
|
60
|
-
| API endpoints | 85-90% |
|
|
61
|
-
| Utilities | 80-85% |
|
|
62
|
-
| Overall | 80-90% |
|
|
63
|
-
|
|
64
|
-
## Multi-Project Format
|
|
65
|
-
|
|
66
|
-
If umbrella.enabled in config:
|
|
67
|
-
```markdown
|
|
68
|
-
## Phase 1: Shared (sw-app-shared)
|
|
69
|
-
|
|
70
|
-
### User Story: US-SHARED-001 - Types
|
|
71
|
-
**Linked ACs**: AC-SHARED-US1-01
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Workflow
|
|
75
|
-
|
|
76
|
-
1. **Analysis** (< 500 tokens): Read spec.md and plan.md, list user stories, determine order
|
|
77
|
-
2. **Generate ONE US tasks** (< 800 tokens): Write tasks for first user story to tasks.md
|
|
78
|
-
3. **Continue**: Append next user story's tasks
|
|
79
|
-
4. **Repeat**: One user story at a time until all are covered
|
|
80
|
-
|
|
81
|
-
## Token Budget
|
|
82
|
-
|
|
83
|
-
- **Analysis**: 300-500 tokens
|
|
84
|
-
- **Each user story**: 600-800 tokens
|
|
85
|
-
|
|
86
|
-
**NEVER exceed 2000 tokens per response!**
|
|
16
|
+
The `sw:test-aware-planner` skill is preloaded with full domain logic including task format, BDD patterns, and coverage targets. Follow its instructions for tasks.md creation.
|
|
87
17
|
|
|
88
|
-
##
|
|
18
|
+
## Critical Reminders
|
|
89
19
|
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
- [ ] Tasks grouped by User Story
|
|
95
|
-
- [ ] Frontmatter has by_user_story map
|
|
20
|
+
- **Register skill-chain marker** (STEP 0 in preloaded skill) before writing tasks.md
|
|
21
|
+
- **ONE user story per response** — never generate all tasks at once (prevents crashes)
|
|
22
|
+
- **AC coverage** — every AC-ID from spec.md must be covered by at least one task
|
|
23
|
+
- **Chunking discipline** — never exceed 2000 tokens per response
|