specky-sdd 2.0.0 → 2.2.2
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/CHANGELOG.md +93 -0
- package/README.md +803 -88
- package/SECURITY.md +110 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +66 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +100 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +112 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/dist/schemas/environment.d.ts +12 -37
- package/dist/schemas/environment.d.ts.map +1 -1
- package/dist/schemas/infrastructure.d.ts +22 -42
- package/dist/schemas/infrastructure.d.ts.map +1 -1
- package/dist/schemas/input.d.ts +13 -34
- package/dist/schemas/input.d.ts.map +1 -1
- package/dist/schemas/integration.d.ts +12 -80
- package/dist/schemas/integration.d.ts.map +1 -1
- package/dist/schemas/pipeline.d.ts +24 -230
- package/dist/schemas/pipeline.d.ts.map +1 -1
- package/dist/schemas/quality.d.ts +27 -39
- package/dist/schemas/quality.d.ts.map +1 -1
- package/dist/schemas/quality.js +13 -0
- package/dist/schemas/quality.js.map +1 -1
- package/dist/schemas/testing.d.ts +23 -0
- package/dist/schemas/testing.d.ts.map +1 -0
- package/dist/schemas/testing.js +26 -0
- package/dist/schemas/testing.js.map +1 -0
- package/dist/schemas/transcript.d.ts +18 -40
- package/dist/schemas/transcript.d.ts.map +1 -1
- package/dist/schemas/utility.d.ts +33 -65
- package/dist/schemas/utility.d.ts.map +1 -1
- package/dist/schemas/visualization.d.ts +28 -39
- package/dist/schemas/visualization.d.ts.map +1 -1
- package/dist/services/test-generator.d.ts +61 -0
- package/dist/services/test-generator.d.ts.map +1 -0
- package/dist/services/test-generator.js +217 -0
- package/dist/services/test-generator.js.map +1 -0
- package/dist/tools/input.d.ts.map +1 -1
- package/dist/tools/input.js +12 -0
- package/dist/tools/input.js.map +1 -1
- package/dist/tools/integration.d.ts.map +1 -1
- package/dist/tools/integration.js +24 -0
- package/dist/tools/integration.js.map +1 -1
- package/dist/tools/quality.d.ts +3 -2
- package/dist/tools/quality.d.ts.map +1 -1
- package/dist/tools/quality.js +84 -3
- package/dist/tools/quality.js.map +1 -1
- package/dist/tools/testing.d.ts +9 -0
- package/dist/tools/testing.d.ts.map +1 -0
- package/dist/tools/testing.js +130 -0
- package/dist/tools/testing.js.map +1 -0
- package/dist/tools/utility.d.ts.map +1 -1
- package/dist/tools/utility.js +36 -1
- package/dist/tools/utility.js.map +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -1
- package/hooks/auto-docs.md +53 -0
- package/hooks/auto-test.md +61 -0
- package/hooks/changelog.md +74 -0
- package/hooks/security-scan.md +72 -0
- package/hooks/spec-sync.md +80 -0
- package/hooks/srp-validator.md +86 -0
- package/package.json +14 -5
- package/references/design-patterns.md +434 -0
- package/references/ears-notation.md +605 -0
- package/references/spec-templates.md +936 -0
- package/templates/analysis.md +1 -0
- package/templates/api-docs.md +1 -0
- package/templates/bugfix.md +1 -0
- package/templates/checklist.md +1 -0
- package/templates/compliance.md +1 -0
- package/templates/constitution.md +1 -0
- package/templates/cross-analysis.md +1 -0
- package/templates/data-model.md +1 -0
- package/templates/design.md +1 -0
- package/templates/devcontainer.md +1 -0
- package/templates/dockerfile.md +1 -0
- package/templates/onboarding.md +1 -0
- package/templates/research.md +1 -0
- package/templates/runbook.md +1 -0
- package/templates/specification.md +1 -0
- package/templates/sync-report.md +1 -0
- package/templates/tasks.md +3 -2
- package/templates/terraform.md +1 -0
- package/templates/test-stub.md +34 -0
- package/templates/user-stories.md +1 -0
- package/templates/verification.md +1 -0
- package/templates/work-items.md +1 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-scan
|
|
3
|
+
description: "Run security checklist against OWASP Top 10 and validate authentication patterns"
|
|
4
|
+
trigger: "before PR merge / after implementation"
|
|
5
|
+
model: claude-haiku-3.5
|
|
6
|
+
enabled: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Security Scan Hook
|
|
10
|
+
|
|
11
|
+
Validates implementation against OWASP Top 10 vulnerabilities, secrets detection, and authentication patterns before merge or deployment.
|
|
12
|
+
|
|
13
|
+
## Trigger Event
|
|
14
|
+
|
|
15
|
+
- PR submitted or marked as ready for review
|
|
16
|
+
- Implementation phase complete (TASK_STATUS = `implemented`)
|
|
17
|
+
- Pre-deployment verification requested
|
|
18
|
+
|
|
19
|
+
## Execution Steps
|
|
20
|
+
|
|
21
|
+
1. **Read implementation** from modified code files
|
|
22
|
+
2. **Scan for secrets** — API keys, tokens, credentials (regex patterns)
|
|
23
|
+
3. **Check OWASP Top 10** categories:
|
|
24
|
+
- A1: Broken Access Control
|
|
25
|
+
- A2: Cryptographic Failures
|
|
26
|
+
- A3: Injection
|
|
27
|
+
- A4: Insecure Design
|
|
28
|
+
- A5: Security Misconfiguration
|
|
29
|
+
- A6: Vulnerable Components
|
|
30
|
+
- A7: Auth Failures
|
|
31
|
+
- A8: Data Integrity
|
|
32
|
+
- A9: Logging/Monitoring
|
|
33
|
+
- A10: SSRF
|
|
34
|
+
4. **Validate auth patterns** — JWT, OAuth, session handling
|
|
35
|
+
5. **Generate report** in SECURITY_SCAN.md
|
|
36
|
+
|
|
37
|
+
## Output Format
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
# Security Scan Report
|
|
41
|
+
|
|
42
|
+
Scanned: [files count]
|
|
43
|
+
Timestamp: [ISO]
|
|
44
|
+
Status: [PASS / WARNINGS / BLOCKED]
|
|
45
|
+
|
|
46
|
+
## Secrets Detected
|
|
47
|
+
- [list or "None found"]
|
|
48
|
+
|
|
49
|
+
## OWASP Findings
|
|
50
|
+
- A1: [risk level] - [finding]
|
|
51
|
+
- A3: [risk level] - [finding]
|
|
52
|
+
|
|
53
|
+
## Auth Pattern Review
|
|
54
|
+
- JWT validation: [status]
|
|
55
|
+
- Error messages: [no credential leaks? Y/N]
|
|
56
|
+
|
|
57
|
+
## Recommendations
|
|
58
|
+
1. [action]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Model Configuration
|
|
62
|
+
|
|
63
|
+
- **Model:** claude-haiku-3.5 (fast, security-focused)
|
|
64
|
+
- **Temperature:** 0.1 (conservative, no false negatives)
|
|
65
|
+
- **Max tokens:** 2500
|
|
66
|
+
|
|
67
|
+
## Notes
|
|
68
|
+
|
|
69
|
+
- BLOCKED status prevents merge; WARNINGS require acknowledgment
|
|
70
|
+
- Use community security patterns (OWASP cheatsheets)
|
|
71
|
+
- Flag custom crypto or auth implementations for manual review
|
|
72
|
+
- Store scan reports in `reports/security/`
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-sync
|
|
3
|
+
description: "Compare implementation against SPECIFICATION.md and DESIGN.md; flag drift"
|
|
4
|
+
trigger: "after code changes"
|
|
5
|
+
model: claude-haiku-3.5
|
|
6
|
+
enabled: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Spec-Sync Hook
|
|
10
|
+
|
|
11
|
+
Continuously validates that implementation matches specification and design documents. Flags any divergence and suggests updates to either code or specs.
|
|
12
|
+
|
|
13
|
+
## Trigger Event
|
|
14
|
+
|
|
15
|
+
- Code changes in `src/`, `lib/`, or `app/`
|
|
16
|
+
- SPECIFICATION.md or DESIGN.md modified
|
|
17
|
+
- Manual sync check requested
|
|
18
|
+
|
|
19
|
+
## Execution Steps
|
|
20
|
+
|
|
21
|
+
1. **Read specification** from SPECIFICATION.md (acceptance criteria, requirements)
|
|
22
|
+
2. **Read design** from DESIGN.md (architecture, interfaces, algorithms)
|
|
23
|
+
3. **Read implementation** from changed code files
|
|
24
|
+
4. **Map acceptance criteria** to code sections
|
|
25
|
+
5. **Check for drift**:
|
|
26
|
+
- Missing implementations vs. spec
|
|
27
|
+
- Extra features not in spec (scope creep)
|
|
28
|
+
- Design changes not reflected in code
|
|
29
|
+
- Code changes not reflected in design docs
|
|
30
|
+
6. **Generate SYNC_REPORT.md** with findings
|
|
31
|
+
|
|
32
|
+
## Output Format
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
# Spec-Sync Report
|
|
36
|
+
|
|
37
|
+
Generated: [ISO timestamp]
|
|
38
|
+
Comparison: SPECIFICATION.md ↔ DESIGN.md ↔ Implementation
|
|
39
|
+
|
|
40
|
+
## Status Summary
|
|
41
|
+
- Total Criteria: [N]
|
|
42
|
+
- Implemented: [N]
|
|
43
|
+
- Pending: [N]
|
|
44
|
+
- Drifted: [N]
|
|
45
|
+
|
|
46
|
+
## Drift Analysis
|
|
47
|
+
|
|
48
|
+
### Missing Implementations
|
|
49
|
+
- [spec criterion] → [file] → NOT FOUND
|
|
50
|
+
|
|
51
|
+
### Extra Implementations
|
|
52
|
+
- [code feature] → [file] → NOT IN SPEC
|
|
53
|
+
|
|
54
|
+
### Design Drift
|
|
55
|
+
- [design doc] conflicts with [code] in [file]
|
|
56
|
+
|
|
57
|
+
## Recommended Actions
|
|
58
|
+
1. [action to realign spec or code]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Traceability Matrix
|
|
62
|
+
|
|
63
|
+
Each finding includes a trace ID linking:
|
|
64
|
+
- Spec requirement ID
|
|
65
|
+
- Design section reference
|
|
66
|
+
- Code file location
|
|
67
|
+
- Status (implemented / pending / drifted)
|
|
68
|
+
|
|
69
|
+
## Model Configuration
|
|
70
|
+
|
|
71
|
+
- **Model:** claude-haiku-3.5 (precision)
|
|
72
|
+
- **Temperature:** 0.2 (objective comparison)
|
|
73
|
+
- **Max tokens:** 3000
|
|
74
|
+
|
|
75
|
+
## Notes
|
|
76
|
+
|
|
77
|
+
- This hook is the "source of truth" for spec-code alignment
|
|
78
|
+
- Run before every PR merge
|
|
79
|
+
- Store reports in `reports/traceability/`
|
|
80
|
+
- Do not modify code or specs; only report drift
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: srp-validator
|
|
3
|
+
description: "Validate Single Responsibility Principle; flag files/functions doing too much"
|
|
4
|
+
trigger: "after code changes"
|
|
5
|
+
model: claude-haiku-3.5
|
|
6
|
+
enabled: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# SRP Validator Hook
|
|
10
|
+
|
|
11
|
+
Validates code against the Single Responsibility Principle (SRP) after every change. Flags functions and files that do too much and suggests decomposition.
|
|
12
|
+
|
|
13
|
+
## Trigger Event
|
|
14
|
+
|
|
15
|
+
- Code changes in `src/`, `lib/`, or `app/`
|
|
16
|
+
- New function added (>50 lines or >5 responsibilities detected)
|
|
17
|
+
- New file added (>200 lines)
|
|
18
|
+
- Manual SRP audit requested
|
|
19
|
+
|
|
20
|
+
## Execution Steps
|
|
21
|
+
|
|
22
|
+
1. **Analyze changed functions** — extract responsibilities
|
|
23
|
+
2. **Count responsibilities** using heuristics:
|
|
24
|
+
- Number of reasons to change (spec dependencies)
|
|
25
|
+
- Cyclomatic complexity (decision branches)
|
|
26
|
+
- Function length (lines of code)
|
|
27
|
+
- Parameter count
|
|
28
|
+
3. **Flag violations**:
|
|
29
|
+
- Functions with >1 domain responsibility
|
|
30
|
+
- Files with >3 related responsibilities
|
|
31
|
+
- Utility files with >10 unrelated functions
|
|
32
|
+
4. **Generate suggestions** for decomposition
|
|
33
|
+
5. **Write SRP_REPORT.md** with findings
|
|
34
|
+
|
|
35
|
+
## Output Format
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
# SRP Validator Report
|
|
39
|
+
|
|
40
|
+
Analyzed: [file count], [function count]
|
|
41
|
+
Timestamp: [ISO]
|
|
42
|
+
Violations: [count]
|
|
43
|
+
|
|
44
|
+
## Violations
|
|
45
|
+
|
|
46
|
+
### [file.js] - Line [N]
|
|
47
|
+
**Function:** \`functionName()\`
|
|
48
|
+
**Responsibilities:**
|
|
49
|
+
1. [responsibility 1 - spec dependency]
|
|
50
|
+
2. [responsibility 2 - spec dependency]
|
|
51
|
+
3. [responsibility 3 - spec dependency]
|
|
52
|
+
|
|
53
|
+
**Metrics:**
|
|
54
|
+
- Lines: [N]
|
|
55
|
+
- Complexity: [N]
|
|
56
|
+
- Parameters: [N]
|
|
57
|
+
|
|
58
|
+
**Suggestion:**
|
|
59
|
+
Extract into:
|
|
60
|
+
- \`validateInput()\` — handles validation
|
|
61
|
+
- \`processData()\` — handles transformation
|
|
62
|
+
|
|
63
|
+
## SRP Score
|
|
64
|
+
Overall: [percent] violations of SRP
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Responsibility Detection
|
|
68
|
+
|
|
69
|
+
Scans for:
|
|
70
|
+
- Multiple spec sections referenced
|
|
71
|
+
- Multiple error conditions or branches
|
|
72
|
+
- Multiple domain concepts (parsing + validation + logging)
|
|
73
|
+
- Multiple external dependencies injected
|
|
74
|
+
|
|
75
|
+
## Model Configuration
|
|
76
|
+
|
|
77
|
+
- **Model:** claude-haiku-3.5 (structural analysis)
|
|
78
|
+
- **Temperature:** 0.2 (objective measurement)
|
|
79
|
+
- **Max tokens:** 2000
|
|
80
|
+
|
|
81
|
+
## Notes
|
|
82
|
+
|
|
83
|
+
- SRP violations are warnings, not blockers (allow override with `@srp-skip` comment)
|
|
84
|
+
- Store reports in `reports/code-quality/`
|
|
85
|
+
- Use this hook to guide refactoring, not mandate it
|
|
86
|
+
- High complexity functions should be reviewed manually regardless of line count
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specky-sdd",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Specky — The open-source MCP server for Spec-Driven Development (SDD). Transforms natural language into production-grade specifications with EARS notation, architecture design, and quality gates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,12 +12,19 @@
|
|
|
12
12
|
"build": "tsc && node -e \"const fs=require('fs');const f='dist/index.js';const c=fs.readFileSync(f,'utf8');if(!c.startsWith('#!'))fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c)\" && chmod +x dist/index.js",
|
|
13
13
|
"start": "node dist/index.js",
|
|
14
14
|
"dev": "tsx watch src/index.ts",
|
|
15
|
-
"clean": "rm -rf dist"
|
|
15
|
+
"clean": "rm -rf dist",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:watch": "vitest",
|
|
18
|
+
"test:coverage": "vitest run --coverage"
|
|
16
19
|
},
|
|
17
20
|
"files": [
|
|
18
21
|
"dist/",
|
|
19
22
|
"templates/",
|
|
23
|
+
"references/",
|
|
24
|
+
"hooks/",
|
|
20
25
|
"README.md",
|
|
26
|
+
"CHANGELOG.md",
|
|
27
|
+
"SECURITY.md",
|
|
21
28
|
"LICENSE"
|
|
22
29
|
],
|
|
23
30
|
"engines": {
|
|
@@ -43,11 +50,13 @@
|
|
|
43
50
|
"homepage": "https://github.com/paulasilvatech/specky#readme",
|
|
44
51
|
"dependencies": {
|
|
45
52
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
46
|
-
"zod": "^3.
|
|
53
|
+
"zod": "^4.3.6"
|
|
47
54
|
},
|
|
48
55
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^
|
|
56
|
+
"@types/node": "^25.5.0",
|
|
57
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
50
58
|
"tsx": "^4.19.2",
|
|
51
|
-
"typescript": "^5.7.2"
|
|
59
|
+
"typescript": "^5.7.2",
|
|
60
|
+
"vitest": "^4.1.0"
|
|
52
61
|
}
|
|
53
62
|
}
|