@girardmedia/bootspring 1.1.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/LICENSE +21 -0
- package/README.md +255 -0
- package/agents/README.md +93 -0
- package/agents/api-expert/context.md +416 -0
- package/agents/architecture-expert/context.md +454 -0
- package/agents/backend-expert/context.md +483 -0
- package/agents/code-review-expert/context.md +365 -0
- package/agents/database-expert/context.md +250 -0
- package/agents/devops-expert/context.md +446 -0
- package/agents/frontend-expert/context.md +364 -0
- package/agents/index.js +140 -0
- package/agents/performance-expert/context.md +377 -0
- package/agents/security-expert/context.md +343 -0
- package/agents/testing-expert/context.md +414 -0
- package/agents/ui-ux-expert/context.md +448 -0
- package/agents/vercel-expert/context.md +426 -0
- package/bin/bootspring.js +310 -0
- package/cli/agent.js +337 -0
- package/cli/context.js +194 -0
- package/cli/dashboard.js +150 -0
- package/cli/generate.js +294 -0
- package/cli/init.js +410 -0
- package/cli/loop.js +421 -0
- package/cli/mcp.js +241 -0
- package/cli/memory.js +303 -0
- package/cli/orchestrator.js +400 -0
- package/cli/plugin.js +451 -0
- package/cli/quality.js +332 -0
- package/cli/skill.js +369 -0
- package/cli/task.js +628 -0
- package/cli/telemetry.js +114 -0
- package/cli/todo.js +614 -0
- package/cli/update.js +312 -0
- package/core/config.js +245 -0
- package/core/context.js +329 -0
- package/core/entitlements.js +209 -0
- package/core/index.js +43 -0
- package/core/policies.js +68 -0
- package/core/telemetry.js +247 -0
- package/core/utils.js +380 -0
- package/dashboard/server.js +818 -0
- package/docs/integrations/claude-code.md +42 -0
- package/docs/integrations/codex.md +42 -0
- package/docs/mcp-api-platform.md +102 -0
- package/generators/generate.js +598 -0
- package/generators/index.js +18 -0
- package/hooks/context-detector.js +177 -0
- package/hooks/index.js +35 -0
- package/hooks/prompt-enhancer.js +289 -0
- package/intelligence/git-memory.js +551 -0
- package/intelligence/index.js +59 -0
- package/intelligence/orchestrator.js +964 -0
- package/intelligence/prd.js +447 -0
- package/intelligence/recommendation-weights.json +18 -0
- package/intelligence/recommendations.js +234 -0
- package/mcp/capabilities.js +71 -0
- package/mcp/contracts/mcp-contract.v1.json +497 -0
- package/mcp/registry.js +213 -0
- package/mcp/response-formatter.js +462 -0
- package/mcp/server.js +99 -0
- package/mcp/tools/agent-tool.js +137 -0
- package/mcp/tools/capabilities-tool.js +54 -0
- package/mcp/tools/context-tool.js +49 -0
- package/mcp/tools/dashboard-tool.js +58 -0
- package/mcp/tools/generate-tool.js +46 -0
- package/mcp/tools/loop-tool.js +134 -0
- package/mcp/tools/memory-tool.js +180 -0
- package/mcp/tools/orchestrator-tool.js +232 -0
- package/mcp/tools/plugin-tool.js +76 -0
- package/mcp/tools/quality-tool.js +47 -0
- package/mcp/tools/skill-tool.js +233 -0
- package/mcp/tools/telemetry-tool.js +95 -0
- package/mcp/tools/todo-tool.js +133 -0
- package/package.json +98 -0
- package/plugins/index.js +141 -0
- package/quality/index.js +380 -0
- package/quality/lint-budgets.json +19 -0
- package/skills/index.js +787 -0
- package/skills/patterns/README.md +163 -0
- package/skills/patterns/api/route-handler.md +217 -0
- package/skills/patterns/api/server-action.md +249 -0
- package/skills/patterns/auth/clerk.md +132 -0
- package/skills/patterns/database/prisma.md +180 -0
- package/skills/patterns/payments/stripe.md +272 -0
- package/skills/patterns/security/validation.md +268 -0
- package/skills/patterns/testing/vitest.md +307 -0
- package/templates/bootspring.config.js +83 -0
- package/templates/mcp.json +9 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bootspring CLI
|
|
5
|
+
* Development scaffolding with intelligence
|
|
6
|
+
*
|
|
7
|
+
* @package bootspring
|
|
8
|
+
* @version 1.0.0
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
|
|
15
|
+
// Version and branding
|
|
16
|
+
const VERSION = '1.1.0';
|
|
17
|
+
const BRAND = {
|
|
18
|
+
name: 'Bootspring',
|
|
19
|
+
tagline: 'Development scaffolding with intelligence',
|
|
20
|
+
color: '\x1b[36m', // Cyan
|
|
21
|
+
reset: '\x1b[0m',
|
|
22
|
+
bold: '\x1b[1m',
|
|
23
|
+
dim: '\x1b[2m',
|
|
24
|
+
green: '\x1b[32m',
|
|
25
|
+
yellow: '\x1b[33m',
|
|
26
|
+
red: '\x1b[31m'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// ASCII art logo
|
|
30
|
+
const LOGO = `
|
|
31
|
+
${BRAND.color}╔══════════════════════════════════════════╗
|
|
32
|
+
║ ║
|
|
33
|
+
║ ██████╗ ██████╗ ██████╗ ████████╗ ║
|
|
34
|
+
║ ██╔══██╗██╔═══██╗██╔═══██╗╚══██╔══╝ ║
|
|
35
|
+
║ ██████╔╝██║ ██║██║ ██║ ██║ ║
|
|
36
|
+
║ ██╔══██╗██║ ██║██║ ██║ ██║ ║
|
|
37
|
+
║ ██████╔╝╚██████╔╝╚██████╔╝ ██║ ║
|
|
38
|
+
║ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ║
|
|
39
|
+
║ ║
|
|
40
|
+
║ ███████╗██████╗ ██████╗ ██╗███╗ ██╗ ║
|
|
41
|
+
║ ██╔════╝██╔══██╗██╔══██╗██║████╗ ██║ ║
|
|
42
|
+
║ ███████╗██████╔╝██████╔╝██║██╔██╗ ██║ ║
|
|
43
|
+
║ ╚════██║██╔═══╝ ██╔══██╗██║██║╚██╗██║ ║
|
|
44
|
+
║ ███████║██║ ██║ ██║██║██║ ╚████║ ║
|
|
45
|
+
║ ╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ║
|
|
46
|
+
║ ║
|
|
47
|
+
╚══════════════════════════════════════════╝${BRAND.reset}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
// Compact logo for non-help commands
|
|
51
|
+
const LOGO_COMPACT = `${BRAND.color}${BRAND.bold}⚡ Bootspring${BRAND.reset} ${BRAND.dim}v${VERSION}${BRAND.reset}`;
|
|
52
|
+
|
|
53
|
+
// Command registry
|
|
54
|
+
const COMMANDS = {
|
|
55
|
+
// Core commands
|
|
56
|
+
init: {
|
|
57
|
+
script: '../cli/init.js',
|
|
58
|
+
description: 'Initialize Bootspring in current project',
|
|
59
|
+
usage: 'bootspring init [--force]'
|
|
60
|
+
},
|
|
61
|
+
generate: {
|
|
62
|
+
script: '../cli/generate.js',
|
|
63
|
+
description: 'Generate/regenerate CLAUDE.md context',
|
|
64
|
+
usage: 'bootspring generate [--full]'
|
|
65
|
+
},
|
|
66
|
+
dashboard: {
|
|
67
|
+
script: '../cli/dashboard.js',
|
|
68
|
+
description: 'Start the real-time dashboard',
|
|
69
|
+
usage: 'bootspring dashboard [--port <port>]'
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
// Todo commands
|
|
73
|
+
todo: {
|
|
74
|
+
script: '../cli/todo.js',
|
|
75
|
+
description: 'Manage project todos',
|
|
76
|
+
usage: 'bootspring todo <add|list|done|clear> [args]'
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
// Agent commands
|
|
80
|
+
agent: {
|
|
81
|
+
script: '../cli/agent.js',
|
|
82
|
+
description: 'Work with specialized agents',
|
|
83
|
+
usage: 'bootspring agent <list|show|invoke> [name]'
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
// Skill commands
|
|
87
|
+
skill: {
|
|
88
|
+
script: '../cli/skill.js',
|
|
89
|
+
description: 'Browse and use code patterns',
|
|
90
|
+
usage: 'bootspring skill <list|show|search|export> [args]'
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
// Plugin commands
|
|
94
|
+
plugin: {
|
|
95
|
+
script: '../cli/plugin.js',
|
|
96
|
+
description: 'Manage plugins',
|
|
97
|
+
usage: 'bootspring plugin <list|enable|disable|show> [name]'
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// Task commands
|
|
101
|
+
task: {
|
|
102
|
+
script: '../cli/task.js',
|
|
103
|
+
description: 'Manage complex tasks',
|
|
104
|
+
usage: 'bootspring task <create|list|show|update> [args]'
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
// Quality commands
|
|
108
|
+
quality: {
|
|
109
|
+
script: '../cli/quality.js',
|
|
110
|
+
description: 'Run quality gates',
|
|
111
|
+
usage: 'bootspring quality <pre-commit|pre-push|pre-deploy>'
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
// MCP commands
|
|
115
|
+
mcp: {
|
|
116
|
+
script: '../cli/mcp.js',
|
|
117
|
+
description: 'MCP server control',
|
|
118
|
+
usage: 'bootspring mcp <start|status>'
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
// Context commands
|
|
122
|
+
context: {
|
|
123
|
+
script: '../cli/context.js',
|
|
124
|
+
description: 'View and manage project context',
|
|
125
|
+
usage: 'bootspring context <show|validate|refresh>'
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
// Update commands
|
|
129
|
+
update: {
|
|
130
|
+
script: '../cli/update.js',
|
|
131
|
+
description: 'Check for and apply updates',
|
|
132
|
+
usage: 'bootspring update <check|apply>'
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
// Orchestrator commands
|
|
136
|
+
orchestrator: {
|
|
137
|
+
script: '../cli/orchestrator.js',
|
|
138
|
+
description: 'Intelligent agent coordination',
|
|
139
|
+
usage: 'bootspring orchestrator <analyze|workflow|status> [args]'
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
// Loop commands
|
|
143
|
+
loop: {
|
|
144
|
+
script: '../cli/loop.js',
|
|
145
|
+
description: 'Autonomous task execution loop',
|
|
146
|
+
usage: 'bootspring loop <start|status|prd> [args]'
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
// Memory commands
|
|
150
|
+
memory: {
|
|
151
|
+
script: '../cli/memory.js',
|
|
152
|
+
description: 'View git-based project memory',
|
|
153
|
+
usage: 'bootspring memory <summary|search|files|stats> [args]'
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
// Telemetry commands
|
|
157
|
+
telemetry: {
|
|
158
|
+
script: '../cli/telemetry.js',
|
|
159
|
+
description: 'Inspect and upload telemetry events',
|
|
160
|
+
usage: 'bootspring telemetry <status|list|upload|clear> [options]'
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
// Help
|
|
164
|
+
help: {
|
|
165
|
+
script: null,
|
|
166
|
+
description: 'Show this help message',
|
|
167
|
+
usage: 'bootspring help [command]'
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// Command categories for help display
|
|
172
|
+
const CATEGORIES = {
|
|
173
|
+
'Getting Started': ['init', 'generate', 'dashboard', 'help'],
|
|
174
|
+
'Daily Workflow': ['todo', 'task', 'context'],
|
|
175
|
+
'Intelligence': ['agent', 'skill', 'orchestrator', 'loop', 'memory'],
|
|
176
|
+
'Quality & Plugins': ['quality', 'plugin'],
|
|
177
|
+
'System': ['mcp', 'telemetry', 'update']
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Display help message
|
|
182
|
+
*/
|
|
183
|
+
function showHelp(specificCommand = null) {
|
|
184
|
+
if (specificCommand && COMMANDS[specificCommand]) {
|
|
185
|
+
const cmd = COMMANDS[specificCommand];
|
|
186
|
+
console.log(LOGO_COMPACT);
|
|
187
|
+
console.log(`\n${BRAND.bold}Command: ${specificCommand}${BRAND.reset}`);
|
|
188
|
+
console.log(`${BRAND.dim}${cmd.description}${BRAND.reset}\n`);
|
|
189
|
+
console.log(`${BRAND.bold}Usage:${BRAND.reset} ${cmd.usage}\n`);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
console.log(LOGO);
|
|
194
|
+
console.log(`${BRAND.dim}${BRAND.tagline}${BRAND.reset}\n`);
|
|
195
|
+
console.log(`${BRAND.bold}Usage:${BRAND.reset} bootspring <command> [options]\n`);
|
|
196
|
+
|
|
197
|
+
for (const [category, commands] of Object.entries(CATEGORIES)) {
|
|
198
|
+
console.log(`${BRAND.bold}${category}:${BRAND.reset}`);
|
|
199
|
+
for (const cmdName of commands) {
|
|
200
|
+
const cmd = COMMANDS[cmdName];
|
|
201
|
+
const padding = ' '.repeat(14 - cmdName.length);
|
|
202
|
+
console.log(` ${BRAND.color}${cmdName}${BRAND.reset}${padding}${BRAND.dim}${cmd.description}${BRAND.reset}`);
|
|
203
|
+
}
|
|
204
|
+
console.log();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
console.log(`${BRAND.bold}Examples:${BRAND.reset}`);
|
|
208
|
+
console.log(` ${BRAND.dim}$${BRAND.reset} bootspring init ${BRAND.dim}# Initialize new project${BRAND.reset}`);
|
|
209
|
+
console.log(` ${BRAND.dim}$${BRAND.reset} bootspring todo add "Build auth" ${BRAND.dim}# Add a todo${BRAND.reset}`);
|
|
210
|
+
console.log(` ${BRAND.dim}$${BRAND.reset} bootspring agent invoke security ${BRAND.dim}# Get security review${BRAND.reset}`);
|
|
211
|
+
console.log(` ${BRAND.dim}$${BRAND.reset} bootspring dashboard ${BRAND.dim}# Start dashboard${BRAND.reset}`);
|
|
212
|
+
console.log();
|
|
213
|
+
console.log(`${BRAND.dim}Documentation: https://bootspring.com/docs${BRAND.reset}`);
|
|
214
|
+
console.log(`${BRAND.dim}Report issues: https://github.com/bootspring/bootspring/issues${BRAND.reset}\n`);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Display version
|
|
219
|
+
*/
|
|
220
|
+
function showVersion() {
|
|
221
|
+
console.log(`${BRAND.name} v${VERSION}`);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Main entry point
|
|
226
|
+
*/
|
|
227
|
+
async function main() {
|
|
228
|
+
const args = process.argv.slice(2);
|
|
229
|
+
const command = args[0];
|
|
230
|
+
|
|
231
|
+
// Handle no command
|
|
232
|
+
if (!command) {
|
|
233
|
+
showHelp();
|
|
234
|
+
process.exit(0);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Handle version flag
|
|
238
|
+
if (command === '--version' || command === '-v') {
|
|
239
|
+
showVersion();
|
|
240
|
+
process.exit(0);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Handle help flag
|
|
244
|
+
if (command === '--help' || command === '-h') {
|
|
245
|
+
showHelp();
|
|
246
|
+
process.exit(0);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Handle help command
|
|
250
|
+
if (command === 'help') {
|
|
251
|
+
showHelp(args[1]);
|
|
252
|
+
process.exit(0);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Check if command exists
|
|
256
|
+
if (!COMMANDS[command]) {
|
|
257
|
+
console.log(LOGO_COMPACT);
|
|
258
|
+
console.log(`\n${BRAND.red}Error: Unknown command '${command}'${BRAND.reset}`);
|
|
259
|
+
console.log(`${BRAND.dim}Run 'bootspring help' to see available commands${BRAND.reset}\n`);
|
|
260
|
+
process.exit(1);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Get command config
|
|
264
|
+
const cmdConfig = COMMANDS[command];
|
|
265
|
+
|
|
266
|
+
// Resolve command script path
|
|
267
|
+
const scriptPath = path.resolve(__dirname, cmdConfig.script);
|
|
268
|
+
|
|
269
|
+
// Check if script exists
|
|
270
|
+
if (!fs.existsSync(scriptPath)) {
|
|
271
|
+
console.log(LOGO_COMPACT);
|
|
272
|
+
console.log(`\n${BRAND.yellow}Command '${command}' is not yet implemented${BRAND.reset}`);
|
|
273
|
+
console.log(`${BRAND.dim}Coming soon in a future release${BRAND.reset}\n`);
|
|
274
|
+
process.exit(0);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Load and execute command
|
|
278
|
+
try {
|
|
279
|
+
const commandModule = require(scriptPath);
|
|
280
|
+
|
|
281
|
+
// Pass remaining args to command
|
|
282
|
+
const commandArgs = args.slice(1);
|
|
283
|
+
|
|
284
|
+
// Execute command
|
|
285
|
+
if (typeof commandModule.run === 'function') {
|
|
286
|
+
await commandModule.run(commandArgs);
|
|
287
|
+
} else if (typeof commandModule === 'function') {
|
|
288
|
+
await commandModule(commandArgs);
|
|
289
|
+
} else {
|
|
290
|
+
console.log(`${BRAND.red}Error: Command '${command}' has invalid module format${BRAND.reset}`);
|
|
291
|
+
process.exit(1);
|
|
292
|
+
}
|
|
293
|
+
} catch (error) {
|
|
294
|
+
console.log(LOGO_COMPACT);
|
|
295
|
+
console.log(`\n${BRAND.red}Error executing '${command}':${BRAND.reset}`);
|
|
296
|
+
console.log(`${BRAND.dim}${error.message}${BRAND.reset}\n`);
|
|
297
|
+
|
|
298
|
+
if (process.env.DEBUG) {
|
|
299
|
+
console.log(error.stack);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
process.exit(1);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Run main
|
|
307
|
+
main().catch(error => {
|
|
308
|
+
console.error(`${BRAND.red}Fatal error:${BRAND.reset}`, error.message);
|
|
309
|
+
process.exit(1);
|
|
310
|
+
});
|
package/cli/agent.js
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bootspring Agent Command
|
|
3
|
+
* Work with specialized AI agents
|
|
4
|
+
*
|
|
5
|
+
* @package bootspring
|
|
6
|
+
* @command agent
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const utils = require('../core/utils');
|
|
12
|
+
|
|
13
|
+
// Agent definitions - these will be loaded from agents/profiles/ in production
|
|
14
|
+
const AGENTS = {
|
|
15
|
+
'database-expert': {
|
|
16
|
+
name: 'Database Expert',
|
|
17
|
+
category: 'Backend',
|
|
18
|
+
description: 'Specializes in database design, queries, migrations, and optimization',
|
|
19
|
+
expertise: ['SQL', 'NoSQL', 'Prisma', 'Drizzle', 'PostgreSQL', 'MongoDB'],
|
|
20
|
+
triggers: ['database', 'schema', 'migration', 'query', 'prisma', 'sql']
|
|
21
|
+
},
|
|
22
|
+
'security-expert': {
|
|
23
|
+
name: 'Security Expert',
|
|
24
|
+
category: 'Security',
|
|
25
|
+
description: 'Focuses on application security, OWASP, authentication, and authorization',
|
|
26
|
+
expertise: ['OWASP', 'Authentication', 'Authorization', 'Input Validation', 'XSS', 'CSRF'],
|
|
27
|
+
triggers: ['security', 'auth', 'owasp', 'vulnerability', 'xss', 'csrf', 'injection']
|
|
28
|
+
},
|
|
29
|
+
'frontend-expert': {
|
|
30
|
+
name: 'Frontend Expert',
|
|
31
|
+
category: 'Frontend',
|
|
32
|
+
description: 'Expert in React, Next.js, UI components, and modern frontend patterns',
|
|
33
|
+
expertise: ['React', 'Next.js', 'TypeScript', 'Tailwind', 'Components', 'State Management'],
|
|
34
|
+
triggers: ['component', 'react', 'frontend', 'ui', 'tailwind', 'css', 'styling']
|
|
35
|
+
},
|
|
36
|
+
'backend-expert': {
|
|
37
|
+
name: 'Backend Expert',
|
|
38
|
+
category: 'Backend',
|
|
39
|
+
description: 'Specializes in server-side development, APIs, and business logic',
|
|
40
|
+
expertise: ['Node.js', 'APIs', 'Server Actions', 'Middleware', 'Business Logic'],
|
|
41
|
+
triggers: ['api', 'backend', 'server', 'endpoint', 'route', 'middleware']
|
|
42
|
+
},
|
|
43
|
+
'api-expert': {
|
|
44
|
+
name: 'API Expert',
|
|
45
|
+
category: 'Backend',
|
|
46
|
+
description: 'Focuses on API design, REST, GraphQL, and integration patterns',
|
|
47
|
+
expertise: ['REST', 'GraphQL', 'tRPC', 'OpenAPI', 'Webhooks', 'Integration'],
|
|
48
|
+
triggers: ['api', 'rest', 'graphql', 'trpc', 'webhook', 'endpoint']
|
|
49
|
+
},
|
|
50
|
+
'testing-expert': {
|
|
51
|
+
name: 'Testing Expert',
|
|
52
|
+
category: 'Quality',
|
|
53
|
+
description: 'Expert in testing strategies, test frameworks, and quality assurance',
|
|
54
|
+
expertise: ['Unit Testing', 'Integration Testing', 'E2E', 'Vitest', 'Jest', 'Playwright'],
|
|
55
|
+
triggers: ['test', 'testing', 'jest', 'vitest', 'playwright', 'coverage']
|
|
56
|
+
},
|
|
57
|
+
'performance-expert': {
|
|
58
|
+
name: 'Performance Expert',
|
|
59
|
+
category: 'DevOps',
|
|
60
|
+
description: 'Specializes in performance optimization, caching, and monitoring',
|
|
61
|
+
expertise: ['Optimization', 'Caching', 'Profiling', 'Core Web Vitals', 'Load Testing'],
|
|
62
|
+
triggers: ['performance', 'optimize', 'cache', 'slow', 'speed', 'profiling']
|
|
63
|
+
},
|
|
64
|
+
'devops-expert': {
|
|
65
|
+
name: 'DevOps Expert',
|
|
66
|
+
category: 'DevOps',
|
|
67
|
+
description: 'Focuses on deployment, CI/CD, infrastructure, and monitoring',
|
|
68
|
+
expertise: ['CI/CD', 'Docker', 'Kubernetes', 'Monitoring', 'Infrastructure'],
|
|
69
|
+
triggers: ['deploy', 'ci', 'cd', 'docker', 'kubernetes', 'infrastructure']
|
|
70
|
+
},
|
|
71
|
+
'ui-ux-expert': {
|
|
72
|
+
name: 'UI/UX Expert',
|
|
73
|
+
category: 'Frontend',
|
|
74
|
+
description: 'Expert in user interface design, user experience, and accessibility',
|
|
75
|
+
expertise: ['Design Systems', 'Accessibility', 'Responsive Design', 'Animation'],
|
|
76
|
+
triggers: ['ui', 'ux', 'design', 'accessibility', 'a11y', 'responsive']
|
|
77
|
+
},
|
|
78
|
+
'architecture-expert': {
|
|
79
|
+
name: 'Architecture Expert',
|
|
80
|
+
category: 'Backend',
|
|
81
|
+
description: 'Specializes in system architecture, design patterns, and scalability',
|
|
82
|
+
expertise: ['System Design', 'Design Patterns', 'Microservices', 'Scalability'],
|
|
83
|
+
triggers: ['architecture', 'design', 'pattern', 'scalability', 'structure']
|
|
84
|
+
},
|
|
85
|
+
'code-review-expert': {
|
|
86
|
+
name: 'Code Review Expert',
|
|
87
|
+
category: 'Quality',
|
|
88
|
+
description: 'Focuses on code quality, best practices, and constructive feedback',
|
|
89
|
+
expertise: ['Code Quality', 'Best Practices', 'Refactoring', 'Clean Code'],
|
|
90
|
+
triggers: ['review', 'refactor', 'quality', 'clean', 'improve']
|
|
91
|
+
},
|
|
92
|
+
'vercel-expert': {
|
|
93
|
+
name: 'Vercel Expert',
|
|
94
|
+
category: 'DevOps',
|
|
95
|
+
description: 'Expert in Vercel deployment, serverless, and edge functions',
|
|
96
|
+
expertise: ['Vercel', 'Serverless', 'Edge Functions', 'ISR', 'Deployment'],
|
|
97
|
+
triggers: ['vercel', 'serverless', 'edge', 'deployment', 'hosting']
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* List all available agents
|
|
103
|
+
*/
|
|
104
|
+
function listAgents(options = {}) {
|
|
105
|
+
console.log(`
|
|
106
|
+
${utils.COLORS.cyan}${utils.COLORS.bold}⚡ Bootspring Agents${utils.COLORS.reset}
|
|
107
|
+
${utils.COLORS.dim}Specialized AI expertise on demand${utils.COLORS.reset}
|
|
108
|
+
`);
|
|
109
|
+
|
|
110
|
+
// Group by category
|
|
111
|
+
const categories = {};
|
|
112
|
+
for (const [id, agent] of Object.entries(AGENTS)) {
|
|
113
|
+
if (!categories[agent.category]) {
|
|
114
|
+
categories[agent.category] = [];
|
|
115
|
+
}
|
|
116
|
+
categories[agent.category].push({ id, ...agent });
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
for (const [category, agents] of Object.entries(categories)) {
|
|
120
|
+
console.log(`${utils.COLORS.bold}${category}${utils.COLORS.reset}`);
|
|
121
|
+
for (const agent of agents) {
|
|
122
|
+
console.log(` ${utils.COLORS.cyan}${agent.id}${utils.COLORS.reset}`);
|
|
123
|
+
console.log(` ${utils.COLORS.dim}${agent.description}${utils.COLORS.reset}`);
|
|
124
|
+
}
|
|
125
|
+
console.log();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
utils.print.dim(`${Object.keys(AGENTS).length} agents available`);
|
|
129
|
+
utils.print.dim('Use "bootspring agent show <name>" for details');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Show agent details
|
|
134
|
+
*/
|
|
135
|
+
function showAgent(agentId) {
|
|
136
|
+
const agent = AGENTS[agentId];
|
|
137
|
+
|
|
138
|
+
if (!agent) {
|
|
139
|
+
utils.print.error(`Agent not found: ${agentId}`);
|
|
140
|
+
utils.print.dim('Use "bootspring agent list" to see available agents');
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
console.log(`
|
|
145
|
+
${utils.COLORS.cyan}${utils.COLORS.bold}⚡ ${agent.name}${utils.COLORS.reset}
|
|
146
|
+
${utils.COLORS.dim}Category: ${agent.category}${utils.COLORS.reset}
|
|
147
|
+
|
|
148
|
+
${utils.COLORS.bold}Description${utils.COLORS.reset}
|
|
149
|
+
${agent.description}
|
|
150
|
+
|
|
151
|
+
${utils.COLORS.bold}Expertise${utils.COLORS.reset}
|
|
152
|
+
${agent.expertise.map(e => ` ${utils.COLORS.green}●${utils.COLORS.reset} ${e}`).join('\n')}
|
|
153
|
+
|
|
154
|
+
${utils.COLORS.bold}Trigger Keywords${utils.COLORS.reset}
|
|
155
|
+
${agent.triggers.map(t => ` ${utils.COLORS.dim}${t}${utils.COLORS.reset}`).join(', ')}
|
|
156
|
+
|
|
157
|
+
${utils.COLORS.bold}Usage${utils.COLORS.reset}
|
|
158
|
+
bootspring agent invoke ${agentId} --topic "your question"
|
|
159
|
+
`);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Invoke an agent
|
|
164
|
+
*/
|
|
165
|
+
function invokeAgent(agentId, args) {
|
|
166
|
+
const parsedArgs = utils.parseArgs(args);
|
|
167
|
+
const topic = parsedArgs.topic || parsedArgs.t || args.filter(a => !a.startsWith('-')).join(' ');
|
|
168
|
+
|
|
169
|
+
const agent = AGENTS[agentId];
|
|
170
|
+
|
|
171
|
+
if (!agent) {
|
|
172
|
+
utils.print.error(`Agent not found: ${agentId}`);
|
|
173
|
+
utils.print.dim('Use "bootspring agent list" to see available agents');
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
console.log(`
|
|
178
|
+
${utils.COLORS.cyan}${utils.COLORS.bold}⚡ Invoking ${agent.name}${utils.COLORS.reset}
|
|
179
|
+
`);
|
|
180
|
+
|
|
181
|
+
// Generate agent context for AI
|
|
182
|
+
const context = `
|
|
183
|
+
## Agent: ${agent.name}
|
|
184
|
+
|
|
185
|
+
You are now acting as the **${agent.name}**, a specialized expert in:
|
|
186
|
+
${agent.expertise.map(e => `- ${e}`).join('\n')}
|
|
187
|
+
|
|
188
|
+
### Your Role
|
|
189
|
+
${agent.description}
|
|
190
|
+
|
|
191
|
+
### Guidelines
|
|
192
|
+
1. Focus on your areas of expertise listed above
|
|
193
|
+
2. Provide specific, actionable advice
|
|
194
|
+
3. Include code examples when relevant
|
|
195
|
+
4. Consider security and best practices
|
|
196
|
+
5. Reference official documentation when helpful
|
|
197
|
+
|
|
198
|
+
### Topic
|
|
199
|
+
${topic || 'The user will provide context for your assistance.'}
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
Please provide your expert analysis and recommendations.
|
|
204
|
+
`;
|
|
205
|
+
|
|
206
|
+
console.log(`${utils.COLORS.dim}─────────────────────────────────────────${utils.COLORS.reset}`);
|
|
207
|
+
console.log(context);
|
|
208
|
+
console.log(`${utils.COLORS.dim}─────────────────────────────────────────${utils.COLORS.reset}`);
|
|
209
|
+
|
|
210
|
+
console.log(`
|
|
211
|
+
${utils.COLORS.bold}Instructions${utils.COLORS.reset}
|
|
212
|
+
Copy the context above and provide it to your AI assistant, or use the
|
|
213
|
+
MCP integration for automatic agent invocation.
|
|
214
|
+
|
|
215
|
+
${utils.COLORS.dim}Tip: With MCP enabled, agents are invoked automatically based on your prompts${utils.COLORS.reset}
|
|
216
|
+
`);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Search for agents by keyword
|
|
221
|
+
*/
|
|
222
|
+
function searchAgents(query) {
|
|
223
|
+
const queryLower = query.toLowerCase();
|
|
224
|
+
|
|
225
|
+
const matches = Object.entries(AGENTS).filter(([id, agent]) => {
|
|
226
|
+
return id.includes(queryLower) ||
|
|
227
|
+
agent.name.toLowerCase().includes(queryLower) ||
|
|
228
|
+
agent.description.toLowerCase().includes(queryLower) ||
|
|
229
|
+
agent.expertise.some(e => e.toLowerCase().includes(queryLower)) ||
|
|
230
|
+
agent.triggers.some(t => t.includes(queryLower));
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
if (matches.length === 0) {
|
|
234
|
+
utils.print.warning(`No agents found matching "${query}"`);
|
|
235
|
+
utils.print.dim('Use "bootspring agent list" to see all agents');
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
console.log(`
|
|
240
|
+
${utils.COLORS.cyan}${utils.COLORS.bold}⚡ Agent Search: "${query}"${utils.COLORS.reset}
|
|
241
|
+
`);
|
|
242
|
+
|
|
243
|
+
for (const [id, agent] of matches) {
|
|
244
|
+
console.log(` ${utils.COLORS.cyan}${id}${utils.COLORS.reset} - ${agent.description}`);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
console.log();
|
|
248
|
+
utils.print.dim(`${matches.length} agents found`);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Show agent help
|
|
253
|
+
*/
|
|
254
|
+
function showHelp() {
|
|
255
|
+
console.log(`
|
|
256
|
+
${utils.COLORS.cyan}${utils.COLORS.bold}⚡ Bootspring Agent${utils.COLORS.reset}
|
|
257
|
+
${utils.COLORS.dim}Work with specialized AI agents${utils.COLORS.reset}
|
|
258
|
+
|
|
259
|
+
${utils.COLORS.bold}Usage:${utils.COLORS.reset}
|
|
260
|
+
bootspring agent <command> [args]
|
|
261
|
+
|
|
262
|
+
${utils.COLORS.bold}Commands:${utils.COLORS.reset}
|
|
263
|
+
${utils.COLORS.cyan}list${utils.COLORS.reset} List all available agents
|
|
264
|
+
${utils.COLORS.cyan}show${utils.COLORS.reset} <name> Show agent details
|
|
265
|
+
${utils.COLORS.cyan}invoke${utils.COLORS.reset} <name> Invoke an agent
|
|
266
|
+
${utils.COLORS.cyan}search${utils.COLORS.reset} <query> Search for agents
|
|
267
|
+
|
|
268
|
+
${utils.COLORS.bold}Examples:${utils.COLORS.reset}
|
|
269
|
+
bootspring agent list
|
|
270
|
+
bootspring agent show security-expert
|
|
271
|
+
bootspring agent invoke database-expert --topic "optimize queries"
|
|
272
|
+
bootspring agent search performance
|
|
273
|
+
`);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Run agent command
|
|
278
|
+
*/
|
|
279
|
+
async function run(args) {
|
|
280
|
+
const subcommand = args[0] || 'list';
|
|
281
|
+
const subargs = args.slice(1);
|
|
282
|
+
|
|
283
|
+
switch (subcommand) {
|
|
284
|
+
case 'list':
|
|
285
|
+
case 'ls':
|
|
286
|
+
listAgents();
|
|
287
|
+
break;
|
|
288
|
+
|
|
289
|
+
case 'show':
|
|
290
|
+
case 'info':
|
|
291
|
+
if (!subargs[0]) {
|
|
292
|
+
utils.print.error('Please specify an agent name');
|
|
293
|
+
utils.print.dim('Usage: bootspring agent show <name>');
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
showAgent(subargs[0]);
|
|
297
|
+
break;
|
|
298
|
+
|
|
299
|
+
case 'invoke':
|
|
300
|
+
case 'use':
|
|
301
|
+
case 'call':
|
|
302
|
+
if (!subargs[0]) {
|
|
303
|
+
utils.print.error('Please specify an agent name');
|
|
304
|
+
utils.print.dim('Usage: bootspring agent invoke <name> --topic "your question"');
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
invokeAgent(subargs[0], subargs.slice(1));
|
|
308
|
+
break;
|
|
309
|
+
|
|
310
|
+
case 'search':
|
|
311
|
+
case 'find':
|
|
312
|
+
if (!subargs[0]) {
|
|
313
|
+
utils.print.error('Please specify a search query');
|
|
314
|
+
utils.print.dim('Usage: bootspring agent search <query>');
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
searchAgents(subargs.join(' '));
|
|
318
|
+
break;
|
|
319
|
+
|
|
320
|
+
case 'help':
|
|
321
|
+
case '-h':
|
|
322
|
+
case '--help':
|
|
323
|
+
showHelp();
|
|
324
|
+
break;
|
|
325
|
+
|
|
326
|
+
default:
|
|
327
|
+
// Check if it's an agent name (shortcut for show)
|
|
328
|
+
if (AGENTS[subcommand]) {
|
|
329
|
+
showAgent(subcommand);
|
|
330
|
+
} else {
|
|
331
|
+
utils.print.error(`Unknown subcommand: ${subcommand}`);
|
|
332
|
+
showHelp();
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
module.exports = { run, AGENTS, listAgents, showAgent, invokeAgent, searchAgents };
|