@daniel-da-silva-alves/sddk 2.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/CHANGELOG.md +27 -0
- package/LICENSE +21 -0
- package/README.md +260 -0
- package/bin/cli.js +430 -0
- package/package.json +49 -0
- package/sddk/plugin.json +12 -0
- package/sddk/skills/code-review/SKILL.md +185 -0
- package/sddk/skills/code-review/references/anti-ai-design-patterns.md +185 -0
- package/sddk/skills/code-review/references/refactoring-severity-guide.md +96 -0
- package/sddk/skills/code-review/references/security-checklist.md +131 -0
- package/sddk/skills/fullstack-development/SKILL.md +128 -0
- package/sddk/skills/fullstack-development/references/clean-code-rules.md +146 -0
- package/sddk/skills/fullstack-development/references/self-review-checklist.md +64 -0
- package/sddk/skills/implementation-planning/SKILL.md +102 -0
- package/sddk/skills/implementation-planning/references/manual-tests-template.md +95 -0
- package/sddk/skills/implementation-planning/references/microtask-template.md +66 -0
- package/sddk/skills/software-requirements-specification/SKILL.md +80 -0
- package/sddk/skills/software-requirements-specification/references/checklist-template.md +65 -0
- package/sddk/skills/software-requirements-specification/references/ieee-830-template.md +151 -0
- package/sddk/skills/software-requirements-specification/references/socratic-interview-guide.md +96 -0
- package/sddk/skills/system-design-document/SKILL.md +164 -0
- package/sddk/skills/system-design-document/references/architecture-patterns.md +105 -0
- package/sddk/skills/system-design-document/references/documentation-sources-guide.md +126 -0
- package/sddk/skills/system-design-document/references/sdd-template.md +259 -0
- package/sddk/skills/system-design-document/references/standards-api-template.md +128 -0
- package/sddk/skills/system-design-document/references/standards-architecture-template.md +76 -0
- package/sddk/skills/system-design-document/references/standards-coding-template.md +114 -0
- package/sddk/skills/system-design-document/references/standards-design-system-template.md +137 -0
- package/sddk/skills/system-design-document/references/standards-naming-template.md +96 -0
- package/sddk/skills/system-design-document/references/standards-onboarding-guide.md +119 -0
- package/sddk/skills/system-design-document/references/tech-stack-analysis.md +84 -0
package/bin/cli.js
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SDDK CLI — Spec-Driven Development Kit Installer
|
|
5
|
+
*
|
|
6
|
+
* Installs the SDDK plugin for AI coding agents (Gemini, Claude, etc.)
|
|
7
|
+
* into the appropriate plugin directory.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* sddk install [--global] Install the plugin
|
|
11
|
+
* sddk uninstall [--global] Remove the plugin
|
|
12
|
+
* sddk --version Show version
|
|
13
|
+
* sddk --help Show help
|
|
14
|
+
*
|
|
15
|
+
* Zero dependencies — uses only Node.js built-in modules.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
"use strict";
|
|
19
|
+
|
|
20
|
+
const fs = require("fs");
|
|
21
|
+
const path = require("path");
|
|
22
|
+
const os = require("os");
|
|
23
|
+
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Constants
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
const PACKAGE = require(path.join(__dirname, "..", "package.json"));
|
|
29
|
+
const VERSION = PACKAGE.version;
|
|
30
|
+
const PLUGIN_SOURCE = path.join(__dirname, "..", "sddk");
|
|
31
|
+
const PLUGIN_DIR_NAME = "sddk";
|
|
32
|
+
|
|
33
|
+
// Target directories for plugin installation
|
|
34
|
+
const GLOBAL_PLUGIN_DIR = path.join(
|
|
35
|
+
os.homedir(),
|
|
36
|
+
".gemini",
|
|
37
|
+
"config",
|
|
38
|
+
"plugins",
|
|
39
|
+
PLUGIN_DIR_NAME
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const LOCAL_PLUGIN_DIR = path.join(
|
|
43
|
+
process.cwd(),
|
|
44
|
+
".gemini",
|
|
45
|
+
"plugins",
|
|
46
|
+
PLUGIN_DIR_NAME
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// ANSI color helpers (works on all modern terminals)
|
|
50
|
+
const color = {
|
|
51
|
+
reset: "\x1b[0m",
|
|
52
|
+
bold: "\x1b[1m",
|
|
53
|
+
dim: "\x1b[2m",
|
|
54
|
+
green: "\x1b[32m",
|
|
55
|
+
yellow: "\x1b[33m",
|
|
56
|
+
blue: "\x1b[34m",
|
|
57
|
+
magenta: "\x1b[35m",
|
|
58
|
+
cyan: "\x1b[36m",
|
|
59
|
+
red: "\x1b[31m",
|
|
60
|
+
white: "\x1b[37m",
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// Utility Functions
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
function log(message) {
|
|
68
|
+
console.log(message);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function logSuccess(message) {
|
|
72
|
+
log(`${color.green}✔${color.reset} ${message}`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function logError(message) {
|
|
76
|
+
log(`${color.red}✖${color.reset} ${message}`);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function logInfo(message) {
|
|
80
|
+
log(`${color.cyan}ℹ${color.reset} ${message}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function logStep(message) {
|
|
84
|
+
log(`${color.blue}→${color.reset} ${message}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Recursively copies a directory from src to dest.
|
|
89
|
+
* Creates dest and any intermediate directories as needed.
|
|
90
|
+
*/
|
|
91
|
+
function copyDirRecursive(src, dest) {
|
|
92
|
+
if (!fs.existsSync(src)) {
|
|
93
|
+
throw new Error(`Source directory not found: ${src}`);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
97
|
+
|
|
98
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
99
|
+
|
|
100
|
+
for (const entry of entries) {
|
|
101
|
+
const srcPath = path.join(src, entry.name);
|
|
102
|
+
const destPath = path.join(dest, entry.name);
|
|
103
|
+
|
|
104
|
+
if (entry.isDirectory()) {
|
|
105
|
+
copyDirRecursive(srcPath, destPath);
|
|
106
|
+
} else {
|
|
107
|
+
fs.copyFileSync(srcPath, destPath);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Recursively removes a directory.
|
|
114
|
+
*/
|
|
115
|
+
function removeDirRecursive(dirPath) {
|
|
116
|
+
if (fs.existsSync(dirPath)) {
|
|
117
|
+
fs.rmSync(dirPath, { recursive: true, force: true });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Counts files recursively in a directory.
|
|
123
|
+
*/
|
|
124
|
+
function countFiles(dirPath) {
|
|
125
|
+
let count = 0;
|
|
126
|
+
if (!fs.existsSync(dirPath)) return 0;
|
|
127
|
+
|
|
128
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
129
|
+
for (const entry of entries) {
|
|
130
|
+
if (entry.isDirectory()) {
|
|
131
|
+
count += countFiles(path.join(dirPath, entry.name));
|
|
132
|
+
} else {
|
|
133
|
+
count++;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return count;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ---------------------------------------------------------------------------
|
|
140
|
+
// Commands
|
|
141
|
+
// ---------------------------------------------------------------------------
|
|
142
|
+
|
|
143
|
+
function showHelp() {
|
|
144
|
+
log("");
|
|
145
|
+
log(
|
|
146
|
+
`${color.bold}${color.magenta} SDDK${color.reset} ${color.dim}— Spec-Driven Development Kit${color.reset}`
|
|
147
|
+
);
|
|
148
|
+
log(
|
|
149
|
+
`${color.dim} An AI agent plugin for disciplined software engineering${color.reset}`
|
|
150
|
+
);
|
|
151
|
+
log("");
|
|
152
|
+
log(`${color.bold} USAGE${color.reset}`);
|
|
153
|
+
log("");
|
|
154
|
+
log(
|
|
155
|
+
` ${color.cyan}sddk install${color.reset} Install plugin in current project`
|
|
156
|
+
);
|
|
157
|
+
log(
|
|
158
|
+
` ${color.cyan}sddk install --global${color.reset} Install plugin globally (all projects)`
|
|
159
|
+
);
|
|
160
|
+
log(
|
|
161
|
+
` ${color.cyan}sddk uninstall${color.reset} Remove plugin from current project`
|
|
162
|
+
);
|
|
163
|
+
log(
|
|
164
|
+
` ${color.cyan}sddk uninstall --global${color.reset} Remove plugin globally`
|
|
165
|
+
);
|
|
166
|
+
log(
|
|
167
|
+
` ${color.cyan}sddk status${color.reset} Check installation status`
|
|
168
|
+
);
|
|
169
|
+
log(` ${color.cyan}sddk --version${color.reset} Show version`);
|
|
170
|
+
log(` ${color.cyan}sddk --help${color.reset} Show this help`);
|
|
171
|
+
log("");
|
|
172
|
+
log(`${color.bold} EXAMPLES${color.reset}`);
|
|
173
|
+
log("");
|
|
174
|
+
log(
|
|
175
|
+
` ${color.dim}# Install globally via npm${color.reset}`
|
|
176
|
+
);
|
|
177
|
+
log(` ${color.white}npm install -g sddk${color.reset}`);
|
|
178
|
+
log(` ${color.white}sddk install --global${color.reset}`);
|
|
179
|
+
log("");
|
|
180
|
+
log(
|
|
181
|
+
` ${color.dim}# Install per-project via npx (no permanent install)${color.reset}`
|
|
182
|
+
);
|
|
183
|
+
log(` ${color.white}npx sddk install${color.reset}`);
|
|
184
|
+
log("");
|
|
185
|
+
log(
|
|
186
|
+
` ${color.dim}# Install per-project as devDependency${color.reset}`
|
|
187
|
+
);
|
|
188
|
+
log(` ${color.white}npm install --save-dev sddk${color.reset}`);
|
|
189
|
+
log(` ${color.white}npx sddk install${color.reset}`);
|
|
190
|
+
log("");
|
|
191
|
+
log(`${color.bold} PLUGIN DIRECTORIES${color.reset}`);
|
|
192
|
+
log("");
|
|
193
|
+
log(
|
|
194
|
+
` ${color.dim}Global:${color.reset} ~/.gemini/config/plugins/sddk/`
|
|
195
|
+
);
|
|
196
|
+
log(
|
|
197
|
+
` ${color.dim}Per-project:${color.reset} ./.gemini/plugins/sddk/`
|
|
198
|
+
);
|
|
199
|
+
log("");
|
|
200
|
+
log(
|
|
201
|
+
` ${color.dim}v${VERSION} — https://github.com/Daniel-da-Silva-Alves/Spec-Driven-Development-Kit${color.reset}`
|
|
202
|
+
);
|
|
203
|
+
log("");
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function showVersion() {
|
|
207
|
+
log(VERSION);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function install(isGlobal) {
|
|
211
|
+
const targetDir = isGlobal ? GLOBAL_PLUGIN_DIR : LOCAL_PLUGIN_DIR;
|
|
212
|
+
const modeLabel = isGlobal ? "global" : "per-project";
|
|
213
|
+
|
|
214
|
+
log("");
|
|
215
|
+
log(
|
|
216
|
+
`${color.bold}${color.magenta} SDDK${color.reset} ${color.dim}v${VERSION}${color.reset}`
|
|
217
|
+
);
|
|
218
|
+
log("");
|
|
219
|
+
|
|
220
|
+
// Validate source exists
|
|
221
|
+
if (!fs.existsSync(PLUGIN_SOURCE)) {
|
|
222
|
+
logError(
|
|
223
|
+
`Plugin source directory not found: ${PLUGIN_SOURCE}`
|
|
224
|
+
);
|
|
225
|
+
logInfo(
|
|
226
|
+
"This usually means the npm package is corrupted. Try reinstalling:"
|
|
227
|
+
);
|
|
228
|
+
log(` npm install -g sddk`);
|
|
229
|
+
process.exit(1);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Check if already installed
|
|
233
|
+
if (fs.existsSync(targetDir)) {
|
|
234
|
+
logInfo(`Plugin already installed at: ${color.dim}${targetDir}${color.reset}`);
|
|
235
|
+
logStep("Updating to latest version...");
|
|
236
|
+
removeDirRecursive(targetDir);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Install
|
|
240
|
+
logStep(`Installing ${color.bold}${modeLabel}${color.reset}...`);
|
|
241
|
+
logStep(`Target: ${color.dim}${targetDir}${color.reset}`);
|
|
242
|
+
|
|
243
|
+
try {
|
|
244
|
+
copyDirRecursive(PLUGIN_SOURCE, targetDir);
|
|
245
|
+
const fileCount = countFiles(targetDir);
|
|
246
|
+
|
|
247
|
+
log("");
|
|
248
|
+
logSuccess(
|
|
249
|
+
`${color.bold}SDDK plugin installed successfully!${color.reset} (${fileCount} files)`
|
|
250
|
+
);
|
|
251
|
+
log("");
|
|
252
|
+
|
|
253
|
+
if (isGlobal) {
|
|
254
|
+
logInfo("The plugin is now available in ALL your projects.");
|
|
255
|
+
logInfo(
|
|
256
|
+
'Restart your IDE and ask your agent: "What skills do you have?"'
|
|
257
|
+
);
|
|
258
|
+
} else {
|
|
259
|
+
logInfo("The plugin is now available in THIS project only.");
|
|
260
|
+
logInfo(
|
|
261
|
+
`Installed to: ${color.dim}${path.relative(process.cwd(), targetDir)}${color.reset}`
|
|
262
|
+
);
|
|
263
|
+
logInfo(
|
|
264
|
+
'Restart your IDE and ask your agent: "What skills do you have?"'
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
log("");
|
|
269
|
+
log(
|
|
270
|
+
`${color.dim} Tip: Run ${color.cyan}sddk status${color.reset}${color.dim} to check your installation anytime.${color.reset}`
|
|
271
|
+
);
|
|
272
|
+
log("");
|
|
273
|
+
} catch (err) {
|
|
274
|
+
logError(`Installation failed: ${err.message}`);
|
|
275
|
+
process.exit(1);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function uninstall(isGlobal) {
|
|
280
|
+
const targetDir = isGlobal ? GLOBAL_PLUGIN_DIR : LOCAL_PLUGIN_DIR;
|
|
281
|
+
const modeLabel = isGlobal ? "global" : "per-project";
|
|
282
|
+
|
|
283
|
+
log("");
|
|
284
|
+
log(
|
|
285
|
+
`${color.bold}${color.magenta} SDDK${color.reset} ${color.dim}v${VERSION}${color.reset}`
|
|
286
|
+
);
|
|
287
|
+
log("");
|
|
288
|
+
|
|
289
|
+
if (!fs.existsSync(targetDir)) {
|
|
290
|
+
logInfo(
|
|
291
|
+
`No ${modeLabel} installation found at: ${color.dim}${targetDir}${color.reset}`
|
|
292
|
+
);
|
|
293
|
+
log("");
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
logStep(`Removing ${color.bold}${modeLabel}${color.reset} installation...`);
|
|
298
|
+
logStep(`Target: ${color.dim}${targetDir}${color.reset}`);
|
|
299
|
+
|
|
300
|
+
try {
|
|
301
|
+
removeDirRecursive(targetDir);
|
|
302
|
+
log("");
|
|
303
|
+
logSuccess(
|
|
304
|
+
`${color.bold}SDDK plugin removed successfully!${color.reset}`
|
|
305
|
+
);
|
|
306
|
+
logInfo("Restart your IDE for changes to take effect.");
|
|
307
|
+
log("");
|
|
308
|
+
} catch (err) {
|
|
309
|
+
logError(`Uninstall failed: ${err.message}`);
|
|
310
|
+
process.exit(1);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function status() {
|
|
315
|
+
log("");
|
|
316
|
+
log(
|
|
317
|
+
`${color.bold}${color.magenta} SDDK${color.reset} ${color.dim}v${VERSION}${color.reset}`
|
|
318
|
+
);
|
|
319
|
+
log("");
|
|
320
|
+
|
|
321
|
+
const globalExists = fs.existsSync(GLOBAL_PLUGIN_DIR);
|
|
322
|
+
const localExists = fs.existsSync(LOCAL_PLUGIN_DIR);
|
|
323
|
+
|
|
324
|
+
log(`${color.bold} Installation Status${color.reset}`);
|
|
325
|
+
log("");
|
|
326
|
+
|
|
327
|
+
// Global
|
|
328
|
+
if (globalExists) {
|
|
329
|
+
const fileCount = countFiles(GLOBAL_PLUGIN_DIR);
|
|
330
|
+
logSuccess(
|
|
331
|
+
`Global: ${color.green}installed${color.reset} (${fileCount} files)`
|
|
332
|
+
);
|
|
333
|
+
log(
|
|
334
|
+
` ${color.dim}${GLOBAL_PLUGIN_DIR}${color.reset}`
|
|
335
|
+
);
|
|
336
|
+
} else {
|
|
337
|
+
log(
|
|
338
|
+
`${color.dim}○${color.reset} Global: ${color.dim}not installed${color.reset}`
|
|
339
|
+
);
|
|
340
|
+
log(
|
|
341
|
+
` ${color.dim}${GLOBAL_PLUGIN_DIR}${color.reset}`
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
log("");
|
|
346
|
+
|
|
347
|
+
// Local
|
|
348
|
+
if (localExists) {
|
|
349
|
+
const fileCount = countFiles(LOCAL_PLUGIN_DIR);
|
|
350
|
+
logSuccess(
|
|
351
|
+
`Per-project: ${color.green}installed${color.reset} (${fileCount} files)`
|
|
352
|
+
);
|
|
353
|
+
log(
|
|
354
|
+
` ${color.dim}${LOCAL_PLUGIN_DIR}${color.reset}`
|
|
355
|
+
);
|
|
356
|
+
} else {
|
|
357
|
+
log(
|
|
358
|
+
`${color.dim}○${color.reset} Per-project: ${color.dim}not installed${color.reset}`
|
|
359
|
+
);
|
|
360
|
+
log(
|
|
361
|
+
` ${color.dim}${LOCAL_PLUGIN_DIR}${color.reset}`
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
log("");
|
|
366
|
+
|
|
367
|
+
if (!globalExists && !localExists) {
|
|
368
|
+
logInfo(
|
|
369
|
+
`Run ${color.cyan}sddk install${color.reset} or ${color.cyan}sddk install --global${color.reset} to get started.`
|
|
370
|
+
);
|
|
371
|
+
log("");
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// ---------------------------------------------------------------------------
|
|
376
|
+
// CLI Argument Parser
|
|
377
|
+
// ---------------------------------------------------------------------------
|
|
378
|
+
|
|
379
|
+
function main() {
|
|
380
|
+
const args = process.argv.slice(2);
|
|
381
|
+
|
|
382
|
+
// Flags
|
|
383
|
+
const hasGlobal = args.includes("--global") || args.includes("-g");
|
|
384
|
+
const hasVersion = args.includes("--version") || args.includes("-v");
|
|
385
|
+
const hasHelp =
|
|
386
|
+
args.includes("--help") || args.includes("-h") || args.length === 0;
|
|
387
|
+
|
|
388
|
+
// Get command (first non-flag argument)
|
|
389
|
+
const command = args.find((arg) => !arg.startsWith("-"));
|
|
390
|
+
|
|
391
|
+
// Handle flags first
|
|
392
|
+
if (hasVersion) {
|
|
393
|
+
showVersion();
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
if (!command && hasHelp) {
|
|
398
|
+
showHelp();
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Handle commands
|
|
403
|
+
switch (command) {
|
|
404
|
+
case "install":
|
|
405
|
+
install(hasGlobal);
|
|
406
|
+
break;
|
|
407
|
+
|
|
408
|
+
case "uninstall":
|
|
409
|
+
case "remove":
|
|
410
|
+
uninstall(hasGlobal);
|
|
411
|
+
break;
|
|
412
|
+
|
|
413
|
+
case "status":
|
|
414
|
+
status();
|
|
415
|
+
break;
|
|
416
|
+
|
|
417
|
+
case "help":
|
|
418
|
+
showHelp();
|
|
419
|
+
break;
|
|
420
|
+
|
|
421
|
+
default:
|
|
422
|
+
logError(`Unknown command: ${command}`);
|
|
423
|
+
log("");
|
|
424
|
+
log(`Run ${color.cyan}sddk --help${color.reset} for usage information.`);
|
|
425
|
+
log("");
|
|
426
|
+
process.exit(1);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@daniel-da-silva-alves/sddk",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Spec-Driven Development Kit — An AI agent plugin that enforces disciplined software engineering through a 5-stage specification-driven pipeline (SRS → SDD → Planning → Dev → Code Review).",
|
|
5
|
+
"author": "SDDK Contributors",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"ai-agent",
|
|
9
|
+
"plugin",
|
|
10
|
+
"spec-driven",
|
|
11
|
+
"software-engineering",
|
|
12
|
+
"gemini",
|
|
13
|
+
"claude",
|
|
14
|
+
"srs",
|
|
15
|
+
"sdd",
|
|
16
|
+
"code-review",
|
|
17
|
+
"requirements",
|
|
18
|
+
"architecture",
|
|
19
|
+
"ieee-830",
|
|
20
|
+
"development-pipeline",
|
|
21
|
+
"ai-coding",
|
|
22
|
+
"specification"
|
|
23
|
+
],
|
|
24
|
+
"bin": {
|
|
25
|
+
"sddk": "./bin/cli.js"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"bin/",
|
|
29
|
+
"sddk/",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"CHANGELOG.md"
|
|
33
|
+
],
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/Daniel-da-Silva-Alves/Spec-Driven-Development-Kit.git"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/Daniel-da-Silva-Alves/Spec-Driven-Development-Kit#readme",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/Daniel-da-Silva-Alves/Spec-Driven-Development-Kit/issues"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"test": "node bin/cli.js --version",
|
|
47
|
+
"validate": "node -e \"const p = require('./package.json'); console.log(p.name + '@' + p.version + ' ✓');\""
|
|
48
|
+
}
|
|
49
|
+
}
|
package/sddk/plugin.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "spec-driven-development-kit",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Spec-Driven Development Kit (SDDK) — Plugin com pipeline sequencial de 5 skills para desenvolvimento orientado por especificacao. Conduz o agente por: Especificacao de Requisitos (SRS) -> System Design Document (SDD) -> Planejamento de Implementacao -> Desenvolvimento Fullstack -> Code Review, garantindo qualidade e rastreabilidade em cada etapa.",
|
|
5
|
+
"skills": [
|
|
6
|
+
"skills/software-requirements-specification",
|
|
7
|
+
"skills/system-design-document",
|
|
8
|
+
"skills/implementation-planning",
|
|
9
|
+
"skills/fullstack-development",
|
|
10
|
+
"skills/code-review"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: "Code review final com auditoria de qualidade, segurança e anti-design de IA. ATIVE esta skill quando o usuário mencionar: code review, revisão de código, review, auditar código, verificar qualidade, checar segurança, revisar implementação. Também acione quando o agente completar a skill de Desenvolvimento e o usuário confirmar a transição para o Code Review."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill de Code Review
|
|
7
|
+
|
|
8
|
+
## Identidade
|
|
9
|
+
|
|
10
|
+
Você é um **Code Reviewer Sênior e Security Auditor** com foco em qualidade de código, segurança, componentização, e detecção de padrões de "código gerado por IA".
|
|
11
|
+
|
|
12
|
+
## Contexto do Pipeline
|
|
13
|
+
|
|
14
|
+
Esta é a **Skill 5 de 5** do pipeline Spec-Driven Development (SDD):
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
1. SRS ✅ → 2. SDD ✅ → 3. Planejamento ✅ → 4. Dev ✅ → ► [5. CodeReview]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
> [!IMPORTANT]
|
|
21
|
+
> O Desenvolvimento DEVE ter sido concluído antes desta skill. Todas as microtasks do Task artifact devem estar marcadas como `[x]`.
|
|
22
|
+
|
|
23
|
+
## Pré-condição
|
|
24
|
+
|
|
25
|
+
Antes de iniciar, verificar:
|
|
26
|
+
- `.specs/features/{feature-name}/srs.md` — existe
|
|
27
|
+
- `.specs/features/{feature-name}/sdd.md` — existe
|
|
28
|
+
- `.specs/features/{feature-name}/manual-tests.md` — existe
|
|
29
|
+
- Task artifact — todas as microtasks estão `[x]`
|
|
30
|
+
|
|
31
|
+
## Regras Obrigatórias
|
|
32
|
+
|
|
33
|
+
1. **SEMPRE revisar todos os arquivos** criados/modificados durante o desenvolvimento
|
|
34
|
+
2. **SEMPRE comparar com o SDD** — o código deve refletir exatamente o design especificado
|
|
35
|
+
3. **SEMPRE classificar problemas por severidade** — Crítica, Média, Baixa
|
|
36
|
+
4. **SEMPRE executar refatorações críticas imediatamente** — não deixar para backlog
|
|
37
|
+
5. **SEMPRE documentar refatorações não-críticas** no `refactoring-backlog.md`
|
|
38
|
+
6. **NUNCA aprovar código com issues de segurança** — segurança é sempre crítica
|
|
39
|
+
|
|
40
|
+
## Fluxo de Execução
|
|
41
|
+
|
|
42
|
+
### Fase 1: Preparação
|
|
43
|
+
|
|
44
|
+
1. **Ler o SDD.md** para ter como referência de design
|
|
45
|
+
2. **Ler TODOS os standards** do projeto em `.specs/standards/` — architecture, naming, design-system, api, coding
|
|
46
|
+
3. **Listar todos os arquivos** criados/modificados (extrair da lista de microtasks do Task)
|
|
47
|
+
4. **Ler cada arquivo** para revisão
|
|
48
|
+
|
|
49
|
+
### Fase 2: Revisão Sistemática
|
|
50
|
+
|
|
51
|
+
Para cada arquivo, aplicar as 6 categorias de revisão:
|
|
52
|
+
|
|
53
|
+
#### Categoria 1: Qualidade de Código
|
|
54
|
+
Leia `references/anti-ai-design-patterns.md` para os 8 padrões a detectar.
|
|
55
|
+
|
|
56
|
+
- [ ] Clean code e legibilidade
|
|
57
|
+
- [ ] Naming conventions consistentes com a stack
|
|
58
|
+
- [ ] Sem nomes genéricos (`data`, `handleClick`, `temp`, `result`)
|
|
59
|
+
- [ ] Sem comentários que explicam o óbvio
|
|
60
|
+
- [ ] Sem código boilerplate repetitivo (deveria ter abstrações)
|
|
61
|
+
- [ ] Componentes granulares com responsabilidade única (não monolíticos)
|
|
62
|
+
- [ ] Sem emojis em textos de interface
|
|
63
|
+
- [ ] Sem CSS/Tailwind genérico (deve usar design tokens)
|
|
64
|
+
- [ ] Sem textos placeholder genéricos
|
|
65
|
+
- [ ] Sem UI com aparência "tutorial de YouTube"
|
|
66
|
+
|
|
67
|
+
#### Categoria 2: Segurança
|
|
68
|
+
Leia `references/security-checklist.md` para o checklist completo.
|
|
69
|
+
|
|
70
|
+
- [ ] Inputs validados e sanitizados
|
|
71
|
+
- [ ] Sem vulnerabilidades de injeção (SQL, XSS, command injection)
|
|
72
|
+
- [ ] Autenticação e autorização corretas
|
|
73
|
+
- [ ] Dados sensíveis protegidos (não expostos em logs, responses, ou client-side)
|
|
74
|
+
- [ ] CORS configurado adequadamente
|
|
75
|
+
- [ ] Sem secrets/tokens hardcoded no código
|
|
76
|
+
|
|
77
|
+
#### Categoria 3: Aderência ao SDD
|
|
78
|
+
- [ ] Arquitetura segue as camadas definidas
|
|
79
|
+
- [ ] Modelo de dados corresponde ao schema
|
|
80
|
+
- [ ] Endpoints seguem o design de API
|
|
81
|
+
- [ ] Componentes de UI seguem a componentização planejada
|
|
82
|
+
- [ ] Design tokens são usados consistentemente
|
|
83
|
+
|
|
84
|
+
#### Categoria 4: Componentização e Design System
|
|
85
|
+
- [ ] Componentes reutilizáveis estão em diretório compartilhado
|
|
86
|
+
- [ ] Design tokens (cores, espaçamentos, tipografia) são consistentes
|
|
87
|
+
- [ ] Não há estilos inline desnecessários
|
|
88
|
+
- [ ] Responsividade está implementada conforme SDD
|
|
89
|
+
|
|
90
|
+
#### Categoria 5: Uso Correto de APIs e Documentação
|
|
91
|
+
Consultar a seção 10 do SDD para validar:
|
|
92
|
+
|
|
93
|
+
- [ ] APIs de tecnologias usadas correspondem à versão da stack (ex: não usar API depreciada)
|
|
94
|
+
- [ ] Patterns utilizados são os recomendados pela doc oficial da versão atual
|
|
95
|
+
- [ ] Import paths seguem a convenção da versão instalada
|
|
96
|
+
- [ ] Em caso de dúvida sobre uma API, consultar a documentação seguindo a hierarquia da seção 10 do SDD:
|
|
97
|
+
1. Docs local do projeto
|
|
98
|
+
2. MCP/Skill (se configurado)
|
|
99
|
+
3. URL oficial (`read_url_content`)
|
|
100
|
+
4. Web search como fallback (`search_web`)
|
|
101
|
+
|
|
102
|
+
#### Categoria 6: Conformidade com Standards do Projeto
|
|
103
|
+
Validar contra TODOS os arquivos em `.specs/standards/`:
|
|
104
|
+
|
|
105
|
+
- [ ] Arquitetura segue as camadas e regras de dependência de `architecture.md`
|
|
106
|
+
- [ ] Nomenclatura de variáveis, funções, classes segue `naming-conventions.md`
|
|
107
|
+
- [ ] Nomenclatura de tabelas, colunas e FKs segue `naming-conventions.md#banco-de-dados`
|
|
108
|
+
- [ ] Design tokens são usados consistentemente conforme `design-system.md` (se frontend)
|
|
109
|
+
- [ ] Endpoints e responses seguem `api-conventions.md` (se API)
|
|
110
|
+
- [ ] Boas práticas de `coding-standards.md` respeitadas (SSOT, DRY, error handling)
|
|
111
|
+
- [ ] Tratamento de erros segue a estratégia definida nos standards
|
|
112
|
+
|
|
113
|
+
> [!WARNING]
|
|
114
|
+
> Violação de standards do projeto é classificada como 🔴 Crítica se a regra estiver marcada como "NUNCA" no standard, ou 🟡 Média caso contrário.
|
|
115
|
+
|
|
116
|
+
### Fase 3: Classificação de Issues
|
|
117
|
+
|
|
118
|
+
Para cada problema encontrado, classificar usando o guia em `references/refactoring-severity-guide.md`:
|
|
119
|
+
|
|
120
|
+
| Severidade | Critério | Ação |
|
|
121
|
+
|:---|:---|:---|
|
|
122
|
+
| 🔴 **Crítica** | Segurança, bugs que quebram funcionalidade, violação grave do SDD | Executar imediatamente |
|
|
123
|
+
| 🟡 **Média** | Code smells, duplicação, naming inconsistente | Documentar no backlog |
|
|
124
|
+
| 🟢 **Baixa** | Melhorias estéticas, otimizações opcionais | Documentar no backlog |
|
|
125
|
+
|
|
126
|
+
### Fase 4: Execução de Refatorações Críticas
|
|
127
|
+
|
|
128
|
+
Para cada issue 🔴 Crítica:
|
|
129
|
+
|
|
130
|
+
1. Corrigir o código diretamente
|
|
131
|
+
2. Verificar que a correção não quebra outras partes
|
|
132
|
+
3. Documentar o que foi corrigido
|
|
133
|
+
|
|
134
|
+
> [!WARNING]
|
|
135
|
+
> Se as refatorações críticas forem extensas (mais de 5 correções), voltar para a Skill 4 (Dev) com uma lista de microtasks de correção.
|
|
136
|
+
|
|
137
|
+
### Fase 5: Documentação do Backlog
|
|
138
|
+
|
|
139
|
+
Gerar/atualizar `.specs/features/{feature-name}/refactoring-backlog.md` com issues 🟡 e 🟢:
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
# Refactoring Backlog — {Feature}
|
|
143
|
+
|
|
144
|
+
## Severidade Média 🟡
|
|
145
|
+
|
|
146
|
+
### RB-001: {Título}
|
|
147
|
+
- **Arquivo**: `{caminho}`
|
|
148
|
+
- **Linha**: {número}
|
|
149
|
+
- **Descrição**: {o que está errado}
|
|
150
|
+
- **Sugestão**: {como corrigir}
|
|
151
|
+
|
|
152
|
+
## Severidade Baixa 🟢
|
|
153
|
+
|
|
154
|
+
### RB-002: {Título}
|
|
155
|
+
- **Arquivo**: `{caminho}`
|
|
156
|
+
- **Linha**: {número}
|
|
157
|
+
- **Descrição**: {o que pode melhorar}
|
|
158
|
+
- **Sugestão**: {como melhorar}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Fase 6: Conclusão
|
|
162
|
+
|
|
163
|
+
1. Apresentar **relatório de revisão** ao usuário:
|
|
164
|
+
- Total de issues encontradas por severidade
|
|
165
|
+
- Issues críticas corrigidas
|
|
166
|
+
- Issues no backlog para futuro
|
|
167
|
+
2. Anunciar: "✅ Code Review concluído. Feature **{nome}** finalizada. {N} issues críticas corrigidas, {M} issues documentadas no backlog."
|
|
168
|
+
3. Lembrar o usuário: "Execute os testes manuais em `.specs/features/{feature-name}/manual-tests.md` para validar a implementação."
|
|
169
|
+
|
|
170
|
+
## Consulta de Documentação Técnica
|
|
171
|
+
|
|
172
|
+
Quando durante a revisão precisar validar se uma API ou padrão está correto para a versão da stack:
|
|
173
|
+
|
|
174
|
+
1. **Ler a seção 10 do SDD** — localizar a tabela de fontes de documentação
|
|
175
|
+
2. **Seguir a hierarquia** configurada (docs local → MCP/Skill → URL oficial → web search)
|
|
176
|
+
3. **Comparar** o código com a documentação da versão correta
|
|
177
|
+
4. **Classificar** como 🔴 Crítica se a API usada está depreciada ou é de outra versão
|
|
178
|
+
|
|
179
|
+
## Routing Table
|
|
180
|
+
|
|
181
|
+
### References
|
|
182
|
+
|
|
183
|
+
- Se precisar dos 8 padrões de anti-design de IA para detectar e rejeitar, leia `references/anti-ai-design-patterns.md`
|
|
184
|
+
- Se precisar do checklist de segurança para auditoria, leia `references/security-checklist.md`
|
|
185
|
+
- Se precisar do guia de classificação de severidade de refatorações, leia `references/refactoring-severity-guide.md`
|