specweave 0.23.12 → 0.23.16
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/CLAUDE.md +55 -0
- package/dist/src/core/progress/error-logger.d.ts +58 -0
- package/dist/src/core/progress/error-logger.d.ts.map +1 -0
- package/dist/src/core/progress/error-logger.js +99 -0
- package/dist/src/core/progress/error-logger.js.map +1 -0
- package/dist/src/core/spec-detector.d.ts +5 -0
- package/dist/src/core/spec-detector.d.ts.map +1 -1
- package/dist/src/core/spec-detector.js +91 -33
- package/dist/src/core/spec-detector.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/hooks/docs-changed.sh +9 -1
- package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
- package/plugins/specweave/hooks/human-input-required.sh +9 -1
- package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
- package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
- package/plugins/specweave/hooks/post-increment-change.sh +6 -1
- package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
- package/plugins/specweave/hooks/post-increment-completion.sh +6 -1
- package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
- package/plugins/specweave/hooks/post-increment-planning.sh +6 -1
- package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
- package/plugins/specweave/hooks/post-increment-status-change.sh +6 -1
- package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
- package/plugins/specweave/hooks/post-metadata-change.sh +7 -1
- package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
- package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
- package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
- package/plugins/specweave/hooks/pre-implementation.sh +9 -1
- package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
- package/plugins/specweave/hooks/pre-task-completion.sh +9 -1
- package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
- package/plugins/specweave/hooks/pre-tool-use.sh +9 -1
- package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
- package/plugins/specweave-ado/hooks/post-living-docs-update.sh +9 -2
- package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
- package/plugins/specweave-ado/hooks/post-task-completion.sh +9 -1
- package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
- package/plugins/specweave-github/.claude-plugin/plugin.json +15 -1
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +16 -0
- package/plugins/specweave-github/hooks/post-task-completion.sh +62 -1
- package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
- package/plugins/specweave-jira/hooks/post-task-completion.sh +9 -1
- package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +48 -0
- package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +0 -21
- package/plugins/specweave-alternatives/skills/bmad-method-expert/SKILL.md +0 -626
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/check-setup.js +0 -208
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
- package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +0 -1010
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +0 -20
- package/plugins/specweave-cost-optimizer/skills/cost-optimizer/SKILL.md +0 -190
- package/plugins/specweave-docs/.claude-plugin/plugin.json +0 -19
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +0 -613
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/README.md +0 -264
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +0 -439
- package/plugins/specweave-docs/skills/spec-driven-debugging/README.md +0 -479
- package/plugins/specweave-docs/skills/spec-driven-debugging/SKILL.md +0 -652
- package/plugins/specweave-figma/.claude-plugin/.mcp.json +0 -12
- package/plugins/specweave-figma/.claude-plugin/plugin.json +0 -20
- package/plugins/specweave-figma/ARCHITECTURE.md +0 -453
- package/plugins/specweave-figma/README.md +0 -728
- package/plugins/specweave-figma/skills/figma-to-code/SKILL.md +0 -632
- package/plugins/specweave-figma/skills/figma-to-code/test-1-token-generation.yaml +0 -29
- package/plugins/specweave-figma/skills/figma-to-code/test-2-component-generation.yaml +0 -27
- package/plugins/specweave-figma/skills/figma-to-code/test-3-typescript-generation.yaml +0 -28
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +0 -21
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +0 -107
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +0 -177
- package/plugins/specweave-frontend/skills/nextjs/SKILL.md +0 -176
- package/plugins/specweave-testing/.claude-plugin/plugin.json +0 -20
- package/plugins/specweave-testing/skills/e2e-playwright/README.md +0 -506
- package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +0 -457
- package/plugins/specweave-testing/skills/e2e-playwright/execute.js +0 -373
- package/plugins/specweave-testing/skills/e2e-playwright/lib/utils.js +0 -514
- package/plugins/specweave-testing/skills/e2e-playwright/package.json +0 -33
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +0 -19
- package/plugins/specweave-tooling/skills/skill-creator/LICENSE.txt +0 -202
- package/plugins/specweave-tooling/skills/skill-creator/SKILL.md +0 -209
- package/plugins/specweave-tooling/skills/skill-creator/scripts/init_skill.py +0 -303
- package/plugins/specweave-tooling/skills/skill-creator/scripts/package_skill.py +0 -110
- package/plugins/specweave-tooling/skills/skill-creator/scripts/quick_validate.py +0 -65
- package/plugins/specweave-tooling/skills/skill-router/SKILL.md +0 -479
- package/plugins/specweave-ui/.claude-plugin/plugin.json +0 -26
- package/plugins/specweave-ui/.mcp.json +0 -10
- package/plugins/specweave-ui/README.md +0 -492
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +0 -676
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: skill-router
|
|
3
|
-
description: Intelligent routing system that parses ambiguous user requests and routes them to appropriate SpecWeave skills with >90% accuracy. Acts as the "traffic controller" for all skill invocations. Activates when user intent is unclear or when multiple skills could handle a request. Also activates proactively when detecting product description patterns (name + features + tech stack + timeline) in SpecWeave folders. Keywords: route, clarify, ambiguous, which skill, help me decide, product description, new project, feature list, tech stack, build this.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Skill Router - Intelligent Request Routing
|
|
7
|
-
|
|
8
|
-
## Purpose
|
|
9
|
-
|
|
10
|
-
The skill-router is SpecWeave's **intelligent routing system** that:
|
|
11
|
-
1. Parses ambiguous or complex user requests
|
|
12
|
-
2. Determines which skill(s) should handle the request
|
|
13
|
-
3. Routes with >90% accuracy (target from constitution)
|
|
14
|
-
4. Learns from user feedback to improve routing
|
|
15
|
-
5. Handles multi-skill orchestration
|
|
16
|
-
|
|
17
|
-
## When to Activate
|
|
18
|
-
|
|
19
|
-
This skill activates when:
|
|
20
|
-
- User request is ambiguous ("Help me with payments")
|
|
21
|
-
- Multiple skills could handle the request
|
|
22
|
-
- specweave-detector needs clarification
|
|
23
|
-
- User explicitly asks "which skill should I use?"
|
|
24
|
-
- Request parsing confidence is <90%
|
|
25
|
-
|
|
26
|
-
## Routing Algorithm
|
|
27
|
-
|
|
28
|
-
### Phase 1: Intent Classification
|
|
29
|
-
|
|
30
|
-
```typescript
|
|
31
|
-
interface UserIntent {
|
|
32
|
-
primary_action: 'create' | 'plan' | 'implement' | 'test' | 'document' | 'analyze' | 'sync' | 'optimize';
|
|
33
|
-
domain: string[]; // ['payment', 'authentication', 'api']
|
|
34
|
-
complexity: 'simple' | 'moderate' | 'complex';
|
|
35
|
-
scope: 'greenfield' | 'brownfield' | 'unknown';
|
|
36
|
-
confidence: number; // 0.0 to 1.0
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
**Intent Extraction Examples**:
|
|
41
|
-
|
|
42
|
-
| User Says | Primary Action | Domain | Complexity | Confidence |
|
|
43
|
-
|-----------|---------------|--------|------------|-----------|
|
|
44
|
-
| "Add Stripe payments" | create | ['payment', 'stripe'] | moderate | 0.95 |
|
|
45
|
-
| "Help with auth" | unknown | ['authentication'] | unknown | 0.40 |
|
|
46
|
-
| "Build a SaaS" | create | ['saas', 'product'] | complex | 0.85 |
|
|
47
|
-
| "Optimize slow queries" | optimize | ['performance', 'database'] | moderate | 0.90 |
|
|
48
|
-
| "Document the API" | document | ['api', 'documentation'] | simple | 0.98 |
|
|
49
|
-
|
|
50
|
-
### Phase 2: Skill Mapping
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
const skillMap = {
|
|
54
|
-
// Core planning and specification
|
|
55
|
-
'create + spec': 'spec-author',
|
|
56
|
-
'create + plan': 'increment-planner',
|
|
57
|
-
'create + architecture': 'architect-agent',
|
|
58
|
-
|
|
59
|
-
// Implementation
|
|
60
|
-
'implement + nodejs': 'nodejs-backend',
|
|
61
|
-
'implement + python': 'python-backend',
|
|
62
|
-
'implement + dotnet': 'dotnet-backend',
|
|
63
|
-
'implement + frontend': 'frontend-agent',
|
|
64
|
-
|
|
65
|
-
// Testing and quality
|
|
66
|
-
'test + e2e': 'playwright-tester',
|
|
67
|
-
'test + unit': 'qa-engineer',
|
|
68
|
-
'analyze + quality': 'qa-lead-agent',
|
|
69
|
-
|
|
70
|
-
// Operations
|
|
71
|
-
'deploy + infrastructure': 'devops-agent',
|
|
72
|
-
'optimize + performance': 'performance-agent',
|
|
73
|
-
'secure + security': 'security-agent',
|
|
74
|
-
|
|
75
|
-
// Sync and integration
|
|
76
|
-
'sync + jira': 'jira-sync',
|
|
77
|
-
'sync + ado': 'ado-sync',
|
|
78
|
-
'sync + github': 'github-sync',
|
|
79
|
-
|
|
80
|
-
// Documentation
|
|
81
|
-
'document + code': 'docs-writer-agent',
|
|
82
|
-
'update + docs': 'docs-updater',
|
|
83
|
-
|
|
84
|
-
// Analysis
|
|
85
|
-
'analyze + brownfield': 'brownfield-analyzer',
|
|
86
|
-
'analyze + code': 'tech-lead-agent',
|
|
87
|
-
|
|
88
|
-
// Orchestration
|
|
89
|
-
'complex + multi-role': 'role-orchestrator',
|
|
90
|
-
'create + tasks': 'task-builder'
|
|
91
|
-
};
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Phase 3: Confidence Assessment
|
|
95
|
-
|
|
96
|
-
```typescript
|
|
97
|
-
function assessConfidence(intent: UserIntent, matchedSkills: string[]): RoutingDecision {
|
|
98
|
-
let confidence = 0.0;
|
|
99
|
-
|
|
100
|
-
// Single skill match with high intent confidence
|
|
101
|
-
if (matchedSkills.length === 1 && intent.confidence > 0.85) {
|
|
102
|
-
confidence = intent.confidence;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Multiple skills but clear priority
|
|
106
|
-
else if (matchedSkills.length > 1) {
|
|
107
|
-
const prioritySkill = determinePriority(matchedSkills, intent);
|
|
108
|
-
confidence = 0.7; // Multi-skill always has some ambiguity
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// No clear match
|
|
112
|
-
else {
|
|
113
|
-
confidence = 0.3;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
skill: matchedSkills[0] || 'unknown',
|
|
118
|
-
confidence,
|
|
119
|
-
alternatives: matchedSkills.slice(1),
|
|
120
|
-
needsClarification: confidence < 0.90
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Phase 4: Clarification (if needed)
|
|
126
|
-
|
|
127
|
-
When confidence < 0.90, ask user for clarification:
|
|
128
|
-
|
|
129
|
-
```markdown
|
|
130
|
-
Your request: "Help me with authentication"
|
|
131
|
-
|
|
132
|
-
I can route this to several skills. What would you like to do?
|
|
133
|
-
|
|
134
|
-
1. **Create specification** - Define authentication requirements (spec-author)
|
|
135
|
-
2. **Plan implementation** - Design auth architecture (architect-agent)
|
|
136
|
-
3. **Implement auth** - Build authentication system (backend skill)
|
|
137
|
-
4. **Secure existing auth** - Security review and hardening (security-agent)
|
|
138
|
-
5. **Test authentication** - E2E auth testing (playwright-tester)
|
|
139
|
-
|
|
140
|
-
Please select (1-5) or describe in more detail.
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Routing Workflows
|
|
144
|
-
|
|
145
|
-
### Simple Routing (High Confidence)
|
|
146
|
-
|
|
147
|
-
```
|
|
148
|
-
User: "Create a feature plan for payment processing"
|
|
149
|
-
↓
|
|
150
|
-
skill-router analyzes:
|
|
151
|
-
Primary action: create + plan
|
|
152
|
-
Domain: payment
|
|
153
|
-
Complexity: moderate
|
|
154
|
-
Confidence: 0.95
|
|
155
|
-
↓
|
|
156
|
-
Route to: increment-planner (direct)
|
|
157
|
-
↓
|
|
158
|
-
No clarification needed
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Ambiguous Routing (Low Confidence)
|
|
162
|
-
|
|
163
|
-
```
|
|
164
|
-
User: "Help with payments"
|
|
165
|
-
↓
|
|
166
|
-
skill-router analyzes:
|
|
167
|
-
Primary action: unknown
|
|
168
|
-
Domain: payment
|
|
169
|
-
Complexity: unknown
|
|
170
|
-
Confidence: 0.40
|
|
171
|
-
↓
|
|
172
|
-
Needs clarification
|
|
173
|
-
↓
|
|
174
|
-
Present options:
|
|
175
|
-
1. spec-author (create spec)
|
|
176
|
-
2. increment-planner (plan feature)
|
|
177
|
-
3. architect-agent (design architecture)
|
|
178
|
-
4. nodejs-backend (implement)
|
|
179
|
-
5. security-agent (PCI compliance)
|
|
180
|
-
↓
|
|
181
|
-
User selects: 2
|
|
182
|
-
↓
|
|
183
|
-
Route to: increment-planner
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Multi-Skill Routing (Complex Request)
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
User: "Build a SaaS for project management"
|
|
190
|
-
↓
|
|
191
|
-
skill-router analyzes:
|
|
192
|
-
Primary action: create
|
|
193
|
-
Domain: saas, product, project-management
|
|
194
|
-
Complexity: complex
|
|
195
|
-
Confidence: 0.85 (high but complex)
|
|
196
|
-
↓
|
|
197
|
-
Route to: role-orchestrator
|
|
198
|
-
↓
|
|
199
|
-
role-orchestrator determines needed roles:
|
|
200
|
-
- pm-agent (product strategy)
|
|
201
|
-
- architect-agent (system design)
|
|
202
|
-
- qa-lead-agent (test strategy)
|
|
203
|
-
- devops-agent (infrastructure)
|
|
204
|
-
↓
|
|
205
|
-
Orchestrated execution
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## Machine Learning Enhancement
|
|
209
|
-
|
|
210
|
-
### Training Data Collection
|
|
211
|
-
|
|
212
|
-
```typescript
|
|
213
|
-
interface RoutingFeedback {
|
|
214
|
-
userInput: string;
|
|
215
|
-
parsedIntent: UserIntent;
|
|
216
|
-
routedSkill: string;
|
|
217
|
-
userAccepted: boolean; // Did user accept this routing?
|
|
218
|
-
userSelectedInstead?: string; // If rejected, what did user choose?
|
|
219
|
-
timestamp: number;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Store in .specweave/cache/routing-feedback.json
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### Improvement Cycle
|
|
226
|
-
|
|
227
|
-
```
|
|
228
|
-
1. Collect routing decisions and user feedback
|
|
229
|
-
2. Analyze patterns:
|
|
230
|
-
- Which phrases consistently map to which skills?
|
|
231
|
-
- Which ambiguous cases were resolved by users?
|
|
232
|
-
- What keywords are strong indicators?
|
|
233
|
-
3. Update routing confidence thresholds
|
|
234
|
-
4. Refine intent classification rules
|
|
235
|
-
5. Achieve >90% accuracy target
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### Success Metrics
|
|
239
|
-
|
|
240
|
-
```typescript
|
|
241
|
-
// Stored in .specweave/cache/routing-metrics.json
|
|
242
|
-
interface RoutingMetrics {
|
|
243
|
-
total_routings: number;
|
|
244
|
-
correct_routings: number; // User accepted
|
|
245
|
-
accuracy: number; // correct / total
|
|
246
|
-
average_confidence: number;
|
|
247
|
-
clarifications_needed: number;
|
|
248
|
-
multi_skill_routes: number;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// Target: accuracy > 0.90 (90% from constitution)
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
## Skill Priority Matrix
|
|
255
|
-
|
|
256
|
-
When multiple skills could handle a request, use priority:
|
|
257
|
-
|
|
258
|
-
| Context | Priority Order |
|
|
259
|
-
|---------|---------------|
|
|
260
|
-
| **New Product/Feature** | pm-agent → architect-agent → increment-planner → implementation |
|
|
261
|
-
| **Brownfield Modification** | brownfield-analyzer → increment-planner → implementation |
|
|
262
|
-
| **Bug Fix** | tech-lead-agent → implementation → qa-engineer |
|
|
263
|
-
| **Performance Issue** | performance-agent → tech-lead-agent → implementation |
|
|
264
|
-
| **Security Issue** | security-agent → implementation → qa-engineer |
|
|
265
|
-
| **Documentation** | docs-writer-agent → docs-updater |
|
|
266
|
-
| **Testing** | qa-lead-agent → playwright-tester or qa-engineer |
|
|
267
|
-
|
|
268
|
-
## Integration Points
|
|
269
|
-
|
|
270
|
-
### 1. Called By
|
|
271
|
-
|
|
272
|
-
- **specweave-detector**: When initial parsing is ambiguous
|
|
273
|
-
- **Users**: Explicit routing questions
|
|
274
|
-
- **role-orchestrator**: For sub-routing within complex workflows
|
|
275
|
-
|
|
276
|
-
### 2. Calls
|
|
277
|
-
|
|
278
|
-
- Any SpecWeave skill based on routing decision
|
|
279
|
-
- **role-orchestrator**: For complex multi-skill requests
|
|
280
|
-
|
|
281
|
-
### 3. Updates
|
|
282
|
-
|
|
283
|
-
- `.specweave/cache/routing-feedback.json`: Training data
|
|
284
|
-
- `.specweave/cache/routing-metrics.json`: Performance metrics
|
|
285
|
-
|
|
286
|
-
## Configuration
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
## Examples
|
|
291
|
-
|
|
292
|
-
### Example 1: Stripe Integration
|
|
293
|
-
|
|
294
|
-
```
|
|
295
|
-
User: "I want to integrate Stripe for subscription billing"
|
|
296
|
-
|
|
297
|
-
skill-router analysis:
|
|
298
|
-
Action: create + integrate
|
|
299
|
-
Domain: stripe, payment, subscription
|
|
300
|
-
Keywords: integrate (suggests implementation)
|
|
301
|
-
Confidence: 0.88 (just below threshold)
|
|
302
|
-
|
|
303
|
-
Clarification:
|
|
304
|
-
"I see you want to integrate Stripe for subscriptions.
|
|
305
|
-
|
|
306
|
-
Would you like to:
|
|
307
|
-
1. Plan the integration (increment-planner)
|
|
308
|
-
2. Design the architecture (architect-agent)
|
|
309
|
-
3. Start implementation (nodejs-backend)
|
|
310
|
-
|
|
311
|
-
Recommendation: Start with #1 (Plan) for best practice."
|
|
312
|
-
|
|
313
|
-
User: "Yes, plan it first"
|
|
314
|
-
|
|
315
|
-
Route to: increment-planner
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
### Example 2: Performance Optimization
|
|
319
|
-
|
|
320
|
-
```
|
|
321
|
-
User: "The app is slow, especially the dashboard"
|
|
322
|
-
|
|
323
|
-
skill-router analysis:
|
|
324
|
-
Action: optimize
|
|
325
|
-
Domain: performance, dashboard, frontend
|
|
326
|
-
Confidence: 0.92 (above threshold!)
|
|
327
|
-
|
|
328
|
-
Route to: performance-agent (direct, no clarification)
|
|
329
|
-
|
|
330
|
-
performance-agent:
|
|
331
|
-
"I'll analyze the dashboard performance.
|
|
332
|
-
[runs profiling, identifies issues]
|
|
333
|
-
|
|
334
|
-
Found 3 issues:
|
|
335
|
-
1. Unnecessary re-renders (React)
|
|
336
|
-
2. Unoptimized database queries
|
|
337
|
-
3. Large bundle size
|
|
338
|
-
|
|
339
|
-
Routing optimization tasks:
|
|
340
|
-
- Issue 1 → frontend-agent
|
|
341
|
-
- Issue 2 → nodejs-backend
|
|
342
|
-
- Issue 3 → tech-lead-agent (code splitting)"
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
### Example 3: Brownfield Documentation
|
|
346
|
-
|
|
347
|
-
```
|
|
348
|
-
User: "Document the existing payment processing code"
|
|
349
|
-
|
|
350
|
-
skill-router analysis:
|
|
351
|
-
Action: document
|
|
352
|
-
Domain: payment, existing-code
|
|
353
|
-
Scope: brownfield
|
|
354
|
-
Confidence: 0.75 (brownfield detection uncertain)
|
|
355
|
-
|
|
356
|
-
Clarification:
|
|
357
|
-
"You want to document existing payment code.
|
|
358
|
-
|
|
359
|
-
Options:
|
|
360
|
-
1. Analyze & document current implementation (brownfield-analyzer)
|
|
361
|
-
2. Update existing documentation (docs-updater)
|
|
362
|
-
3. Write new developer guide (docs-writer-agent)
|
|
363
|
-
|
|
364
|
-
If the code isn't documented yet, I recommend #1."
|
|
365
|
-
|
|
366
|
-
User: "1"
|
|
367
|
-
|
|
368
|
-
Route to: brownfield-analyzer
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
## Error Handling
|
|
372
|
-
|
|
373
|
-
### Unknown Domain
|
|
374
|
-
|
|
375
|
-
```
|
|
376
|
-
User: "What's for lunch?"
|
|
377
|
-
|
|
378
|
-
skill-router:
|
|
379
|
-
Domain: food, lunch
|
|
380
|
-
No matching SpecWeave skills
|
|
381
|
-
|
|
382
|
-
"This seems outside SpecWeave's domain (software development).
|
|
383
|
-
SpecWeave handles:
|
|
384
|
-
- Feature planning
|
|
385
|
-
- Code implementation
|
|
386
|
-
- Testing and QA
|
|
387
|
-
- Documentation
|
|
388
|
-
- DevOps and deployment
|
|
389
|
-
|
|
390
|
-
Would you like me to answer as regular Claude instead?"
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
### Confidence Collapse
|
|
394
|
-
|
|
395
|
-
```
|
|
396
|
-
If 5+ consecutive routings have confidence < 0.50:
|
|
397
|
-
"I'm having trouble understanding your requests.
|
|
398
|
-
|
|
399
|
-
Available SpecWeave skills:
|
|
400
|
-
[list all installed skills with descriptions]
|
|
401
|
-
|
|
402
|
-
Please try:
|
|
403
|
-
1. Being more specific ("create a spec" vs "help")
|
|
404
|
-
2. Including action keywords (plan, implement, test, etc.)
|
|
405
|
-
3. Mentioning technology (Node.js, Python, React, etc.)"
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
## Testing
|
|
409
|
-
|
|
410
|
-
### Test Cases
|
|
411
|
-
|
|
412
|
-
**TC-001: High Confidence Routing**
|
|
413
|
-
- Given: "Create a plan for Stripe payment integration"
|
|
414
|
-
- When: skill-router parses request
|
|
415
|
-
- Then: Confidence > 0.90
|
|
416
|
-
- And: Routes to increment-planner without clarification
|
|
417
|
-
|
|
418
|
-
**TC-002: Low Confidence Clarification**
|
|
419
|
-
- Given: "Help with auth"
|
|
420
|
-
- When: skill-router parses request
|
|
421
|
-
- Then: Confidence < 0.90
|
|
422
|
-
- And: Asks user for clarification
|
|
423
|
-
- And: Presents 3-5 options
|
|
424
|
-
|
|
425
|
-
**TC-003: Multi-Skill Complex Request**
|
|
426
|
-
- Given: "Build a real-time collaboration SaaS"
|
|
427
|
-
- When: skill-router parses request
|
|
428
|
-
- Then: Recognizes complexity
|
|
429
|
-
- And: Routes to role-orchestrator
|
|
430
|
-
- And: Confidence recorded
|
|
431
|
-
|
|
432
|
-
**TC-004: Accuracy Tracking**
|
|
433
|
-
- Given: 100 routing decisions
|
|
434
|
-
- When: Users provide feedback (accept/reject)
|
|
435
|
-
- Then: Accuracy calculated correctly
|
|
436
|
-
- And: Metrics stored in cache
|
|
437
|
-
- And: Accuracy > 90% target
|
|
438
|
-
|
|
439
|
-
**TC-005: Learning from Feedback**
|
|
440
|
-
- Given: User rejects routing 3 times for "help with payments"
|
|
441
|
-
- When: User always selects "increment-planner"
|
|
442
|
-
- Then: Pattern learned
|
|
443
|
-
- And: Future "help with payments" routes to increment-planner
|
|
444
|
-
- And: Confidence increases
|
|
445
|
-
|
|
446
|
-
## Resources
|
|
447
|
-
|
|
448
|
-
### Natural Language Processing
|
|
449
|
-
- [spaCy](https://spacy.io/) - Industrial-strength NLP
|
|
450
|
-
- [compromise](https://github.com/spencermountain/compromise) - Natural language processing in JavaScript
|
|
451
|
-
- [natural](https://github.com/NaturalNode/natural) - Natural language facilities for Node.js
|
|
452
|
-
|
|
453
|
-
### Intent Classification
|
|
454
|
-
- [Rasa NLU](https://rasa.com/docs/rasa/nlu-training-data/) - Intent classification and entity extraction
|
|
455
|
-
- [Dialogflow](https://cloud.google.com/dialogflow/docs/intents) - Google's intent classification
|
|
456
|
-
- [LUIS](https://www.luis.ai/) - Microsoft Language Understanding
|
|
457
|
-
|
|
458
|
-
### Pattern Matching
|
|
459
|
-
- [string-similarity](https://github.com/aceakash/string-similarity) - Find similarity between strings
|
|
460
|
-
- [fuzzyset.js](https://github.com/Glench/fuzzyset.js) - Fuzzy string matching
|
|
461
|
-
|
|
462
|
-
### Machine Learning (Optional Enhancement)
|
|
463
|
-
- [TensorFlow.js](https://www.tensorflow.org/js) - ML in JavaScript
|
|
464
|
-
- [brain.js](https://brain.js.org/) - Neural networks in JavaScript
|
|
465
|
-
- [ml.js](https://github.com/mljs/ml) - Machine learning tools
|
|
466
|
-
|
|
467
|
-
---
|
|
468
|
-
|
|
469
|
-
## Summary
|
|
470
|
-
|
|
471
|
-
The skill-router is SpecWeave's **intelligent traffic controller** that:
|
|
472
|
-
- ✅ Parses user requests with intent classification
|
|
473
|
-
- ✅ Routes to appropriate skills with >90% accuracy (constitution target)
|
|
474
|
-
- ✅ Provides clarification when needed (confidence < 0.90)
|
|
475
|
-
- ✅ Learns from user feedback to improve over time
|
|
476
|
-
- ✅ Handles multi-skill orchestration for complex requests
|
|
477
|
-
- ✅ Tracks metrics for continuous improvement
|
|
478
|
-
|
|
479
|
-
**User benefit**: Natural language requests are intelligently routed to the right skill, making SpecWeave feel like a unified development assistant instead of fragmented tools.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "specweave-ui",
|
|
3
|
-
"description": "Complete UI/UX development toolkit - Playwright E2E testing, Figma design integration, React/Vue/Angular development, design systems, Storybook component testing. Auto-activates for frontend projects.",
|
|
4
|
-
"version": "0.22.14",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "SpecWeave Team",
|
|
7
|
-
"email": "anton.abyzov@gmail.com",
|
|
8
|
-
"url": "https://spec-weave.com"
|
|
9
|
-
},
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"homepage": "https://spec-weave.com",
|
|
12
|
-
"repository": "https://github.com/anton-abyzov/specweave",
|
|
13
|
-
"keywords": [
|
|
14
|
-
"ui",
|
|
15
|
-
"ux",
|
|
16
|
-
"playwright",
|
|
17
|
-
"figma",
|
|
18
|
-
"react",
|
|
19
|
-
"nextjs",
|
|
20
|
-
"design-system",
|
|
21
|
-
"e2e-testing",
|
|
22
|
-
"storybook",
|
|
23
|
-
"frontend",
|
|
24
|
-
"specweave"
|
|
25
|
-
]
|
|
26
|
-
}
|