sdd-mcp-server 1.6.1 → 1.7.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 +29 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +861 -586
- package/dist/index.js.map +1 -1
- package/dist/utils/moduleLoader.d.ts +75 -0
- package/dist/utils/moduleLoader.js +82 -0
- package/dist/utils/moduleLoader.js.map +1 -0
- package/dist/utils/specGenerator.js +228 -160
- package/dist/utils/specGenerator.js.map +1 -1
- package/package.json +1 -1
- package/dist/__tests__/legacy/setup.d.ts +0 -44
- package/dist/__tests__/legacy/setup.js +0 -178
- package/dist/__tests__/legacy/setup.js.map +0 -1
- package/dist/__tests__/legacy/test-helpers/mock-factories.d.ts +0 -26
- package/dist/__tests__/legacy/test-helpers/mock-factories.js +0 -466
- package/dist/__tests__/legacy/test-helpers/mock-factories.js.map +0 -1
- package/dist/__tests__/setup.d.ts +0 -44
- package/dist/__tests__/setup.js +0 -178
- package/dist/__tests__/setup.js.map +0 -1
- package/dist/__tests__/test-helpers/mock-factories.d.ts +0 -26
- package/dist/__tests__/test-helpers/mock-factories.js +0 -466
- package/dist/__tests__/test-helpers/mock-factories.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
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
|
+
> 🔧 **v1.6.2 - Module Loading Fix**: Fixed critical bug where `sdd-steering` generated generic templates instead of analyzing actual codebases when run via `npx`. Root cause: hardcoded import paths didn't account for different execution contexts. Solution: Unified module loading system with **4-path fallback resolution** handling npm start, npm dev, node dist/index.js, and npx contexts. Comprehensive error handling with all attempted paths in error messages. Debug logging for troubleshooting. **100% test coverage** (71 tests passing, 6 new moduleLoader tests). Code review score: **9/10 (Excellent)** ✅. Production-ready with zero security issues!
|
|
10
|
+
|
|
9
11
|
> 🚀 **v1.6.0 - Architecture Refactoring**: Decomposed requirements clarification into **5 focused services** following Single Responsibility Principle! Each service now has one clear purpose: `SteeringContextLoader` (I/O), `DescriptionAnalyzer` (scored semantic detection 0-100), `QuestionGenerator` (template-based), `AnswerValidator` (validation + security), `DescriptionEnricher` (5W1H synthesis). Replaced brittle boolean regex with **scored semantic detection** for better accuracy. Externalized question templates to configuration. **62 new unit tests** (65 total passing) ✅. Services average ~100 LOC vs previous 500 LOC monolith. Better maintainability, testability, and type safety!
|
|
10
12
|
|
|
11
13
|
> 🎯 **v1.5.0 - Interactive Requirements Clarification**: `sdd-init` now **blocks vague requirements**! The agent analyzes your project description (quality score 0-100) and interactively asks targeted clarification questions if score < 70%. Focuses on **WHY** (business justification), WHO (target users), WHAT (core features), and success criteria. Context-aware using existing steering docs. Prevents "garbage in, garbage out" with enriched 5W1H structured descriptions.
|
|
@@ -269,6 +271,10 @@ npm install -g sdd-mcp-server@latest
|
|
|
269
271
|
export LOG_LEVEL=info # debug, info, warn, error
|
|
270
272
|
export DEFAULT_LANG=en # en, es, fr, de, it, pt, ru, ja, zh, ko
|
|
271
273
|
|
|
274
|
+
# Document generation behavior
|
|
275
|
+
export SDD_ALLOW_TEMPLATE_FALLBACK=false # true to allow fallback templates when module loading fails
|
|
276
|
+
# false (default) to fail fast with actionable errors
|
|
277
|
+
|
|
272
278
|
# Advanced configuration (optional)
|
|
273
279
|
export PLUGIN_DIR=/path/to/plugins
|
|
274
280
|
export TEMPLATE_DIR=/path/to/templates
|
|
@@ -276,6 +282,28 @@ export MAX_PLUGINS=50
|
|
|
276
282
|
export HOOK_TIMEOUT=10000
|
|
277
283
|
```
|
|
278
284
|
|
|
285
|
+
#### Module Loading and Fallback Behavior
|
|
286
|
+
|
|
287
|
+
By default, the SDD server requires actual codebase analysis to generate steering documents and specifications. If module loading fails (e.g., running from source without building), commands will error with helpful messages:
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# Default behavior - fail fast with clear error
|
|
291
|
+
sdd-steering
|
|
292
|
+
# Error: Failed to load documentGenerator: ...
|
|
293
|
+
# To use template fallbacks, set SDD_ALLOW_TEMPLATE_FALLBACK=true or run 'npm run build'
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
To allow fallback templates when modules cannot be loaded:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Allow fallback templates (useful for development/debugging)
|
|
300
|
+
export SDD_ALLOW_TEMPLATE_FALLBACK=true
|
|
301
|
+
sdd-steering
|
|
302
|
+
# ⚠️ Warning: Using fallback templates - documents will contain generic content
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Recommendation**: Keep fallback disabled in production to ensure all generated documents reflect your actual codebase.
|
|
306
|
+
|
|
279
307
|
### Claude Code Integration Example
|
|
280
308
|
```bash
|
|
281
309
|
# Install globally first
|
|
@@ -437,9 +465,9 @@ As of v1.4.3, comprehensive codebase analysis is automatic with multi-language d
|
|
|
437
465
|
## 📖 Advanced Documentation
|
|
438
466
|
|
|
439
467
|
For detailed documentation on:
|
|
468
|
+
- **🏗️ Architecture Overview**: See [ARCHITECTURE.md](ARCHITECTURE.md) for complete system design, layered architecture, module loading, and Mermaid diagrams
|
|
440
469
|
- **Plugin Development**: See [DEPLOYMENT.md](DEPLOYMENT.md)
|
|
441
470
|
- **Docker Deployment**: See [Dockerfile](Dockerfile) and [docker-compose.yml](docker-compose.yml)
|
|
442
|
-
- **Architecture Details**: Explore the `/src` directory structure
|
|
443
471
|
- **Code Quality Standards**: Review `.kiro/steering/linus-review.md`
|
|
444
472
|
- **TDD Guidelines**: See `.kiro/steering/tdd-guideline.md` for complete Test-Driven Development workflow
|
|
445
473
|
- **Coding Principles**: Review `.kiro/steering/principles.md` for SOLID, DRY, KISS, YAGNI, SoC, and Modularity guidance
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import type { LoggerPort } from
|
|
4
|
-
import { MCPServer } from
|
|
5
|
-
import { PluginManager } from
|
|
6
|
-
import { HookSystem } from
|
|
7
|
-
import { PluginToolRegistry } from
|
|
8
|
-
import { PluginSteeringRegistry } from
|
|
2
|
+
import "reflect-metadata";
|
|
3
|
+
import type { LoggerPort } from "./domain/ports";
|
|
4
|
+
import { MCPServer } from "./infrastructure/mcp/MCPServer";
|
|
5
|
+
import { PluginManager } from "./infrastructure/plugins/PluginManager";
|
|
6
|
+
import { HookSystem } from "./infrastructure/plugins/HookSystem";
|
|
7
|
+
import { PluginToolRegistry } from "./infrastructure/plugins/PluginToolRegistry";
|
|
8
|
+
import { PluginSteeringRegistry } from "./infrastructure/plugins/PluginSteeringRegistry";
|
|
9
9
|
export declare function createMCPServer(): Promise<{
|
|
10
10
|
container: import("inversify").Container;
|
|
11
11
|
logger: LoggerPort;
|