sdd-mcp-server 3.3.0 → 3.5.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 (102) hide show
  1. package/README.md +120 -54
  2. package/dist/adapters/cli/SDDToolAdapter.d.ts +5 -1
  3. package/dist/adapters/cli/SDDToolAdapter.js +111 -18
  4. package/dist/adapters/cli/SDDToolAdapter.js.map +1 -1
  5. package/dist/application/services/ContextCompactionService.d.ts +39 -0
  6. package/dist/application/services/ContextCompactionService.js +253 -0
  7. package/dist/application/services/ContextCompactionService.js.map +1 -0
  8. package/dist/application/services/ProjectService.d.ts +7 -1
  9. package/dist/application/services/ProjectService.js +56 -1
  10. package/dist/application/services/ProjectService.js.map +1 -1
  11. package/dist/application/services/TemplateService.js +27 -5
  12. package/dist/application/services/TemplateService.js.map +1 -1
  13. package/dist/application/services/WorkflowEngineService.d.ts +3 -1
  14. package/dist/application/services/WorkflowEngineService.js +20 -5
  15. package/dist/application/services/WorkflowEngineService.js.map +1 -1
  16. package/dist/application/services/WorkflowService.js +8 -0
  17. package/dist/application/services/WorkflowService.js.map +1 -1
  18. package/dist/application/services/staticSteering.js +12 -13
  19. package/dist/application/services/staticSteering.js.map +1 -1
  20. package/dist/cli/install-skills.d.ts +13 -31
  21. package/dist/cli/install-skills.js +230 -173
  22. package/dist/cli/install-skills.js.map +1 -1
  23. package/dist/cli/install-target.d.ts +127 -0
  24. package/dist/cli/install-target.js +127 -0
  25. package/dist/cli/install-target.js.map +1 -0
  26. package/dist/cli/migrate-steering.js +13 -13
  27. package/dist/cli/migrate-steering.js.map +1 -1
  28. package/dist/cli/sdd-mcp-cli.d.ts +1 -1
  29. package/dist/cli/sdd-mcp-cli.js +14 -10
  30. package/dist/cli/sdd-mcp-cli.js.map +1 -1
  31. package/dist/cli/tool-support/antigravity.d.ts +6 -1
  32. package/dist/cli/tool-support/antigravity.js +55 -12
  33. package/dist/cli/tool-support/antigravity.js.map +1 -1
  34. package/dist/cli/tool-support/claude-code.d.ts +5 -0
  35. package/dist/cli/tool-support/claude-code.js +93 -0
  36. package/dist/cli/tool-support/claude-code.js.map +1 -0
  37. package/dist/cli/tool-support/codex.d.ts +18 -1
  38. package/dist/cli/tool-support/codex.js +161 -36
  39. package/dist/cli/tool-support/codex.js.map +1 -1
  40. package/dist/cli/tool-support/index.d.ts +2 -2
  41. package/dist/cli/tool-support/root-guidance.d.ts +9 -0
  42. package/dist/cli/tool-support/root-guidance.js +40 -0
  43. package/dist/cli/tool-support/root-guidance.js.map +1 -0
  44. package/dist/cli/tool-support/target-agent-renderer.d.ts +11 -0
  45. package/dist/cli/tool-support/target-agent-renderer.js +52 -0
  46. package/dist/cli/tool-support/target-agent-renderer.js.map +1 -0
  47. package/dist/cli/tool-support/target-installer.d.ts +40 -0
  48. package/dist/cli/tool-support/target-installer.js +116 -0
  49. package/dist/cli/tool-support/target-installer.js.map +1 -0
  50. package/dist/cli/utils/gitignore-manager.d.ts +5 -0
  51. package/dist/cli/utils/gitignore-manager.js +85 -0
  52. package/dist/cli/utils/gitignore-manager.js.map +1 -0
  53. package/dist/cli/utils/preserving-writer.d.ts +13 -0
  54. package/dist/cli/utils/preserving-writer.js +106 -0
  55. package/dist/cli/utils/preserving-writer.js.map +1 -0
  56. package/dist/domain/services/DomainService.d.ts +1 -0
  57. package/dist/domain/services/DomainService.js +12 -2
  58. package/dist/domain/services/DomainService.js.map +1 -1
  59. package/dist/domain/types.d.ts +13 -0
  60. package/dist/domain/types.js.map +1 -1
  61. package/dist/domain/workflow/WorkflowStateMachine.js +7 -2
  62. package/dist/domain/workflow/WorkflowStateMachine.js.map +1 -1
  63. package/dist/hooks/HookLoader.js +9 -1
  64. package/dist/hooks/HookLoader.js.map +1 -1
  65. package/dist/index.js +347 -26
  66. package/dist/index.js.map +1 -1
  67. package/dist/infrastructure/di/container.js +4 -0
  68. package/dist/infrastructure/di/container.js.map +1 -1
  69. package/dist/infrastructure/di/types.d.ts +1 -0
  70. package/dist/infrastructure/di/types.js +1 -0
  71. package/dist/infrastructure/di/types.js.map +1 -1
  72. package/dist/infrastructure/mcp/ResourceManager.js +21 -1
  73. package/dist/infrastructure/mcp/ResourceManager.js.map +1 -1
  74. package/dist/infrastructure/mcp/ToolRegistry.js +34 -2
  75. package/dist/infrastructure/mcp/ToolRegistry.js.map +1 -1
  76. package/dist/infrastructure/schemas/project.schema.d.ts +47 -4
  77. package/dist/infrastructure/schemas/project.schema.js +39 -2
  78. package/dist/infrastructure/schemas/project.schema.js.map +1 -1
  79. package/dist/shared/BaseManager.d.ts +10 -1
  80. package/dist/shared/BaseManager.js +34 -5
  81. package/dist/shared/BaseManager.js.map +1 -1
  82. package/dist/skills/SkillManager.d.ts +3 -1
  83. package/dist/skills/SkillManager.js +15 -3
  84. package/dist/skills/SkillManager.js.map +1 -1
  85. package/package.json +2 -2
  86. package/sdd-entry.js +2 -2
  87. package/skills/sdd-design/SKILL.md +4 -0
  88. package/skills/sdd-implement/SKILL.md +10 -4
  89. package/skills/sdd-requirements/SKILL.md +4 -0
  90. package/skills/sdd-review/SKILL.md +4 -0
  91. package/skills/sdd-security-check/SKILL.md +4 -0
  92. package/skills/sdd-steering/SKILL.md +4 -0
  93. package/skills/sdd-steering-custom/SKILL.md +4 -0
  94. package/skills/sdd-tasks/SKILL.md +24 -7
  95. package/skills/sdd-test-gen/SKILL.md +4 -0
  96. package/skills/simple-task/SKILL.md +4 -0
  97. package/templates/CLAUDE.md +2 -36
  98. package/templates/codex-AGENTS.md +1 -2
  99. package/templates/codex-hook-runner.js +85 -0
  100. package/dist/utils/sddPaths.d.ts +0 -69
  101. package/dist/utils/sddPaths.js +0 -138
  102. package/dist/utils/sddPaths.js.map +0 -1
package/README.md CHANGED
@@ -6,7 +6,26 @@
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
- > **v3.3** - Multi-tool install support: `--codex` (AGENTS.md for OpenAI Codex CLI), `--antigravity` (.agent/ symlinks for Google Antigravity), `--all-tools`. See [CHANGELOG.md](CHANGELOG.md) for full version history.
9
+ > **v3.5.0** - Target-aware native Codex and Claude Code installation, model routing, portable Codex hooks, and hardened failure reporting. See [CHANGELOG.md](CHANGELOG.md) for full version history.
10
+
11
+ ## Why sdd-mcp?
12
+
13
+ Most AI coding workflows start as prompts and Markdown conventions. `sdd-mcp` adds a stateful MCP workflow layer so assistants can validate progress, enforce approvals, load the right amount of context, and keep long-running SDD work repeatable.
14
+
15
+ ```text
16
+ sdd-init -> requirements -> approve -> design -> approve -> tasks -> review tests -> approve -> implement
17
+ \-> compact handoff generated automatically ->/
18
+ ```
19
+
20
+ ### Compared With Superpowers and OpenSpec
21
+
22
+ | Project | Best For | Main Strength | sdd-mcp Difference |
23
+ |---------|----------|---------------|--------------------|
24
+ | [Superpowers](https://github.com/obra/superpowers) | Agentic skill-driven development | Automatic skill activation, strong TDD culture, subagent workflows | `sdd-mcp` is MCP-native and keeps workflow state in tools, approvals, validation, and generated handoffs |
25
+ | [OpenSpec](https://github.com/Fission-AI/OpenSpec) | Lightweight spec artifacts | Simple propose/apply/archive flow with broad tool support | `sdd-mcp` uses stricter phase gates, explicit review checkpoints, and compact context loading for governed workflows |
26
+ | `sdd-mcp` | Repeatable SDD across MCP-compatible clients | Stateful tools, compact context handoffs, TDD checkpoints, quality gates | Optimized for teams that need enforceable workflow control rather than only guidance files |
27
+
28
+ Use `sdd-mcp` when you want the AI assistant to follow a governed lifecycle, not just remember a convention from chat history.
10
29
 
11
30
  ## 🚀 Quick Start
12
31
 
@@ -16,7 +35,7 @@ A Model Context Protocol (MCP) server implementing Spec-Driven Development (SDD)
16
35
  npx -y sdd-mcp-server@latest
17
36
 
18
37
  # Pin exact version (optional)
19
- npx -y sdd-mcp-server@1.6.0
38
+ npx -y sdd-mcp-server@3.5.0
20
39
 
21
40
  # For Claude Code MCP integration, add to your configuration:
22
41
  # "sdd-mcp-server": {
@@ -31,7 +50,7 @@ npx -y sdd-mcp-server@1.6.0
31
50
  npm install -g sdd-mcp-server@latest
32
51
 
33
52
  # Pin exact version (optional)
34
- npm install -g sdd-mcp-server@1.6.0
53
+ npm install -g sdd-mcp-server@3.5.0
35
54
 
36
55
  # Start the server
37
56
  sdd-mcp-server
@@ -140,54 +159,68 @@ npm install -g sdd-mcp-server@latest
140
159
  sdd-mcp-server
141
160
  ```
142
161
 
143
- ## 🎯 Agent Skills (NEW in v1.9.0)
162
+ ## 🎯 Agent Skills & Components (v3.5.0)
144
163
 
145
164
  SDD now uses a **hybrid architecture** for better token efficiency:
146
165
 
147
166
  - **MCP Tools**: Action-oriented operations (init, status, approve, quality-check, validate, spec-impl)
148
167
  - **Agent Skills**: Template/guidance-heavy operations (requirements, design, tasks, steering, implement, commit)
149
168
 
150
- ### Installing Components (v3.0+)
169
+ ### Installing Components (v3.5.0)
151
170
 
152
171
  ```bash
153
- # Recommended: Install ALL components (skills, steering, rules, contexts, agents, hooks)
154
- npx sdd-mcp-server install --all
172
+ # Lean compatibility install (defaults to Claude Code when non-interactive)
173
+ npx sdd-mcp-server install
174
+
175
+ # Full install prompts for Codex or Claude Code in an interactive terminal
176
+ npx sdd-mcp-server install --profile full
155
177
 
156
- # Install specific component types
157
- npx sdd-mcp-server install --skills # Skills to .claude/skills/
158
- npx sdd-mcp-server install --steering # Steering to .spec/steering/
159
- npx sdd-mcp-server install --rules # Rules to .claude/rules/
160
- npx sdd-mcp-server install --contexts # Contexts to .claude/contexts/
161
- npx sdd-mcp-server install --agents # Agents to .claude/agents/
162
- npx sdd-mcp-server install --hooks # Hooks to .claude/hooks/
178
+ # Automation and CI should select the target explicitly
179
+ npx sdd-mcp-server install --profile full --target codex
180
+ npx sdd-mcp-server install --profile full --target claude-code
181
+
182
+ # Install selected components using that target's native paths
183
+ npx sdd-mcp-server install --target codex --skills --rules --agents
184
+ npx sdd-mcp-server install --target claude-code --skills --rules --agents
163
185
 
164
186
  # Install multiple component types
165
187
  npx sdd-mcp-server install --skills --rules --agents
166
188
 
167
- # Default: Install skills + steering (backward compatible)
168
- npx sdd-mcp-server install
169
-
170
189
  # List all available components
171
190
  npx sdd-mcp-server install --list
172
191
 
173
192
  # Legacy: Install skills only
174
193
  npx sdd-mcp-server install-skills
175
194
 
176
- # Multi-tool support (v3.3+)
177
- npx sdd-mcp-server install --codex # + AGENTS.md for OpenAI Codex CLI
195
+ # Compatibility and additional integrations
196
+ npx sdd-mcp-server install --codex # Deprecated alias for --target codex
178
197
  npx sdd-mcp-server install --antigravity # + .agent/ symlinks for Google Antigravity
179
198
  npx sdd-mcp-server install --all-tools # + all tool integrations
180
199
  ```
181
200
 
182
- **Component Types (v3.0):**
183
- | Component | Install Path | Purpose |
184
- |-----------|--------------|---------|
185
- | **Skills** | `.claude/skills/` | Workflow guidance (requirements, design, tasks, implement, etc.) |
186
- | **Steering** | `.spec/steering/` | Project-specific templates (product, tech, structure) |
187
- | **Rules** | `.claude/rules/` | Always-active guidelines (coding-style, testing, security, git-workflow) |
188
- | **Contexts** | `.claude/contexts/` | Mode-specific prompts (dev, review, planning, security-audit, research) |
189
- | **Agents** | `.claude/agents/` | Specialized AI personas (planner, architect, reviewer, implementer) |
190
- | **Hooks** | `.claude/hooks/` | Event-driven automation (pre-tool-use, post-tool-use, session events) |
201
+ The installer creates only the selected primary target's native artifacts, preserves existing files, and updates the project's existing `.gitignore` with a managed block. `CLAUDE.md`, `AGENTS.md`, and `.spec/steering/` remain trackable.
202
+
203
+ **Target paths:**
204
+
205
+ | Component | Claude Code | Codex |
206
+ |-----------|-------------|-------|
207
+ | **Root guidance** | `CLAUDE.md` | `AGENTS.md` |
208
+ | **Skills** | `.claude/skills/` | `.agents/skills/` |
209
+ | **Steering** | `.spec/steering/` | `.spec/steering/` |
210
+ | **Rules** | `.claude/rules/` | `.codex/guidance/rules/` |
211
+ | **Contexts** | `.claude/contexts/` | `.codex/guidance/contexts/` |
212
+ | **Agents** | `.claude/agents/*.md` | `.codex/agents/*.toml` |
213
+ | **Hooks** | `.claude/hooks/` | `.codex/hooks.json`, `.codex/hooks/` |
214
+
215
+ **Token-aware specialist routing:**
216
+
217
+ | Work | Codex | Claude Code |
218
+ |------|-------|-------------|
219
+ | Planning, architecture, review, security | `gpt-5.6-sol` (`xhigh`) | `opus` |
220
+ | Implementation and TDD (default) | `gpt-5.6-luna` (`max`) | `sonnet` |
221
+
222
+ Codex uses `gpt-5.6-luna` as the default model for routed work. High-level advisor roles override that default with `gpt-5.6-sol` at xhigh effort. `gpt-5.6-terra` remains supported but is not selected by a default SDD role.
223
+ For a detailed explanation of role selection, native agent metadata, delegation, and rerun behavior, see [Model Routing](docs/MODEL-ROUTING.md).
191
224
 
192
225
  ### Component Architecture & Relationships
193
226
 
@@ -208,11 +241,12 @@ The 6 component types work together in a **layered guidance model**:
208
241
 
209
242
 
210
243
  ┌──────────────────────────────────────────────────────────────┐
211
- │ RULES (always active)
244
+ │ RULES (optional always-active profile)
212
245
  │ • coding-style.md → TypeScript/JS conventions │
213
246
  │ • testing.md → TDD requirements │
214
247
  │ • security.md → OWASP guidelines │
215
- │ • Loaded at session start, apply to ALL operations
248
+ │ • Install only when your client benefits from always-on
249
+ │ rule files │
216
250
  └──────────────────────────────────────────────────────────────┘
217
251
 
218
252
 
@@ -244,7 +278,7 @@ The 6 component types work together in a **layered guidance model**:
244
278
 
245
279
 
246
280
  ┌──────────────────────────────────────────────────────────────┐
247
- │ STEERING (project-specific templates - v3.1+)
281
+ │ STEERING (project-specific templates - v3.5.0)
248
282
  │ • product.md → Product description │
249
283
  │ • tech.md → Technology stack │
250
284
  │ • structure.md → Project structure │
@@ -262,7 +296,7 @@ The 6 component types work together in a **layered guidance model**:
262
296
  **When Each Component Activates:**
263
297
  | Component | Activation | Example |
264
298
  |-----------|------------|---------|
265
- | **Rules** | Session start (always) | `coding-style.md` enforces conventions on every response |
299
+ | **Rules** | Full profile/session start | `coding-style.md` enforces conventions when rules are installed |
266
300
  | **Contexts** | Task type detection | `review.md` activates when reviewing code |
267
301
  | **Agents** | Explicit invocation | `reviewer.md` invoked by `/sdd-review` skill |
268
302
  | **Skills** | User command (`/skill-name`) | `/sdd-requirements` loads requirements template |
@@ -305,11 +339,11 @@ npx sdd-mcp-server migrate-steering --path ./my-project
305
339
  - Backs up existing `.spec/steering/` to `.spec/steering.backup/`
306
340
  - Removes static steering docs (principles.md, tdd-guideline.md, linus-review.md, etc.)
307
341
  - Preserves project-specific templates (product.md, tech.md, structure.md)
308
- - The static content now lives in enhanced `.claude/` components
342
+ - The static content now lives in packaged `rules/`, `agents/`, and `skills/` sources and is rendered for the selected target
309
343
 
310
344
  ### Available Skills
311
345
 
312
- After installation, use these skills in Claude Code:
346
+ After installation, use these skills in the selected target agent:
313
347
 
314
348
  | Skill | Description |
315
349
  |-------|-------------|
@@ -329,8 +363,35 @@ After installation, use these skills in Claude Code:
329
363
 
330
364
  **Old Design** (static steering): ~3,800 tokens loaded for every operation
331
365
  **New Design** (skills): ~1,700 tokens loaded only when skill invoked
366
+ **Lean Install** (default): avoids installing rules, contexts, and agents unless requested
367
+ **Automatic Handoffs**: phase approvals write compact `.spec/specs/{feature}/context/handoff.md` summaries and `sdd-context-load` uses them by default
368
+
369
+ **Savings**: ~55% fewer tokens in typical operations, with further savings from lean install and compact handoffs. On typical specs, compact handoff loading targets a 60-85% reduction versus loading full `requirements.md`, `design.md`, and `tasks.md`.
370
+
371
+ ### Automatic Context Handoffs
372
+
373
+ To reduce context growth during long SDD workflows, approval tools automatically compact phase context:
374
+
375
+ ```text
376
+ sdd-approve requirements -> .spec/specs/{feature}/context/requirements-handoff.md
377
+ sdd-approve design -> .spec/specs/{feature}/context/design-handoff.md
378
+ sdd-approve tasks -> .spec/specs/{feature}/context/tasks-handoff.md
379
+ latest approved context -> .spec/specs/{feature}/context/handoff.md
380
+ ```
381
+
382
+ `sdd-context-load` defaults to compact mode and loads `handoff.md` instead of all phase documents.
332
383
 
333
- **Savings**: ~55% fewer tokens in typical operations!
384
+ Use explicit modes when needed:
385
+
386
+ ```json
387
+ { "featureName": "auth-flow", "mode": "compact" }
388
+ { "featureName": "auth-flow", "mode": "standard" }
389
+ { "featureName": "auth-flow", "mode": "full" }
390
+ ```
391
+
392
+ - `compact`: handoff only, best for routine continuation.
393
+ - `standard`: handoff plus current `spec.json`.
394
+ - `full`: all phase documents, for audits or ambiguous decisions.
334
395
 
335
396
  ## 📋 Available MCP Tools
336
397
 
@@ -341,21 +402,22 @@ Once connected to your AI client, you can use these MCP tools:
341
402
  | `sdd-init` | Initialize new SDD project with interactive clarification | Analyzes description quality (0-100 score), blocks if < 70%, asks targeted WHY/WHO/WHAT questions |
342
403
  | `sdd-status` | Check workflow progress | Shows current phase and approvals for features |
343
404
  | `sdd-approve` | Approve workflow phases | Mark phases (requirements, design, tasks) as approved |
405
+ | `sdd-review-test-cases` | Approve optional TDD test-case checkpoint | Use before approving tasks when test-case review is enabled |
344
406
  | `sdd-quality-check` | Code quality analysis | Linus-style 5-layer code review |
345
- | `sdd-context-load` | Load project context | Restore project memory and state |
407
+ | `sdd-context-load` | Load project context | Defaults to compact handoff context; use `mode: "full"` only when needed |
346
408
  | `sdd-validate-design` | Design quality validation | Interactive GO/NO-GO design review |
347
409
  | `sdd-validate-gap` | Implementation gap analysis | Analyze requirements vs codebase |
348
410
  | `sdd-spec-impl` | Execute tasks with TDD | Kent Beck's Red-Green-Refactor methodology |
349
- | `sdd-list-skills` | List available Agent Skills | Shows skills that can be installed for Claude Code |
411
+ | `sdd-list-skills` | List available Agent Skills | Shows skills that can be installed for the selected target agent |
350
412
 
351
- > **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.
413
+ > **Note**: Template/guidance tools (`sdd-requirements`, `sdd-design`, `sdd-tasks`, `sdd-steering`, `sdd-implement`) are now **Agent Skills**. Install them with the target-aware `install` command and use them as `/sdd-requirements`, `/sdd-design`, etc.
352
414
 
353
415
  ## 💡 Basic Workflow
354
416
 
355
- 1. **Setup: Install Skills & Steering, Initialize Project**
417
+ 1. **Setup: Install Target Components, Initialize Project**
356
418
  ```bash
357
- # Install skills and steering documents (recommended)
358
- npx sdd-mcp-server install
419
+ # Interactive full install, or pass --target explicitly in automation
420
+ npx sdd-mcp-server install --profile full
359
421
 
360
422
  # Initialize project with MCP tool
361
423
  Use sdd-init to create a new SDD project
@@ -385,6 +447,8 @@ Once connected to your AI client, you can use these MCP tools:
385
447
  Use /sdd-tasks <feature-name> to create TDD-focused task breakdown
386
448
  Includes test pyramid guidance (70/20/10 ratio)
387
449
  Tasks follow RED-GREEN-REFACTOR workflow automatically
450
+ Optional: enable test-case review checkpoint before implementation
451
+ If enabled, run sdd-review-test-cases before approving tasks
388
452
  Use sdd-approve (MCP tool) to approve the tasks phase
389
453
  ```
390
454
 
@@ -404,7 +468,7 @@ Once connected to your AI client, you can use these MCP tools:
404
468
  7. **Monitor & Manage (MCP Tools)**
405
469
  ```
406
470
  Use sdd-status to check workflow progress and phase approvals
407
- Use sdd-context-load to restore project memory
471
+ Use sdd-context-load to restore compact project memory
408
472
  ```
409
473
 
410
474
  ## ⚙️ Configuration
@@ -480,7 +544,7 @@ claude mcp add sdd "sdd-mcp-server"
480
544
  - **EARS-Formatted Requirements**: Generate acceptance criteria based on actual npm scripts and dependencies
481
545
  - **Quality Enforcement**: Linus-style 5-layer code review system with security (OWASP Top 10) checks
482
546
 
483
- ### Plugin Architecture (v3.0)
547
+ ### Plugin Architecture (v3.5.0)
484
548
  - **6 Component Types**: Skills, Steering, Rules, Contexts, Agents, Hooks for comprehensive AI guidance
485
549
  - **Specialized Agents**: Planner, Architect, Reviewer, Implementer, Security-Auditor, TDD-Guide personas
486
550
  - **Always-Active Rules**: Coding-style, Testing, Security, Git-workflow, Error-handling enforcement
@@ -496,7 +560,7 @@ claude mcp add sdd "sdd-mcp-server"
496
560
 
497
561
  ### Guidelines & Standards
498
562
  - **Coding Principles Enforcement**: Built-in SOLID, DRY, KISS, YAGNI, Separation of Concerns, and Modularity guidance
499
- - **Comprehensive Steering Documents**: 8 auto-generated guidance docs (product, tech, structure, linus-review, commit, tdd-guideline, security-check, principles)
563
+ - **Project Steering Documents**: Project-specific `product.md`, `tech.md`, and `structure.md` docs, with static guidance consolidated into installable skills/rules/agents
500
564
  - **Multi-Language Support**: 10 languages with cultural adaptation (en, es, fr, de, it, pt, ru, ja, zh, ko)
501
565
  - **Template Engine**: Handlebars-based file generation with project-specific data
502
566
  - **Plugin System**: Extensible architecture for custom workflows
@@ -512,8 +576,8 @@ Here's how to use the MCP SDD Server in your AI client:
512
576
  for a React/TypeScript application with user authentication"
513
577
 
514
578
  # 2. Generate steering documents
515
- "Use sdd-steering to analyze my codebase and generate all steering documents"
516
- # Result: 8 steering documents created including principles.md and tdd-guideline.md
579
+ "Use /sdd-steering to analyze my codebase and update project steering documents"
580
+ # Result: product.md, tech.md, and structure.md describe your project
517
581
 
518
582
  # 3. Generate requirements with comprehensive analysis
519
583
  "Use sdd-requirements to analyze the project and create requirements.md"
@@ -533,7 +597,7 @@ Here's how to use the MCP SDD Server in your AI client:
533
597
 
534
598
  # 7. Implement with TDD
535
599
  "Use sdd-spec-impl to execute the authentication tasks with TDD methodology"
536
- # Result: Test-first development following principles.md and tdd-guideline.md
600
+ # Result: Test-first development using installed skill and agent guidance
537
601
 
538
602
  # 8. Review code quality
539
603
  "Use sdd-quality-check to perform Linus-style code review with SOLID principles check"
@@ -630,19 +694,21 @@ For detailed documentation on:
630
694
  - **Plugin Development**: See [DEPLOYMENT.md](DEPLOYMENT.md)
631
695
  - **Docker Deployment**: See [Dockerfile](Dockerfile) and [docker-compose.yml](docker-compose.yml)
632
696
 
633
- **Component Documentation (v3.0)**:
697
+ **Component Documentation (v3.5.0)**:
634
698
  - **Rules**: See `rules/*.md` for always-active coding guidelines
635
699
  - **Contexts**: See `contexts/*.md` for mode-specific system prompts
636
700
  - **Agents**: See `agents/*.md` for specialized AI personas
637
701
  - **Hooks**: See `hooks/**/*.md` for event-driven automation
638
702
 
639
- **Steering Documents (v3.1+)**:
703
+ **Steering Documents (v3.5.0)**:
704
+
705
+ Static steering content has been consolidated into enhanced components:
706
+ - **Design Principles**: `rules/coding-style.md` (includes SOLID, DRY, KISS, YAGNI, SoC)
707
+ - **TDD Methodology**: `agents/tdd-guide.md` (Red-Green-Refactor workflow)
708
+ - **Code Review**: `agents/reviewer.md` (Linus-style 5-layer thinking)
709
+ - **Security Checklist**: `agents/security-auditor.md` (OWASP Top 10)
640
710
 
641
- As of v3.1, static steering content has been consolidated into enhanced components:
642
- - **Design Principles**: `.claude/rules/coding-style.md` (includes SOLID, DRY, KISS, YAGNI, SoC)
643
- - **TDD Methodology**: `.claude/agents/tdd-guide.md` (Red-Green-Refactor workflow)
644
- - **Code Review**: `.claude/agents/reviewer.md` (Linus-style 5-layer thinking)
645
- - **Security Checklist**: `.claude/agents/security-auditor.md` (OWASP Top 10)
711
+ The installer renders these sources into the Claude Code or Codex paths shown in the target table above.
646
712
 
647
713
  The `.spec/steering/` directory now contains only project-specific templates:
648
714
  - `product.md` - Product description template
@@ -6,6 +6,7 @@ import { QualityService } from "../../application/services/QualityService.js";
6
6
  import { SteeringDocumentService } from "../../application/services/SteeringDocumentService.js";
7
7
  import { CodebaseAnalysisService } from "../../application/services/CodebaseAnalysisService.js";
8
8
  import { RequirementsClarificationService } from "../../application/services/RequirementsClarificationService.js";
9
+ import { ContextCompactionService } from "../../application/services/ContextCompactionService.js";
9
10
  import { LoggerPort } from "../../domain/ports.js";
10
11
  export interface SDDToolHandler {
11
12
  name: string;
@@ -20,8 +21,9 @@ export declare class SDDToolAdapter {
20
21
  private readonly steeringService;
21
22
  private readonly codebaseAnalysisService;
22
23
  private readonly clarificationService;
24
+ private readonly contextCompactionService;
23
25
  private readonly logger;
24
- constructor(projectService: ProjectService, workflowService: WorkflowService, templateService: TemplateService, qualityService: QualityService, steeringService: SteeringDocumentService, codebaseAnalysisService: CodebaseAnalysisService, clarificationService: RequirementsClarificationService, logger: LoggerPort);
26
+ constructor(projectService: ProjectService, workflowService: WorkflowService, templateService: TemplateService, qualityService: QualityService, steeringService: SteeringDocumentService, codebaseAnalysisService: CodebaseAnalysisService, clarificationService: RequirementsClarificationService, contextCompactionService: ContextCompactionService, logger: LoggerPort);
25
27
  getSDDTools(): SDDToolHandler[];
26
28
  private handleProjectInit;
27
29
  private formatClarificationQuestions;
@@ -29,7 +31,9 @@ export declare class SDDToolAdapter {
29
31
  private handleRequirements;
30
32
  private handleDesign;
31
33
  private handleTasks;
34
+ private handleReviewTestCases;
32
35
  private handleQualityCheck;
36
+ private handleContextLoad;
33
37
  private handleSteering;
34
38
  private handleSteeringCustom;
35
39
  private generateProductSteering;
@@ -20,6 +20,7 @@ import { QualityService } from "../../application/services/QualityService.js";
20
20
  import { SteeringDocumentService } from "../../application/services/SteeringDocumentService.js";
21
21
  import { CodebaseAnalysisService } from "../../application/services/CodebaseAnalysisService.js";
22
22
  import { RequirementsClarificationService } from "../../application/services/RequirementsClarificationService.js";
23
+ import { ContextCompactionService } from "../../application/services/ContextCompactionService.js";
23
24
  import { WorkflowPhase } from "../../domain/types.js";
24
25
  import { ensureStaticSteeringDocuments } from "../../application/services/staticSteering.js";
25
26
  let SDDToolAdapter = class SDDToolAdapter {
@@ -30,8 +31,9 @@ let SDDToolAdapter = class SDDToolAdapter {
30
31
  steeringService;
31
32
  codebaseAnalysisService;
32
33
  clarificationService;
34
+ contextCompactionService;
33
35
  logger;
34
- constructor(projectService, workflowService, templateService, qualityService, steeringService, codebaseAnalysisService, clarificationService, logger) {
36
+ constructor(projectService, workflowService, templateService, qualityService, steeringService, codebaseAnalysisService, clarificationService, contextCompactionService, logger) {
35
37
  this.projectService = projectService;
36
38
  this.workflowService = workflowService;
37
39
  this.templateService = templateService;
@@ -39,6 +41,7 @@ let SDDToolAdapter = class SDDToolAdapter {
39
41
  this.steeringService = steeringService;
40
42
  this.codebaseAnalysisService = codebaseAnalysisService;
41
43
  this.clarificationService = clarificationService;
44
+ this.contextCompactionService = contextCompactionService;
42
45
  this.logger = logger;
43
46
  }
44
47
  getSDDTools() {
@@ -64,6 +67,10 @@ let SDDToolAdapter = class SDDToolAdapter {
64
67
  description: "Answers to clarification questions (second pass)",
65
68
  additionalProperties: { type: "string" },
66
69
  },
70
+ reviewTestCases: {
71
+ type: "boolean",
72
+ description: "Enable an optional checkpoint requiring TDD test-case review before implementation",
73
+ },
67
74
  },
68
75
  required: ["projectName"],
69
76
  },
@@ -96,9 +103,9 @@ let SDDToolAdapter = class SDDToolAdapter {
96
103
  inputSchema: {
97
104
  type: "object",
98
105
  properties: {
99
- featureName: { type: "string", description: "Feature name" },
106
+ projectId: { type: "string", description: "Project ID" },
100
107
  },
101
- required: ["featureName"],
108
+ required: ["projectId"],
102
109
  },
103
110
  },
104
111
  handler: this.handleRequirements.bind(this),
@@ -111,9 +118,9 @@ let SDDToolAdapter = class SDDToolAdapter {
111
118
  inputSchema: {
112
119
  type: "object",
113
120
  properties: {
114
- featureName: { type: "string", description: "Feature name" },
121
+ projectId: { type: "string", description: "Project ID" },
115
122
  },
116
- required: ["featureName"],
123
+ required: ["projectId"],
117
124
  },
118
125
  },
119
126
  handler: this.handleDesign.bind(this),
@@ -126,13 +133,32 @@ let SDDToolAdapter = class SDDToolAdapter {
126
133
  inputSchema: {
127
134
  type: "object",
128
135
  properties: {
129
- featureName: { type: "string", description: "Feature name" },
136
+ projectId: { type: "string", description: "Project ID" },
137
+ reviewTestCases: {
138
+ type: "boolean",
139
+ description: "When true, require an explicit TDD test-case review checkpoint before implementation",
140
+ },
130
141
  },
131
- required: ["featureName"],
142
+ required: ["projectId"],
132
143
  },
133
144
  },
134
145
  handler: this.handleTasks.bind(this),
135
146
  },
147
+ {
148
+ name: "sdd-review-test-cases",
149
+ tool: {
150
+ name: "sdd-review-test-cases",
151
+ description: "Mark the optional TDD test-case review checkpoint as reviewed",
152
+ inputSchema: {
153
+ type: "object",
154
+ properties: {
155
+ projectId: { type: "string", description: "Project ID" },
156
+ },
157
+ required: ["projectId"],
158
+ },
159
+ },
160
+ handler: this.handleReviewTestCases.bind(this),
161
+ },
136
162
  {
137
163
  name: "sdd-quality-check",
138
164
  tool: {
@@ -149,6 +175,26 @@ let SDDToolAdapter = class SDDToolAdapter {
149
175
  },
150
176
  handler: this.handleQualityCheck.bind(this),
151
177
  },
178
+ {
179
+ name: "sdd-context-load",
180
+ tool: {
181
+ name: "sdd-context-load",
182
+ description: "Load compact workflow handoff context by default; use mode=full only when necessary",
183
+ inputSchema: {
184
+ type: "object",
185
+ properties: {
186
+ projectId: { type: "string", description: "Project ID" },
187
+ mode: {
188
+ type: "string",
189
+ enum: ["compact", "standard", "full"],
190
+ description: "Context size mode. compact is default and uses handoff.md.",
191
+ },
192
+ },
193
+ required: ["projectId"],
194
+ },
195
+ },
196
+ handler: this.handleContextLoad.bind(this),
197
+ },
152
198
  {
153
199
  name: "sdd-steering",
154
200
  tool: {
@@ -201,7 +247,7 @@ let SDDToolAdapter = class SDDToolAdapter {
201
247
  ];
202
248
  }
203
249
  async handleProjectInit(args) {
204
- const { projectName, description = "", clarificationAnswers } = args;
250
+ const { projectName, description = "", clarificationAnswers, reviewTestCases = false, } = args;
205
251
  if (typeof projectName !== "string") {
206
252
  throw new Error("Invalid arguments: projectName must be a string");
207
253
  }
@@ -228,7 +274,7 @@ let SDDToolAdapter = class SDDToolAdapter {
228
274
  }
229
275
  }
230
276
  // Create project with enriched description
231
- const project = await this.projectService.createProject(projectName, currentPath, "en");
277
+ const project = await this.projectService.createProject(projectName, currentPath, "en", { reviewTestCases: reviewTestCases === true });
232
278
  // Generate initial spec.json
233
279
  const specContent = await this.templateService.generateSpecJson(project);
234
280
  await this.templateService.writeProjectFile(project, "spec.json", specContent);
@@ -283,6 +329,10 @@ let SDDToolAdapter = class SDDToolAdapter {
283
329
  output += `Current Phase: ${status.currentPhase}\n`;
284
330
  output += `Next Phase: ${status.nextPhase ?? "Complete"}\n`;
285
331
  output += `Can Progress: ${status.canProgress ? "Yes" : "No"}\n`;
332
+ const testCaseCheckpoint = project.metadata.checkpoints?.testCases;
333
+ if (testCaseCheckpoint?.required) {
334
+ output += `TDD Test Cases Reviewed: ${testCaseCheckpoint.reviewed ? "Yes" : "No"}\n`;
335
+ }
286
336
  if (status.blockers && status.blockers.length > 0) {
287
337
  output += `Blockers:\n`;
288
338
  for (const blocker of status.blockers) {
@@ -310,10 +360,12 @@ let SDDToolAdapter = class SDDToolAdapter {
310
360
  await this.templateService.writeProjectFile(project, "requirements.md", content);
311
361
  // Update project phase and approval status
312
362
  await this.projectService.updateProjectPhase(projectId, WorkflowPhase.REQUIREMENTS);
313
- await this.projectService.updateApprovalStatus(projectId, "requirements", {
363
+ const updatedProject = await this.projectService.updateApprovalStatus(projectId, "requirements", {
314
364
  generated: true,
315
365
  approved: false,
316
366
  });
367
+ const specContent = await this.templateService.generateSpecJson(updatedProject);
368
+ await this.templateService.writeProjectFile(updatedProject, "spec.json", specContent);
317
369
  return `Requirements document generated for project "${project.name}"`;
318
370
  }
319
371
  async handleDesign(args) {
@@ -335,14 +387,16 @@ let SDDToolAdapter = class SDDToolAdapter {
335
387
  await this.templateService.writeProjectFile(project, "design.md", content);
336
388
  // Update project phase and approval status
337
389
  await this.projectService.updateProjectPhase(projectId, WorkflowPhase.DESIGN);
338
- await this.projectService.updateApprovalStatus(projectId, "design", {
390
+ const updatedProject = await this.projectService.updateApprovalStatus(projectId, "design", {
339
391
  generated: true,
340
392
  approved: false,
341
393
  });
394
+ const specContent = await this.templateService.generateSpecJson(updatedProject);
395
+ await this.templateService.writeProjectFile(updatedProject, "spec.json", specContent);
342
396
  return `Design document generated for project "${project.name}"`;
343
397
  }
344
398
  async handleTasks(args) {
345
- const { projectId } = args;
399
+ const { projectId, reviewTestCases } = args;
346
400
  if (typeof projectId !== "string") {
347
401
  throw new Error("Invalid argument: projectId must be a string");
348
402
  }
@@ -358,14 +412,36 @@ let SDDToolAdapter = class SDDToolAdapter {
358
412
  // Generate tasks template
359
413
  const content = await this.templateService.generateTasksTemplate(project);
360
414
  await this.templateService.writeProjectFile(project, "tasks.md", content);
415
+ if (typeof reviewTestCases === "boolean") {
416
+ await this.projectService.updateTestCaseReviewCheckpoint(projectId, {
417
+ required: reviewTestCases,
418
+ reviewed: !reviewTestCases,
419
+ });
420
+ }
361
421
  // Update project phase and approval status
362
422
  await this.projectService.updateProjectPhase(projectId, WorkflowPhase.TASKS);
363
- await this.projectService.updateApprovalStatus(projectId, "tasks", {
423
+ const updatedProject = await this.projectService.updateApprovalStatus(projectId, "tasks", {
364
424
  generated: true,
365
425
  approved: false,
366
426
  });
427
+ const specContent = await this.templateService.generateSpecJson(updatedProject);
428
+ await this.templateService.writeProjectFile(updatedProject, "spec.json", specContent);
367
429
  return `Tasks document generated for project "${project.name}"`;
368
430
  }
431
+ async handleReviewTestCases(args) {
432
+ const { projectId } = args;
433
+ if (typeof projectId !== "string") {
434
+ throw new Error("Invalid argument: projectId must be a string");
435
+ }
436
+ const project = await this.projectService.getProject(projectId);
437
+ if (!project) {
438
+ throw new Error("Project not found");
439
+ }
440
+ const updatedProject = await this.projectService.updateTestCaseReviewCheckpoint(projectId, { required: true, reviewed: true });
441
+ const specContent = await this.templateService.generateSpecJson(updatedProject);
442
+ await this.templateService.writeProjectFile(updatedProject, "spec.json", specContent);
443
+ return `TDD test cases reviewed for project "${project.name}"`;
444
+ }
369
445
  async handleQualityCheck(args) {
370
446
  const { code, language = "typescript" } = args;
371
447
  if (typeof code !== "string") {
@@ -377,6 +453,21 @@ let SDDToolAdapter = class SDDToolAdapter {
377
453
  });
378
454
  return this.qualityService.formatQualityReport(report);
379
455
  }
456
+ async handleContextLoad(args) {
457
+ const { projectId, mode = "compact" } = args;
458
+ if (typeof projectId !== "string") {
459
+ throw new Error("Invalid argument: projectId must be a string");
460
+ }
461
+ if (!["compact", "standard", "full"].includes(mode)) {
462
+ throw new Error("Invalid argument: mode must be compact, standard, or full");
463
+ }
464
+ const project = await this.projectService.getProject(projectId);
465
+ if (!project) {
466
+ throw new Error("Project not found");
467
+ }
468
+ const context = await this.contextCompactionService.loadContext(project, mode);
469
+ return context;
470
+ }
380
471
  async handleSteering(args) {
381
472
  const { updateMode = "update" } = args;
382
473
  const projectPath = process.cwd();
@@ -444,10 +535,10 @@ let SDDToolAdapter = class SDDToolAdapter {
444
535
  - Project type: ${packageJson.type || "Unknown"}
445
536
  - Existing steering: Updated preserving customizations
446
537
 
447
- **Tip**: For a unified installation of skills and steering documents, run:
448
- \`npx sdd-mcp-server install\`
538
+ **Tip**: For a complete target-native component installation, run:
539
+ \`npx sdd-mcp-server install --profile full\`
449
540
 
450
- This installs both \`.claude/skills/\` (workflow guides) and \`.spec/steering/\` (project rules).`;
541
+ Choose Codex or Claude Code interactively, or pass \`--target\` explicitly in automation.`;
451
542
  }
452
543
  catch (error) {
453
544
  this.logger.error("Failed to generate steering documents", error);
@@ -774,14 +865,16 @@ SDDToolAdapter = __decorate([
774
865
  __param(4, inject(TYPES.SteeringDocumentService)),
775
866
  __param(5, inject(TYPES.CodebaseAnalysisService)),
776
867
  __param(6, inject(TYPES.RequirementsClarificationService)),
777
- __param(7, inject(TYPES.LoggerPort)),
868
+ __param(7, inject(TYPES.ContextCompactionService)),
869
+ __param(8, inject(TYPES.LoggerPort)),
778
870
  __metadata("design:paramtypes", [ProjectService,
779
871
  WorkflowService,
780
872
  TemplateService,
781
873
  QualityService,
782
874
  SteeringDocumentService,
783
875
  CodebaseAnalysisService,
784
- RequirementsClarificationService, Object])
876
+ RequirementsClarificationService,
877
+ ContextCompactionService, Object])
785
878
  ], SDDToolAdapter);
786
879
  export { SDDToolAdapter };
787
880
  //# sourceMappingURL=SDDToolAdapter.js.map