specialist-agent 1.2.0 â 1.2.2
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 +31 -13
- package/cli/index.mjs +116 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,25 @@
|
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## ð Table of Contents
|
|
19
|
+
|
|
20
|
+
- [ðĄ What is Specialist Agent?](#-what-is-specialist-agent)
|
|
21
|
+
- [ðŠ Token Consumption Notice](#-token-consumption-notice)
|
|
22
|
+
- [ð Quick Start](#-quick-start)
|
|
23
|
+
- [ðĪ Meet Your AI Team](#-meet-your-ai-team)
|
|
24
|
+
- [⥠Skills](#-skills)
|
|
25
|
+
- [ðïļ Architecture](#ïļ-architecture)
|
|
26
|
+
- [ðŠķ Lite Mode](#-lite-mode--lower-token-usage)
|
|
27
|
+
- [ð Project Structure](#-project-structure)
|
|
28
|
+
- [ð Optional: Context7 MCP](#-optional-context7-mcp)
|
|
29
|
+
- [ð§ Customization](#-customization)
|
|
30
|
+
- [ð Documentation](#-documentation)
|
|
31
|
+
- [ðŦ Contributing](#-contributing)
|
|
32
|
+
- [ð License](#-license)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## ðĄ What is Specialist Agent?
|
|
19
37
|
|
|
20
38
|
Specialist Agent is a collection of **AI agents**, **skills**, and **architectural conventions** for Claude Code. It's not a library â it's a set of markdown instructions that make Claude Code work like a senior developer who knows your codebase.
|
|
21
39
|
|
|
@@ -30,7 +48,7 @@ Specialist Agent is a collection of **AI agents**, **skills**, and **architectur
|
|
|
30
48
|
|
|
31
49
|
---
|
|
32
50
|
|
|
33
|
-
## Token Consumption Notice
|
|
51
|
+
## ðŠ Token Consumption Notice
|
|
34
52
|
|
|
35
53
|
Agents consume tokens proportional to their complexity. Specialist Agent ships with **Lite agents** that use `model: haiku` â significantly cheaper per token.
|
|
36
54
|
|
|
@@ -41,7 +59,7 @@ Agents consume tokens proportional to their complexity. Specialist Agent ships w
|
|
|
41
59
|
|
|
42
60
|
---
|
|
43
61
|
|
|
44
|
-
## Quick Start
|
|
62
|
+
## ð Quick Start
|
|
45
63
|
|
|
46
64
|
**1. Install into your project**
|
|
47
65
|
|
|
@@ -69,7 +87,7 @@ claude
|
|
|
69
87
|
|
|
70
88
|
---
|
|
71
89
|
|
|
72
|
-
## Meet Your AI Team
|
|
90
|
+
## ðĪ Meet Your AI Team
|
|
73
91
|
|
|
74
92
|
### Framework-Agnostic
|
|
75
93
|
|
|
@@ -127,7 +145,7 @@ claude
|
|
|
127
145
|
|
|
128
146
|
---
|
|
129
147
|
|
|
130
|
-
## Skills
|
|
148
|
+
## ⥠Skills
|
|
131
149
|
|
|
132
150
|
Quick shortcuts you invoke with `/skill-name` in Claude Code.
|
|
133
151
|
|
|
@@ -165,7 +183,7 @@ Quick shortcuts you invoke with `/skill-name` in Claude Code.
|
|
|
165
183
|
|
|
166
184
|
---
|
|
167
185
|
|
|
168
|
-
## Architecture
|
|
186
|
+
## ðïļ Architecture
|
|
169
187
|
|
|
170
188
|
All agents enforce the four-layer architecture defined in each pack:
|
|
171
189
|
|
|
@@ -186,7 +204,7 @@ Each pack adapts the orchestration layer:
|
|
|
186
204
|
|
|
187
205
|
---
|
|
188
206
|
|
|
189
|
-
## Lite Mode â Lower Token Usage
|
|
207
|
+
## ðŠķ Lite Mode â Lower Token Usage
|
|
190
208
|
|
|
191
209
|
For cost-conscious usage or simpler tasks:
|
|
192
210
|
|
|
@@ -204,7 +222,7 @@ npx specialist-agent init # select "Lite" mode in wizard
|
|
|
204
222
|
|
|
205
223
|
---
|
|
206
224
|
|
|
207
|
-
## Project Structure
|
|
225
|
+
## ð Project Structure
|
|
208
226
|
|
|
209
227
|
```text
|
|
210
228
|
specialist-agent/
|
|
@@ -230,7 +248,7 @@ specialist-agent/
|
|
|
230
248
|
|
|
231
249
|
---
|
|
232
250
|
|
|
233
|
-
## Optional: Context7 MCP
|
|
251
|
+
## ð Optional: Context7 MCP
|
|
234
252
|
|
|
235
253
|
For up-to-date library documentation when asking Claude about APIs, you can add the [Context7 MCP server](https://github.com/upstash/context7). This benefits you as a developer â agents work fully without it.
|
|
236
254
|
|
|
@@ -251,7 +269,7 @@ Add to your Claude Code MCP config (`~/.claude/mcp.json`):
|
|
|
251
269
|
|
|
252
270
|
---
|
|
253
271
|
|
|
254
|
-
## Customization
|
|
272
|
+
## ð§ Customization
|
|
255
273
|
|
|
256
274
|
### Add an Agent
|
|
257
275
|
|
|
@@ -315,7 +333,7 @@ Edit `docs/ARCHITECTURE.md` â all agents read this file before acting. Changes
|
|
|
315
333
|
|
|
316
334
|
---
|
|
317
335
|
|
|
318
|
-
## Documentation
|
|
336
|
+
## ð Documentation
|
|
319
337
|
|
|
320
338
|
Full docs are available via VitePress:
|
|
321
339
|
|
|
@@ -333,7 +351,7 @@ npm install && npm run docs:dev
|
|
|
333
351
|
|
|
334
352
|
---
|
|
335
353
|
|
|
336
|
-
## Contributing
|
|
354
|
+
## ðŦ Contributing
|
|
337
355
|
|
|
338
356
|
Contributions are welcome!
|
|
339
357
|
|
|
@@ -351,7 +369,7 @@ git push origin feature/my-feature
|
|
|
351
369
|
|
|
352
370
|
---
|
|
353
371
|
|
|
354
|
-
## License
|
|
372
|
+
## ð License
|
|
355
373
|
|
|
356
374
|
MIT â Use freely. See [LICENSE](LICENSE).
|
|
357
375
|
|
package/cli/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { createInterface } from 'readline'
|
|
4
|
-
import { existsSync, mkdirSync, cpSync, readdirSync, readFileSync } from 'fs'
|
|
4
|
+
import { existsSync, mkdirSync, cpSync, readdirSync, readFileSync, writeFileSync } from 'fs'
|
|
5
5
|
import { join, dirname, resolve } from 'path'
|
|
6
6
|
import { fileURLToPath } from 'url'
|
|
7
7
|
|
|
@@ -17,24 +17,36 @@ const DIM = '\x1b[2m'
|
|
|
17
17
|
const NC = '\x1b[0m'
|
|
18
18
|
|
|
19
19
|
const rl = createInterface({ input: process.stdin, output: process.stdout })
|
|
20
|
+
rl.on('close', () => {
|
|
21
|
+
console.log()
|
|
22
|
+
process.exit(0)
|
|
23
|
+
})
|
|
20
24
|
|
|
21
25
|
function ask(question, options) {
|
|
22
26
|
return new Promise((resolve) => {
|
|
23
|
-
|
|
24
|
-
console.log()
|
|
25
|
-
options.forEach((opt, i) => {
|
|
26
|
-
console.log(` ${BOLD}${i + 1}${NC}) ${opt.label}${opt.hint ? ` ${DIM}${opt.hint}${NC}` : ''}`)
|
|
27
|
-
})
|
|
28
|
-
console.log()
|
|
29
|
-
}
|
|
30
|
-
rl.question(`${BLUE}${question}${NC} `, (answer) => {
|
|
27
|
+
const prompt = () => {
|
|
31
28
|
if (options) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
console.log()
|
|
30
|
+
options.forEach((opt, i) => {
|
|
31
|
+
console.log(` ${BOLD}${i + 1}${NC}) ${opt.label}${opt.hint ? ` ${DIM}${opt.hint}${NC}` : ''}`)
|
|
32
|
+
})
|
|
33
|
+
console.log()
|
|
36
34
|
}
|
|
37
|
-
|
|
35
|
+
rl.question(`${BLUE}${question}${NC} `, (answer) => {
|
|
36
|
+
if (options) {
|
|
37
|
+
const idx = parseInt(answer, 10) - 1
|
|
38
|
+
if (idx >= 0 && idx < options.length) {
|
|
39
|
+
resolve(options[idx].value)
|
|
40
|
+
} else {
|
|
41
|
+
console.log(` ${YELLOW}Invalid choice. Please enter a number between 1 and ${options.length}.${NC}`)
|
|
42
|
+
prompt()
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
resolve(answer.trim())
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
prompt()
|
|
38
50
|
})
|
|
39
51
|
}
|
|
40
52
|
|
|
@@ -66,22 +78,34 @@ function getAgentNames(dir) {
|
|
|
66
78
|
}
|
|
67
79
|
|
|
68
80
|
async function main() {
|
|
81
|
+
const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8'))
|
|
82
|
+
|
|
69
83
|
console.log()
|
|
70
|
-
console.log(`${BOLD}${BLUE}
|
|
71
|
-
console.log(`${BOLD}${BLUE} â Specialist Agent â Setup Wizard
|
|
72
|
-
console.log(`${BOLD}${BLUE}
|
|
84
|
+
console.log(`${BOLD}${BLUE} âââââââââââââââââââââââââââââââââââââââââââââââââ${NC}`)
|
|
85
|
+
console.log(`${BOLD}${BLUE} â Specialist Agent â Setup Wizard â${NC}`)
|
|
86
|
+
console.log(`${BOLD}${BLUE} âââââââââââââââââââââââââââââââââââââââââââââââââ${NC}`)
|
|
73
87
|
console.log()
|
|
74
|
-
console.log(` ${DIM}AI agents for Claude Code â any framework, any stack${NC}`)
|
|
88
|
+
console.log(` ${DIM}AI agents for Claude Code â any framework, any stack v${pkg.version}${NC}`)
|
|
75
89
|
console.log()
|
|
76
90
|
|
|
77
91
|
// Check we're in a project
|
|
78
92
|
const cwd = process.cwd()
|
|
79
93
|
if (!existsSync(join(cwd, 'package.json'))) {
|
|
80
94
|
console.log(`${YELLOW} â No package.json found in current directory.${NC}`)
|
|
81
|
-
console.log(` Run this command from the root of your project.`)
|
|
82
95
|
console.log()
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
const createPkg = await ask('Create a package.json to initialize this project?', [
|
|
97
|
+
{ label: 'Yes', value: true, hint: '(recommended)' },
|
|
98
|
+
{ label: 'No', value: false, hint: '(exit)' },
|
|
99
|
+
])
|
|
100
|
+
if (!createPkg) {
|
|
101
|
+
console.log(` Run this command from the root of your project.`)
|
|
102
|
+
console.log()
|
|
103
|
+
process.exit(1)
|
|
104
|
+
}
|
|
105
|
+
const dirName = cwd.split(/[\\/]/).pop() || 'my-project'
|
|
106
|
+
writeFileSync(join(cwd, 'package.json'), JSON.stringify({ name: dirName, version: '0.1.0', private: true }, null, 2) + '\n')
|
|
107
|
+
console.log(` ${GREEN}â
${NC} package.json created`)
|
|
108
|
+
console.log()
|
|
85
109
|
}
|
|
86
110
|
|
|
87
111
|
// 1. Framework
|
|
@@ -112,16 +136,17 @@ async function main() {
|
|
|
112
136
|
])
|
|
113
137
|
|
|
114
138
|
// 4. Specialist agents
|
|
115
|
-
const installSpecialists = await ask('Install specialist agents? (@finance, @cloud, @security, @designer, @data, @devops, @tester)', [
|
|
139
|
+
const installSpecialists = await ask('Install specialist agents? (@explorer, @finance, @cloud, @security, @designer, @data, @devops, @tester)', [
|
|
116
140
|
{ label: 'Yes', value: true, hint: '(recommended)' },
|
|
117
141
|
{ label: 'No', value: false, hint: '' },
|
|
118
142
|
])
|
|
119
143
|
|
|
120
144
|
console.log()
|
|
121
|
-
console.log(`${BLUE}
|
|
145
|
+
console.log(`${BLUE} âââââââââââââââââââââââââââââââââââââââââââââââ${NC}`)
|
|
122
146
|
console.log(` ${BOLD}Installing Specialist Agent${NC}`)
|
|
123
|
-
|
|
124
|
-
console.log(
|
|
147
|
+
const packLabel = packLabels[framework] || framework
|
|
148
|
+
console.log(` ${DIM}Pack: ${packLabel} | Mode: ${mode} | Starter: ${installStarter ? 'yes' : 'no'} | Specialists: ${installSpecialists ? 'yes' : 'no'}${NC}`)
|
|
149
|
+
console.log(`${BLUE} âââââââââââââââââââââââââââââââââââââââââââââââ${NC}`)
|
|
125
150
|
console.log()
|
|
126
151
|
|
|
127
152
|
const packDir = join(ROOT, 'packs', framework)
|
|
@@ -155,7 +180,7 @@ async function main() {
|
|
|
155
180
|
|
|
156
181
|
// Install specialist agents
|
|
157
182
|
if (installSpecialists) {
|
|
158
|
-
const specialistNames = ['finance', 'cloud', 'security', 'designer', 'data', 'devops', 'tester']
|
|
183
|
+
const specialistNames = ['explorer', 'finance', 'cloud', 'security', 'designer', 'data', 'devops', 'tester']
|
|
159
184
|
for (const name of specialistNames) {
|
|
160
185
|
const suffix = mode === 'lite' ? `-lite.md` : '.md'
|
|
161
186
|
const source = join(ROOT, 'agents', `${name}${suffix}`)
|
|
@@ -173,15 +198,23 @@ async function main() {
|
|
|
173
198
|
const skillsDest = join(cwd, '.claude', 'skills')
|
|
174
199
|
mkdirSync(skillsDest, { recursive: true })
|
|
175
200
|
const skillCount = copyDir(skillsSource, skillsDest)
|
|
176
|
-
|
|
201
|
+
if (skillCount > 0) {
|
|
202
|
+
console.log(` ${GREEN}${skillCount} skills installed${NC}`)
|
|
203
|
+
} else {
|
|
204
|
+
console.log(` ${DIM} No skills available for this pack${NC}`)
|
|
205
|
+
}
|
|
177
206
|
|
|
178
207
|
// Install ARCHITECTURE.md
|
|
179
208
|
console.log()
|
|
180
209
|
const archDest = join(cwd, 'docs', 'ARCHITECTURE.md')
|
|
181
210
|
if (!existsSync(archDest)) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
211
|
+
if (existsSync(archSource)) {
|
|
212
|
+
mkdirSync(dirname(archDest), { recursive: true })
|
|
213
|
+
cpSync(archSource, archDest)
|
|
214
|
+
console.log(` ${GREEN}â
${NC} docs/ARCHITECTURE.md`)
|
|
215
|
+
} else {
|
|
216
|
+
console.log(` ${YELLOW}â ${NC} ARCHITECTURE.md not found in pack (skipped)`)
|
|
217
|
+
}
|
|
185
218
|
} else {
|
|
186
219
|
console.log(` ${YELLOW}â ${NC} docs/ARCHITECTURE.md already exists (not overwritten)`)
|
|
187
220
|
}
|
|
@@ -189,17 +222,21 @@ async function main() {
|
|
|
189
222
|
// Install CLAUDE.md
|
|
190
223
|
const claudeDest = join(cwd, 'CLAUDE.md')
|
|
191
224
|
if (!existsSync(claudeDest)) {
|
|
192
|
-
|
|
193
|
-
|
|
225
|
+
if (existsSync(claudeSource)) {
|
|
226
|
+
cpSync(claudeSource, claudeDest)
|
|
227
|
+
console.log(` ${GREEN}â
${NC} CLAUDE.md`)
|
|
228
|
+
} else {
|
|
229
|
+
console.log(` ${YELLOW}â ${NC} CLAUDE.md not found in pack (skipped)`)
|
|
230
|
+
}
|
|
194
231
|
} else {
|
|
195
232
|
console.log(` ${YELLOW}â ${NC} CLAUDE.md already exists (not overwritten)`)
|
|
196
233
|
}
|
|
197
234
|
|
|
198
235
|
// Done
|
|
199
236
|
console.log()
|
|
200
|
-
console.log(`${GREEN}
|
|
237
|
+
console.log(`${GREEN} âââââââââââââââââââââââââââââââââââââââââââââââ${NC}`)
|
|
201
238
|
console.log(`${GREEN} ð Specialist Agent installed successfully!${NC}`)
|
|
202
|
-
console.log(`${GREEN}
|
|
239
|
+
console.log(`${GREEN} âââââââââââââââââââââââââââââââââââââââââââââââ${NC}`)
|
|
203
240
|
console.log()
|
|
204
241
|
|
|
205
242
|
if (mode === 'lite') {
|
|
@@ -208,12 +245,21 @@ async function main() {
|
|
|
208
245
|
console.log()
|
|
209
246
|
}
|
|
210
247
|
|
|
248
|
+
// Show installed skills as examples
|
|
249
|
+
const installedSkills = existsSync(skillsDest)
|
|
250
|
+
? readdirSync(skillsDest, { withFileTypes: true }).filter(d => d.isDirectory()).map(d => '/' + d.name)
|
|
251
|
+
: []
|
|
252
|
+
|
|
211
253
|
console.log(` Open Claude Code and try:`)
|
|
212
254
|
console.log()
|
|
213
255
|
console.log(` claude`)
|
|
214
256
|
console.log(` /agents ${DIM}# list agents${NC}`)
|
|
215
|
-
|
|
216
|
-
|
|
257
|
+
if (installedSkills.length > 0) {
|
|
258
|
+
const examples = installedSkills.slice(0, 2)
|
|
259
|
+
examples.forEach(skill => {
|
|
260
|
+
console.log(` ${skill}`)
|
|
261
|
+
})
|
|
262
|
+
}
|
|
217
263
|
console.log()
|
|
218
264
|
console.log(` Or just ask:`)
|
|
219
265
|
console.log()
|
|
@@ -225,8 +271,40 @@ async function main() {
|
|
|
225
271
|
rl.close()
|
|
226
272
|
}
|
|
227
273
|
|
|
274
|
+
const args = process.argv.slice(2)
|
|
275
|
+
|
|
276
|
+
const validCommands = ['init']
|
|
277
|
+
const command = args.find(a => !a.startsWith('-'))
|
|
278
|
+
if (command && !validCommands.includes(command)) {
|
|
279
|
+
console.error(` ${YELLOW}Unknown command: ${command}${NC}`)
|
|
280
|
+
console.error(` Run ${BOLD}specialist-agent --help${NC} for usage.`)
|
|
281
|
+
process.exit(1)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
285
|
+
const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8'))
|
|
286
|
+
console.log()
|
|
287
|
+
console.log(` ${BOLD}specialist-agent${NC} v${pkg.version}`)
|
|
288
|
+
console.log()
|
|
289
|
+
console.log(' Usage: specialist-agent [init] [options]')
|
|
290
|
+
console.log()
|
|
291
|
+
console.log(' Options:')
|
|
292
|
+
console.log(' -h, --help Show this help message')
|
|
293
|
+
console.log(' -v, --version Show version number')
|
|
294
|
+
console.log()
|
|
295
|
+
console.log(' Run the setup wizard to install AI agents for Claude Code.')
|
|
296
|
+
console.log(' Can be executed from any directory (creates package.json if needed).')
|
|
297
|
+
console.log()
|
|
298
|
+
process.exit(0)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
302
|
+
const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8'))
|
|
303
|
+
console.log(pkg.version)
|
|
304
|
+
process.exit(0)
|
|
305
|
+
}
|
|
306
|
+
|
|
228
307
|
main().catch((err) => {
|
|
229
|
-
console.error(err)
|
|
230
|
-
rl.close()
|
|
308
|
+
console.error(` ${YELLOW}Error: ${err.message}${NC}`)
|
|
231
309
|
process.exit(1)
|
|
232
310
|
})
|