sdd-mcp-server 3.0.1 → 3.1.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 +117 -98
- package/agents/architect.md +107 -0
- package/agents/implementer.md +154 -0
- package/agents/planner.md +97 -0
- package/agents/reviewer.md +252 -0
- package/agents/security-auditor.md +127 -0
- package/agents/tdd-guide.md +241 -0
- package/contexts/dev.md +58 -0
- package/contexts/planning.md +79 -0
- package/contexts/research.md +93 -0
- package/contexts/review.md +73 -0
- package/contexts/security-audit.md +92 -0
- package/dist/cli/install-skills.js +29 -15
- package/dist/cli/install-skills.js.map +1 -1
- package/dist/cli/migrate-steering.d.ts +24 -0
- package/dist/cli/migrate-steering.js +308 -0
- package/dist/cli/migrate-steering.js.map +1 -0
- package/dist/cli/sdd-mcp-cli.js +9 -0
- package/dist/cli/sdd-mcp-cli.js.map +1 -1
- package/hooks/post-tool-use/log-tool-execution.md +51 -0
- package/hooks/post-tool-use/update-spec-status.md +50 -0
- package/hooks/pre-tool-use/check-test-coverage.md +51 -0
- package/hooks/pre-tool-use/validate-sdd-workflow.md +55 -0
- package/hooks/session-end/remind-uncommitted-changes.md +58 -0
- package/hooks/session-end/save-session-summary.md +72 -0
- package/hooks/session-start/load-project-context.md +62 -0
- package/package.json +5 -1
- package/rules/coding-style.md +97 -0
- package/rules/error-handling.md +134 -0
- package/rules/git-workflow.md +92 -0
- package/rules/sdd-workflow.md +116 -0
- package/rules/security.md +89 -0
- package/rules/testing.md +85 -0
- package/sdd-entry.js +1 -1
- package/skills/sdd-commit/SKILL.md +0 -14
- package/steering/product.md +29 -0
- package/steering/structure.md +60 -0
- package/steering/tech.md +52 -0
- package/steering/AGENTS.md +0 -281
- package/steering/commit.md +0 -59
- package/steering/linus-review.md +0 -153
- package/steering/owasp-top10-check.md +0 -49
- package/steering/principles.md +0 -639
- package/steering/tdd-guideline.md +0 -324
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Steering Migration Tool for SDD MCP v3.1
|
|
4
|
+
*
|
|
5
|
+
* Migrates projects from static steering documents to the new consolidated
|
|
6
|
+
* agents/rules/skills architecture.
|
|
7
|
+
*
|
|
8
|
+
* This tool:
|
|
9
|
+
* 1. Detects old steering structure (.spec/steering/ with static docs)
|
|
10
|
+
* 2. Backs up existing steering to .spec/steering.backup/
|
|
11
|
+
* 3. Removes static steering docs (principles, tdd-guideline, linus-review, etc.)
|
|
12
|
+
* 4. Preserves project-specific docs (product.md, tech.md, structure.md)
|
|
13
|
+
*
|
|
14
|
+
* The static steering content has been merged into:
|
|
15
|
+
* - principles.md → rules/coding-style.md
|
|
16
|
+
* - tdd-guideline.md → agents/tdd-guide.md
|
|
17
|
+
* - linus-review.md → agents/reviewer.md
|
|
18
|
+
* - owasp-top10-check.md → agents/security-auditor.md
|
|
19
|
+
* - commit.md → skills/sdd-commit/SKILL.md
|
|
20
|
+
*/
|
|
21
|
+
import * as fs from 'fs';
|
|
22
|
+
import * as path from 'path';
|
|
23
|
+
const HELP = `
|
|
24
|
+
SDD Steering Migration Tool (v3.1)
|
|
25
|
+
|
|
26
|
+
Migrates from static steering documents to consolidated agents/rules/skills.
|
|
27
|
+
|
|
28
|
+
Usage: npx sdd-mcp-server migrate-steering [options]
|
|
29
|
+
|
|
30
|
+
Options:
|
|
31
|
+
--path <dir> Project directory (default: current directory)
|
|
32
|
+
--dry-run, -n Preview without making changes
|
|
33
|
+
--force, -f Skip confirmation prompts
|
|
34
|
+
--help, -h Show this help
|
|
35
|
+
|
|
36
|
+
What This Tool Does:
|
|
37
|
+
1. Backs up existing .spec/steering/ to .spec/steering.backup/
|
|
38
|
+
2. Removes static steering documents that have been merged:
|
|
39
|
+
- AGENTS.md (meta-doc, removed)
|
|
40
|
+
- commit.md (merged into skills/sdd-commit/SKILL.md)
|
|
41
|
+
- linus-review.md (merged into agents/reviewer.md)
|
|
42
|
+
- owasp-top10-check.md (merged into agents/security-auditor.md)
|
|
43
|
+
- principles.md (merged into rules/coding-style.md)
|
|
44
|
+
- tdd-guideline.md (merged into agents/tdd-guide.md)
|
|
45
|
+
3. Preserves project-specific templates:
|
|
46
|
+
- product.md
|
|
47
|
+
- tech.md
|
|
48
|
+
- structure.md
|
|
49
|
+
|
|
50
|
+
Migration Path:
|
|
51
|
+
The static guidance content now lives in enhanced components:
|
|
52
|
+
- Design principles: .claude/rules/coding-style.md
|
|
53
|
+
- TDD methodology: .claude/agents/tdd-guide.md
|
|
54
|
+
- Review criteria: .claude/agents/reviewer.md
|
|
55
|
+
- Security checklist: .claude/agents/security-auditor.md
|
|
56
|
+
- Commit format: .claude/skills/sdd-commit/SKILL.md
|
|
57
|
+
|
|
58
|
+
Examples:
|
|
59
|
+
npx sdd-mcp-server migrate-steering # Migrate current directory
|
|
60
|
+
npx sdd-mcp-server migrate-steering --dry-run # Preview changes
|
|
61
|
+
npx sdd-mcp-server migrate-steering --path ./my-project
|
|
62
|
+
`;
|
|
63
|
+
/**
|
|
64
|
+
* Static steering documents that should be removed
|
|
65
|
+
* These have been merged into agents/rules/skills
|
|
66
|
+
*/
|
|
67
|
+
const STATIC_STEERING_DOCS = [
|
|
68
|
+
'AGENTS.md',
|
|
69
|
+
'commit.md',
|
|
70
|
+
'linus-review.md',
|
|
71
|
+
'owasp-top10-check.md',
|
|
72
|
+
'principles.md',
|
|
73
|
+
'tdd-guideline.md',
|
|
74
|
+
];
|
|
75
|
+
/**
|
|
76
|
+
* Project-specific templates that should be preserved
|
|
77
|
+
*/
|
|
78
|
+
const PROJECT_SPECIFIC_DOCS = [
|
|
79
|
+
'product.md',
|
|
80
|
+
'tech.md',
|
|
81
|
+
'structure.md',
|
|
82
|
+
];
|
|
83
|
+
/**
|
|
84
|
+
* Parse command line arguments
|
|
85
|
+
*/
|
|
86
|
+
function parseArgs(args) {
|
|
87
|
+
let projectPath = process.cwd();
|
|
88
|
+
let dryRun = false;
|
|
89
|
+
let force = false;
|
|
90
|
+
let showHelp = false;
|
|
91
|
+
for (let i = 0; i < args.length; i++) {
|
|
92
|
+
switch (args[i]) {
|
|
93
|
+
case '--path':
|
|
94
|
+
projectPath = path.resolve(args[++i] || '.');
|
|
95
|
+
break;
|
|
96
|
+
case '--dry-run':
|
|
97
|
+
case '-n':
|
|
98
|
+
dryRun = true;
|
|
99
|
+
break;
|
|
100
|
+
case '--force':
|
|
101
|
+
case '-f':
|
|
102
|
+
force = true;
|
|
103
|
+
break;
|
|
104
|
+
case '--help':
|
|
105
|
+
case '-h':
|
|
106
|
+
showHelp = true;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return { projectPath, dryRun, force, showHelp };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get all files in a directory recursively
|
|
114
|
+
*/
|
|
115
|
+
function getAllFiles(dir) {
|
|
116
|
+
const files = [];
|
|
117
|
+
if (!fs.existsSync(dir))
|
|
118
|
+
return files;
|
|
119
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
120
|
+
const fullPath = path.join(dir, entry.name);
|
|
121
|
+
if (entry.isDirectory()) {
|
|
122
|
+
files.push(...getAllFiles(fullPath));
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
files.push(fullPath);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return files;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Check if a steering directory has static docs that need migration
|
|
132
|
+
*/
|
|
133
|
+
function detectOldStructure(steeringPath) {
|
|
134
|
+
const staticDocs = [];
|
|
135
|
+
const projectDocs = [];
|
|
136
|
+
const otherDocs = [];
|
|
137
|
+
if (!fs.existsSync(steeringPath)) {
|
|
138
|
+
return { hasStaticDocs: false, staticDocs, projectDocs, otherDocs };
|
|
139
|
+
}
|
|
140
|
+
const entries = fs.readdirSync(steeringPath);
|
|
141
|
+
for (const entry of entries) {
|
|
142
|
+
if (!entry.endsWith('.md'))
|
|
143
|
+
continue;
|
|
144
|
+
if (STATIC_STEERING_DOCS.includes(entry)) {
|
|
145
|
+
staticDocs.push(entry);
|
|
146
|
+
}
|
|
147
|
+
else if (PROJECT_SPECIFIC_DOCS.includes(entry)) {
|
|
148
|
+
projectDocs.push(entry);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
otherDocs.push(entry);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
hasStaticDocs: staticDocs.length > 0,
|
|
156
|
+
staticDocs,
|
|
157
|
+
projectDocs,
|
|
158
|
+
otherDocs,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Create backup of steering directory
|
|
163
|
+
*/
|
|
164
|
+
function backupSteering(steeringPath, backupPath, dryRun) {
|
|
165
|
+
if (dryRun) {
|
|
166
|
+
console.log(` Would backup: ${steeringPath} → ${backupPath}`);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
// If backup already exists, add timestamp
|
|
170
|
+
let finalBackupPath = backupPath;
|
|
171
|
+
if (fs.existsSync(backupPath)) {
|
|
172
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
173
|
+
finalBackupPath = `${backupPath}-${timestamp}`;
|
|
174
|
+
}
|
|
175
|
+
// Copy all files to backup
|
|
176
|
+
fs.mkdirSync(finalBackupPath, { recursive: true });
|
|
177
|
+
const files = getAllFiles(steeringPath);
|
|
178
|
+
for (const file of files) {
|
|
179
|
+
const rel = path.relative(steeringPath, file);
|
|
180
|
+
const destFile = path.join(finalBackupPath, rel);
|
|
181
|
+
fs.mkdirSync(path.dirname(destFile), { recursive: true });
|
|
182
|
+
fs.copyFileSync(file, destFile);
|
|
183
|
+
}
|
|
184
|
+
console.log(` ✓ Backed up to: ${finalBackupPath}`);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Remove static steering documents
|
|
188
|
+
*/
|
|
189
|
+
function removeStaticDocs(steeringPath, staticDocs, dryRun) {
|
|
190
|
+
for (const doc of staticDocs) {
|
|
191
|
+
const docPath = path.join(steeringPath, doc);
|
|
192
|
+
if (dryRun) {
|
|
193
|
+
console.log(` Would remove: ${doc}`);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
if (fs.existsSync(docPath)) {
|
|
197
|
+
fs.unlinkSync(docPath);
|
|
198
|
+
console.log(` ✓ Removed: ${doc}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Main migration function
|
|
205
|
+
*/
|
|
206
|
+
export async function main() {
|
|
207
|
+
const args = process.argv.slice(2);
|
|
208
|
+
const { projectPath, dryRun, force, showHelp } = parseArgs(args);
|
|
209
|
+
if (showHelp) {
|
|
210
|
+
console.log(HELP);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const steeringPath = path.join(projectPath, '.spec', 'steering');
|
|
214
|
+
const backupPath = path.join(projectPath, '.spec', 'steering.backup');
|
|
215
|
+
console.log('\n🔄 SDD Steering Migration (v3.1)\n');
|
|
216
|
+
// Check if .spec/steering exists
|
|
217
|
+
if (!fs.existsSync(steeringPath)) {
|
|
218
|
+
console.log('ℹ️ No .spec/steering directory found. Nothing to migrate.\n');
|
|
219
|
+
console.log(' If this is a new project, run: npx sdd-mcp-server install\n');
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
// Detect structure
|
|
223
|
+
const { hasStaticDocs, staticDocs, projectDocs, otherDocs } = detectOldStructure(steeringPath);
|
|
224
|
+
if (!hasStaticDocs) {
|
|
225
|
+
console.log('✅ No static steering documents found. Already migrated or clean install.\n');
|
|
226
|
+
if (projectDocs.length > 0) {
|
|
227
|
+
console.log(' Project-specific documents preserved:');
|
|
228
|
+
for (const doc of projectDocs) {
|
|
229
|
+
console.log(` • ${doc}`);
|
|
230
|
+
}
|
|
231
|
+
console.log('');
|
|
232
|
+
}
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
// Display what will happen
|
|
236
|
+
console.log('📋 Migration Plan:\n');
|
|
237
|
+
console.log(' Static documents to remove (merged into components):');
|
|
238
|
+
for (const doc of staticDocs) {
|
|
239
|
+
const mergedInto = getMergeTarget(doc);
|
|
240
|
+
console.log(` • ${doc} → ${mergedInto}`);
|
|
241
|
+
}
|
|
242
|
+
console.log('');
|
|
243
|
+
if (projectDocs.length > 0) {
|
|
244
|
+
console.log(' Project-specific documents to preserve:');
|
|
245
|
+
for (const doc of projectDocs) {
|
|
246
|
+
console.log(` • ${doc}`);
|
|
247
|
+
}
|
|
248
|
+
console.log('');
|
|
249
|
+
}
|
|
250
|
+
if (otherDocs.length > 0) {
|
|
251
|
+
console.log(' Other documents (will be preserved):');
|
|
252
|
+
for (const doc of otherDocs) {
|
|
253
|
+
console.log(` • ${doc}`);
|
|
254
|
+
}
|
|
255
|
+
console.log('');
|
|
256
|
+
}
|
|
257
|
+
if (dryRun) {
|
|
258
|
+
console.log('🔍 DRY RUN - No changes will be made.\n');
|
|
259
|
+
}
|
|
260
|
+
// Backup
|
|
261
|
+
console.log('📦 Backup:\n');
|
|
262
|
+
backupSteering(steeringPath, backupPath, dryRun);
|
|
263
|
+
console.log('');
|
|
264
|
+
// Remove static docs
|
|
265
|
+
console.log('🗑️ Removing static documents:\n');
|
|
266
|
+
removeStaticDocs(steeringPath, staticDocs, dryRun);
|
|
267
|
+
console.log('');
|
|
268
|
+
// Summary
|
|
269
|
+
if (dryRun) {
|
|
270
|
+
console.log('✅ Preview complete. Run without --dry-run to apply changes.\n');
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
console.log('✅ Migration complete!\n');
|
|
274
|
+
console.log(' The static steering content now lives in:');
|
|
275
|
+
console.log(' • .claude/rules/coding-style.md (SOLID, DRY, KISS, YAGNI)');
|
|
276
|
+
console.log(' • .claude/agents/reviewer.md (Linus-style review)');
|
|
277
|
+
console.log(' • .claude/agents/tdd-guide.md (TDD methodology)');
|
|
278
|
+
console.log(' • .claude/agents/security-auditor.md (OWASP Top 10)');
|
|
279
|
+
console.log(' • .claude/skills/sdd-commit/SKILL.md (Commit format)\n');
|
|
280
|
+
console.log(' To update .claude/ components, run: npx sdd-mcp-server install\n');
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Get the merge target description for a static doc
|
|
285
|
+
*/
|
|
286
|
+
function getMergeTarget(doc) {
|
|
287
|
+
const targets = {
|
|
288
|
+
'AGENTS.md': '(removed - meta documentation)',
|
|
289
|
+
'commit.md': 'skills/sdd-commit/SKILL.md',
|
|
290
|
+
'linus-review.md': 'agents/reviewer.md',
|
|
291
|
+
'owasp-top10-check.md': 'agents/security-auditor.md',
|
|
292
|
+
'principles.md': 'rules/coding-style.md',
|
|
293
|
+
'tdd-guideline.md': 'agents/tdd-guide.md',
|
|
294
|
+
};
|
|
295
|
+
return targets[doc] || '(unknown)';
|
|
296
|
+
}
|
|
297
|
+
// ESM main module detection
|
|
298
|
+
const isMainModule = process.argv[1] && (process.argv[1].endsWith('/migrate-steering.js') ||
|
|
299
|
+
process.argv[1].endsWith('/migrate-steering.ts') ||
|
|
300
|
+
process.argv[1].endsWith('\\migrate-steering.js') ||
|
|
301
|
+
process.argv[1].endsWith('\\migrate-steering.ts'));
|
|
302
|
+
if (isMainModule) {
|
|
303
|
+
main().catch((error) => {
|
|
304
|
+
console.error('Error:', error.message);
|
|
305
|
+
process.exit(1);
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=migrate-steering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-steering.js","sourceRoot":"","sources":["../../src/cli/migrate-steering.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,IAAI,GAAG;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ACxE,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;QAE3E,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;IACrF,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,OAAO,GAA2B;QACtC,WAAW,EAAE,gCAAgC;QAC7C,WAAW,EAAE,4BAA4B;QACzC,iBAAiB,EAAE,oBAAoB;QACvC,sBAAsB,EAAE,4BAA4B;QACpD,eAAe,EAAE,uBAAuB;QACxC,kBAAkB,EAAE,qBAAqB;KAC1C,CAAC;IACF,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC;AACrC,CAAC;AAED,4BAA4B;AAC5B,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAClD,CAAC;AAEF,IAAI,YAAY,EAAE,CAAC;IACjB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/cli/sdd-mcp-cli.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { main as installSkillsMain, mainInstall as installMain } from './install-skills.js';
|
|
12
12
|
import { main as migrateKiroMain } from './migrate-kiro.js';
|
|
13
|
+
import { main as migrateSteeringMain } from './migrate-steering.js';
|
|
13
14
|
const HELP = `
|
|
14
15
|
SDD MCP CLI
|
|
15
16
|
|
|
@@ -19,6 +20,7 @@ Commands:
|
|
|
19
20
|
install Install SDD skills AND steering documents (recommended)
|
|
20
21
|
install-skills Install SDD skills only (legacy)
|
|
21
22
|
migrate-kiro Migrate .kiro directory to .spec (v2.1.0+)
|
|
23
|
+
migrate-steering Migrate steering docs to consolidated components (v3.1.0+)
|
|
22
24
|
|
|
23
25
|
Options:
|
|
24
26
|
--help, -h Show this help message
|
|
@@ -32,6 +34,8 @@ Examples:
|
|
|
32
34
|
npx sdd-mcp-server install-skills --list # List available skills
|
|
33
35
|
npx sdd-mcp-server migrate-kiro # Migrate .kiro to .spec
|
|
34
36
|
npx sdd-mcp-server migrate-kiro --dry-run # Preview migration
|
|
37
|
+
npx sdd-mcp-server migrate-steering # Migrate static steering docs
|
|
38
|
+
npx sdd-mcp-server migrate-steering --dry-run # Preview steering migration
|
|
35
39
|
|
|
36
40
|
Running without a command starts the MCP server (for IDE integrations).
|
|
37
41
|
`;
|
|
@@ -58,6 +62,11 @@ async function main() {
|
|
|
58
62
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
59
63
|
await migrateKiroMain();
|
|
60
64
|
break;
|
|
65
|
+
case 'migrate-steering':
|
|
66
|
+
// Remove the command from args and pass the rest to migrate-steering
|
|
67
|
+
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
68
|
+
await migrateSteeringMain();
|
|
69
|
+
break;
|
|
61
70
|
default:
|
|
62
71
|
console.error(`Unknown command: ${command}`);
|
|
63
72
|
console.log(HELP);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdd-mcp-cli.js","sourceRoot":"","sources":["../../src/cli/sdd-mcp-cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,IAAI,iBAAiB,EA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AAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,MAAM,iBAAiB,EAAE,CAAC;YAC1B,MAAM;QAER,KAAK,cAAc;YACjB,iEAAiE;YACjE,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,MAAM,eAAe,EAAE,CAAC;YACxB,MAAM;QAER,KAAK,kBAAkB;YACrB,qEAAqE;YACrE,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,MAAM,mBAAmB,EAAE,CAAC;YAC5B,MAAM;QAER;YACE,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;YAC7C,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: log-tool-execution
|
|
3
|
+
description: Logs all tool executions for debugging and audit purposes
|
|
4
|
+
event: post-tool-use
|
|
5
|
+
priority: 50
|
|
6
|
+
enabled: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Log Tool Execution Hook
|
|
10
|
+
|
|
11
|
+
This hook logs all tool executions to a local log file for debugging and auditing.
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
- **Debugging** - Trace issues by reviewing tool invocation history
|
|
16
|
+
- **Auditing** - Track what actions were taken during a session
|
|
17
|
+
- **Learning** - Analyze patterns in tool usage over time
|
|
18
|
+
|
|
19
|
+
## Log Format
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
[2024-01-15T10:30:00.000Z] TOOL_EXEC
|
|
23
|
+
tool: sdd-requirements
|
|
24
|
+
feature: user-authentication
|
|
25
|
+
duration: 1250ms
|
|
26
|
+
status: success
|
|
27
|
+
output_files:
|
|
28
|
+
- .spec/specs/user-authentication/requirements.md
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Log Location
|
|
32
|
+
|
|
33
|
+
Logs are written to:
|
|
34
|
+
- Default: `.sdd/logs/tool-execution.log`
|
|
35
|
+
- Configurable via `SDD_LOG_PATH` environment variable
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
# In .sdd/config.yaml
|
|
41
|
+
hooks:
|
|
42
|
+
log-tool-execution:
|
|
43
|
+
enabled: true
|
|
44
|
+
log_level: info # debug, info, warn, error
|
|
45
|
+
max_log_size: 10MB
|
|
46
|
+
retain_days: 30
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Note
|
|
50
|
+
|
|
51
|
+
This hook is disabled by default to avoid unnecessary disk I/O during normal development. Enable it when debugging or for compliance requirements.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: update-spec-status
|
|
3
|
+
description: Automatically updates spec.json status after SDD tool completion
|
|
4
|
+
event: post-tool-use
|
|
5
|
+
priority: 100
|
|
6
|
+
enabled: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Update Spec Status Hook
|
|
10
|
+
|
|
11
|
+
This hook automatically updates the spec.json file after SDD workflow tools complete successfully.
|
|
12
|
+
|
|
13
|
+
## Trigger Conditions
|
|
14
|
+
|
|
15
|
+
Triggered after these tools complete successfully:
|
|
16
|
+
- `sdd-init` - Sets status to "initialized"
|
|
17
|
+
- `sdd-requirements` - Sets requirements phase to "generated"
|
|
18
|
+
- `sdd-approve requirements` - Sets requirements phase to "approved"
|
|
19
|
+
- `sdd-design` - Sets design phase to "generated"
|
|
20
|
+
- `sdd-approve design` - Sets design phase to "approved"
|
|
21
|
+
- `sdd-tasks` - Sets tasks phase to "generated"
|
|
22
|
+
- `sdd-approve tasks` - Sets tasks phase to "approved"
|
|
23
|
+
- `sdd-implement` - Updates task completion status
|
|
24
|
+
|
|
25
|
+
## Status Updates
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"workflow_status": {
|
|
30
|
+
"current_phase": "design",
|
|
31
|
+
"phases": {
|
|
32
|
+
"requirements": {
|
|
33
|
+
"status": "approved",
|
|
34
|
+
"completed_at": "2024-01-15T10:30:00Z"
|
|
35
|
+
},
|
|
36
|
+
"design": {
|
|
37
|
+
"status": "in_progress",
|
|
38
|
+
"started_at": "2024-01-15T11:00:00Z"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Benefits
|
|
46
|
+
|
|
47
|
+
1. **Audit Trail** - Track when each phase was completed
|
|
48
|
+
2. **Workflow Validation** - Enable pre-tool-use hooks to validate phase order
|
|
49
|
+
3. **Progress Visibility** - Show current workflow status in sdd-status
|
|
50
|
+
4. **Automation** - Enable CI/CD integration based on spec status
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: check-test-coverage
|
|
3
|
+
description: Reminds developers to write tests first when implementing features
|
|
4
|
+
event: pre-tool-use
|
|
5
|
+
priority: 90
|
|
6
|
+
enabled: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Check Test Coverage Hook
|
|
10
|
+
|
|
11
|
+
This hook promotes TDD by reminding developers to write tests before implementation.
|
|
12
|
+
|
|
13
|
+
## Trigger Conditions
|
|
14
|
+
|
|
15
|
+
Triggered before code modification tools:
|
|
16
|
+
- File writes to `src/**/*.ts` (excluding test files)
|
|
17
|
+
- Code generation requests
|
|
18
|
+
- Implementation-related tool calls
|
|
19
|
+
|
|
20
|
+
## Validation Logic
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
IF modifying source file (not test file) THEN
|
|
24
|
+
CHECK if corresponding test file exists
|
|
25
|
+
IF no test file THEN
|
|
26
|
+
WARN about TDD best practice
|
|
27
|
+
SUGGEST creating test file first
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example Prompt
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
🧪 TDD Reminder
|
|
34
|
+
|
|
35
|
+
You're about to modify 'src/services/UserService.ts' but no
|
|
36
|
+
corresponding test file was found.
|
|
37
|
+
|
|
38
|
+
Consider creating 'src/__tests__/services/UserService.test.ts'
|
|
39
|
+
first and writing failing tests for the expected behavior.
|
|
40
|
+
|
|
41
|
+
TDD Flow:
|
|
42
|
+
1. Write failing test (Red)
|
|
43
|
+
2. Implement code to pass test (Green)
|
|
44
|
+
3. Refactor for quality (Refactor)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Configuration
|
|
48
|
+
|
|
49
|
+
This hook can be configured via environment variables:
|
|
50
|
+
- `SDD_TDD_STRICT=true` - Block modifications without tests
|
|
51
|
+
- `SDD_TDD_REMINDER=true` - Show reminder but allow proceeding (default)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: validate-sdd-workflow
|
|
3
|
+
description: Validates that SDD workflow phases are followed in correct order
|
|
4
|
+
event: pre-tool-use
|
|
5
|
+
priority: 100
|
|
6
|
+
enabled: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Validate SDD Workflow Hook
|
|
10
|
+
|
|
11
|
+
This hook validates that the SDD workflow phases are being followed correctly before tool invocation.
|
|
12
|
+
|
|
13
|
+
## Trigger Conditions
|
|
14
|
+
|
|
15
|
+
Triggered before these tools are invoked:
|
|
16
|
+
- `sdd-design` (requires `sdd-requirements` to be completed first)
|
|
17
|
+
- `sdd-tasks` (requires `sdd-design` to be completed first)
|
|
18
|
+
- `sdd-implement` (requires `sdd-tasks` to be completed first)
|
|
19
|
+
|
|
20
|
+
## Validation Logic
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
IF tool == 'sdd-design' THEN
|
|
24
|
+
CHECK that requirements.md exists and is approved
|
|
25
|
+
CHECK that spec.json shows requirements phase completed
|
|
26
|
+
|
|
27
|
+
IF tool == 'sdd-tasks' THEN
|
|
28
|
+
CHECK that design.md exists and is approved
|
|
29
|
+
CHECK that spec.json shows design phase completed
|
|
30
|
+
|
|
31
|
+
IF tool == 'sdd-implement' THEN
|
|
32
|
+
CHECK that tasks.md exists
|
|
33
|
+
CHECK that spec.json shows tasks phase completed
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## On Validation Failure
|
|
37
|
+
|
|
38
|
+
If validation fails:
|
|
39
|
+
1. Display warning message explaining which phase is missing
|
|
40
|
+
2. Suggest running the correct phase first
|
|
41
|
+
3. Allow override with explicit `--skip-validation` flag
|
|
42
|
+
|
|
43
|
+
## Example Warning
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
⚠️ SDD Workflow Violation
|
|
47
|
+
|
|
48
|
+
You're attempting to run 'sdd-design' but the requirements phase
|
|
49
|
+
has not been completed yet.
|
|
50
|
+
|
|
51
|
+
Please run 'sdd-requirements' first to generate the requirements
|
|
52
|
+
document, then have it reviewed and approved before proceeding.
|
|
53
|
+
|
|
54
|
+
To skip this check: sdd-design --skip-validation
|
|
55
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: remind-uncommitted-changes
|
|
3
|
+
description: Reminds developer of uncommitted changes before ending session
|
|
4
|
+
event: session-end
|
|
5
|
+
priority: 90
|
|
6
|
+
enabled: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Remind Uncommitted Changes Hook
|
|
10
|
+
|
|
11
|
+
This hook checks for uncommitted changes and reminds the developer before the session ends.
|
|
12
|
+
|
|
13
|
+
## Actions
|
|
14
|
+
|
|
15
|
+
1. **Check Git Status**
|
|
16
|
+
- Detect uncommitted changes
|
|
17
|
+
- Identify untracked files
|
|
18
|
+
- Check for stashed changes
|
|
19
|
+
|
|
20
|
+
2. **Display Warning**
|
|
21
|
+
```
|
|
22
|
+
⚠️ Uncommitted Changes Detected
|
|
23
|
+
|
|
24
|
+
You have changes that haven't been committed:
|
|
25
|
+
|
|
26
|
+
Modified:
|
|
27
|
+
• src/hooks/HookLoader.ts
|
|
28
|
+
• src/__tests__/hooks/HookLoader.test.ts
|
|
29
|
+
|
|
30
|
+
Untracked:
|
|
31
|
+
• hooks/pre-tool-use/validate-sdd-workflow.md
|
|
32
|
+
|
|
33
|
+
Consider committing your changes before ending the session.
|
|
34
|
+
Run: /sdd-commit to create a commit with proper message
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
3. **Suggest Actions**
|
|
38
|
+
- Offer to run commit command
|
|
39
|
+
- Show diff summary
|
|
40
|
+
- Remind about push to remote
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
|
|
44
|
+
```yaml
|
|
45
|
+
# In .sdd/config.yaml
|
|
46
|
+
hooks:
|
|
47
|
+
remind-uncommitted-changes:
|
|
48
|
+
enabled: true
|
|
49
|
+
include_untracked: true
|
|
50
|
+
warn_large_diff: true
|
|
51
|
+
large_diff_threshold: 500 # lines
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Benefits
|
|
55
|
+
|
|
56
|
+
- **Prevent Lost Work** - Don't lose changes between sessions
|
|
57
|
+
- **Clean State** - End sessions with clean working directory
|
|
58
|
+
- **Team Sync** - Remind to push for team visibility
|