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.
Files changed (3) hide show
  1. package/README.md +31 -13
  2. package/cli/index.mjs +116 -38
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -15,7 +15,25 @@
15
15
 
16
16
  ---
17
17
 
18
- ## What is Specialist Agent?
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
- if (options) {
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
- const idx = parseInt(answer, 10) - 1
33
- resolve(idx >= 0 && idx < options.length ? options[idx].value : options[0].value)
34
- } else {
35
- resolve(answer.trim())
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} ╔══════════════════════════════════════╗${NC}`)
71
- console.log(`${BOLD}${BLUE} ║ Specialist Agent — Setup Wizard ║${NC}`)
72
- console.log(`${BOLD}${BLUE} ╚══════════════════════════════════════╝${NC}`)
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
- rl.close()
84
- process.exit(1)
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} ─────────────────────────────────────${NC}`)
145
+ console.log(`${BLUE} ───────────────────────────────────────────────${NC}`)
122
146
  console.log(` ${BOLD}Installing Specialist Agent${NC}`)
123
- console.log(` ${DIM}Pack: ${framework} | Mode: ${mode} | Starter: ${installStarter ? 'yes' : 'no'} | Specialists: ${installSpecialists ? 'yes' : 'no'}${NC}`)
124
- console.log(`${BLUE} ─────────────────────────────────────${NC}`)
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
- console.log(` ${GREEN}${skillCount} skills installed${NC}`)
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
- mkdirSync(dirname(archDest), { recursive: true })
183
- cpSync(archSource, archDest)
184
- console.log(` ${GREEN}✅${NC} docs/ARCHITECTURE.md`)
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
- cpSync(claudeSource, claudeDest)
193
- console.log(` ${GREEN}✅${NC} CLAUDE.md`)
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} ══════════════════════════════════════${NC}`)
237
+ console.log(`${GREEN} ═══════════════════════════════════════════════${NC}`)
201
238
  console.log(`${GREEN} 🎉 Specialist Agent installed successfully!${NC}`)
202
- console.log(`${GREEN} ══════════════════════════════════════${NC}`)
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
- console.log(` /dev-create-module marketplace ${DIM}# scaffold a module${NC}`)
216
- console.log(` /review-check-architecture ${DIM}# validate architecture${NC}`)
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
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specialist-agent",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "description": "AI agents for Claude Code — any framework, any stack",
6
6
  "bin": {