sdd-mcp-server 3.5.0 → 4.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.
Files changed (95) hide show
  1. package/README.md +97 -671
  2. package/agents/architect.md +15 -93
  3. package/agents/implementer.md +16 -141
  4. package/agents/planner.md +16 -84
  5. package/agents/reviewer.md +16 -239
  6. package/agents/security-auditor.md +16 -114
  7. package/agents/tdd-guide.md +17 -228
  8. package/dist/adapters/cli/SDDToolAdapter.d.ts +14 -5
  9. package/dist/adapters/cli/SDDToolAdapter.js +189 -362
  10. package/dist/adapters/cli/SDDToolAdapter.js.map +1 -1
  11. package/dist/application/services/ContextCompactionService.d.ts +81 -16
  12. package/dist/application/services/ContextCompactionService.js +370 -187
  13. package/dist/application/services/ContextCompactionService.js.map +1 -1
  14. package/dist/application/services/SpecPathResolver.d.ts +24 -0
  15. package/dist/application/services/SpecPathResolver.js +70 -0
  16. package/dist/application/services/SpecPathResolver.js.map +1 -0
  17. package/dist/application/services/WorkflowEngineService.d.ts +100 -46
  18. package/dist/application/services/WorkflowEngineService.js +468 -288
  19. package/dist/application/services/WorkflowEngineService.js.map +1 -1
  20. package/dist/cli/install-skills.d.ts +3 -9
  21. package/dist/cli/install-skills.js +130 -175
  22. package/dist/cli/install-skills.js.map +1 -1
  23. package/dist/cli/install-target.d.ts +45 -14
  24. package/dist/cli/install-target.js +26 -12
  25. package/dist/cli/install-target.js.map +1 -1
  26. package/dist/cli/sdd-mcp-cli.d.ts +1 -1
  27. package/dist/cli/sdd-mcp-cli.js +7 -6
  28. package/dist/cli/sdd-mcp-cli.js.map +1 -1
  29. package/dist/cli/tool-support/claude-code.js +13 -34
  30. package/dist/cli/tool-support/claude-code.js.map +1 -1
  31. package/dist/cli/tool-support/codex.d.ts +0 -53
  32. package/dist/cli/tool-support/codex.js +6 -94
  33. package/dist/cli/tool-support/codex.js.map +1 -1
  34. package/dist/cli/tool-support/index.d.ts +3 -2
  35. package/dist/cli/tool-support/index.js +3 -1
  36. package/dist/cli/tool-support/index.js.map +1 -1
  37. package/dist/cli/tool-support/omp.d.ts +5 -0
  38. package/dist/cli/tool-support/omp.js +43 -0
  39. package/dist/cli/tool-support/omp.js.map +1 -0
  40. package/dist/cli/tool-support/root-guidance.d.ts +2 -9
  41. package/dist/cli/tool-support/root-guidance.js +44 -37
  42. package/dist/cli/tool-support/root-guidance.js.map +1 -1
  43. package/dist/cli/tool-support/target-agent-renderer.d.ts +1 -0
  44. package/dist/cli/tool-support/target-agent-renderer.js +37 -4
  45. package/dist/cli/tool-support/target-agent-renderer.js.map +1 -1
  46. package/dist/cli/tool-support/target-installer.d.ts +8 -2
  47. package/dist/cli/tool-support/target-installer.js +94 -26
  48. package/dist/cli/tool-support/target-installer.js.map +1 -1
  49. package/dist/cli/utils/preserving-writer.d.ts +22 -0
  50. package/dist/cli/utils/preserving-writer.js +233 -11
  51. package/dist/cli/utils/preserving-writer.js.map +1 -1
  52. package/dist/domain/ports.d.ts +4 -0
  53. package/dist/index.d.ts +13 -10
  54. package/dist/index.js +16 -1199
  55. package/dist/index.js.map +1 -1
  56. package/dist/infrastructure/adapters/NodeFileSystemAdapter.d.ts +3 -0
  57. package/dist/infrastructure/adapters/NodeFileSystemAdapter.js +10 -0
  58. package/dist/infrastructure/adapters/NodeFileSystemAdapter.js.map +1 -1
  59. package/dist/infrastructure/mcp/CapabilityNegotiator.js +3 -3
  60. package/dist/infrastructure/mcp/CapabilityNegotiator.js.map +1 -1
  61. package/dist/infrastructure/mcp/sddToolDefinitions.d.ts +6 -0
  62. package/dist/infrastructure/mcp/sddToolDefinitions.js +124 -0
  63. package/dist/infrastructure/mcp/sddToolDefinitions.js.map +1 -0
  64. package/dist/utils/atomicWrite.d.ts +8 -35
  65. package/dist/utils/atomicWrite.js +12 -60
  66. package/dist/utils/atomicWrite.js.map +1 -1
  67. package/mcp-server.js +5 -2883
  68. package/package.json +5 -2
  69. package/scripts/context-usage-report.mjs +602 -0
  70. package/sdd-entry.js +17 -6
  71. package/skills/sdd-commit/REFERENCE.md +31 -0
  72. package/skills/sdd-commit/SKILL.md +17 -273
  73. package/skills/sdd-design/REFERENCE.md +35 -0
  74. package/skills/sdd-design/SKILL.md +19 -265
  75. package/skills/sdd-implement/REFERENCE.md +26 -0
  76. package/skills/sdd-implement/SKILL.md +22 -283
  77. package/skills/sdd-requirements/REFERENCE.md +31 -0
  78. package/skills/sdd-requirements/SKILL.md +23 -135
  79. package/skills/sdd-review/REFERENCE.md +26 -0
  80. package/skills/sdd-review/SKILL.md +17 -181
  81. package/skills/sdd-security-check/REFERENCE.md +19 -0
  82. package/skills/sdd-security-check/SKILL.md +18 -184
  83. package/skills/sdd-steering/REFERENCE.md +25 -0
  84. package/skills/sdd-steering/SKILL.md +18 -216
  85. package/skills/sdd-steering-custom/REFERENCE.md +27 -0
  86. package/skills/sdd-steering-custom/SKILL.md +19 -203
  87. package/skills/sdd-tasks/REFERENCE.md +25 -0
  88. package/skills/sdd-tasks/SKILL.md +19 -248
  89. package/skills/sdd-test-gen/REFERENCE.md +15 -0
  90. package/skills/sdd-test-gen/SKILL.md +17 -287
  91. package/skills/simple-task/REFERENCE.md +22 -0
  92. package/skills/simple-task/SKILL.md +17 -138
  93. package/templates/CLAUDE.md +18 -30
  94. package/rules/git-workflow.md +0 -92
  95. package/rules/sdd-workflow.md +0 -116
@@ -1,152 +1,31 @@
1
1
  ---
2
2
  name: simple-task
3
- description: Implement simple features with best practices. Use when adding small features, bug fixes, or quick enhancements without the full SDD workflow. Invoked via /simple-task <description>.
3
+ description: Implement a small focused change test-first without starting the full SDD workflow.
4
+ disable-model-invocation: true
4
5
  ---
5
6
 
6
- # Simple Task Implementation
7
+ # Simple Task
7
8
 
8
- Implement small features, bug fixes, or quick enhancements while following best practices from the project's steering documents.
9
+ Work inline in the current turn; do not create a serial implementation specialist.
9
10
 
10
- ## When to Use
11
+ Use this route for a bounded bug fix, refactor, or enhancement with clear acceptance behavior. Switch to formal SDD when requirements, architecture, approval gates, or several dependent components need design.
11
12
 
12
- Use `/simple-task` for:
13
- - Small feature additions (e.g., "add logout button")
14
- - Bug fixes
15
- - Minor enhancements
16
- - Quick refactoring
13
+ ## Required Workflow
17
14
 
18
- Use **full SDD workflow** for:
19
- - Complex features requiring multiple components
20
- - New modules or subsystems
21
- - Features needing formal requirements/design review
15
+ 1. Confirm the requested behavior and inspect existing patterns. Do not infer extra scope.
16
+ 2. Locate the narrowest affected code and focused test.
17
+ 3. **RED:** write or adjust a focused failing test for observable behavior; run it and confirm the intended failure.
18
+ 4. **GREEN:** implement the smallest complete fix; run the focused test.
19
+ 5. **REFACTOR:** simplify while preserving behavior; rerun the focused test.
20
+ 6. Check boundaries, error propagation, compatibility, authorization, input validation, injection, secret handling, and sensitive logs where relevant.
21
+ 7. Review all affected callers and artifacts. Never discard unrelated work or claim unobserved checks.
22
22
 
23
- ## Workflow
24
-
25
- ### Step 1: Understand the Task
26
-
27
- 1. Clarify what needs to be done
28
- 2. Identify affected files/components
29
- 3. Estimate scope (if larger than expected, suggest full SDD workflow)
30
-
31
- ### Step 2: Apply TDD (Test-Driven Development)
32
-
33
- **Reference:** `.spec/steering/tdd-guideline.md`
34
-
35
- Follow the Red-Green-Refactor cycle:
36
-
37
- ```
38
- 1. RED → Write a failing test first
39
- 2. GREEN → Write minimal code to pass
40
- 3. REFACTOR → Clean up while tests pass
41
- ```
42
-
43
- **Quick TDD Checklist:**
44
- - [ ] Write test before implementation
45
- - [ ] Test describes expected behavior
46
- - [ ] Minimal code to make test pass
47
- - [ ] Refactor without breaking tests
48
-
49
- ### Step 3: Apply Design Principles
50
-
51
- **Reference:** `.spec/steering/principles.md`
52
-
53
- **SOLID Quick Reference:**
54
- - **S**ingle Responsibility: Each function/class does one thing
55
- - **O**pen/Closed: Extend behavior without modifying existing code
56
- - **L**iskov Substitution: Subtypes must be substitutable
57
- - **I**nterface Segregation: Small, focused interfaces
58
- - **D**ependency Inversion: Depend on abstractions
59
-
60
- **Other Principles:**
61
- - **DRY**: Don't repeat yourself - extract common logic
62
- - **KISS**: Keep it simple - avoid unnecessary complexity
63
- - **YAGNI**: You aren't gonna need it - only implement what's required
64
-
65
- ### Step 4: Code Quality Review
66
-
67
- **Reference:** `.spec/steering/linus-review.md`
68
-
69
- Before finalizing, ask:
70
- 1. **Taste**: Is the solution elegant? Can special cases be eliminated?
71
- 2. **Simplicity**: Can it be simpler? Fewer lines? Less nesting?
72
- 3. **Data Structures**: Is the right data structure used?
73
- 4. **Breaking Changes**: Does this break existing functionality?
74
-
75
- **Quality Checklist:**
76
- - [ ] Functions are short and focused
77
- - [ ] No more than 3 levels of indentation
78
- - [ ] Clear, descriptive naming
79
- - [ ] No unnecessary complexity
80
-
81
- ### Step 5: Security Check
82
-
83
- **Reference:** `.spec/steering/owasp-top10-check.md`
84
-
85
- **Quick Security Checklist:**
86
- - [ ] Input validation (sanitize user inputs)
87
- - [ ] No SQL/command injection (use parameterized queries)
88
- - [ ] Access control enforced
89
- - [ ] No secrets in code (use env vars)
90
- - [ ] Proper error handling (no stack traces to users)
91
-
92
- ### Step 6: Implement and Test
93
-
94
- 1. Write the failing test (RED)
95
- 2. Implement minimal solution (GREEN)
96
- 3. Run tests to confirm pass
97
- 4. Refactor if needed
98
- 5. Run full test suite
99
- 6. Verify no lint/type errors
100
-
101
- ## Reference Documents
102
-
103
- These steering documents provide detailed guidance:
104
-
105
- | Document | Content |
106
- |----------|---------|
107
- | `tdd-guideline.md` | TDD methodology, test pyramid, Red-Green-Refactor |
108
- | `principles.md` | SOLID, DRY, KISS, YAGNI, Separation of Concerns |
109
- | `linus-review.md` | Code quality, "good taste", simplicity standards |
110
- | `owasp-top10-check.md` | Security checklist (OWASP Top 10) |
23
+ If the work genuinely decomposes into at least two independent slices, they may run concurrently; otherwise keep it in the parent.
111
24
 
112
25
  ## Output
113
26
 
114
- After implementing, provide:
115
-
116
- ```markdown
117
- ## Implementation Summary
118
-
119
- **Task:** {what was implemented}
120
-
121
- **Changes:**
122
- - {file1}: {what changed}
123
- - {file2}: {what changed}
124
-
125
- **Tests Added:**
126
- - {test description}
127
-
128
- **Principles Applied:**
129
- - TDD: {how TDD was followed}
130
- - Design: {which principles were applied}
131
- - Security: {security considerations}
132
-
133
- **Ready for:** {commit / further review / testing}
134
- ```
135
-
136
- ## Example
137
-
138
- ```
139
- User: /simple-task add a logout button to the navbar
140
-
141
- Claude:
142
- 1. Understand: Add logout button that clears session and redirects to login
143
- 2. TDD: Write test for logout functionality first
144
- 3. Principles: Single responsibility - logout logic in AuthService
145
- 4. Security: Ensure session is properly invalidated
146
- 5. Implement: Button component + logout handler
147
- 6. Test: Verify all tests pass
148
- ```
27
+ Report changed paths, behavior protected, failing and passing focused test evidence, security considerations, and unresolved blockers.
149
28
 
150
- ## Specialist Delegation
29
+ ## Optional Reference
151
30
 
152
- When the host supports subagents, delegate the implementation to the `implementer` role with a compact handoff containing only the requested change, affected files, constraints, and focused verification. Wait for the specialist and then integrate its result into the current workflow. If specialist delegation is unavailable, state the fallback and continue in the current agent.
31
+ Read [REFERENCE.md](REFERENCE.md) only for scope examples, TDD reminders, or the completion checklist.
@@ -1,43 +1,31 @@
1
- # CLAUDE.md — Spec-Driven Development (SDD)
1
+ # CLAUDE.md — Spec-Driven Development
2
2
 
3
- This project uses the SDD workflow powered by `sdd-mcp-server`.
3
+ This project uses `sdd-mcp-server` with manual-only skills and the canonical v4 MCP runtime.
4
4
 
5
- ## Two Development Paths
5
+ ## Development paths
6
6
 
7
- ### Path A: Simple Task (`/simple-task`)
8
- For small features, bug fixes, and quick enhancements.
7
+ ### Simple task
9
8
 
10
- ### Path B: Full SDD Workflow
11
- For complex features requiring formal specification.
9
+ Invoke `/simple-task` for a small feature, bug fix, or focused enhancement.
12
10
 
13
- ```
14
- sdd-init → /sdd-requirements → /sdd-design → /sdd-tasks → /sdd-implement
11
+ ### Formal SDD
12
+
13
+ For work requiring approved requirements, design, and TDD tasks:
14
+
15
+ ```text
16
+ sdd-init → /sdd-requirements → sdd-approve → /sdd-design → sdd-approve → /sdd-tasks → optional test review → sdd-approve → /sdd-implement
15
17
  ```
16
18
 
17
- Each phase requires human approval before proceeding.
19
+ Use the installed `sdd-*` MCP tools for state changes and compact context by default. Feature-scoped calls use `featureName`, not `projectId`.
18
20
 
19
- ## Installed Components
21
+ For continuation, call `sdd-context-load` with `featureName`; retain the returned `fingerprint` and send it as `ifNoneMatch` on the next identical request. A `not-modified` result means the prior payload remains current and must not be requested or repeated again.
20
22
 
21
- The installer appends only the components selected for this target and their effective paths.
23
+ ## Model execution
22
24
 
23
- ## MCP Tools
25
+ Claude applies the routed model to the current skill turn: Opus for requirements, design, review, and security; Sonnet for implementation and TDD. Execute in this turn and do not spawn a second specialist merely to switch models. Commit work remains in the current turn.
24
26
 
25
- | Tool | Description |
26
- |------|-------------|
27
- | `sdd-init` | Initialize new SDD spec |
28
- | `sdd-status` | Check workflow progress |
29
- | `sdd-approve` | Approve workflow phases |
30
- | `sdd-quality-check` | Code quality analysis |
31
- | `sdd-context-load` | Load project context |
32
- | `sdd-validate-design` | Design quality validation |
33
- | `sdd-validate-gap` | Implementation gap analysis |
34
- | `sdd-spec-impl` | Execute tasks with TDD |
27
+ ## Installed components
35
28
 
36
- ## Workflow
29
+ The installer appends only selected components and their effective paths. Detailed rules and references load on demand; path-scoped rule bodies are not imported into this root file.
37
30
 
38
- 1. **Setup**: `npx sdd-mcp-server install --profile full --target claude-code` (already done)
39
- 2. **Steering** (optional): `/sdd-steering` to generate project-specific docs
40
- 3. **Specify**: `sdd-init` → `/sdd-requirements` → `/sdd-design` → `/sdd-tasks` (approve each phase)
41
- 4. **Implement**: `/sdd-implement` or `sdd-spec-impl`
42
- 5. **Review**: `sdd-quality-check`
43
- 6. **Commit**: `/sdd-commit`
31
+ To update untouched generated guidance automatically, rerun the installer. User-modified managed files are preserved. A legacy refresh uses `--refresh-generated` and stores reversible backups under `.sdd-mcp/backups/<timestamp>/claude-code/`.
@@ -1,92 +0,0 @@
1
- ---
2
- name: git-workflow
3
- description: Git commit and branching conventions
4
- priority: 80
5
- alwaysActive: true
6
- ---
7
-
8
- # Git Workflow Rules
9
-
10
- ## Commit Messages
11
-
12
- ### Format
13
- ```
14
- <type>(<scope>): <subject>
15
-
16
- <body>
17
-
18
- <footer>
19
- ```
20
-
21
- ### Types
22
- - **feat**: New feature
23
- - **fix**: Bug fix
24
- - **docs**: Documentation only changes
25
- - **style**: Code style changes (formatting, semicolons)
26
- - **refactor**: Code change that neither fixes a bug nor adds a feature
27
- - **perf**: Performance improvement
28
- - **test**: Adding or updating tests
29
- - **chore**: Build process or auxiliary tool changes
30
-
31
- ### Subject Line
32
- - Use imperative mood ("add" not "added")
33
- - No period at the end
34
- - Maximum 50 characters
35
- - Capitalize first letter
36
-
37
- ### Body
38
- - Explain "what" and "why", not "how"
39
- - Wrap at 72 characters
40
- - Separate from subject with blank line
41
-
42
- ### Examples
43
- ```
44
- feat(auth): add JWT token refresh endpoint
45
-
46
- Implement automatic token refresh to improve user experience.
47
- Tokens are refreshed 5 minutes before expiration.
48
-
49
- Closes #123
50
- ```
51
-
52
- ```
53
- fix(api): handle null response from external service
54
-
55
- The external payment API occasionally returns null instead of
56
- an error object. This caused unhandled exceptions in production.
57
-
58
- Fixes #456
59
- ```
60
-
61
- ## Branching Strategy
62
-
63
- ### Branch Types
64
- - **main/master**: Production-ready code
65
- - **develop**: Integration branch for features
66
- - **feature/**: New features (`feature/add-user-auth`)
67
- - **fix/**: Bug fixes (`fix/login-validation`)
68
- - **refactor/**: Code refactoring (`refactor/better-architecture`)
69
-
70
- ### Branch Naming
71
- - Use lowercase with hyphens
72
- - Include ticket number if applicable
73
- - Keep names descriptive but concise
74
-
75
- ## Pull Requests
76
-
77
- ### Before Creating PR
78
- - Rebase on latest target branch
79
- - Run all tests locally
80
- - Update documentation if needed
81
- - Self-review your changes
82
-
83
- ### PR Description
84
- - Reference related issues
85
- - Describe what changed and why
86
- - Include testing instructions
87
- - Add screenshots for UI changes
88
-
89
- ### Review Process
90
- - Address all review comments
91
- - Don't force-push after review started
92
- - Squash commits when merging (if team policy)
@@ -1,116 +0,0 @@
1
- ---
2
- name: sdd-workflow
3
- description: Spec-Driven Development process rules
4
- priority: 85
5
- alwaysActive: true
6
- ---
7
-
8
- # SDD Workflow Rules
9
-
10
- ## Spec-Driven Development Process
11
-
12
- ### Phase Order
13
- Follow the SDD phases in strict order:
14
-
15
- 1. **Initialize** (`sdd-init`)
16
- - Define feature name and description
17
- - Answer clarification questions
18
- - Create spec directory structure
19
-
20
- 2. **Requirements** (`sdd-requirements`)
21
- - Generate EARS-formatted requirements
22
- - Define acceptance criteria
23
- - Identify constraints and assumptions
24
-
25
- 3. **Design** (`sdd-design`)
26
- - Create technical design specifications
27
- - Define component architecture
28
- - Document interfaces and data flows
29
-
30
- 4. **Tasks** (`sdd-tasks`)
31
- - Break down into implementable tasks
32
- - Apply TDD methodology
33
- - Estimate complexity
34
-
35
- 5. **Implement** (`sdd-implement`)
36
- - Follow TDD (Red-Green-Refactor)
37
- - Reference steering documents
38
- - Update spec status
39
-
40
- ## EARS Requirements Format
41
-
42
- Use Easy Approach to Requirements Syntax:
43
-
44
- | Pattern | Template | Use Case |
45
- |---------|----------|----------|
46
- | Ubiquitous | The `<system>` SHALL `<action>` | Always true |
47
- | Event-Driven | WHEN `<trigger>` THEN the `<system>` SHALL `<action>` | Response to event |
48
- | State-Driven | WHILE `<state>` THE `<system>` SHALL `<action>` | During state |
49
- | Optional | WHERE `<feature>` THE `<system>` SHALL `<action>` | Configurable |
50
- | Unwanted | IF `<condition>` THEN the `<system>` SHALL `<action>` | Exception |
51
-
52
- ### Example
53
- ```markdown
54
- ## FR-1: User Authentication
55
- WHEN a user submits valid credentials
56
- THEN the system SHALL authenticate the user and return a session token
57
-
58
- **Acceptance Criteria:**
59
- 1. Token expires after 24 hours of inactivity
60
- 2. Invalid credentials return 401 error
61
- 3. Rate limiting prevents brute force attempts
62
- ```
63
-
64
- ## Steering Documents
65
-
66
- ### Always Reference
67
- - `.spec/steering/tdd-guideline.md` - TDD methodology
68
- - `.spec/steering/principles.md` - SOLID, DRY, KISS, YAGNI
69
- - `.spec/steering/linus-review.md` - Code review standards
70
-
71
- ### When to Reference
72
- - Before writing any code, review relevant steering docs
73
- - During code review, verify compliance
74
- - When refactoring, ensure principles are maintained
75
-
76
- ## Approval Gates
77
-
78
- ### Requirements Approval
79
- Before proceeding to design:
80
- - [ ] All requirements use EARS format
81
- - [ ] Each requirement is testable
82
- - [ ] Acceptance criteria are specific
83
- - [ ] Constraints are documented
84
-
85
- ### Design Approval
86
- Before proceeding to tasks:
87
- - [ ] Architecture diagram included
88
- - [ ] Interfaces defined
89
- - [ ] Dependencies identified
90
- - [ ] Security considerations addressed
91
-
92
- ### Tasks Approval
93
- Before proceeding to implementation:
94
- - [ ] Tasks follow TDD structure
95
- - [ ] Complexity estimated
96
- - [ ] Dependencies mapped
97
- - [ ] Steering doc references included
98
-
99
- ## Spec File Locations
100
-
101
- ```
102
- .spec/
103
- ├── steering/ # Project-wide rules
104
- │ ├── product.md
105
- │ ├── tech.md
106
- │ ├── structure.md
107
- │ ├── tdd-guideline.md
108
- │ ├── principles.md
109
- │ └── linus-review.md
110
- └── specs/ # Feature specifications
111
- └── {feature-name}/
112
- ├── spec.json
113
- ├── requirements.md
114
- ├── design.md
115
- └── tasks.md
116
- ```