specialist-agent 1.4.0 → 1.4.1
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/agents/starter-lite.md +1 -1
- package/agents/starter.md +1 -1
- package/agents/tester-lite.md +1 -1
- package/agents/tester.md +5 -5
- package/cli/index.mjs +63 -11
- package/package.json +1 -1
package/agents/starter-lite.md
CHANGED
|
@@ -14,7 +14,7 @@ Create new projects from scratch. Ask the user about their stack, then scaffold
|
|
|
14
14
|
|
|
15
15
|
### 1. Ask Requirements
|
|
16
16
|
- **Project name** (kebab-case)
|
|
17
|
-
- **Frontend framework**: Vue 3
|
|
17
|
+
- **Frontend framework**: Based on your project's framework (Vue 3, React, Next.js, SvelteKit, or Other)
|
|
18
18
|
- **Frontend extras**: Router, state management, server state, testing, linting, CSS framework
|
|
19
19
|
- **Backend**: None | Node (Express/Fastify) | Python (FastAPI/Django) | Go (Gin/Fiber) | Java (Spring Boot)
|
|
20
20
|
- **Database**: None | PostgreSQL | MySQL | MongoDB | SQLite
|
package/agents/starter.md
CHANGED
|
@@ -16,7 +16,7 @@ Create new projects from scratch. Ask the user about their desired stack, then s
|
|
|
16
16
|
Ask the user:
|
|
17
17
|
|
|
18
18
|
1. **Project name** — kebab-case (e.g. `my-ecommerce-app`)
|
|
19
|
-
2. **Frontend framework** —
|
|
19
|
+
2. **Frontend framework** — Based on your project's framework (Vue 3, React, Next.js, SvelteKit, or Other)
|
|
20
20
|
3. **Frontend extras** — Which additions?
|
|
21
21
|
- Router (default: yes)
|
|
22
22
|
- State management: Pinia / Zustand / None (default: yes)
|
package/agents/tester-lite.md
CHANGED
|
@@ -26,7 +26,7 @@ Design and implement comprehensive testing strategies.
|
|
|
26
26
|
2. Determine type:
|
|
27
27
|
- Pure functions: direct I/O, no mocks
|
|
28
28
|
- Services: mock HTTP, test request/response
|
|
29
|
-
- Composables: mock services, test reactivity
|
|
29
|
+
- Hooks/Composables: mock services, test reactivity
|
|
30
30
|
- Components: render, test interactions
|
|
31
31
|
3. Write: happy path + edge cases + error cases
|
|
32
32
|
4. Use AAA: Arrange → Act → Assert
|
package/agents/tester.md
CHANGED
|
@@ -23,12 +23,12 @@ Read `docs/ARCHITECTURE.md` if it exists, then scan the project for existing tes
|
|
|
23
23
|
|
|
24
24
|
### Workflow
|
|
25
25
|
1. Analyze project structure:
|
|
26
|
-
- Identify all testable layers (services, adapters, composables, components, API routes)
|
|
26
|
+
- Identify all testable layers (services, adapters, hooks/composables, components, API routes)
|
|
27
27
|
- Check existing test coverage
|
|
28
28
|
- Identify test gaps and high-risk untested code
|
|
29
29
|
2. Design testing pyramid:
|
|
30
30
|
- **Unit tests** (70%): pure functions, adapters, utilities, validators
|
|
31
|
-
- **Integration tests** (20%): composables + services, API endpoints, database queries
|
|
31
|
+
- **Integration tests** (20%): hooks/composables + services, API endpoints, database queries
|
|
32
32
|
- **E2E tests** (10%): critical user flows (login, checkout, CRUD operations)
|
|
33
33
|
3. Define testing conventions:
|
|
34
34
|
- File naming: `[OriginalName].spec.ts` or `[OriginalName].test.ts`
|
|
@@ -62,7 +62,7 @@ Read `docs/ARCHITECTURE.md` if it exists, then scan the project for existing tes
|
|
|
62
62
|
2. Determine test type:
|
|
63
63
|
- **Pure functions** (adapters, utils): direct input/output testing, no mocks needed
|
|
64
64
|
- **Services** (HTTP calls): mock HTTP client, test request building and response handling
|
|
65
|
-
- **Composables**: mock services, test reactive behavior and state transitions
|
|
65
|
+
- **Hooks/Composables**: mock services, test reactive behavior and state transitions
|
|
66
66
|
- **Components**: render with test-utils, test user interactions and rendered output
|
|
67
67
|
- **API routes**: supertest/integration test with test database
|
|
68
68
|
3. Create test file:
|
|
@@ -83,8 +83,8 @@ Read `docs/ARCHITECTURE.md` if it exists, then scan the project for existing tes
|
|
|
83
83
|
```
|
|
84
84
|
Pure functions (adapters, utils): No mocks — test directly
|
|
85
85
|
Services (HTTP): Mock axios/fetch, verify URL + params
|
|
86
|
-
Composables (with service):
|
|
87
|
-
Components (with composable):
|
|
86
|
+
Hooks/Composables (with service): Mock service module, test reactive state
|
|
87
|
+
Components (with hook/composable): Mock hook/composable return values, test UI
|
|
88
88
|
API routes (with database): Test database or mock repository layer
|
|
89
89
|
```
|
|
90
90
|
|
package/cli/index.mjs
CHANGED
|
@@ -23,6 +23,28 @@ function copyDir(src, dest) {
|
|
|
23
23
|
return countFiles(dest)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
function copyNewOnly(src, dest) {
|
|
27
|
+
if (!existsSync(src)) return 0
|
|
28
|
+
let count = 0
|
|
29
|
+
for (const entry of readdirSync(src, { withFileTypes: true })) {
|
|
30
|
+
const srcPath = join(src, entry.name)
|
|
31
|
+
const destPath = join(dest, entry.name)
|
|
32
|
+
if (entry.isDirectory()) {
|
|
33
|
+
mkdirSync(destPath, { recursive: true })
|
|
34
|
+
count += copyNewOnly(srcPath, destPath)
|
|
35
|
+
} else if (entry.name.endsWith('.md') && !existsSync(destPath)) {
|
|
36
|
+
cpSync(srcPath, destPath)
|
|
37
|
+
count++
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return count
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function detectExistingAgents(agentsDir) {
|
|
44
|
+
if (!existsSync(agentsDir)) return []
|
|
45
|
+
return readdirSync(agentsDir).filter(f => f.endsWith('.md'))
|
|
46
|
+
}
|
|
47
|
+
|
|
26
48
|
function countFiles(dir) {
|
|
27
49
|
if (!existsSync(dir)) return 0
|
|
28
50
|
let count = 0
|
|
@@ -141,6 +163,7 @@ if (args.includes('--help') || args.includes('-h')) {
|
|
|
141
163
|
console.log(' Options:')
|
|
142
164
|
console.log(` -h, --help ${DIM}Show this help message${NC}`)
|
|
143
165
|
console.log(` -v, --version ${DIM}Show version number${NC}`)
|
|
166
|
+
console.log(` -f, --force ${DIM}Overwrite existing agents without asking${NC}`)
|
|
144
167
|
console.log()
|
|
145
168
|
console.log(` ${DIM}Run the setup wizard to install AI agents for Claude Code.${NC}`)
|
|
146
169
|
console.log(` ${DIM}Can be executed from any directory (creates package.json if needed).${NC}`)
|
|
@@ -154,6 +177,8 @@ if (args.includes('--version') || args.includes('-v')) {
|
|
|
154
177
|
process.exit(0)
|
|
155
178
|
}
|
|
156
179
|
|
|
180
|
+
const forceMode = args.includes('--force') || args.includes('-f')
|
|
181
|
+
|
|
157
182
|
// ── Main ─────────────────────────────────────────────
|
|
158
183
|
|
|
159
184
|
async function main() {
|
|
@@ -259,7 +284,7 @@ async function main() {
|
|
|
259
284
|
|
|
260
285
|
// 4. Specialist agents
|
|
261
286
|
const installSpecialists = await clack.confirm({
|
|
262
|
-
message:
|
|
287
|
+
message: `Install specialist agents? ${DIM}(@finance, @cloud, @security, @designer, @data, @devops, @tester, @explorer)${NC}`,
|
|
263
288
|
initialValue: true,
|
|
264
289
|
})
|
|
265
290
|
|
|
@@ -278,26 +303,47 @@ async function main() {
|
|
|
278
303
|
|
|
279
304
|
// ── Install files ──────────────────────────────────
|
|
280
305
|
|
|
281
|
-
const s = clack.spinner()
|
|
282
|
-
s.start('Installing agents and skills...')
|
|
283
|
-
|
|
284
306
|
const packDir = join(ROOT, 'packs', framework)
|
|
285
307
|
const agentsSource = mode === 'lite' ? join(packDir, 'agents-lite') : join(packDir, 'agents')
|
|
286
308
|
const skillsSource = join(packDir, 'skills')
|
|
287
309
|
const archSource = join(packDir, 'ARCHITECTURE.md')
|
|
288
310
|
const claudeSource = join(packDir, 'CLAUDE.md')
|
|
289
311
|
|
|
290
|
-
// Install pack agents
|
|
291
312
|
const agentsDest = join(cwd, '.claude', 'agents')
|
|
292
313
|
mkdirSync(agentsDest, { recursive: true })
|
|
293
|
-
|
|
314
|
+
|
|
315
|
+
// Detect existing agents
|
|
316
|
+
const existingAgents = detectExistingAgents(agentsDest)
|
|
317
|
+
let shouldOverwrite = forceMode
|
|
318
|
+
|
|
319
|
+
if (existingAgents.length > 0 && !forceMode) {
|
|
320
|
+
clack.log.warn(`Existing agents detected in .claude/agents/ (${existingAgents.length} files)`)
|
|
321
|
+
const overwriteChoice = await clack.confirm({
|
|
322
|
+
message: 'Overwrite existing agent files?',
|
|
323
|
+
initialValue: false,
|
|
324
|
+
})
|
|
325
|
+
if (clack.isCancel(overwriteChoice)) handleCancel()
|
|
326
|
+
shouldOverwrite = overwriteChoice
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const s = clack.spinner()
|
|
330
|
+
if (existingAgents.length > 0 && !shouldOverwrite) {
|
|
331
|
+
s.start('Installing new agents and skills (preserving existing)...')
|
|
332
|
+
} else {
|
|
333
|
+
s.start('Installing agents and skills...')
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Install pack agents
|
|
337
|
+
const agentCount = shouldOverwrite
|
|
338
|
+
? copyDir(agentsSource, agentsDest)
|
|
339
|
+
: copyNewOnly(agentsSource, agentsDest)
|
|
294
340
|
|
|
295
341
|
// Install starter agent
|
|
296
342
|
if (installStarter) {
|
|
297
343
|
const starterFile = mode === 'lite' ? 'starter-lite.md' : 'starter.md'
|
|
298
344
|
const starterSource = join(ROOT, 'agents', starterFile)
|
|
299
345
|
const starterDest = join(agentsDest, 'starter.md')
|
|
300
|
-
if (existsSync(starterSource)) {
|
|
346
|
+
if (existsSync(starterSource) && (shouldOverwrite || !existsSync(starterDest))) {
|
|
301
347
|
cpSync(starterSource, starterDest)
|
|
302
348
|
}
|
|
303
349
|
}
|
|
@@ -309,7 +355,7 @@ async function main() {
|
|
|
309
355
|
const suffix = mode === 'lite' ? '-lite.md' : '.md'
|
|
310
356
|
const source = join(ROOT, 'agents', `${name}${suffix}`)
|
|
311
357
|
const dest = join(agentsDest, `${name}.md`)
|
|
312
|
-
if (existsSync(source)) {
|
|
358
|
+
if (existsSync(source) && (shouldOverwrite || !existsSync(dest))) {
|
|
313
359
|
cpSync(source, dest)
|
|
314
360
|
}
|
|
315
361
|
}
|
|
@@ -325,7 +371,7 @@ async function main() {
|
|
|
325
371
|
const starterFile = mode === 'lite' ? 'starter-lite.md' : 'starter.md'
|
|
326
372
|
const starterSource = join(ROOT, 'agents', starterFile)
|
|
327
373
|
const starterGlobalDest = join(globalAgentsDest, 'starter.md')
|
|
328
|
-
if (existsSync(starterSource)) {
|
|
374
|
+
if (existsSync(starterSource) && (shouldOverwrite || !existsSync(starterGlobalDest))) {
|
|
329
375
|
cpSync(starterSource, starterGlobalDest)
|
|
330
376
|
globalAgentCount++
|
|
331
377
|
}
|
|
@@ -337,7 +383,7 @@ async function main() {
|
|
|
337
383
|
const suffix = mode === 'lite' ? '-lite.md' : '.md'
|
|
338
384
|
const source = join(ROOT, 'agents', `${name}${suffix}`)
|
|
339
385
|
const dest = join(globalAgentsDest, `${name}.md`)
|
|
340
|
-
if (existsSync(source)) {
|
|
386
|
+
if (existsSync(source) && (shouldOverwrite || !existsSync(dest))) {
|
|
341
387
|
cpSync(source, dest)
|
|
342
388
|
globalAgentCount++
|
|
343
389
|
}
|
|
@@ -348,7 +394,9 @@ async function main() {
|
|
|
348
394
|
// Install skills
|
|
349
395
|
const skillsDest = join(cwd, '.claude', 'skills')
|
|
350
396
|
mkdirSync(skillsDest, { recursive: true })
|
|
351
|
-
const skillCount =
|
|
397
|
+
const skillCount = shouldOverwrite
|
|
398
|
+
? copyDir(skillsSource, skillsDest)
|
|
399
|
+
: copyNewOnly(skillsSource, skillsDest)
|
|
352
400
|
|
|
353
401
|
// Install ARCHITECTURE.md
|
|
354
402
|
const archDest = join(cwd, 'docs', 'ARCHITECTURE.md')
|
|
@@ -384,6 +432,10 @@ async function main() {
|
|
|
384
432
|
|
|
385
433
|
clack.note(summaryLines.join('\n'), `${packLabel} \u00b7 ${mode === 'full' ? 'Full' : 'Lite'}`)
|
|
386
434
|
|
|
435
|
+
if (existingAgents.length > 0 && !shouldOverwrite) {
|
|
436
|
+
clack.log.info(`${DIM}${existingAgents.length} existing agent(s) preserved. Use --force to overwrite.${NC}`)
|
|
437
|
+
}
|
|
438
|
+
|
|
387
439
|
// Getting started
|
|
388
440
|
const installedSkills = existsSync(skillsDest)
|
|
389
441
|
? readdirSync(skillsDest, { withFileTypes: true }).filter(d => d.isDirectory()).map(d => '/' + d.name)
|