specialist-agent 1.2.2 → 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.
Files changed (2) hide show
  1. package/cli/index.mjs +95 -71
  2. package/package.json +1 -1
package/cli/index.mjs CHANGED
@@ -16,37 +16,68 @@ const BOLD = '\x1b[1m'
16
16
  const DIM = '\x1b[2m'
17
17
  const NC = '\x1b[0m'
18
18
 
19
+ const W = 50
20
+
19
21
  const rl = createInterface({ input: process.stdin, output: process.stdout })
20
22
  rl.on('close', () => {
21
23
  console.log()
22
24
  process.exit(0)
23
25
  })
24
26
 
25
- function ask(question, options) {
27
+ function ask(question, options, stepInfo) {
26
28
  return new Promise((resolve) => {
27
- const prompt = () => {
28
- if (options) {
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()
34
- }
35
- rl.question(`${BLUE}${question}${NC} `, (answer) => {
29
+ const prefix = stepInfo ? `${BLUE}[${stepInfo}]${NC} ` : ''
30
+ console.log()
31
+ console.log(` ${prefix}${question}`)
32
+ if (options) {
33
+ console.log()
34
+ options.forEach((opt, i) => {
35
+ console.log(` ${BOLD}${i + 1}${NC}) ${opt.label}${opt.hint ? ` ${DIM}${opt.hint}${NC}` : ''}`)
36
+ })
37
+ console.log()
38
+ }
39
+ const doPrompt = () => {
40
+ rl.question(` ${BLUE}\u203a${NC} `, (answer) => {
36
41
  if (options) {
37
42
  const idx = parseInt(answer, 10) - 1
38
43
  if (idx >= 0 && idx < options.length) {
39
44
  resolve(options[idx].value)
40
45
  } else {
41
- console.log(` ${YELLOW}Invalid choice. Please enter a number between 1 and ${options.length}.${NC}`)
42
- prompt()
46
+ console.log(` ${YELLOW}Enter a number between 1 and ${options.length}${NC}`)
47
+ doPrompt()
43
48
  }
44
49
  } else {
45
50
  resolve(answer.trim())
46
51
  }
47
52
  })
48
53
  }
49
- prompt()
54
+ doPrompt()
55
+ })
56
+ }
57
+
58
+ function confirm(question, defaultYes, stepInfo) {
59
+ return new Promise((resolve) => {
60
+ const prefix = stepInfo ? `${BLUE}[${stepInfo}]${NC} ` : ''
61
+ const hint = defaultYes ? `${DIM}(Y/n)${NC}` : `${DIM}(y/N)${NC}`
62
+ console.log()
63
+ console.log(` ${prefix}${question} ${hint}`)
64
+ console.log()
65
+ const doPrompt = () => {
66
+ rl.question(` ${BLUE}\u203a${NC} `, (answer) => {
67
+ const val = answer.trim().toLowerCase()
68
+ if (val === '') {
69
+ resolve(defaultYes)
70
+ } else if (val === 'y' || val === 'yes') {
71
+ resolve(true)
72
+ } else if (val === 'n' || val === 'no') {
73
+ resolve(false)
74
+ } else {
75
+ console.log(` ${YELLOW}Enter Y or N${NC}`)
76
+ doPrompt()
77
+ }
78
+ })
79
+ }
80
+ doPrompt()
50
81
  })
51
82
  }
52
83
 
@@ -79,24 +110,23 @@ function getAgentNames(dir) {
79
110
 
80
111
  async function main() {
81
112
  const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8'))
113
+ const ver = `v${pkg.version}`
82
114
 
115
+ // Header
83
116
  console.log()
84
- console.log(`${BOLD}${BLUE} ╔═══════════════════════════════════════════════╗${NC}`)
85
- console.log(`${BOLD}${BLUE} ║ Specialist Agent — Setup Wizard ║${NC}`)
86
- console.log(`${BOLD}${BLUE} ╚═══════════════════════════════════════════════╝${NC}`)
87
- console.log()
88
- console.log(` ${DIM}AI agents for Claude Code — any framework, any stack v${pkg.version}${NC}`)
117
+ console.log(` ${BLUE}\u256d${'─'.repeat(W)}\u256e${NC}`)
118
+ console.log(` ${BLUE}\u2502${NC}${' '.repeat(W)}${BLUE}\u2502${NC}`)
119
+ console.log(` ${BLUE}\u2502${NC} ${BOLD}Specialist Agent${NC}${' '.repeat(W - 22 - ver.length)}${DIM}${ver}${NC} ${BLUE}\u2502${NC}`)
120
+ console.log(` ${BLUE}\u2502${NC} ${DIM}AI agents for Claude Code${NC}${' '.repeat(W - 28)}${BLUE}\u2502${NC}`)
121
+ console.log(` ${BLUE}\u2502${NC}${' '.repeat(W)}${BLUE}\u2502${NC}`)
122
+ console.log(` ${BLUE}\u2570${'─'.repeat(W)}\u256f${NC}`)
89
123
  console.log()
90
124
 
91
125
  // Check we're in a project
92
126
  const cwd = process.cwd()
93
127
  if (!existsSync(join(cwd, 'package.json'))) {
94
- console.log(`${YELLOW} ⚠ No package.json found in current directory.${NC}`)
95
- console.log()
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
- ])
128
+ console.log(` ${YELLOW}\u26a0${NC} No package.json found in current directory.`)
129
+ const createPkg = await confirm('Create a package.json to initialize this project?', true)
100
130
  if (!createPkg) {
101
131
  console.log(` Run this command from the root of your project.`)
102
132
  console.log()
@@ -104,7 +134,7 @@ async function main() {
104
134
  }
105
135
  const dirName = cwd.split(/[\\/]/).pop() || 'my-project'
106
136
  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`)
137
+ console.log(` ${GREEN}\u2713${NC} package.json created`)
108
138
  console.log()
109
139
  }
110
140
 
@@ -121,32 +151,26 @@ async function main() {
121
151
  hint: ''
122
152
  }))
123
153
 
124
- const framework = await ask('Which framework?', packOptions)
154
+ const framework = await ask('Which framework?', packOptions, '1/4')
125
155
 
126
156
  // 2. Mode
127
157
  const mode = await ask('Agent mode?', [
128
- { label: 'Full', value: 'full', hint: '(Sonnet/Opus — detailed output, validation)' },
129
- { label: 'Lite', value: 'lite', hint: '(Haiku — lower cost, faster)' },
130
- ])
158
+ { label: 'Full', value: 'full', hint: '(Sonnet/Opus)' },
159
+ { label: 'Lite', value: 'lite', hint: '(Haiku \u2014 lower cost)' },
160
+ ], '2/4')
131
161
 
132
162
  // 3. Starter agent
133
- const installStarter = await ask('Install @starter agent? (creates projects from scratch)', [
134
- { label: 'Yes', value: true, hint: '(recommended)' },
135
- { label: 'No', value: false, hint: '' },
136
- ])
163
+ const installStarter = await confirm('Install @starter agent?', true, '3/4')
137
164
 
138
165
  // 4. Specialist agents
139
- const installSpecialists = await ask('Install specialist agents? (@explorer, @finance, @cloud, @security, @designer, @data, @devops, @tester)', [
140
- { label: 'Yes', value: true, hint: '(recommended)' },
141
- { label: 'No', value: false, hint: '' },
142
- ])
166
+ const installSpecialists = await confirm('Install specialist agents?', true, '4/4')
143
167
 
144
- console.log()
145
- console.log(`${BLUE} ───────────────────────────────────────────────${NC}`)
146
- console.log(` ${BOLD}Installing Specialist Agent${NC}`)
168
+ // Summary
147
169
  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}`)
170
+ console.log()
171
+ console.log(` ${BLUE}${'─'.repeat(W)}${NC}`)
172
+ console.log()
173
+ console.log(` ${packLabel} ${DIM}\u00b7${NC} ${mode === 'full' ? 'Full' : 'Lite'} ${DIM}\u00b7${NC} Starter: ${installStarter ? 'yes' : 'no'} ${DIM}\u00b7${NC} Specialists: ${installSpecialists ? 'yes' : 'no'}`)
150
174
  console.log()
151
175
 
152
176
  const packDir = join(ROOT, 'packs', framework)
@@ -155,16 +179,15 @@ async function main() {
155
179
  const archSource = join(packDir, 'ARCHITECTURE.md')
156
180
  const claudeSource = join(packDir, 'CLAUDE.md')
157
181
 
158
- // Install agents
182
+ // Install pack agents
159
183
  const agentsDest = join(cwd, '.claude', 'agents')
160
184
  mkdirSync(agentsDest, { recursive: true })
161
185
  const agentCount = copyDir(agentsSource, agentsDest)
162
186
  const agentNames = getAgentNames(agentsDest)
163
187
 
164
188
  agentNames.forEach(name => {
165
- console.log(` ${GREEN}✅${NC} @${name}`)
189
+ console.log(` ${GREEN}\u2713${NC} @${name}`)
166
190
  })
167
- console.log(` ${GREEN}${agentCount} agents installed${NC}`)
168
191
 
169
192
  // Install starter agent
170
193
  if (installStarter) {
@@ -174,7 +197,7 @@ async function main() {
174
197
 
175
198
  if (existsSync(starterSource)) {
176
199
  cpSync(starterSource, starterDest)
177
- console.log(` ${GREEN}✅${NC} @starter`)
200
+ console.log(` ${GREEN}\u2713${NC} @starter`)
178
201
  }
179
202
  }
180
203
 
@@ -188,35 +211,36 @@ async function main() {
188
211
 
189
212
  if (existsSync(source)) {
190
213
  cpSync(source, dest)
191
- console.log(` ${GREEN}✅${NC} @${name}`)
214
+ console.log(` ${GREEN}\u2713${NC} @${name}`)
192
215
  }
193
216
  }
194
217
  }
195
218
 
219
+ console.log(` ${DIM}${agentCount} pack agents + extras installed${NC}`)
220
+
196
221
  // Install skills
197
222
  console.log()
198
223
  const skillsDest = join(cwd, '.claude', 'skills')
199
224
  mkdirSync(skillsDest, { recursive: true })
200
225
  const skillCount = copyDir(skillsSource, skillsDest)
201
226
  if (skillCount > 0) {
202
- console.log(` ${GREEN}${skillCount} skills installed${NC}`)
227
+ console.log(` ${GREEN}\u2713${NC} ${skillCount} skills installed`)
203
228
  } else {
204
229
  console.log(` ${DIM} No skills available for this pack${NC}`)
205
230
  }
206
231
 
207
232
  // Install ARCHITECTURE.md
208
- console.log()
209
233
  const archDest = join(cwd, 'docs', 'ARCHITECTURE.md')
210
234
  if (!existsSync(archDest)) {
211
235
  if (existsSync(archSource)) {
212
236
  mkdirSync(dirname(archDest), { recursive: true })
213
237
  cpSync(archSource, archDest)
214
- console.log(` ${GREEN}✅${NC} docs/ARCHITECTURE.md`)
238
+ console.log(` ${GREEN}\u2713${NC} docs/ARCHITECTURE.md`)
215
239
  } else {
216
- console.log(` ${YELLOW}⚠${NC} ARCHITECTURE.md not found in pack (skipped)`)
240
+ console.log(` ${YELLOW}\u26a0${NC} ARCHITECTURE.md not found in pack ${DIM}(skipped)${NC}`)
217
241
  }
218
242
  } else {
219
- console.log(` ${YELLOW}⚠${NC} docs/ARCHITECTURE.md already exists (not overwritten)`)
243
+ console.log(` ${DIM} docs/ARCHITECTURE.md already exists${NC}`)
220
244
  }
221
245
 
222
246
  // Install CLAUDE.md
@@ -224,24 +248,24 @@ async function main() {
224
248
  if (!existsSync(claudeDest)) {
225
249
  if (existsSync(claudeSource)) {
226
250
  cpSync(claudeSource, claudeDest)
227
- console.log(` ${GREEN}✅${NC} CLAUDE.md`)
251
+ console.log(` ${GREEN}\u2713${NC} CLAUDE.md`)
228
252
  } else {
229
- console.log(` ${YELLOW}⚠${NC} CLAUDE.md not found in pack (skipped)`)
253
+ console.log(` ${YELLOW}\u26a0${NC} CLAUDE.md not found in pack ${DIM}(skipped)${NC}`)
230
254
  }
231
255
  } else {
232
- console.log(` ${YELLOW}⚠${NC} CLAUDE.md already exists (not overwritten)`)
256
+ console.log(` ${DIM} CLAUDE.md already exists${NC}`)
233
257
  }
234
258
 
235
259
  // Done
236
260
  console.log()
237
- console.log(`${GREEN} ═══════════════════════════════════════════════${NC}`)
238
- console.log(`${GREEN} 🎉 Specialist Agent installed successfully!${NC}`)
239
- console.log(`${GREEN} ═══════════════════════════════════════════════${NC}`)
261
+ console.log(` ${BLUE}${'─'.repeat(W)}${NC}`)
262
+ console.log()
263
+ console.log(` ${GREEN}${BOLD}Setup complete!${NC}`)
240
264
  console.log()
241
265
 
242
266
  if (mode === 'lite') {
243
- console.log(` ${YELLOW}Lite mode: agents run on Haiku model (lower cost, faster).${NC}`)
244
- console.log(` ${YELLOW}To switch to Full agents: npx specialist-agent init${NC}`)
267
+ console.log(` ${DIM}Lite mode: agents run on Haiku (lower cost, faster).${NC}`)
268
+ console.log(` ${DIM}Switch to Full: npx specialist-agent init${NC}`)
245
269
  console.log()
246
270
  }
247
271
 
@@ -250,14 +274,13 @@ async function main() {
250
274
  ? readdirSync(skillsDest, { withFileTypes: true }).filter(d => d.isDirectory()).map(d => '/' + d.name)
251
275
  : []
252
276
 
253
- console.log(` Open Claude Code and try:`)
277
+ console.log(` Get started:`)
254
278
  console.log()
255
- console.log(` claude`)
256
- console.log(` /agents ${DIM}# list agents${NC}`)
279
+ console.log(` ${DIM}$${NC} claude`)
280
+ console.log(` ${DIM}$${NC} /agents ${DIM}# list installed agents${NC}`)
257
281
  if (installedSkills.length > 0) {
258
- const examples = installedSkills.slice(0, 2)
259
- examples.forEach(skill => {
260
- console.log(` ${skill}`)
282
+ installedSkills.slice(0, 2).forEach(skill => {
283
+ console.log(` ${DIM}$${NC} ${skill}`)
261
284
  })
262
285
  }
263
286
  console.log()
@@ -271,6 +294,7 @@ async function main() {
271
294
  rl.close()
272
295
  }
273
296
 
297
+ // CLI argument handling
274
298
  const args = process.argv.slice(2)
275
299
 
276
300
  const validCommands = ['init']
@@ -284,16 +308,16 @@ if (command && !validCommands.includes(command)) {
284
308
  if (args.includes('--help') || args.includes('-h')) {
285
309
  const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8'))
286
310
  console.log()
287
- console.log(` ${BOLD}specialist-agent${NC} v${pkg.version}`)
311
+ console.log(` ${BOLD}specialist-agent${NC} ${DIM}v${pkg.version}${NC}`)
288
312
  console.log()
289
313
  console.log(' Usage: specialist-agent [init] [options]')
290
314
  console.log()
291
315
  console.log(' Options:')
292
- console.log(' -h, --help Show this help message')
293
- console.log(' -v, --version Show version number')
316
+ console.log(` -h, --help ${DIM}Show this help message${NC}`)
317
+ console.log(` -v, --version ${DIM}Show version number${NC}`)
294
318
  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).')
319
+ console.log(` ${DIM}Run the setup wizard to install AI agents for Claude Code.${NC}`)
320
+ console.log(` ${DIM}Can be executed from any directory (creates package.json if needed).${NC}`)
297
321
  console.log()
298
322
  process.exit(0)
299
323
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specialist-agent",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "description": "AI agents for Claude Code — any framework, any stack",
6
6
  "bin": {