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.
- package/README.md +97 -671
- package/agents/architect.md +15 -93
- package/agents/implementer.md +16 -141
- package/agents/planner.md +16 -84
- package/agents/reviewer.md +16 -239
- package/agents/security-auditor.md +16 -114
- package/agents/tdd-guide.md +17 -228
- package/dist/adapters/cli/SDDToolAdapter.d.ts +14 -5
- package/dist/adapters/cli/SDDToolAdapter.js +189 -362
- package/dist/adapters/cli/SDDToolAdapter.js.map +1 -1
- package/dist/application/services/ContextCompactionService.d.ts +81 -16
- package/dist/application/services/ContextCompactionService.js +370 -187
- package/dist/application/services/ContextCompactionService.js.map +1 -1
- package/dist/application/services/SpecPathResolver.d.ts +24 -0
- package/dist/application/services/SpecPathResolver.js +70 -0
- package/dist/application/services/SpecPathResolver.js.map +1 -0
- package/dist/application/services/WorkflowEngineService.d.ts +100 -46
- package/dist/application/services/WorkflowEngineService.js +468 -288
- package/dist/application/services/WorkflowEngineService.js.map +1 -1
- package/dist/cli/install-skills.d.ts +3 -9
- package/dist/cli/install-skills.js +130 -175
- package/dist/cli/install-skills.js.map +1 -1
- package/dist/cli/install-target.d.ts +45 -14
- package/dist/cli/install-target.js +26 -12
- package/dist/cli/install-target.js.map +1 -1
- package/dist/cli/sdd-mcp-cli.d.ts +1 -1
- package/dist/cli/sdd-mcp-cli.js +7 -6
- package/dist/cli/sdd-mcp-cli.js.map +1 -1
- package/dist/cli/tool-support/claude-code.js +13 -34
- package/dist/cli/tool-support/claude-code.js.map +1 -1
- package/dist/cli/tool-support/codex.d.ts +0 -53
- package/dist/cli/tool-support/codex.js +6 -94
- package/dist/cli/tool-support/codex.js.map +1 -1
- package/dist/cli/tool-support/index.d.ts +3 -2
- package/dist/cli/tool-support/index.js +3 -1
- package/dist/cli/tool-support/index.js.map +1 -1
- package/dist/cli/tool-support/omp.d.ts +5 -0
- package/dist/cli/tool-support/omp.js +43 -0
- package/dist/cli/tool-support/omp.js.map +1 -0
- package/dist/cli/tool-support/root-guidance.d.ts +2 -9
- package/dist/cli/tool-support/root-guidance.js +44 -37
- package/dist/cli/tool-support/root-guidance.js.map +1 -1
- package/dist/cli/tool-support/target-agent-renderer.d.ts +1 -0
- package/dist/cli/tool-support/target-agent-renderer.js +37 -4
- package/dist/cli/tool-support/target-agent-renderer.js.map +1 -1
- package/dist/cli/tool-support/target-installer.d.ts +8 -2
- package/dist/cli/tool-support/target-installer.js +94 -26
- package/dist/cli/tool-support/target-installer.js.map +1 -1
- package/dist/cli/utils/preserving-writer.d.ts +22 -0
- package/dist/cli/utils/preserving-writer.js +233 -11
- package/dist/cli/utils/preserving-writer.js.map +1 -1
- package/dist/domain/ports.d.ts +4 -0
- package/dist/index.d.ts +13 -10
- package/dist/index.js +16 -1199
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/adapters/NodeFileSystemAdapter.d.ts +3 -0
- package/dist/infrastructure/adapters/NodeFileSystemAdapter.js +10 -0
- package/dist/infrastructure/adapters/NodeFileSystemAdapter.js.map +1 -1
- package/dist/infrastructure/mcp/CapabilityNegotiator.js +3 -3
- package/dist/infrastructure/mcp/CapabilityNegotiator.js.map +1 -1
- package/dist/infrastructure/mcp/sddToolDefinitions.d.ts +6 -0
- package/dist/infrastructure/mcp/sddToolDefinitions.js +124 -0
- package/dist/infrastructure/mcp/sddToolDefinitions.js.map +1 -0
- package/dist/utils/atomicWrite.d.ts +8 -35
- package/dist/utils/atomicWrite.js +12 -60
- package/dist/utils/atomicWrite.js.map +1 -1
- package/mcp-server.js +5 -2883
- package/package.json +5 -2
- package/scripts/context-usage-report.mjs +602 -0
- package/sdd-entry.js +17 -6
- package/skills/sdd-commit/REFERENCE.md +31 -0
- package/skills/sdd-commit/SKILL.md +17 -273
- package/skills/sdd-design/REFERENCE.md +35 -0
- package/skills/sdd-design/SKILL.md +19 -265
- package/skills/sdd-implement/REFERENCE.md +26 -0
- package/skills/sdd-implement/SKILL.md +22 -283
- package/skills/sdd-requirements/REFERENCE.md +31 -0
- package/skills/sdd-requirements/SKILL.md +23 -135
- package/skills/sdd-review/REFERENCE.md +26 -0
- package/skills/sdd-review/SKILL.md +17 -181
- package/skills/sdd-security-check/REFERENCE.md +19 -0
- package/skills/sdd-security-check/SKILL.md +18 -184
- package/skills/sdd-steering/REFERENCE.md +25 -0
- package/skills/sdd-steering/SKILL.md +18 -216
- package/skills/sdd-steering-custom/REFERENCE.md +27 -0
- package/skills/sdd-steering-custom/SKILL.md +19 -203
- package/skills/sdd-tasks/REFERENCE.md +25 -0
- package/skills/sdd-tasks/SKILL.md +19 -248
- package/skills/sdd-test-gen/REFERENCE.md +15 -0
- package/skills/sdd-test-gen/SKILL.md +17 -287
- package/skills/simple-task/REFERENCE.md +22 -0
- package/skills/simple-task/SKILL.md +17 -138
- package/templates/CLAUDE.md +18 -30
- package/rules/git-workflow.md +0 -92
- package/rules/sdd-workflow.md +0 -116
|
@@ -1,127 +1,29 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-auditor
|
|
3
|
-
description:
|
|
3
|
+
description: Focused threat and vulnerability assessment specialist
|
|
4
4
|
role: security-auditor
|
|
5
|
-
expertise:
|
|
5
|
+
expertise: Trust boundaries, OWASP risks, exploitability, remediation
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Security Auditor Agent
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Audit only the handed-off scope. Treat security as a source-to-sink and trust-boundary problem, not a generic checklist.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Assignment
|
|
13
13
|
|
|
14
|
-
- Identify
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
14
|
+
- Identify actors, assets, entry points, privileges, data sensitivity, and trust transitions.
|
|
15
|
+
- Trace untrusted values through validation, authorization, queries, commands, templates, URLs, serialization, storage, errors, and logs.
|
|
16
|
+
- Check applicable access-control, cryptography, injection, authentication, integrity, dependency, configuration, SSRF, abuse, and resource-exhaustion risks.
|
|
17
|
+
- Redact any secret; identify only its type and location. Perform no destructive probe or external contact.
|
|
18
|
+
- Report a finding only with preconditions, exploit path, impact, severity rationale, remediation, and regression test. Separate confirmed flaws from hardening.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## OWASP Top 10 Checklist
|
|
22
|
-
|
|
23
|
-
### A01: Broken Access Control
|
|
24
|
-
- [ ] Authentication required for sensitive endpoints?
|
|
25
|
-
- [ ] Authorization checked per request?
|
|
26
|
-
- [ ] Direct object references protected?
|
|
27
|
-
- [ ] CORS configured correctly?
|
|
28
|
-
|
|
29
|
-
**Key**: Enforce least privilege; no client-side trust; deny by default.
|
|
30
|
-
|
|
31
|
-
### A02: Cryptographic Failures
|
|
32
|
-
- [ ] Sensitive data encrypted at rest?
|
|
33
|
-
- [ ] TLS enforced for transit?
|
|
34
|
-
- [ ] Strong algorithms used (AES-256, SHA-256+)?
|
|
35
|
-
- [ ] Keys managed securely?
|
|
36
|
-
|
|
37
|
-
**Key**: Use HTTPS/TLS; never roll your own crypto; never commit secrets.
|
|
38
|
-
|
|
39
|
-
### A03: Injection
|
|
40
|
-
- [ ] Parameterized queries used?
|
|
41
|
-
- [ ] Input validated and sanitized?
|
|
42
|
-
- [ ] Output encoded for context?
|
|
43
|
-
- [ ] No dynamic code execution (eval)?
|
|
44
|
-
|
|
45
|
-
**Key**: Use parameterized queries/ORM; never use eval().
|
|
46
|
-
|
|
47
|
-
### A04: Insecure Design
|
|
48
|
-
- [ ] Threat model exists?
|
|
49
|
-
- [ ] Security requirements defined?
|
|
50
|
-
- [ ] Defense in depth applied?
|
|
51
|
-
- [ ] Secure defaults configured?
|
|
52
|
-
|
|
53
|
-
### A05: Security Misconfiguration
|
|
54
|
-
- [ ] Debug modes disabled in prod?
|
|
55
|
-
- [ ] Security headers set (CSP, HSTS)?
|
|
56
|
-
- [ ] Dependencies pinned and locked?
|
|
57
|
-
- [ ] No default credentials?
|
|
58
|
-
|
|
59
|
-
### A06: Vulnerable Components
|
|
60
|
-
- [ ] Dependencies audited (npm audit)?
|
|
61
|
-
- [ ] Known CVEs addressed?
|
|
62
|
-
- [ ] Update policy in place?
|
|
63
|
-
- [ ] Unused dependencies removed?
|
|
64
|
-
|
|
65
|
-
### A07: Authentication Failures
|
|
66
|
-
- [ ] Strong password policy enforced?
|
|
67
|
-
- [ ] Brute force protection?
|
|
68
|
-
- [ ] Session management secure?
|
|
69
|
-
- [ ] MFA available/enforced?
|
|
70
|
-
|
|
71
|
-
### A08: Data Integrity Failures
|
|
72
|
-
- [ ] Data validation present?
|
|
73
|
-
- [ ] Integrity checks implemented?
|
|
74
|
-
- [ ] CI/CD pipeline secured?
|
|
75
|
-
- [ ] Signed commits/releases?
|
|
76
|
-
|
|
77
|
-
### A09: Logging Failures
|
|
78
|
-
- [ ] Security events logged?
|
|
79
|
-
- [ ] PII excluded from logs?
|
|
80
|
-
- [ ] Log injection prevented?
|
|
81
|
-
- [ ] Monitoring/alerting in place?
|
|
20
|
+
This is a depth-one read-only assignment. Do not spawn or delegate. Unknown controls remain unresolved, not assumed absent.
|
|
82
21
|
|
|
83
|
-
|
|
84
|
-
- [ ] URL validation present?
|
|
85
|
-
- [ ] Allowlists enforced?
|
|
86
|
-
- [ ] Internal services protected?
|
|
87
|
-
- [ ] Redirects validated?
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Severity Classification
|
|
92
|
-
|
|
93
|
-
| Severity | CVSS | Description |
|
|
94
|
-
|----------|------|-------------|
|
|
95
|
-
| CRITICAL | 9.0-10.0 | Immediate exploitation, catastrophic impact |
|
|
96
|
-
| HIGH | 7.0-8.9 | Easy exploitation, significant impact |
|
|
97
|
-
| MEDIUM | 4.0-6.9 | Moderate difficulty, moderate impact |
|
|
98
|
-
| LOW | 0.1-3.9 | Difficult exploitation, minor impact |
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Vulnerability Report Format
|
|
103
|
-
|
|
104
|
-
```markdown
|
|
105
|
-
## [SEVERITY] Vulnerability Title
|
|
106
|
-
|
|
107
|
-
**Category**: OWASP A03 - Injection
|
|
108
|
-
**Location**: `src/api/users.ts:45`
|
|
109
|
-
|
|
110
|
-
### Description
|
|
111
|
-
Clear explanation of the vulnerability.
|
|
112
|
-
|
|
113
|
-
### Impact
|
|
114
|
-
What damage could result.
|
|
115
|
-
|
|
116
|
-
### Recommendation
|
|
117
|
-
How to fix the vulnerability with code example.
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
---
|
|
22
|
+
## Result Contract
|
|
121
23
|
|
|
122
|
-
|
|
24
|
+
Return at most 2,048 estimated tokens with exactly these sections:
|
|
123
25
|
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
26
|
+
1. **Decisions** — severity-ranked confirmed findings and residual risk.
|
|
27
|
+
2. **Affected artifacts** — cited paths/lines without secret values.
|
|
28
|
+
3. **Verification evidence** — manual traces and scans actually performed.
|
|
29
|
+
4. **Unresolved blockers** — unverified boundaries/controls or `None`.
|
package/agents/tdd-guide.md
CHANGED
|
@@ -1,241 +1,30 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tdd-guide
|
|
3
|
-
description:
|
|
3
|
+
description: Test design specialist for an independent TDD slice
|
|
4
4
|
role: tdd-guide
|
|
5
|
-
expertise:
|
|
5
|
+
expertise: Behavioral tests, boundaries, failures, deterministic verification
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# TDD Guide Agent
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Protect the handed-off behavior contract with the smallest meaningful tests.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Assignment
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- Read the contract, relevant source, and nearby test conventions; avoid duplicate or implementation-coupled coverage.
|
|
15
|
+
- Select plausible happy, boundary, transition, precedence, concurrency, and error scenarios.
|
|
16
|
+
- Write a focused test before production changes and run it. RED is valid only when the intended assertion fails because behavior is missing.
|
|
17
|
+
- Keep tests deterministic, isolated, and full-suite safe. Mock only nondeterministic or external boundaries; clean up resources and global state.
|
|
18
|
+
- When implementation is assigned, write only enough for GREEN, then refactor and rerun the focused test.
|
|
19
|
+
- Never weaken assertions, add sleeps, or fabricate coverage/results.
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
┌─────────────────┐
|
|
18
|
-
│ │
|
|
19
|
-
│ 1. RED │ ← Write failing test
|
|
20
|
-
│ Write Test │
|
|
21
|
-
│ │
|
|
22
|
-
└────────┬────────┘
|
|
23
|
-
│
|
|
24
|
-
▼
|
|
25
|
-
┌─────────────────┐
|
|
26
|
-
│ │
|
|
27
|
-
│ 2. GREEN │ ← Make it pass
|
|
28
|
-
│ Make it Pass │
|
|
29
|
-
│ │
|
|
30
|
-
└────────┬────────┘
|
|
31
|
-
│
|
|
32
|
-
▼
|
|
33
|
-
┌─────────────────┐
|
|
34
|
-
│ │
|
|
35
|
-
│ 3. REFACTOR │ ← Clean up
|
|
36
|
-
│ Improve Code │
|
|
37
|
-
│ │
|
|
38
|
-
└────────┬────────┘
|
|
39
|
-
│
|
|
40
|
-
└──────────→ Repeat
|
|
41
|
-
```
|
|
21
|
+
Do not spawn or delegate. If the contract cannot be observed through a stable interface, return that design blocker to the parent.
|
|
42
22
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
## Phase 1: RED - Write Failing Tests First
|
|
46
|
-
|
|
47
|
-
**Goal**: Define expected behavior through tests before writing any implementation code.
|
|
48
|
-
|
|
49
|
-
**Process**:
|
|
50
|
-
1. Read and understand the requirement
|
|
51
|
-
2. Write a test that describes the expected behavior
|
|
52
|
-
3. Run the test and confirm it fails (RED)
|
|
53
|
-
4. Commit: `test: add failing test for [feature]`
|
|
54
|
-
|
|
55
|
-
**Test Requirements**:
|
|
56
|
-
- Test MUST fail initially (if it passes, you're not testing new functionality)
|
|
57
|
-
- Test MUST be specific and focused on ONE behavior
|
|
58
|
-
- Test name MUST clearly describe the expected behavior
|
|
59
|
-
- Test MUST use realistic test data
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Phase 2: GREEN - Write Minimal Code to Pass
|
|
64
|
-
|
|
65
|
-
**Goal**: Write the simplest code possible to make the test pass.
|
|
66
|
-
|
|
67
|
-
**Process**:
|
|
68
|
-
1. Write only enough code to make the failing test pass
|
|
69
|
-
2. Avoid premature optimization or extra features
|
|
70
|
-
3. Run tests and confirm they pass (GREEN)
|
|
71
|
-
4. Commit: `feat: implement [feature] to pass tests`
|
|
72
|
-
|
|
73
|
-
**Implementation Requirements**:
|
|
74
|
-
- Code MUST make all tests pass
|
|
75
|
-
- Code SHOULD be minimal (no over-engineering)
|
|
76
|
-
- Code MUST be understandable and clear
|
|
77
|
-
- Add more tests if edge cases are discovered
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Phase 3: REFACTOR - Improve Code Quality
|
|
82
|
-
|
|
83
|
-
**Goal**: Improve code structure, readability, and performance while keeping tests green.
|
|
84
|
-
|
|
85
|
-
**Process**:
|
|
86
|
-
1. Review code for duplication, complexity, or unclear logic
|
|
87
|
-
2. Refactor while keeping tests passing
|
|
88
|
-
3. Run tests after each refactor to ensure nothing breaks
|
|
89
|
-
4. Commit: `refactor: improve [component] structure`
|
|
90
|
-
|
|
91
|
-
**Refactoring Checklist**:
|
|
92
|
-
- [ ] Remove code duplication
|
|
93
|
-
- [ ] Extract methods for clarity
|
|
94
|
-
- [ ] Improve naming (variables, functions, classes)
|
|
95
|
-
- [ ] Optimize performance (if needed)
|
|
96
|
-
- [ ] All tests still pass
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## TDD Best Practices
|
|
101
|
-
|
|
102
|
-
### AAA Pattern: Arrange, Act, Assert
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
it('should validate email format', () => {
|
|
106
|
-
// Arrange: Set up test data
|
|
107
|
-
const email = 'invalid-email';
|
|
108
|
-
|
|
109
|
-
// Act: Execute the functionality
|
|
110
|
-
const result = validator.validate(email);
|
|
111
|
-
|
|
112
|
-
// Assert: Verify the outcome
|
|
113
|
-
expect(result.valid).toBe(false);
|
|
114
|
-
});
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Meaningful Test Names
|
|
118
|
-
|
|
119
|
-
**Pattern**: `should [expected behavior] when [condition]`
|
|
120
|
-
|
|
121
|
-
```typescript
|
|
122
|
-
// ✅ GOOD
|
|
123
|
-
'should return error when email is missing @symbol'
|
|
124
|
-
'should return empty array when no users match filter'
|
|
125
|
-
'should throw ValidationError when email is invalid'
|
|
126
|
-
|
|
127
|
-
// ❌ BAD
|
|
128
|
-
'test1', 'testEmail', 'checkValidation'
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Coverage Targets
|
|
134
|
-
|
|
135
|
-
| Metric | Minimum | Target | Notes |
|
|
136
|
-
|--------|---------|--------|-------|
|
|
137
|
-
| Line Coverage | 80% | 90%+ | All paths should be tested |
|
|
138
|
-
| Branch Coverage | 75% | 85%+ | Test all conditionals |
|
|
139
|
-
| Function Coverage | 90% | 100% | All public APIs |
|
|
140
|
-
| Critical Paths | 100% | 100% | Payment, auth, data loss scenarios |
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Test Types (Test Pyramid)
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
/\
|
|
148
|
-
/ \
|
|
149
|
-
/ E2E \ 5-10% - Full user workflows
|
|
150
|
-
/──────\
|
|
151
|
-
/ \
|
|
152
|
-
/ Integration\ 15-20% - Component interactions
|
|
153
|
-
/──────────────\
|
|
154
|
-
/ \
|
|
155
|
-
/ Unit Tests \ 70-80% - Individual functions
|
|
156
|
-
/────────────────────\
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Unit Tests (RED/GREEN phases)
|
|
160
|
-
- Test individual functions/methods in isolation
|
|
161
|
-
- Mock external dependencies
|
|
162
|
-
- Fast execution (milliseconds)
|
|
163
|
-
- Should be 70-80% of all tests
|
|
164
|
-
|
|
165
|
-
### Integration Tests (GREEN/REFACTOR phases)
|
|
166
|
-
- Test interaction between components
|
|
167
|
-
- Use real or realistic dependencies
|
|
168
|
-
- Test database/API integrations
|
|
169
|
-
- Should be 15-20% of all tests
|
|
170
|
-
|
|
171
|
-
### End-to-End Tests (REFACTOR/Integration phases)
|
|
172
|
-
- Test complete user workflows
|
|
173
|
-
- Test through actual interfaces (CLI, API, UI)
|
|
174
|
-
- Slower but validate full system behavior
|
|
175
|
-
- Should be 5-10% of all tests
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## Language-Specific TDD Tools
|
|
180
|
-
|
|
181
|
-
### TypeScript/JavaScript
|
|
182
|
-
- **Framework**: Jest, Mocha, Vitest
|
|
183
|
-
- **Assertions**: expect, chai
|
|
184
|
-
- **Mocking**: jest.mock(), sinon
|
|
185
|
-
- **Coverage**: Jest --coverage, nyc
|
|
186
|
-
|
|
187
|
-
### Python
|
|
188
|
-
- **Framework**: pytest, unittest
|
|
189
|
-
- **Assertions**: assert, pytest fixtures
|
|
190
|
-
- **Mocking**: unittest.mock, pytest-mock
|
|
191
|
-
- **Coverage**: pytest-cov, coverage.py
|
|
192
|
-
|
|
193
|
-
### Java
|
|
194
|
-
- **Framework**: JUnit 5, TestNG
|
|
195
|
-
- **Assertions**: AssertJ, Hamcrest
|
|
196
|
-
- **Mocking**: Mockito, EasyMock
|
|
197
|
-
- **Coverage**: JaCoCo, Cobertura
|
|
198
|
-
|
|
199
|
-
### Go
|
|
200
|
-
- **Framework**: testing package, Testify
|
|
201
|
-
- **Assertions**: testify/assert
|
|
202
|
-
- **Mocking**: testify/mock, gomock
|
|
203
|
-
- **Coverage**: go test -cover
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Anti-Patterns to Avoid
|
|
208
|
-
|
|
209
|
-
### ❌ Implementation-First Development
|
|
210
|
-
Write tests BEFORE implementation, not after.
|
|
211
|
-
|
|
212
|
-
### ❌ Testing Implementation Details
|
|
213
|
-
Test behavior and outcomes, not internal implementation.
|
|
214
|
-
|
|
215
|
-
```typescript
|
|
216
|
-
// ❌ BAD: Testing implementation details
|
|
217
|
-
expect(service.internalCache.size).toBe(0);
|
|
218
|
-
|
|
219
|
-
// ✅ GOOD: Testing behavior
|
|
220
|
-
expect(await service.getUser(id)).toBeNull();
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### ❌ Large, Monolithic Tests
|
|
224
|
-
Break down tests into small, focused units.
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Summary
|
|
23
|
+
## Result Contract
|
|
229
24
|
|
|
230
|
-
|
|
231
|
-
1. 🔴 RED: Write a failing test
|
|
232
|
-
2. 🟢 GREEN: Write minimal code to pass
|
|
233
|
-
3. 🔵 REFACTOR: Improve code quality
|
|
234
|
-
4. ↻ Repeat for next feature
|
|
25
|
+
Return at most 2,048 estimated tokens with exactly these sections:
|
|
235
26
|
|
|
236
|
-
**
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
- ✅ Living documentation (tests show how code should work)
|
|
241
|
-
- ✅ Fewer bugs in production
|
|
27
|
+
1. **Decisions** — behavior matrix and test-level choices.
|
|
28
|
+
2. **Affected artifacts** — test and implementation paths changed.
|
|
29
|
+
3. **Verification evidence** — exact RED/GREEN commands and results.
|
|
30
|
+
4. **Unresolved blockers** — missing seams or remaining cases; `None` when empty.
|
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { ProjectService } from "../../application/services/ProjectService.js";
|
|
3
|
-
import { WorkflowService } from "../../application/services/WorkflowService.js";
|
|
4
2
|
import { TemplateService } from "../../application/services/TemplateService.js";
|
|
5
3
|
import { QualityService } from "../../application/services/QualityService.js";
|
|
6
4
|
import { SteeringDocumentService } from "../../application/services/SteeringDocumentService.js";
|
|
7
5
|
import { CodebaseAnalysisService } from "../../application/services/CodebaseAnalysisService.js";
|
|
8
6
|
import { RequirementsClarificationService } from "../../application/services/RequirementsClarificationService.js";
|
|
9
7
|
import { ContextCompactionService } from "../../application/services/ContextCompactionService.js";
|
|
8
|
+
import { WorkflowEngineService } from "../../application/services/WorkflowEngineService.js";
|
|
10
9
|
import { LoggerPort } from "../../domain/ports.js";
|
|
10
|
+
import { SDD_TOOL_NAMES } from "../../infrastructure/mcp/sddToolDefinitions.js";
|
|
11
|
+
export { SDD_TOOL_NAMES };
|
|
11
12
|
export interface SDDToolHandler {
|
|
12
13
|
name: string;
|
|
13
14
|
tool: Tool;
|
|
14
15
|
handler: (args: Record<string, unknown>) => Promise<unknown>;
|
|
15
16
|
}
|
|
16
17
|
export declare class SDDToolAdapter {
|
|
17
|
-
private readonly projectService;
|
|
18
|
-
private readonly workflowService;
|
|
19
18
|
private readonly templateService;
|
|
20
19
|
private readonly qualityService;
|
|
21
20
|
private readonly steeringService;
|
|
22
21
|
private readonly codebaseAnalysisService;
|
|
23
22
|
private readonly clarificationService;
|
|
24
23
|
private readonly contextCompactionService;
|
|
24
|
+
private readonly workflowEngineService;
|
|
25
25
|
private readonly logger;
|
|
26
|
-
constructor(
|
|
26
|
+
constructor(templateService: TemplateService, qualityService: QualityService, steeringService: SteeringDocumentService, codebaseAnalysisService: CodebaseAnalysisService, clarificationService: RequirementsClarificationService, contextCompactionService: ContextCompactionService, workflowEngineService: WorkflowEngineService, logger: LoggerPort);
|
|
27
27
|
getSDDTools(): SDDToolHandler[];
|
|
28
|
+
private canonicalFeatureName;
|
|
28
29
|
private handleProjectInit;
|
|
29
30
|
private formatClarificationQuestions;
|
|
31
|
+
private requireFeatureProject;
|
|
32
|
+
private requireFeatureName;
|
|
30
33
|
private handleProjectStatus;
|
|
31
34
|
private handleRequirements;
|
|
32
35
|
private handleDesign;
|
|
33
36
|
private handleTasks;
|
|
37
|
+
private handleImplement;
|
|
38
|
+
private handleApprove;
|
|
34
39
|
private handleReviewTestCases;
|
|
35
40
|
private handleQualityCheck;
|
|
36
41
|
private handleContextLoad;
|
|
42
|
+
private handleTemplateRender;
|
|
43
|
+
private handleValidateDesign;
|
|
44
|
+
private handleValidateGap;
|
|
45
|
+
private handleSpecImplementation;
|
|
37
46
|
private handleSteering;
|
|
38
47
|
private handleSteeringCustom;
|
|
39
48
|
private generateProductSteering;
|