sdd-mcp-server 2.2.0 → 3.0.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/README.md +107 -46
- package/dist/adapters/cli/SDDToolAdapter.js +1 -1
- package/dist/agents/AgentManager.d.ts +61 -0
- package/dist/agents/AgentManager.js +75 -0
- package/dist/agents/AgentManager.js.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.js +3 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/cli/install-skills.d.ts +52 -9
- package/dist/cli/install-skills.js +330 -78
- package/dist/cli/install-skills.js.map +1 -1
- package/dist/cli/migrate-kiro.js +4 -4
- package/dist/cli/sdd-mcp-cli.js +10 -10
- package/dist/contexts/ContextManager.d.ts +53 -0
- package/dist/contexts/ContextManager.js +64 -0
- package/dist/contexts/ContextManager.js.map +1 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/index.js +3 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/hooks/HookLoader.d.ts +67 -0
- package/dist/hooks/HookLoader.js +180 -0
- package/dist/hooks/HookLoader.js.map +1 -0
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/di/container.js +24 -0
- package/dist/infrastructure/di/container.js.map +1 -1
- package/dist/infrastructure/di/types.d.ts +4 -0
- package/dist/infrastructure/di/types.js +5 -0
- package/dist/infrastructure/di/types.js.map +1 -1
- package/dist/rules/RulesManager.d.ts +53 -0
- package/dist/rules/RulesManager.js +62 -0
- package/dist/rules/RulesManager.js.map +1 -0
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.js +3 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/shared/BaseManager.d.ts +130 -0
- package/dist/shared/BaseManager.js +274 -0
- package/dist/shared/BaseManager.js.map +1 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +3 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/utils/sddPaths.d.ts +69 -0
- package/dist/utils/sddPaths.js +138 -0
- package/dist/utils/sddPaths.js.map +1 -0
- package/documentGenerator.js +1 -1
- package/mcp-server.js +39 -39
- package/package.json +3 -3
- package/sdd-entry.js +31 -0
- package/skills/sdd-review/SKILL.md +191 -0
- package/skills/sdd-security-check/SKILL.md +193 -0
- package/skills/sdd-test-gen/SKILL.md +295 -0
package/README.md
CHANGED
|
@@ -6,11 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
A Model Context Protocol (MCP) server implementing Spec-Driven Development (SDD) workflows for AI-agent CLIs and IDEs like Claude Code, Cursor, and others.
|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
> 🚀 **v3.0.0 - Comprehensive Plugin Architecture**: SDD-MCP is now a full-featured Claude Code plugin system! Adds **6 component types** (skills, steering, rules, contexts, agents, hooks), **4 new managers** (RulesManager, ContextManager, AgentManager, HookLoader), and **3 new skills** (sdd-review, sdd-security-check, sdd-test-gen). Unified install CLI supports `--rules`, `--contexts`, `--agents`, `--hooks`, `--all` flags. Inspired by everything-claude-code architecture.
|
|
10
10
|
|
|
11
|
-
>
|
|
11
|
+
> 🔧 **v2.2.1 - CLI Fix**: Fixed `npx sdd-mcp` not working due to npm package name collision. Now use `npx sdd-mcp-server` for all CLI commands. The unified entry point handles both CLI commands and MCP server mode.
|
|
12
12
|
|
|
13
|
-
>
|
|
13
|
+
> 🎯 **v2.2.0 - Unified Installation & Crash Safety**: `npx sdd-mcp-server install` command installs both skills (to `.claude/skills/`) AND steering documents (to `.spec/steering/`) in one step! Skills now explicitly reference their relevant steering documents for better guidance. Also includes **atomic file writes** for spec.json crash safety - files are never left in a corrupted state even if the process is interrupted. (Thanks to @Lucas Wang for the atomic writes contribution!)
|
|
14
|
+
|
|
15
|
+
> 🔄 **v2.1.0 - Directory Migration**: The SDD specification directory has been renamed from `.kiro` to `.spec`. Use `npx sdd-mcp-server migrate-kiro` to migrate existing projects. Legacy `.kiro` directories are still supported for backwards compatibility.
|
|
16
|
+
|
|
17
|
+
> 🔧 **v2.0.3 - CLI Subcommand Support**: `npx sdd-mcp-server install-skills` now works correctly! Created proper CLI entry point with subcommand support.
|
|
14
18
|
|
|
15
19
|
> 🚀 **v2.0.0 - Hybrid MCP + Agent Skills Architecture**: Restructured for token efficiency! Template/guidance tools (requirements, design, tasks, steering, implement) are now **Claude Code Agent Skills** loaded on-demand. Action-oriented tools remain as MCP tools. ~55% token savings in typical operations.
|
|
16
20
|
|
|
@@ -163,28 +167,42 @@ SDD now uses a **hybrid architecture** for better token efficiency:
|
|
|
163
167
|
- **MCP Tools**: Action-oriented operations (init, status, approve, quality-check, validate, spec-impl)
|
|
164
168
|
- **Agent Skills**: Template/guidance-heavy operations (requirements, design, tasks, steering, implement, commit)
|
|
165
169
|
|
|
166
|
-
### Installing
|
|
170
|
+
### Installing Components (v3.0+)
|
|
167
171
|
|
|
168
172
|
```bash
|
|
169
|
-
# Recommended: Install
|
|
170
|
-
npx sdd-mcp install
|
|
173
|
+
# Recommended: Install ALL components (skills, steering, rules, contexts, agents, hooks)
|
|
174
|
+
npx sdd-mcp-server install --all
|
|
175
|
+
|
|
176
|
+
# Install specific component types
|
|
177
|
+
npx sdd-mcp-server install --skills # Skills to .claude/skills/
|
|
178
|
+
npx sdd-mcp-server install --steering # Steering to .spec/steering/
|
|
179
|
+
npx sdd-mcp-server install --rules # Rules to .claude/rules/
|
|
180
|
+
npx sdd-mcp-server install --contexts # Contexts to .claude/contexts/
|
|
181
|
+
npx sdd-mcp-server install --agents # Agents to .claude/agents/
|
|
182
|
+
npx sdd-mcp-server install --hooks # Hooks to .claude/hooks/
|
|
171
183
|
|
|
172
|
-
# Install
|
|
173
|
-
npx sdd-mcp install --skills
|
|
184
|
+
# Install multiple component types
|
|
185
|
+
npx sdd-mcp-server install --skills --rules --agents
|
|
174
186
|
|
|
175
|
-
# Install
|
|
176
|
-
npx sdd-mcp install
|
|
187
|
+
# Default: Install skills + steering (backward compatible)
|
|
188
|
+
npx sdd-mcp-server install
|
|
177
189
|
|
|
178
|
-
# List available
|
|
179
|
-
npx sdd-mcp install --list
|
|
190
|
+
# List all available components
|
|
191
|
+
npx sdd-mcp-server install --list
|
|
180
192
|
|
|
181
|
-
# Legacy: Install skills only
|
|
182
|
-
npx sdd-mcp install-skills
|
|
193
|
+
# Legacy: Install skills only
|
|
194
|
+
npx sdd-mcp-server install-skills
|
|
183
195
|
```
|
|
184
196
|
|
|
185
|
-
**
|
|
186
|
-
|
|
187
|
-
|
|
197
|
+
**Component Types (v3.0):**
|
|
198
|
+
| Component | Install Path | Purpose |
|
|
199
|
+
|-----------|--------------|---------|
|
|
200
|
+
| **Skills** | `.claude/skills/` | Workflow guidance (requirements, design, tasks, implement, etc.) |
|
|
201
|
+
| **Steering** | `.spec/steering/` | Project-wide conventions (TDD guidelines, SOLID principles, security) |
|
|
202
|
+
| **Rules** | `.claude/rules/` | Always-active guidelines (coding-style, testing, security, git-workflow) |
|
|
203
|
+
| **Contexts** | `.claude/contexts/` | Mode-specific prompts (dev, review, planning, security-audit, research) |
|
|
204
|
+
| **Agents** | `.claude/agents/` | Specialized AI personas (planner, architect, reviewer, implementer) |
|
|
205
|
+
| **Hooks** | `.claude/hooks/` | Event-driven automation (pre-tool-use, post-tool-use, session events) |
|
|
188
206
|
|
|
189
207
|
### Migrating from .kiro to .spec (v2.1.0+)
|
|
190
208
|
|
|
@@ -192,13 +210,13 @@ If you have existing projects using the legacy `.kiro` directory, migrate to the
|
|
|
192
210
|
|
|
193
211
|
```bash
|
|
194
212
|
# Preview migration (dry run)
|
|
195
|
-
npx sdd-mcp migrate-kiro --dry-run
|
|
213
|
+
npx sdd-mcp-server migrate-kiro --dry-run
|
|
196
214
|
|
|
197
215
|
# Perform migration
|
|
198
|
-
npx sdd-mcp migrate-kiro
|
|
216
|
+
npx sdd-mcp-server migrate-kiro
|
|
199
217
|
|
|
200
218
|
# Migrate a specific project
|
|
201
|
-
npx sdd-mcp migrate-kiro --path ./my-project
|
|
219
|
+
npx sdd-mcp-server migrate-kiro --path ./my-project
|
|
202
220
|
```
|
|
203
221
|
|
|
204
222
|
**Note**: Legacy `.kiro` directories are still supported for backwards compatibility, but new projects will use `.spec`.
|
|
@@ -217,6 +235,9 @@ After installation, use these skills in Claude Code:
|
|
|
217
235
|
| `/sdd-steering` | Create/update project-specific steering documents |
|
|
218
236
|
| `/sdd-steering-custom` | Create custom steering with inclusion modes |
|
|
219
237
|
| `/sdd-commit` | Commit/PR guidelines with conventional commits |
|
|
238
|
+
| `/sdd-review` | **NEW in v3.0** - Linus-style direct code review with severity levels |
|
|
239
|
+
| `/sdd-security-check` | **NEW in v3.0** - OWASP Top 10 security audit checklist |
|
|
240
|
+
| `/sdd-test-gen` | **NEW in v3.0** - TDD test generation with Red-Green-Refactor workflow |
|
|
220
241
|
|
|
221
242
|
### Token Efficiency
|
|
222
243
|
|
|
@@ -241,14 +262,14 @@ Once connected to your AI client, you can use these MCP tools:
|
|
|
241
262
|
| `sdd-spec-impl` | Execute tasks with TDD | Kent Beck's Red-Green-Refactor methodology |
|
|
242
263
|
| `sdd-list-skills` | List available Agent Skills | Shows skills that can be installed for Claude Code |
|
|
243
264
|
|
|
244
|
-
> **Note**: Template/guidance tools (`sdd-requirements`, `sdd-design`, `sdd-tasks`, `sdd-steering`, `sdd-implement`) are now **Agent Skills**. Install them with `npx sdd-mcp install-skills` and use as `/sdd-requirements`, `/sdd-design`, etc.
|
|
265
|
+
> **Note**: Template/guidance tools (`sdd-requirements`, `sdd-design`, `sdd-tasks`, `sdd-steering`, `sdd-implement`) are now **Agent Skills**. Install them with `npx sdd-mcp-server install-skills` and use as `/sdd-requirements`, `/sdd-design`, etc.
|
|
245
266
|
|
|
246
267
|
## 💡 Basic Workflow
|
|
247
268
|
|
|
248
269
|
1. **Setup: Install Skills & Steering, Initialize Project**
|
|
249
270
|
```bash
|
|
250
271
|
# Install skills and steering documents (recommended)
|
|
251
|
-
npx sdd-mcp install
|
|
272
|
+
npx sdd-mcp-server install
|
|
252
273
|
|
|
253
274
|
# Initialize project with MCP tool
|
|
254
275
|
Use sdd-init to create a new SDD project
|
|
@@ -300,40 +321,57 @@ Once connected to your AI client, you can use these MCP tools:
|
|
|
300
321
|
Use sdd-context-load to restore project memory
|
|
301
322
|
```
|
|
302
323
|
|
|
303
|
-
## Latest Updates (
|
|
324
|
+
## Latest Updates (v3.0.0)
|
|
304
325
|
|
|
305
|
-
**What's New**:
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
326
|
+
**What's New - Comprehensive Plugin Architecture**:
|
|
327
|
+
- 🚀 **6 Component Types**: Skills, Steering, Rules, Contexts, Agents, Hooks
|
|
328
|
+
- 🤖 **4 New Managers**: RulesManager, ContextManager, AgentManager, HookLoader
|
|
329
|
+
- ✨ **3 New Skills**: sdd-review (Linus-style review), sdd-security-check (OWASP audit), sdd-test-gen (TDD)
|
|
330
|
+
- 🎯 **Unified CLI**: `--rules`, `--contexts`, `--agents`, `--hooks`, `--all` flags
|
|
331
|
+
- 📦 **Plugin Manifest**: `.claude-plugin/plugin.json` for Claude Code integration
|
|
332
|
+
- ✅ **199 Tests**: 58 new tests for component managers, full TDD coverage
|
|
333
|
+
|
|
334
|
+
**New Component Details**:
|
|
335
|
+
| Component | Count | Examples |
|
|
336
|
+
|-----------|-------|----------|
|
|
337
|
+
| Rules | 6 | coding-style, testing, security, git-workflow, error-handling, sdd-workflow |
|
|
338
|
+
| Contexts | 5 | dev, review, planning, security-audit, research |
|
|
339
|
+
| Agents | 6 | planner, architect, reviewer, implementer, security-auditor, tdd-guide |
|
|
340
|
+
| Hooks | 7 | validate-sdd-workflow, check-test-coverage, update-spec-status, load-project-context |
|
|
310
341
|
|
|
311
342
|
**Upgrade Commands**:
|
|
312
343
|
```bash
|
|
313
|
-
# Install
|
|
314
|
-
npx sdd-mcp install
|
|
315
|
-
|
|
316
|
-
# Install skills only
|
|
317
|
-
npx sdd-mcp install --skills
|
|
344
|
+
# Install ALL components (recommended for v3.0)
|
|
345
|
+
npx sdd-mcp-server install --all
|
|
318
346
|
|
|
319
|
-
# Install
|
|
320
|
-
npx sdd-mcp install --
|
|
347
|
+
# Install specific components
|
|
348
|
+
npx sdd-mcp-server install --skills --rules --agents
|
|
321
349
|
|
|
322
|
-
# List available
|
|
323
|
-
npx sdd-mcp install --list
|
|
350
|
+
# List all available components
|
|
351
|
+
npx sdd-mcp-server install --list
|
|
324
352
|
|
|
325
353
|
# Show CLI help
|
|
326
|
-
npx sdd-mcp --help
|
|
354
|
+
npx sdd-mcp-server --help
|
|
327
355
|
```
|
|
328
356
|
|
|
329
|
-
**Previous Versions (v2.
|
|
330
|
-
- v2.
|
|
357
|
+
**Previous Versions (v2.x)**:
|
|
358
|
+
- v2.2.1: CLI fix for npm package name collision
|
|
359
|
+
- v2.2.0: Unified installation, atomic file writes, skill-steering references
|
|
360
|
+
- v2.1.0: Directory migration from .kiro to .spec
|
|
361
|
+
- v2.0.3: CLI subcommand support
|
|
331
362
|
- v2.0.0: Hybrid MCP + Agent Skills architecture, ~55% token savings
|
|
332
363
|
|
|
333
364
|
## Previous Versions
|
|
334
365
|
|
|
366
|
+
### v2.2.x
|
|
367
|
+
- v2.2.1: CLI fix for npm package name collision
|
|
368
|
+
- v2.2.0: Unified installation, atomic file writes, skill-steering references
|
|
369
|
+
|
|
370
|
+
### v2.1.x
|
|
371
|
+
- v2.1.0: Directory migration from `.kiro` to `.spec`
|
|
372
|
+
|
|
335
373
|
### v2.0.x
|
|
336
|
-
- v2.0.3: CLI subcommand support (`npx sdd-mcp install-skills` works)
|
|
374
|
+
- v2.0.3: CLI subcommand support (`npx sdd-mcp-server install-skills` works)
|
|
337
375
|
- v2.0.2: ESM compatibility fix for install-skills CLI
|
|
338
376
|
- v2.0.1: Codebase simplification, removed 7,131 lines of dead code
|
|
339
377
|
- v2.0.0: Hybrid MCP + Agent Skills architecture, ~55% token savings
|
|
@@ -421,15 +459,28 @@ claude mcp add sdd "sdd-mcp-server"
|
|
|
421
459
|
|
|
422
460
|
## 🏗️ Key Features
|
|
423
461
|
|
|
462
|
+
### Core SDD Workflow
|
|
424
463
|
- **5-Phase SDD Workflow**: INIT → REQUIREMENTS → DESIGN → TASKS → IMPLEMENTATION
|
|
425
|
-
- **Comprehensive Multi-Language Analysis**: Automatic detection of TypeScript, JavaScript, Java, Python, Go, Ruby, PHP, Rust, C#, Scala projects with framework-specific insights
|
|
426
|
-
- **Framework Detection**: Recognizes Spring Boot, Django, FastAPI, Flask, Rails, Laravel, Express, React, Vue, Angular, Next.js, and 20+ other frameworks
|
|
427
464
|
- **TDD-First Task Generation**: All implementation tasks follow Test-Driven Development (RED-GREEN-REFACTOR) methodology
|
|
428
|
-
- **Coding Principles Enforcement**: Built-in SOLID, DRY, KISS, YAGNI, Separation of Concerns, and Modularity guidance
|
|
429
|
-
- **Context-Aware Generation**: Analyzes package.json, dependencies, build tools, test frameworks, and project structure for real content
|
|
430
465
|
- **EARS-Formatted Requirements**: Generate acceptance criteria based on actual npm scripts and dependencies
|
|
431
|
-
- **Architecture Pattern Recognition**: Detects DDD, MVC, Microservices, Clean Architecture patterns in your codebase
|
|
432
466
|
- **Quality Enforcement**: Linus-style 5-layer code review system with security (OWASP Top 10) checks
|
|
467
|
+
|
|
468
|
+
### Plugin Architecture (v3.0)
|
|
469
|
+
- **6 Component Types**: Skills, Steering, Rules, Contexts, Agents, Hooks for comprehensive AI guidance
|
|
470
|
+
- **Specialized Agents**: Planner, Architect, Reviewer, Implementer, Security-Auditor, TDD-Guide personas
|
|
471
|
+
- **Always-Active Rules**: Coding-style, Testing, Security, Git-workflow, Error-handling enforcement
|
|
472
|
+
- **Mode-Specific Contexts**: Development, Review, Planning, Security-audit, Research modes
|
|
473
|
+
- **Event-Driven Hooks**: Pre/post tool-use and session lifecycle automation
|
|
474
|
+
- **Plugin Manifest**: `.claude-plugin/plugin.json` for Claude Code integration
|
|
475
|
+
|
|
476
|
+
### Codebase Analysis
|
|
477
|
+
- **Comprehensive Multi-Language Analysis**: Automatic detection of TypeScript, JavaScript, Java, Python, Go, Ruby, PHP, Rust, C#, Scala projects with framework-specific insights
|
|
478
|
+
- **Framework Detection**: Recognizes Spring Boot, Django, FastAPI, Flask, Rails, Laravel, Express, React, Vue, Angular, Next.js, and 20+ other frameworks
|
|
479
|
+
- **Architecture Pattern Recognition**: Detects DDD, MVC, Microservices, Clean Architecture patterns in your codebase
|
|
480
|
+
- **Context-Aware Generation**: Analyzes package.json, dependencies, build tools, test frameworks, and project structure for real content
|
|
481
|
+
|
|
482
|
+
### Guidelines & Standards
|
|
483
|
+
- **Coding Principles Enforcement**: Built-in SOLID, DRY, KISS, YAGNI, Separation of Concerns, and Modularity guidance
|
|
433
484
|
- **Comprehensive Steering Documents**: 8 auto-generated guidance docs (product, tech, structure, linus-review, commit, tdd-guideline, security-check, principles)
|
|
434
485
|
- **Multi-Language Support**: 10 languages with cultural adaptation (en, es, fr, de, it, pt, ru, ja, zh, ko)
|
|
435
486
|
- **Template Engine**: Handlebars-based file generation with project-specific data
|
|
@@ -556,10 +607,20 @@ As of v1.4.3, comprehensive codebase analysis is automatic with multi-language d
|
|
|
556
607
|
## 📖 Advanced Documentation
|
|
557
608
|
|
|
558
609
|
For detailed documentation on:
|
|
610
|
+
- **📥 Installation Guide**: See [docs/INSTALL-GUIDE.md](docs/INSTALL-GUIDE.md) for complete CLI usage examples with real output
|
|
559
611
|
- **🤖 AI Agent Guide**: See [AGENTS.md](AGENTS.md) for detailed instructions on using this server with AI agents
|
|
560
612
|
- **🏗️ Architecture Overview**: See [ARCHITECTURE.md](ARCHITECTURE.md) for complete system design, layered architecture, module loading, and Mermaid diagrams
|
|
613
|
+
- **📦 Plugin Manifest**: See [.claude-plugin/plugin.json](.claude-plugin/plugin.json) for Claude Code plugin configuration
|
|
561
614
|
- **Plugin Development**: See [DEPLOYMENT.md](DEPLOYMENT.md)
|
|
562
615
|
- **Docker Deployment**: See [Dockerfile](Dockerfile) and [docker-compose.yml](docker-compose.yml)
|
|
616
|
+
|
|
617
|
+
**Component Documentation (v3.0)**:
|
|
618
|
+
- **Rules**: See `rules/*.md` for always-active coding guidelines
|
|
619
|
+
- **Contexts**: See `contexts/*.md` for mode-specific system prompts
|
|
620
|
+
- **Agents**: See `agents/*.md` for specialized AI personas
|
|
621
|
+
- **Hooks**: See `hooks/**/*.md` for event-driven automation
|
|
622
|
+
|
|
623
|
+
**Steering Documents**:
|
|
563
624
|
- **Code Quality Standards**: Review `.spec/steering/linus-review.md`
|
|
564
625
|
- **TDD Guidelines**: See `.spec/steering/tdd-guideline.md` for complete Test-Driven Development workflow
|
|
565
626
|
- **Coding Principles**: Review `.spec/steering/principles.md` for SOLID, DRY, KISS, YAGNI, SoC, and Modularity guidance
|
|
@@ -445,7 +445,7 @@ let SDDToolAdapter = class SDDToolAdapter {
|
|
|
445
445
|
- Existing steering: Updated preserving customizations
|
|
446
446
|
|
|
447
447
|
**Tip**: For a unified installation of skills and steering documents, run:
|
|
448
|
-
\`npx sdd-mcp install\`
|
|
448
|
+
\`npx sdd-mcp-server install\`
|
|
449
449
|
|
|
450
450
|
This installs both \`.claude/skills/\` (workflow guides) and \`.spec/steering/\` (project rules).`;
|
|
451
451
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BaseManager, ComponentDescriptor } from '../shared/BaseManager.js';
|
|
2
|
+
/**
|
|
3
|
+
* Descriptor for an agent component
|
|
4
|
+
*/
|
|
5
|
+
export interface AgentDescriptor extends ComponentDescriptor {
|
|
6
|
+
/** Agent name */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Brief description of the agent */
|
|
9
|
+
description: string;
|
|
10
|
+
/** Path to the agent file */
|
|
11
|
+
path: string;
|
|
12
|
+
/** Role identifier (planner, architect, reviewer, implementer, etc.) */
|
|
13
|
+
role: string;
|
|
14
|
+
/** Area of expertise */
|
|
15
|
+
expertise: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Manages agent components - discovery, listing, and installation
|
|
19
|
+
*
|
|
20
|
+
* Agents are specialized AI personas that can be invoked for different tasks.
|
|
21
|
+
* Each agent has a specific role and expertise area.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const manager = new AgentManager('/path/to/agents');
|
|
26
|
+
* const agents = await manager.listComponents();
|
|
27
|
+
* const reviewer = await manager.getAgentByRole('reviewer');
|
|
28
|
+
* await manager.installComponents('/project/.claude/agents');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare class AgentManager extends BaseManager<AgentDescriptor> {
|
|
32
|
+
/**
|
|
33
|
+
* Create a new AgentManager
|
|
34
|
+
* @param agentsPath - Path to the agents directory
|
|
35
|
+
*/
|
|
36
|
+
constructor(agentsPath: string);
|
|
37
|
+
/**
|
|
38
|
+
* Parse metadata from agent file content
|
|
39
|
+
* @param content - Raw content of the agent file
|
|
40
|
+
* @param filePath - Path to the agent file
|
|
41
|
+
* @returns Parsed agent descriptor
|
|
42
|
+
*/
|
|
43
|
+
protected parseMetadata(content: string, filePath: string): AgentDescriptor;
|
|
44
|
+
/**
|
|
45
|
+
* Get an agent by its role identifier
|
|
46
|
+
* @param role - Role identifier to search for
|
|
47
|
+
* @returns Agent descriptor if found, null otherwise
|
|
48
|
+
*/
|
|
49
|
+
getAgentByRole(role: string): Promise<AgentDescriptor | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Get all available roles
|
|
52
|
+
* @returns Array of unique role identifiers
|
|
53
|
+
*/
|
|
54
|
+
listRoles(): Promise<string[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Get agents filtered by expertise keyword
|
|
57
|
+
* @param keyword - Keyword to search in expertise field
|
|
58
|
+
* @returns Array of agents with matching expertise
|
|
59
|
+
*/
|
|
60
|
+
findByExpertise(keyword: string): Promise<AgentDescriptor[]>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import { BaseManager } from '../shared/BaseManager.js';
|
|
3
|
+
/**
|
|
4
|
+
* Manages agent components - discovery, listing, and installation
|
|
5
|
+
*
|
|
6
|
+
* Agents are specialized AI personas that can be invoked for different tasks.
|
|
7
|
+
* Each agent has a specific role and expertise area.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const manager = new AgentManager('/path/to/agents');
|
|
12
|
+
* const agents = await manager.listComponents();
|
|
13
|
+
* const reviewer = await manager.getAgentByRole('reviewer');
|
|
14
|
+
* await manager.installComponents('/project/.claude/agents');
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export class AgentManager extends BaseManager {
|
|
18
|
+
/**
|
|
19
|
+
* Create a new AgentManager
|
|
20
|
+
* @param agentsPath - Path to the agents directory
|
|
21
|
+
*/
|
|
22
|
+
constructor(agentsPath) {
|
|
23
|
+
super({
|
|
24
|
+
componentPath: agentsPath,
|
|
25
|
+
structureType: 'file',
|
|
26
|
+
fileExtension: '.md',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse metadata from agent file content
|
|
31
|
+
* @param content - Raw content of the agent file
|
|
32
|
+
* @param filePath - Path to the agent file
|
|
33
|
+
* @returns Parsed agent descriptor
|
|
34
|
+
*/
|
|
35
|
+
parseMetadata(content, filePath) {
|
|
36
|
+
const metadata = this.parseYamlFrontmatter(content);
|
|
37
|
+
const fileName = path.basename(filePath, this.config.fileExtension);
|
|
38
|
+
return {
|
|
39
|
+
name: metadata.name || fileName,
|
|
40
|
+
description: metadata.description || '',
|
|
41
|
+
path: filePath,
|
|
42
|
+
role: metadata.role || 'assistant', // Default role
|
|
43
|
+
expertise: metadata.expertise || '',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get an agent by its role identifier
|
|
48
|
+
* @param role - Role identifier to search for
|
|
49
|
+
* @returns Agent descriptor if found, null otherwise
|
|
50
|
+
*/
|
|
51
|
+
async getAgentByRole(role) {
|
|
52
|
+
const agents = await this.listComponents();
|
|
53
|
+
return agents.find(agent => agent.role === role) || null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get all available roles
|
|
57
|
+
* @returns Array of unique role identifiers
|
|
58
|
+
*/
|
|
59
|
+
async listRoles() {
|
|
60
|
+
const agents = await this.listComponents();
|
|
61
|
+
const roles = agents.map(agent => agent.role);
|
|
62
|
+
return [...new Set(roles)]; // Return unique roles
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get agents filtered by expertise keyword
|
|
66
|
+
* @param keyword - Keyword to search in expertise field
|
|
67
|
+
* @returns Array of agents with matching expertise
|
|
68
|
+
*/
|
|
69
|
+
async findByExpertise(keyword) {
|
|
70
|
+
const agents = await this.listComponents();
|
|
71
|
+
const lowerKeyword = keyword.toLowerCase();
|
|
72
|
+
return agents.filter(agent => agent.expertise.toLowerCase().includes(lowerKeyword));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=AgentManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentManager.js","sourceRoot":"","sources":["../../src/agents/AgentManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAuB,MAAM,0BAA0B,CAAC;AAkB5E;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,YAAa,SAAQ,WAA4B;IAC5D;;;OAGG;IACH,YAAY,UAAkB;QAC5B,KAAK,CAAC;YACJ,aAAa,EAAE,UAAU;YACzB,aAAa,EAAE,MAAM;YACrB,aAAa,EAAE,KAAK;SACrB,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACO,aAAa,CAAC,OAAe,EAAE,QAAgB;QACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAEpE,OAAO;YACL,IAAI,EAAG,QAAQ,CAAC,IAAe,IAAI,QAAQ;YAC3C,WAAW,EAAG,QAAQ,CAAC,WAAsB,IAAI,EAAE;YACnD,IAAI,EAAE,QAAQ;YACd,IAAI,EAAG,QAAQ,CAAC,IAAe,IAAI,WAAW,EAAE,eAAe;YAC/D,SAAS,EAAG,QAAQ,CAAC,SAAoB,IAAI,EAAE;SAChD,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,cAAc,CAAC,IAAY;QAC/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,sBAAsB;IACpD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,OAAe;QACnC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC3B,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CACrD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AgentManager, AgentDescriptor } from './AgentManager.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,OAAO,EAAE,YAAY,EAAmB,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Component types that can be installed
|
|
4
|
+
*/
|
|
5
|
+
export type ComponentType = 'skills' | 'steering' | 'rules' | 'contexts' | 'agents' | 'hooks';
|
|
2
6
|
/**
|
|
3
7
|
* CLI options for install-skills command
|
|
4
8
|
*/
|
|
@@ -7,6 +11,14 @@ export interface CLIOptions {
|
|
|
7
11
|
targetPath: string;
|
|
8
12
|
/** Target path for steering installation */
|
|
9
13
|
steeringPath: string;
|
|
14
|
+
/** Target path for rules installation */
|
|
15
|
+
rulesPath: string;
|
|
16
|
+
/** Target path for contexts installation */
|
|
17
|
+
contextsPath: string;
|
|
18
|
+
/** Target path for agents installation */
|
|
19
|
+
agentsPath: string;
|
|
20
|
+
/** Target path for hooks installation */
|
|
21
|
+
hooksPath: string;
|
|
10
22
|
/** Only list skills, don't install */
|
|
11
23
|
listOnly: boolean;
|
|
12
24
|
/** Show help message */
|
|
@@ -15,12 +27,26 @@ export interface CLIOptions {
|
|
|
15
27
|
skillsOnly: boolean;
|
|
16
28
|
/** Install steering only (for unified install) */
|
|
17
29
|
steeringOnly: boolean;
|
|
30
|
+
/** Install rules only */
|
|
31
|
+
rulesOnly: boolean;
|
|
32
|
+
/** Install contexts only */
|
|
33
|
+
contextsOnly: boolean;
|
|
34
|
+
/** Install agents only */
|
|
35
|
+
agentsOnly: boolean;
|
|
36
|
+
/** Install hooks only */
|
|
37
|
+
hooksOnly: boolean;
|
|
38
|
+
/** Components to install (empty means all) */
|
|
39
|
+
components: ComponentType[];
|
|
18
40
|
}
|
|
19
41
|
/**
|
|
20
|
-
* CLI for installing SDD
|
|
42
|
+
* CLI for installing SDD components to a project
|
|
21
43
|
*/
|
|
22
44
|
export declare class InstallSkillsCLI {
|
|
23
45
|
private skillManager;
|
|
46
|
+
private rulesManager;
|
|
47
|
+
private contextManager;
|
|
48
|
+
private agentManager;
|
|
49
|
+
private hookLoader;
|
|
24
50
|
private steeringPath;
|
|
25
51
|
/**
|
|
26
52
|
* Create CLI instance
|
|
@@ -29,13 +55,10 @@ export declare class InstallSkillsCLI {
|
|
|
29
55
|
*/
|
|
30
56
|
constructor(skillsPath?: string, steeringPath?: string);
|
|
31
57
|
/**
|
|
32
|
-
* Get the default
|
|
33
|
-
|
|
34
|
-
private getDefaultSkillsPath;
|
|
35
|
-
/**
|
|
36
|
-
* Get the default steering path based on package location
|
|
58
|
+
* Get the default path for a component type based on package location
|
|
59
|
+
* @param componentDir - The component directory name (skills, steering, rules, etc.)
|
|
37
60
|
*/
|
|
38
|
-
private
|
|
61
|
+
private getDefaultPath;
|
|
39
62
|
/**
|
|
40
63
|
* Parse command line arguments
|
|
41
64
|
* @param args - Command line arguments (process.argv.slice(2))
|
|
@@ -48,7 +71,7 @@ export declare class InstallSkillsCLI {
|
|
|
48
71
|
*/
|
|
49
72
|
run(options: CLIOptions): Promise<void>;
|
|
50
73
|
/**
|
|
51
|
-
* Run unified install (
|
|
74
|
+
* Run unified install (all components)
|
|
52
75
|
* @param options - CLI options
|
|
53
76
|
*/
|
|
54
77
|
runUnified(options: CLIOptions): Promise<void>;
|
|
@@ -61,7 +84,7 @@ export declare class InstallSkillsCLI {
|
|
|
61
84
|
*/
|
|
62
85
|
private listSteering;
|
|
63
86
|
/**
|
|
64
|
-
* List all available
|
|
87
|
+
* List all available components
|
|
65
88
|
*/
|
|
66
89
|
private listAll;
|
|
67
90
|
/**
|
|
@@ -74,6 +97,26 @@ export declare class InstallSkillsCLI {
|
|
|
74
97
|
* @param targetPath - Target directory (e.g., .spec/steering)
|
|
75
98
|
*/
|
|
76
99
|
private installSteering;
|
|
100
|
+
/**
|
|
101
|
+
* Install rules to target directory
|
|
102
|
+
* @param targetPath - Target directory (e.g., .claude/rules)
|
|
103
|
+
*/
|
|
104
|
+
private installRules;
|
|
105
|
+
/**
|
|
106
|
+
* Install contexts to target directory
|
|
107
|
+
* @param targetPath - Target directory (e.g., .claude/contexts)
|
|
108
|
+
*/
|
|
109
|
+
private installContexts;
|
|
110
|
+
/**
|
|
111
|
+
* Install agents to target directory
|
|
112
|
+
* @param targetPath - Target directory (e.g., .claude/agents)
|
|
113
|
+
*/
|
|
114
|
+
private installAgents;
|
|
115
|
+
/**
|
|
116
|
+
* Install hooks to target directory
|
|
117
|
+
* @param targetPath - Target directory (e.g., .claude/hooks)
|
|
118
|
+
*/
|
|
119
|
+
private installHooks;
|
|
77
120
|
/**
|
|
78
121
|
* Get help text
|
|
79
122
|
* @returns Help message
|