worclaude 1.2.8 → 1.3.0
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 +3 -2
- package/package.json +1 -1
- package/src/commands/init.js +9 -1
- package/src/core/merger.js +22 -2
- package/src/data/agent-registry.js +324 -0
- package/src/generators/agent-routing.js +149 -0
- package/templates/claude-md.md +3 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
[Full Documentation](https://sefaertunc.github.io/Worclaude/) · [Interactive Demo](https://sefaertunc.github.io/Worclaude/demo/) · [npm](https://www.npmjs.com/package/worclaude)
|
|
12
12
|
|
|
13
|
-
Worclaude scaffolds a complete Claude Code workflow into any project in seconds. It implements all [53 tips by Boris Cherny](https://www.howborisusesclaudecode.com/) — the creator of Claude Code at Anthropic — as a reusable, upgradable scaffold. One `init` command gives you 23 agents, 10 slash commands,
|
|
13
|
+
Worclaude scaffolds a complete Claude Code workflow into any project in seconds. It implements all [53 tips by Boris Cherny](https://www.howborisusesclaudecode.com/) — the creator of Claude Code at Anthropic — as a reusable, upgradable scaffold. One `init` command gives you 23 agents, 10 slash commands, 13 skills, hooks, permissions, and a CLAUDE.md template tuned for your tech stack. Whether you're starting fresh or adding structure to an existing project, Worclaude handles the setup so you can focus on building.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -26,10 +26,11 @@ Worclaude scaffolds a complete Claude Code workflow into any project in seconds.
|
|
|
26
26
|
**Slash Commands (10)**
|
|
27
27
|
`/start` `/end` `/commit-push-pr` `/review-plan` `/techdebt` `/verify` `/compact-safe` `/status` `/update-claude-md` `/setup`
|
|
28
28
|
|
|
29
|
-
**Skills (
|
|
29
|
+
**Skills (13)**
|
|
30
30
|
|
|
31
31
|
- 9 universal knowledge files (testing, git conventions, context management, and more)
|
|
32
32
|
- 3 project-specific templates filled in by `/setup`
|
|
33
|
+
- 1 generated agent routing guide (dynamically built from your agent selection)
|
|
33
34
|
|
|
34
35
|
**Hooks**
|
|
35
36
|
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
CONFIRMATION_STEPS,
|
|
28
28
|
SPEC_MD_TEMPLATE_MAP,
|
|
29
29
|
} from '../data/agents.js';
|
|
30
|
+
import { buildAgentRoutingSkill } from '../generators/agent-routing.js';
|
|
30
31
|
|
|
31
32
|
// --- Helper functions ---
|
|
32
33
|
|
|
@@ -436,6 +437,13 @@ async function scaffoldFresh(projectRoot, selections, variables, settingsStr, ve
|
|
|
436
437
|
}
|
|
437
438
|
spinner.text = `Created ${TEMPLATE_SKILLS.length} template skills`;
|
|
438
439
|
|
|
440
|
+
const agentRoutingContent = buildAgentRoutingSkill(selectedAgents, projectTypes);
|
|
441
|
+
await writeFile(
|
|
442
|
+
path.join(projectRoot, '.claude', 'skills', 'agent-routing.md'),
|
|
443
|
+
agentRoutingContent
|
|
444
|
+
);
|
|
445
|
+
spinner.text = 'Created agent routing guide';
|
|
446
|
+
|
|
439
447
|
await scaffoldFile('mcp-json.json', '.mcp.json', {}, projectRoot);
|
|
440
448
|
spinner.text = 'Created .mcp.json';
|
|
441
449
|
|
|
@@ -481,7 +489,7 @@ async function scaffoldFresh(projectRoot, selections, variables, settingsStr, ve
|
|
|
481
489
|
|
|
482
490
|
function displayFreshSuccess(selections, skipped) {
|
|
483
491
|
const totalAgents = UNIVERSAL_AGENTS.length + selections.selectedAgents.length;
|
|
484
|
-
const totalSkills = UNIVERSAL_SKILLS.length + TEMPLATE_SKILLS.length;
|
|
492
|
+
const totalSkills = UNIVERSAL_SKILLS.length + TEMPLATE_SKILLS.length + 1; // +1 for agent-routing.md
|
|
485
493
|
|
|
486
494
|
display.newline();
|
|
487
495
|
display.success('CLAUDE.md');
|
package/src/core/merger.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
NOTIFICATION_COMMANDS,
|
|
19
19
|
SPEC_MD_TEMPLATE_MAP,
|
|
20
20
|
} from '../data/agents.js';
|
|
21
|
+
import { buildAgentRoutingSkill } from '../generators/agent-routing.js';
|
|
21
22
|
import * as display from '../utils/display.js';
|
|
22
23
|
|
|
23
24
|
// --- Settings builder (shared with Scenario A) ---
|
|
@@ -95,7 +96,7 @@ function parseUserJson(raw, filename) {
|
|
|
95
96
|
|
|
96
97
|
// --- Sub-merge operations ---
|
|
97
98
|
|
|
98
|
-
async function mergeSkills(projectRoot, existingScan, variables, report) {
|
|
99
|
+
async function mergeSkills(projectRoot, existingScan, variables, report, selections) {
|
|
99
100
|
const allSkills = [
|
|
100
101
|
...UNIVERSAL_SKILLS.map((s) => ({
|
|
101
102
|
name: s,
|
|
@@ -128,6 +129,25 @@ async function mergeSkills(projectRoot, existingScan, variables, report) {
|
|
|
128
129
|
report.added.skills.push(filename);
|
|
129
130
|
}
|
|
130
131
|
}
|
|
132
|
+
|
|
133
|
+
// Generated skill: agent-routing.md
|
|
134
|
+
const routingFilename = 'agent-routing.md';
|
|
135
|
+
const skillsDir = path.join('.claude', 'skills');
|
|
136
|
+
const routingContent = buildAgentRoutingSkill(
|
|
137
|
+
selections.selectedAgents,
|
|
138
|
+
selections.projectTypes
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
if (existingScan.existingSkills.includes(routingFilename)) {
|
|
142
|
+
await writeFile(
|
|
143
|
+
path.join(projectRoot, skillsDir, 'agent-routing.workflow-ref.md'),
|
|
144
|
+
routingContent
|
|
145
|
+
);
|
|
146
|
+
report.conflicts.skills.push(routingFilename);
|
|
147
|
+
} else {
|
|
148
|
+
await writeFile(path.join(projectRoot, skillsDir, routingFilename), routingContent);
|
|
149
|
+
report.added.skills.push(routingFilename);
|
|
150
|
+
}
|
|
131
151
|
}
|
|
132
152
|
|
|
133
153
|
async function mergeAgents(projectRoot, existingScan, selectedAgents, report) {
|
|
@@ -395,7 +415,7 @@ export async function performMerge(
|
|
|
395
415
|
hookConflicts: [],
|
|
396
416
|
};
|
|
397
417
|
|
|
398
|
-
await mergeSkills(projectRoot, existingScan, variables, report);
|
|
418
|
+
await mergeSkills(projectRoot, existingScan, variables, report, selections);
|
|
399
419
|
await mergeAgents(projectRoot, existingScan, selections.selectedAgents, report);
|
|
400
420
|
await mergeCommands(projectRoot, existingScan, report);
|
|
401
421
|
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent routing metadata for all 23 agents.
|
|
3
|
+
* Used by the agent-routing generator to produce the routing skill file.
|
|
4
|
+
* Separate from agents.js because this data is only consumed by the generator,
|
|
5
|
+
* not by CLI prompts or display logic.
|
|
6
|
+
*/
|
|
7
|
+
export const AGENT_REGISTRY = {
|
|
8
|
+
// --- Universal agents (5) ---
|
|
9
|
+
|
|
10
|
+
'plan-reviewer': {
|
|
11
|
+
category: 'universal',
|
|
12
|
+
model: 'Opus',
|
|
13
|
+
isolation: 'none',
|
|
14
|
+
pipelineStage: 'Stage 2: Review',
|
|
15
|
+
triggerType: 'manual',
|
|
16
|
+
triggerCommand: '/review-plan',
|
|
17
|
+
whenToUse: 'Before executing any implementation prompt. Always.',
|
|
18
|
+
whatItDoes:
|
|
19
|
+
'Reviews implementation plans as a senior staff engineer. Challenges assumptions, finds ambiguity, checks verification strategy, identifies missing edge cases.',
|
|
20
|
+
expectBack: 'Refined plan with concerns addressed, or list of blocking questions.',
|
|
21
|
+
situationLabel: 'Got an implementation prompt',
|
|
22
|
+
},
|
|
23
|
+
'test-writer': {
|
|
24
|
+
category: 'universal',
|
|
25
|
+
model: 'Sonnet',
|
|
26
|
+
isolation: 'worktree',
|
|
27
|
+
pipelineStage: 'Stage 5: Verify',
|
|
28
|
+
triggerType: 'automatic',
|
|
29
|
+
triggerCommand: null,
|
|
30
|
+
whenToUse: 'After completing implementation of any feature or module.',
|
|
31
|
+
whatItDoes:
|
|
32
|
+
'Writes unit tests, integration tests, edge case tests. Covers happy path, error cases, boundary conditions.',
|
|
33
|
+
expectBack: 'Test files committed to worktree branch. Merge when reviewed.',
|
|
34
|
+
situationLabel: 'Finished implementing a feature',
|
|
35
|
+
},
|
|
36
|
+
'code-simplifier': {
|
|
37
|
+
category: 'universal',
|
|
38
|
+
model: 'Sonnet',
|
|
39
|
+
isolation: 'worktree',
|
|
40
|
+
pipelineStage: 'Stage 4: Quality',
|
|
41
|
+
triggerType: 'automatic',
|
|
42
|
+
triggerCommand: '/simplify',
|
|
43
|
+
whenToUse:
|
|
44
|
+
'After a feature is implemented and tests pass. Also when you notice growing complexity or duplication.',
|
|
45
|
+
whatItDoes:
|
|
46
|
+
'Reviews code for duplication, unnecessary abstraction, missed reuse opportunities. Simplifies without changing behavior.',
|
|
47
|
+
expectBack: 'Cleanup commits on worktree branch. Diff review before merge.',
|
|
48
|
+
situationLabel: 'Notice code getting complex',
|
|
49
|
+
},
|
|
50
|
+
'build-validator': {
|
|
51
|
+
category: 'universal',
|
|
52
|
+
model: 'Haiku',
|
|
53
|
+
isolation: 'none',
|
|
54
|
+
pipelineStage: 'Stage 5: Verify',
|
|
55
|
+
triggerType: 'automatic',
|
|
56
|
+
triggerCommand: null,
|
|
57
|
+
whenToUse: 'Before every commit. After merging worktree branches.',
|
|
58
|
+
whatItDoes:
|
|
59
|
+
'Quick validation — tests pass, build succeeds, lint clean. Fast and cheap (Haiku model).',
|
|
60
|
+
expectBack: 'Pass/fail with specific errors if failed.',
|
|
61
|
+
situationLabel: 'Are about to commit',
|
|
62
|
+
},
|
|
63
|
+
'verify-app': {
|
|
64
|
+
category: 'universal',
|
|
65
|
+
model: 'Sonnet',
|
|
66
|
+
isolation: 'worktree',
|
|
67
|
+
pipelineStage: 'Stage 5: Verify',
|
|
68
|
+
triggerType: 'manual',
|
|
69
|
+
triggerCommand: '/verify',
|
|
70
|
+
whenToUse: 'Before creating a PR. After major changes.',
|
|
71
|
+
whatItDoes:
|
|
72
|
+
'Full end-to-end verification. Runs the app, tests all major flows, checks for regressions. More thorough than build-validator.',
|
|
73
|
+
expectBack: 'Detailed verification report. Blocking issues listed.',
|
|
74
|
+
situationLabel: 'Finished a task, ready for PR',
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
// --- Frontend agents (2) ---
|
|
78
|
+
|
|
79
|
+
'ui-reviewer': {
|
|
80
|
+
category: 'frontend',
|
|
81
|
+
model: 'Sonnet',
|
|
82
|
+
isolation: 'none',
|
|
83
|
+
triggerType: 'manual',
|
|
84
|
+
triggerCommand: null,
|
|
85
|
+
whenToUse:
|
|
86
|
+
'After implementing or modifying UI components. When adding new pages or layouts. During design system changes.',
|
|
87
|
+
whatItDoes:
|
|
88
|
+
'Reviews UI components for consistency, accessibility, responsiveness. Checks component hierarchy and prop patterns.',
|
|
89
|
+
expectBack: 'UI review report with specific issues and accessibility findings.',
|
|
90
|
+
situationLabel: 'Implemented or changed UI components',
|
|
91
|
+
},
|
|
92
|
+
'style-enforcer': {
|
|
93
|
+
category: 'frontend',
|
|
94
|
+
model: 'Haiku',
|
|
95
|
+
isolation: 'none',
|
|
96
|
+
triggerType: 'manual',
|
|
97
|
+
triggerCommand: null,
|
|
98
|
+
whenToUse: 'After CSS/styling changes. When new components are added. During theme updates.',
|
|
99
|
+
whatItDoes:
|
|
100
|
+
'Ensures design system compliance, catches CSS/styling drift, validates consistent spacing/colors/typography.',
|
|
101
|
+
expectBack: 'List of design system violations with fix suggestions.',
|
|
102
|
+
situationLabel: 'Made styling or CSS changes',
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
// --- Backend agents (3) ---
|
|
106
|
+
|
|
107
|
+
'api-designer': {
|
|
108
|
+
category: 'backend',
|
|
109
|
+
model: 'Opus',
|
|
110
|
+
isolation: 'none',
|
|
111
|
+
triggerType: 'manual',
|
|
112
|
+
triggerCommand: null,
|
|
113
|
+
whenToUse:
|
|
114
|
+
'Designing new API endpoints. Changing existing API contracts. Adding new routes or modifying request/response shapes.',
|
|
115
|
+
whatItDoes:
|
|
116
|
+
'Reviews API design for RESTful conventions, naming consistency, backward compatibility, request/response shape validation.',
|
|
117
|
+
expectBack: 'Design review with specific recommendations.',
|
|
118
|
+
situationLabel: 'Designed a new API endpoint',
|
|
119
|
+
},
|
|
120
|
+
'database-analyst': {
|
|
121
|
+
category: 'backend',
|
|
122
|
+
model: 'Sonnet',
|
|
123
|
+
isolation: 'none',
|
|
124
|
+
triggerType: 'manual',
|
|
125
|
+
triggerCommand: null,
|
|
126
|
+
whenToUse: 'Writing migrations. Changing schemas. Complex queries. Data integrity concerns.',
|
|
127
|
+
whatItDoes:
|
|
128
|
+
'Reviews schema design, migration safety, query performance, index usage, data integrity constraints.',
|
|
129
|
+
expectBack: 'Analysis with specific concerns and recommendations.',
|
|
130
|
+
situationLabel: 'Wrote a database migration or schema change',
|
|
131
|
+
},
|
|
132
|
+
'auth-auditor': {
|
|
133
|
+
category: 'backend',
|
|
134
|
+
model: 'Opus',
|
|
135
|
+
isolation: 'none',
|
|
136
|
+
triggerType: 'manual',
|
|
137
|
+
triggerCommand: null,
|
|
138
|
+
whenToUse:
|
|
139
|
+
'Any change to authentication or authorization flow. New roles, permissions, token handling.',
|
|
140
|
+
whatItDoes:
|
|
141
|
+
'Reviews auth flows for correctness, token lifecycle, permission checks, session management, OWASP compliance.',
|
|
142
|
+
expectBack: 'Audit report with pass/fail per check.',
|
|
143
|
+
situationLabel: 'Changed auth or authorization logic',
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
// --- DevOps agents (4) ---
|
|
147
|
+
|
|
148
|
+
'dependency-manager': {
|
|
149
|
+
category: 'devops',
|
|
150
|
+
model: 'Haiku',
|
|
151
|
+
isolation: 'none',
|
|
152
|
+
triggerType: 'manual',
|
|
153
|
+
triggerCommand: null,
|
|
154
|
+
whenToUse:
|
|
155
|
+
'After adding new packages. During regular maintenance. When security advisories are published.',
|
|
156
|
+
whatItDoes:
|
|
157
|
+
'Audits, updates, and resolves dependency issues. Checks for security vulnerabilities in packages.',
|
|
158
|
+
expectBack: 'Dependency audit report with update recommendations.',
|
|
159
|
+
situationLabel: 'Added new dependencies or running maintenance',
|
|
160
|
+
},
|
|
161
|
+
'ci-fixer': {
|
|
162
|
+
category: 'devops',
|
|
163
|
+
model: 'Sonnet',
|
|
164
|
+
isolation: 'worktree',
|
|
165
|
+
triggerType: 'manual',
|
|
166
|
+
triggerCommand: null,
|
|
167
|
+
whenToUse: 'CI pipeline fails. Build errors in GitHub Actions/CI. Flaky tests blocking merges.',
|
|
168
|
+
whatItDoes: 'Reads CI logs, identifies root cause, implements fix in worktree isolation.',
|
|
169
|
+
expectBack: 'Fix committed to worktree branch with CI passing.',
|
|
170
|
+
situationLabel: 'CI pipeline is failing',
|
|
171
|
+
},
|
|
172
|
+
'docker-helper': {
|
|
173
|
+
category: 'devops',
|
|
174
|
+
model: 'Sonnet',
|
|
175
|
+
isolation: 'none',
|
|
176
|
+
triggerType: 'manual',
|
|
177
|
+
triggerCommand: null,
|
|
178
|
+
whenToUse:
|
|
179
|
+
'Creating or modifying Dockerfiles. Compose file changes. Multi-stage build optimization. Container debugging.',
|
|
180
|
+
whatItDoes:
|
|
181
|
+
'Manages containerization, Dockerfile optimization, compose file configuration, multi-stage builds.',
|
|
182
|
+
expectBack: 'Optimized Docker configuration with size/performance improvements.',
|
|
183
|
+
situationLabel: 'Working with Docker or containers',
|
|
184
|
+
},
|
|
185
|
+
'deploy-validator': {
|
|
186
|
+
category: 'devops',
|
|
187
|
+
model: 'Sonnet',
|
|
188
|
+
isolation: 'none',
|
|
189
|
+
triggerType: 'manual',
|
|
190
|
+
triggerCommand: null,
|
|
191
|
+
whenToUse:
|
|
192
|
+
'Before deploying to staging or production. After infrastructure changes. New environment setup.',
|
|
193
|
+
whatItDoes:
|
|
194
|
+
'Validates deployment readiness — environment configs, secrets management, health checks, rollback strategy.',
|
|
195
|
+
expectBack: 'Deployment readiness checklist with pass/fail.',
|
|
196
|
+
situationLabel: 'Preparing for deployment',
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
// --- Quality agents (4) ---
|
|
200
|
+
|
|
201
|
+
'bug-fixer': {
|
|
202
|
+
category: 'quality',
|
|
203
|
+
model: 'Sonnet',
|
|
204
|
+
isolation: 'worktree',
|
|
205
|
+
triggerType: 'manual',
|
|
206
|
+
triggerCommand: null,
|
|
207
|
+
whenToUse:
|
|
208
|
+
"Bug reported. Test failing. Error in logs. Something broke but you don't want to derail current work.",
|
|
209
|
+
whatItDoes:
|
|
210
|
+
'Investigates the bug in isolation. Reads logs, reproduces, finds root cause, implements fix, writes regression test.',
|
|
211
|
+
expectBack: 'Fix committed to worktree branch with regression test.',
|
|
212
|
+
situationLabel: 'Got a bug report mid-task',
|
|
213
|
+
},
|
|
214
|
+
'security-reviewer': {
|
|
215
|
+
category: 'quality',
|
|
216
|
+
model: 'Opus',
|
|
217
|
+
isolation: 'none',
|
|
218
|
+
triggerType: 'manual',
|
|
219
|
+
triggerCommand: null,
|
|
220
|
+
whenToUse:
|
|
221
|
+
'Auth changes. User input handling. New API endpoints exposed to external users. Dependency updates.',
|
|
222
|
+
whatItDoes:
|
|
223
|
+
'Scans for injection vulnerabilities, auth bypasses, data exposure, insecure defaults, dependency vulnerabilities.',
|
|
224
|
+
expectBack: 'Security report with severity ratings.',
|
|
225
|
+
situationLabel: 'Made security-sensitive changes',
|
|
226
|
+
},
|
|
227
|
+
'performance-auditor': {
|
|
228
|
+
category: 'quality',
|
|
229
|
+
model: 'Sonnet',
|
|
230
|
+
isolation: 'none',
|
|
231
|
+
triggerType: 'manual',
|
|
232
|
+
triggerCommand: null,
|
|
233
|
+
whenToUse:
|
|
234
|
+
'Performance concern raised. Slow endpoint discovered. Before releasing to production. After major changes.',
|
|
235
|
+
whatItDoes:
|
|
236
|
+
'Profiles code, identifies bottlenecks, checks database query efficiency, measures response times, suggests optimizations.',
|
|
237
|
+
expectBack: 'Performance report with benchmarks and recommendations.',
|
|
238
|
+
situationLabel: 'Suspect performance issues',
|
|
239
|
+
},
|
|
240
|
+
refactorer: {
|
|
241
|
+
category: 'quality',
|
|
242
|
+
model: 'Sonnet',
|
|
243
|
+
isolation: 'worktree',
|
|
244
|
+
triggerType: 'manual',
|
|
245
|
+
triggerCommand: null,
|
|
246
|
+
whenToUse:
|
|
247
|
+
'Large-scale renames. Architectural pattern changes. Library migrations. Moving code between modules.',
|
|
248
|
+
whatItDoes:
|
|
249
|
+
'Handles large-scale refactoring in worktree isolation. Renames, architectural changes, pattern migrations with full test verification.',
|
|
250
|
+
expectBack: 'Refactored code on worktree branch with all tests passing.',
|
|
251
|
+
situationLabel: 'Need large-scale refactoring',
|
|
252
|
+
},
|
|
253
|
+
|
|
254
|
+
// --- Documentation agents (2) ---
|
|
255
|
+
|
|
256
|
+
'doc-writer': {
|
|
257
|
+
category: 'documentation',
|
|
258
|
+
model: 'Sonnet',
|
|
259
|
+
isolation: 'worktree',
|
|
260
|
+
triggerType: 'manual',
|
|
261
|
+
triggerCommand: null,
|
|
262
|
+
whenToUse:
|
|
263
|
+
'After implementing new features. After API changes. When README is outdated. Before release.',
|
|
264
|
+
whatItDoes:
|
|
265
|
+
'Updates documentation, README, API docs from code changes. Keeps docs in sync with implementation.',
|
|
266
|
+
expectBack: 'Updated docs committed to worktree branch.',
|
|
267
|
+
situationLabel: 'Need docs updated after implementation',
|
|
268
|
+
},
|
|
269
|
+
'changelog-generator': {
|
|
270
|
+
category: 'documentation',
|
|
271
|
+
model: 'Haiku',
|
|
272
|
+
isolation: 'none',
|
|
273
|
+
triggerType: 'manual',
|
|
274
|
+
triggerCommand: null,
|
|
275
|
+
whenToUse:
|
|
276
|
+
'Before releasing a new version. After merging a batch of PRs. When preparing release notes.',
|
|
277
|
+
whatItDoes:
|
|
278
|
+
'Generates changelogs from git history, PR descriptions, and commit messages. Formats for release notes.',
|
|
279
|
+
expectBack: 'Formatted changelog entry for the release.',
|
|
280
|
+
situationLabel: 'Preparing a release',
|
|
281
|
+
},
|
|
282
|
+
|
|
283
|
+
// --- Data / AI agents (3) ---
|
|
284
|
+
|
|
285
|
+
'data-pipeline-reviewer': {
|
|
286
|
+
category: 'data',
|
|
287
|
+
model: 'Sonnet',
|
|
288
|
+
isolation: 'none',
|
|
289
|
+
triggerType: 'manual',
|
|
290
|
+
triggerCommand: null,
|
|
291
|
+
whenToUse:
|
|
292
|
+
'New data pipeline created. ETL logic changed. Data transformation modified. Schema compatibility concerns.',
|
|
293
|
+
whatItDoes:
|
|
294
|
+
'Reviews data flows, validates transformations, checks for data loss, validates schema compatibility.',
|
|
295
|
+
expectBack: 'Pipeline review with data integrity concerns.',
|
|
296
|
+
situationLabel: 'Created or changed a data pipeline',
|
|
297
|
+
},
|
|
298
|
+
'ml-experiment-tracker': {
|
|
299
|
+
category: 'data',
|
|
300
|
+
model: 'Sonnet',
|
|
301
|
+
isolation: 'none',
|
|
302
|
+
triggerType: 'manual',
|
|
303
|
+
triggerCommand: null,
|
|
304
|
+
whenToUse:
|
|
305
|
+
'Running ML experiments. Comparing model performance. Hyperparameter tuning. Model selection.',
|
|
306
|
+
whatItDoes:
|
|
307
|
+
'Tracks ML experiments, compares metrics across runs, documents hyperparameters and results.',
|
|
308
|
+
expectBack: 'Experiment comparison report with recommendations.',
|
|
309
|
+
situationLabel: 'Running or comparing ML experiments',
|
|
310
|
+
},
|
|
311
|
+
'prompt-engineer': {
|
|
312
|
+
category: 'data',
|
|
313
|
+
model: 'Opus',
|
|
314
|
+
isolation: 'none',
|
|
315
|
+
triggerType: 'manual',
|
|
316
|
+
triggerCommand: null,
|
|
317
|
+
whenToUse:
|
|
318
|
+
'Writing LLM prompts. Optimizing prompt performance. Building prompt chains. Testing prompt variations.',
|
|
319
|
+
whatItDoes:
|
|
320
|
+
'Reviews and optimizes LLM prompts and chains. Tests prompt variations, measures output quality.',
|
|
321
|
+
expectBack: 'Optimized prompts with test results and quality comparison.',
|
|
322
|
+
situationLabel: 'Writing or optimizing LLM prompts',
|
|
323
|
+
},
|
|
324
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { UNIVERSAL_AGENTS } from '../data/agents.js';
|
|
2
|
+
import { AGENT_REGISTRY } from '../data/agent-registry.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Generates the agent-routing.md skill file content based on selected agents.
|
|
6
|
+
* @param {string[]} selectedAgentNames - names of optional agents the user selected
|
|
7
|
+
* @param {string[]} projectTypes - e.g. ['Backend / API', 'Frontend / UI']
|
|
8
|
+
* @returns {string} - complete markdown content for agent-routing.md
|
|
9
|
+
*/
|
|
10
|
+
export function buildAgentRoutingSkill(selectedAgentNames, _projectTypes) {
|
|
11
|
+
const allAgents = [...UNIVERSAL_AGENTS, ...selectedAgentNames];
|
|
12
|
+
|
|
13
|
+
const automaticAgents = [];
|
|
14
|
+
const manualAgents = [];
|
|
15
|
+
|
|
16
|
+
for (const name of allAgents) {
|
|
17
|
+
const entry = AGENT_REGISTRY[name];
|
|
18
|
+
if (!entry) continue;
|
|
19
|
+
if (entry.triggerType === 'automatic') {
|
|
20
|
+
automaticAgents.push({ name, ...entry });
|
|
21
|
+
} else {
|
|
22
|
+
manualAgents.push({ name, ...entry });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const sections = [
|
|
27
|
+
buildHeader(),
|
|
28
|
+
buildHowAgentsWork(),
|
|
29
|
+
buildAutomaticTriggers(automaticAgents),
|
|
30
|
+
buildManualTriggers(manualAgents),
|
|
31
|
+
buildDecisionMatrix(allAgents),
|
|
32
|
+
buildRules(),
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
return sections.join('\n');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function buildHeader() {
|
|
39
|
+
return `# Agent Routing Guide
|
|
40
|
+
|
|
41
|
+
Read this file at the start of every session. It tells you which agents are available and when to use them.
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function buildHowAgentsWork() {
|
|
46
|
+
return `## How Agents Work
|
|
47
|
+
- Agents are specialist subprocesses. Spawn them to keep your main context clean.
|
|
48
|
+
- Worktree agents run in isolation — safe to run in parallel with your work.
|
|
49
|
+
- Non-worktree agents share your context — don't edit the same files they're reading.
|
|
50
|
+
- Never spawn more than 3 agents simultaneously.
|
|
51
|
+
- If a task is small enough to do yourself in 2 minutes, don't spawn an agent for it.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function buildAgentEntry(agent) {
|
|
58
|
+
const isolation = agent.isolation === 'worktree' ? 'Worktree' : 'None';
|
|
59
|
+
let trigger;
|
|
60
|
+
if (agent.triggerType === 'automatic' && agent.triggerCommand) {
|
|
61
|
+
trigger = `Automatic — spawn when trigger condition is met (also: ${agent.triggerCommand})`;
|
|
62
|
+
} else if (agent.triggerType === 'automatic') {
|
|
63
|
+
trigger = 'Automatic — spawn when trigger condition is met';
|
|
64
|
+
} else if (agent.triggerCommand) {
|
|
65
|
+
trigger = `Manual — ${agent.triggerCommand}`;
|
|
66
|
+
} else {
|
|
67
|
+
trigger = 'Manual — spawn when needed';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return `### ${agent.name}
|
|
71
|
+
- **Model:** ${agent.model} | **Isolation:** ${isolation}
|
|
72
|
+
- **When:** ${agent.whenToUse}
|
|
73
|
+
- **Trigger:** ${trigger}
|
|
74
|
+
- **What it does:** ${agent.whatItDoes}
|
|
75
|
+
- **Expect back:** ${agent.expectBack}
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function buildAutomaticTriggers(agents) {
|
|
80
|
+
if (agents.length === 0) {
|
|
81
|
+
return `## Automatic Triggers
|
|
82
|
+
|
|
83
|
+
No automatic-trigger agents installed.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const entries = agents.map(buildAgentEntry).join('\n');
|
|
90
|
+
return `## Automatic Triggers
|
|
91
|
+
|
|
92
|
+
These agents should be spawned without being asked when their trigger condition is met.
|
|
93
|
+
|
|
94
|
+
${entries}
|
|
95
|
+
---
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function buildManualTriggers(agents) {
|
|
100
|
+
if (agents.length === 0) {
|
|
101
|
+
return `## Manual Triggers
|
|
102
|
+
|
|
103
|
+
No manual-trigger agents installed.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const entries = agents.map(buildAgentEntry).join('\n');
|
|
110
|
+
return `## Manual Triggers
|
|
111
|
+
|
|
112
|
+
These agents are spawned when you or the user explicitly requests them.
|
|
113
|
+
|
|
114
|
+
${entries}
|
|
115
|
+
---
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function buildDecisionMatrix(allAgents) {
|
|
120
|
+
const header = `## Decision Matrix
|
|
121
|
+
|
|
122
|
+
| You just... | Spawn this | Auto? |
|
|
123
|
+
|---|---|---|`;
|
|
124
|
+
|
|
125
|
+
const rows = [];
|
|
126
|
+
for (const name of allAgents) {
|
|
127
|
+
const entry = AGENT_REGISTRY[name];
|
|
128
|
+
if (!entry) continue;
|
|
129
|
+
const auto = entry.triggerType === 'automatic' ? 'Yes' : 'Manual';
|
|
130
|
+
rows.push(`| ${entry.situationLabel} | ${name} | ${auto} |`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return `${header}
|
|
134
|
+
${rows.join('\n')}
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
`;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function buildRules() {
|
|
141
|
+
return `## Rules
|
|
142
|
+
1. Universal agents are your defaults. Use them every session.
|
|
143
|
+
2. Project agents are specialists. Use them when their domain is relevant.
|
|
144
|
+
3. Worktree agents are safe to run in parallel — they can't break your work.
|
|
145
|
+
4. Non-worktree agents share your context — don't edit the same files they're reading.
|
|
146
|
+
5. When in doubt, spawn the agent. A wasted agent run costs less than a missed bug.
|
|
147
|
+
6. If you spawn an agent and it's not useful, tell the user — they may remove it.
|
|
148
|
+
`;
|
|
149
|
+
}
|
package/templates/claude-md.md
CHANGED
|
@@ -20,11 +20,12 @@ See `.claude/skills/` — load only what's relevant:
|
|
|
20
20
|
- review-and-handoff.md — Session endings
|
|
21
21
|
- verification.md — How to verify work
|
|
22
22
|
- testing.md — Test philosophy and patterns
|
|
23
|
+
- agent-routing.md — When and how to use each installed agent (READ EVERY SESSION)
|
|
23
24
|
{project_specific_skills}
|
|
24
25
|
|
|
25
26
|
## Session Protocol
|
|
26
|
-
**Start:** Read PROGRESS.md. Read active implementation prompt if any.
|
|
27
|
-
**During:** One task at a time. Commit after each. Use subagents
|
|
27
|
+
**Start:** Read PROGRESS.md → Read `.claude/skills/agent-routing.md` → Read active implementation prompt if any.
|
|
28
|
+
**During:** One task at a time. Commit after each. Use subagents per routing guide.
|
|
28
29
|
**End:** Update PROGRESS.md. Write handoff if ending mid-task.
|
|
29
30
|
|
|
30
31
|
## Critical Rules
|