@anhth2/spec-driven-dev-plugin 0.5.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/ARCHITECTURE.md +243 -0
- package/bin/build.js +230 -0
- package/bin/index.js +311 -0
- package/commands/debug.md +374 -0
- package/commands/debug.tmpl +77 -0
- package/commands/define-product.md +451 -0
- package/commands/define-product.tmpl +154 -0
- package/commands/fix-bug.md +379 -0
- package/commands/fix-bug.tmpl +82 -0
- package/commands/generate-bdd.md +591 -0
- package/commands/generate-bdd.tmpl +294 -0
- package/commands/generate-code.md +395 -0
- package/commands/generate-code.tmpl +98 -0
- package/commands/generate-prd.md +488 -0
- package/commands/generate-prd.tmpl +191 -0
- package/commands/generate-tech-docs.md +362 -0
- package/commands/generate-tech-docs.tmpl +65 -0
- package/commands/generate-tests.md +377 -0
- package/commands/generate-tests.tmpl +80 -0
- package/commands/refine-prd.md +408 -0
- package/commands/refine-prd.tmpl +111 -0
- package/commands/review-code.md +354 -0
- package/commands/review-code.tmpl +57 -0
- package/commands/review-context.md +646 -0
- package/commands/review-context.tmpl +349 -0
- package/commands/review-tech-docs.md +518 -0
- package/commands/review-tech-docs.tmpl +221 -0
- package/commands/run-tests.md +343 -0
- package/commands/run-tests.tmpl +46 -0
- package/commands/setup-ai-first.md +278 -0
- package/commands/setup-ai-first.tmpl +197 -0
- package/commands/smoke-test.md +366 -0
- package/commands/smoke-test.tmpl +69 -0
- package/commands/validate-traces.md +529 -0
- package/commands/validate-traces.tmpl +232 -0
- package/core/FRAMEWORK_VERSION +1 -0
- package/core/commands/debug.md +374 -0
- package/core/commands/define-product.md +451 -0
- package/core/commands/fix-bug.md +379 -0
- package/core/commands/generate-bdd.md +591 -0
- package/core/commands/generate-code.md +395 -0
- package/core/commands/generate-prd.md +488 -0
- package/core/commands/generate-tech-docs.md +362 -0
- package/core/commands/generate-tests.md +377 -0
- package/core/commands/refine-prd.md +408 -0
- package/core/commands/review-code.md +354 -0
- package/core/commands/review-context.md +646 -0
- package/core/commands/review-tech-docs.md +518 -0
- package/core/commands/run-tests.md +343 -0
- package/core/commands/setup-ai-first.md +278 -0
- package/core/commands/smoke-test.md +366 -0
- package/core/commands/validate-traces.md +529 -0
- package/core/hooks/data-guard.js +141 -0
- package/core/hooks/settings.json +18 -0
- package/core/modules/angular/architecture-snippets/component-patterns.md +187 -0
- package/core/modules/angular/module.yaml +6 -0
- package/core/modules/angular/stack-profile.yaml +38 -0
- package/core/modules/context-engineering/architecture-snippets/context-design.md +119 -0
- package/core/modules/context-engineering/module.yaml +9 -0
- package/core/modules/context-engineering/stack-profile.yaml +61 -0
- package/core/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
- package/core/modules/dotnet/module.yaml +6 -0
- package/core/modules/dotnet/stack-profile.yaml +50 -0
- package/core/modules/golang/architecture-snippets/domain-layout.md +283 -0
- package/core/modules/golang/module.yaml +6 -0
- package/core/modules/golang/stack-profile.yaml +40 -0
- package/core/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
- package/core/modules/java-spring/module.yaml +15 -0
- package/core/modules/java-spring/stack-profile.yaml +28 -0
- package/core/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
- package/core/modules/nextjs/module.yaml +14 -0
- package/core/modules/nextjs/stack-profile.yaml +74 -0
- package/core/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
- package/core/modules/php-laravel/module.yaml +15 -0
- package/core/modules/php-laravel/stack-profile.yaml +56 -0
- package/core/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
- package/core/modules/react/module.yaml +14 -0
- package/core/modules/react/stack-profile.yaml +63 -0
- package/core/rules/data-protection.md +80 -0
- package/core/rules/workflow.md +44 -0
- package/core/skills/code/SKILL.md +526 -0
- package/core/skills/debug/SKILL.md +584 -0
- package/core/skills/discovery/SKILL.md +363 -0
- package/core/skills/prd/SKILL.md +456 -0
- package/core/skills/setup-ai-first/SKILL.md +160 -0
- package/core/skills/spec/SKILL.md +361 -0
- package/core/skills/test/SKILL.md +862 -0
- package/core/steps/context-loader.md +163 -0
- package/core/steps/gate.md +81 -0
- package/core/steps/report-footer.md +53 -0
- package/core/steps/spawn-agent.md +123 -0
- package/core/templates/architecture.template.md +113 -0
- package/core/templates/feature.template +259 -0
- package/core/templates/platform-guide.template.md +145 -0
- package/core/templates/prd.template.md +312 -0
- package/core/templates/product-definition.template.md +168 -0
- package/core/templates/project-context.yaml +78 -0
- package/hooks/data-guard.js +141 -0
- package/hooks/settings.json +18 -0
- package/modules/angular/architecture-snippets/component-patterns.md +187 -0
- package/modules/angular/module.yaml +6 -0
- package/modules/angular/stack-profile.yaml +38 -0
- package/modules/context-engineering/architecture-snippets/context-design.md +119 -0
- package/modules/context-engineering/module.yaml +9 -0
- package/modules/context-engineering/stack-profile.yaml +61 -0
- package/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
- package/modules/dotnet/module.yaml +6 -0
- package/modules/dotnet/stack-profile.yaml +50 -0
- package/modules/golang/architecture-snippets/domain-layout.md +283 -0
- package/modules/golang/module.yaml +6 -0
- package/modules/golang/stack-profile.yaml +40 -0
- package/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
- package/modules/java-spring/module.yaml +15 -0
- package/modules/java-spring/stack-profile.yaml +28 -0
- package/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
- package/modules/nextjs/module.yaml +14 -0
- package/modules/nextjs/stack-profile.yaml +74 -0
- package/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
- package/modules/php-laravel/module.yaml +15 -0
- package/modules/php-laravel/stack-profile.yaml +56 -0
- package/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
- package/modules/react/module.yaml +14 -0
- package/modules/react/stack-profile.yaml +63 -0
- package/package.json +42 -0
- package/rules/data-protection.md +80 -0
- package/rules/workflow.md +44 -0
- package/scripts/init.sh +49 -0
- package/scripts/upgrade.sh +94 -0
- package/skills/code/SKILL.md +526 -0
- package/skills/code/SKILL.tmpl +176 -0
- package/skills/debug/SKILL.md +584 -0
- package/skills/debug/SKILL.tmpl +262 -0
- package/skills/discovery/SKILL.md +363 -0
- package/skills/discovery/SKILL.tmpl +147 -0
- package/skills/prd/SKILL.md +456 -0
- package/skills/prd/SKILL.tmpl +188 -0
- package/skills/setup-ai-first/SKILL.md +160 -0
- package/skills/setup-ai-first/SKILL.tmpl +107 -0
- package/skills/spec/SKILL.md +361 -0
- package/skills/spec/SKILL.tmpl +174 -0
- package/skills/test/SKILL.md +862 -0
- package/skills/test/SKILL.tmpl +296 -0
- package/steps/context-loader.md +163 -0
- package/steps/gate.md +81 -0
- package/steps/report-footer.md +53 -0
- package/steps/spawn-agent.md +123 -0
- package/templates/architecture.template.md +113 -0
- package/templates/feature.template +259 -0
- package/templates/platform-guide.template.md +145 -0
- package/templates/prd.template.md +312 -0
- package/templates/product-definition.template.md +168 -0
- package/templates/project-context.yaml +78 -0
package/bin/index.js
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
const ROOT = path.join(__dirname, '..');
|
|
8
|
+
|
|
9
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
|
|
10
|
+
const VERSION = pkg.version;
|
|
11
|
+
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const isInit = args.includes('--init');
|
|
14
|
+
const isProject = args.includes('--project');
|
|
15
|
+
const installHooks = args.includes('--hooks');
|
|
16
|
+
const showHelp = args.includes('--help') || args.includes('-h');
|
|
17
|
+
|
|
18
|
+
// --module <name> flag
|
|
19
|
+
const moduleIdx = args.indexOf('--module');
|
|
20
|
+
const moduleName = moduleIdx !== -1 ? args[moduleIdx + 1] : null;
|
|
21
|
+
|
|
22
|
+
const AVAILABLE_MODULES = [
|
|
23
|
+
'java-spring', 'angular', 'react', 'nextjs',
|
|
24
|
+
'dotnet', 'golang', 'php-laravel', 'context-engineering',
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
if (showHelp) {
|
|
28
|
+
console.log('Usage: npx @anhth2/spec-driven-dev [options]');
|
|
29
|
+
console.log('');
|
|
30
|
+
console.log('Install modes:');
|
|
31
|
+
console.log(' --init NEW: Install framework to .agent/ + create shortcuts in .claude/commands/');
|
|
32
|
+
console.log(' Recommended for new projects. Run upgrade.sh to upgrade later.');
|
|
33
|
+
console.log(' --project Install full commands to ./.claude/commands/ (project-scoped, legacy)');
|
|
34
|
+
console.log(' (no flag) Install full commands to ~/.claude/commands/ (global, legacy)');
|
|
35
|
+
console.log('');
|
|
36
|
+
console.log('Options:');
|
|
37
|
+
console.log(' --module <name> Copy stack module to .agent/modules/<name>/');
|
|
38
|
+
console.log(' --hooks Install data-guard hook to .claude/hooks/ + update .claude/settings.json');
|
|
39
|
+
console.log('');
|
|
40
|
+
console.log('Available modules:');
|
|
41
|
+
AVAILABLE_MODULES.forEach(m => console.log(` ${m}`));
|
|
42
|
+
console.log('');
|
|
43
|
+
console.log('Examples:');
|
|
44
|
+
console.log(' npx @anhth2/spec-driven-dev --init # new project setup');
|
|
45
|
+
console.log(' npx @anhth2/spec-driven-dev --init --module java-spring # with stack module');
|
|
46
|
+
console.log(' npx @anhth2/spec-driven-dev --project --hooks # legacy project install');
|
|
47
|
+
process.exit(0);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ── Step 1: Build .tmpl → .md ─────────────────────────────────────────────
|
|
51
|
+
const buildScript = path.join(__dirname, 'build.js');
|
|
52
|
+
if (fs.existsSync(buildScript)) {
|
|
53
|
+
try {
|
|
54
|
+
require(buildScript);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.error('Build step failed:', err.message);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ── --init mode: install to .agent/ + create .claude/commands/ shortcuts ─────
|
|
62
|
+
if (isInit) {
|
|
63
|
+
const coreDir = path.join(ROOT, 'core');
|
|
64
|
+
|
|
65
|
+
if (!fs.existsSync(coreDir)) {
|
|
66
|
+
console.error('');
|
|
67
|
+
console.error('❌ core/ directory not found.');
|
|
68
|
+
console.error(' The package may not have been built correctly.');
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const projectRoot = process.cwd();
|
|
73
|
+
const agentDir = path.join(projectRoot, '.agent');
|
|
74
|
+
const claudeCommandsDir = path.join(projectRoot, '.claude', 'commands');
|
|
75
|
+
const frameworkVersion = fs.readFileSync(path.join(coreDir, 'FRAMEWORK_VERSION'), 'utf8').trim();
|
|
76
|
+
|
|
77
|
+
console.log('');
|
|
78
|
+
console.log('╔══════════════════════════════════════════╗');
|
|
79
|
+
console.log('║ Spec-Driven Dev — Project Init ║');
|
|
80
|
+
console.log(`║ v${frameworkVersion} (Edupia Team) ║`);
|
|
81
|
+
console.log('╚══════════════════════════════════════════╝');
|
|
82
|
+
console.log('');
|
|
83
|
+
console.log(`Target : ${agentDir}`);
|
|
84
|
+
if (moduleName) console.log(`Module : ${moduleName}`);
|
|
85
|
+
console.log('');
|
|
86
|
+
|
|
87
|
+
// 1. Copy core/** → .agent/**
|
|
88
|
+
console.log('Installing framework files to .agent/ ...');
|
|
89
|
+
console.log('');
|
|
90
|
+
copyDirRecursive(coreDir, agentDir);
|
|
91
|
+
|
|
92
|
+
const agentSubdirs = fs.readdirSync(agentDir, { withFileTypes: true })
|
|
93
|
+
.filter(e => e.isDirectory())
|
|
94
|
+
.map(e => e.name);
|
|
95
|
+
for (const sub of agentSubdirs) {
|
|
96
|
+
console.log(` ✅ .agent/${sub}/`);
|
|
97
|
+
}
|
|
98
|
+
console.log(` ✅ .agent/FRAMEWORK_VERSION (v${frameworkVersion})`);
|
|
99
|
+
|
|
100
|
+
// 2. Create .claude/commands/ shortcuts that delegate to .agent/commands/
|
|
101
|
+
console.log('');
|
|
102
|
+
console.log('Creating .claude/commands/ shortcuts ...');
|
|
103
|
+
console.log('');
|
|
104
|
+
fs.mkdirSync(claudeCommandsDir, { recursive: true });
|
|
105
|
+
|
|
106
|
+
const agentCommandsDir = path.join(agentDir, 'commands');
|
|
107
|
+
const commandFiles = fs.readdirSync(agentCommandsDir).filter(f => f.endsWith('.md'));
|
|
108
|
+
const failedShortcuts = [];
|
|
109
|
+
|
|
110
|
+
for (const cmdFile of commandFiles) {
|
|
111
|
+
const cmdName = cmdFile.replace('.md', '');
|
|
112
|
+
const shortcut =
|
|
113
|
+
`# /${cmdName}\n` +
|
|
114
|
+
`\n` +
|
|
115
|
+
`Read the full command definition from \`.agent/commands/${cmdFile}\`` +
|
|
116
|
+
` and execute it with arguments: $ARGUMENTS\n`;
|
|
117
|
+
try {
|
|
118
|
+
fs.writeFileSync(path.join(claudeCommandsDir, cmdFile), shortcut, 'utf8');
|
|
119
|
+
console.log(` ✅ /${cmdName}`);
|
|
120
|
+
} catch {
|
|
121
|
+
console.log(` ❌ /${cmdName} (failed to write shortcut)`);
|
|
122
|
+
failedShortcuts.push(cmdName);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// 3. Install module (optional --module flag)
|
|
127
|
+
if (moduleName) {
|
|
128
|
+
console.log('');
|
|
129
|
+
if (!AVAILABLE_MODULES.includes(moduleName)) {
|
|
130
|
+
console.log(`⚠️ Unknown module: "${moduleName}"`);
|
|
131
|
+
console.log(` Available: ${AVAILABLE_MODULES.join(', ')}`);
|
|
132
|
+
} else {
|
|
133
|
+
const srcModuleDir = path.join(ROOT, 'modules', moduleName);
|
|
134
|
+
const destModuleDir = path.join(agentDir, 'modules', moduleName);
|
|
135
|
+
fs.mkdirSync(destModuleDir, { recursive: true });
|
|
136
|
+
copyDirRecursive(srcModuleDir, destModuleDir);
|
|
137
|
+
console.log(`✅ Module "${moduleName}" installed to: .agent/modules/${moduleName}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 4. Install data-guard hook (optional --hooks flag)
|
|
142
|
+
if (installHooks) {
|
|
143
|
+
console.log('');
|
|
144
|
+
installDataGuardHook();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// 5. Summary
|
|
148
|
+
console.log('');
|
|
149
|
+
if (failedShortcuts.length > 0) {
|
|
150
|
+
console.log(`⚠️ ${commandFiles.length - failedShortcuts.length}/${commandFiles.length} shortcuts created.`);
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
console.log(`✅ Framework v${frameworkVersion} installed!`);
|
|
154
|
+
console.log('');
|
|
155
|
+
console.log('Next steps:');
|
|
156
|
+
console.log(' 1. Open Claude Code and run /setup-ai-first');
|
|
157
|
+
console.log(' 2. Commit .agent/ to git so your whole team has the framework');
|
|
158
|
+
console.log('');
|
|
159
|
+
console.log('To upgrade later: bash scripts/upgrade.sh');
|
|
160
|
+
console.log(' (or: npx @anhth2/spec-driven-dev@latest --init)');
|
|
161
|
+
console.log('');
|
|
162
|
+
process.exit(0);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// ── Banner (legacy --project / global modes) ──────────────────────────────
|
|
166
|
+
const targetDir = isProject
|
|
167
|
+
? path.join(process.cwd(), '.claude', 'commands')
|
|
168
|
+
: path.join(os.homedir(), '.claude', 'commands');
|
|
169
|
+
|
|
170
|
+
const scope = isProject ? 'project' : 'global';
|
|
171
|
+
|
|
172
|
+
console.log('');
|
|
173
|
+
console.log('╔══════════════════════════════════════════╗');
|
|
174
|
+
console.log('║ Spec-Driven Dev — CLI Installer ║');
|
|
175
|
+
console.log(`║ v${VERSION} (Edupia Team) ║`);
|
|
176
|
+
console.log('╚══════════════════════════════════════════╝');
|
|
177
|
+
console.log('');
|
|
178
|
+
console.log(`Scope : ${scope}`);
|
|
179
|
+
console.log(`Target : ${targetDir}`);
|
|
180
|
+
if (moduleName) console.log(`Module : ${moduleName}`);
|
|
181
|
+
if (installHooks) console.log('Hooks : enabled');
|
|
182
|
+
console.log('');
|
|
183
|
+
|
|
184
|
+
// ── Step 2: Install commands ──────────────────────────────────────────────
|
|
185
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
186
|
+
|
|
187
|
+
const commandsDir = path.join(ROOT, 'commands');
|
|
188
|
+
const commands = fs.readdirSync(commandsDir).filter(f => f.endsWith('.md'));
|
|
189
|
+
const failed = [];
|
|
190
|
+
|
|
191
|
+
for (const cmd of commands) {
|
|
192
|
+
try {
|
|
193
|
+
fs.copyFileSync(path.join(commandsDir, cmd), path.join(targetDir, cmd));
|
|
194
|
+
console.log(` ✅ ${cmd.replace('.md', '')}`);
|
|
195
|
+
} catch {
|
|
196
|
+
console.log(` ❌ ${cmd.replace('.md', '')} (failed)`);
|
|
197
|
+
failed.push(cmd);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
console.log('');
|
|
202
|
+
|
|
203
|
+
if (failed.length > 0) {
|
|
204
|
+
console.log(`⚠️ Installed ${commands.length - failed.length}/${commands.length} commands. Failed: ${failed.join(', ')}`);
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
console.log(`✅ Installed ${commands.length}/${commands.length} commands to:`);
|
|
209
|
+
console.log(` ${targetDir}`);
|
|
210
|
+
|
|
211
|
+
// ── Step 3: Install module (optional) ─────────────────────────────────────
|
|
212
|
+
if (moduleName) {
|
|
213
|
+
console.log('');
|
|
214
|
+
if (!AVAILABLE_MODULES.includes(moduleName)) {
|
|
215
|
+
console.log(`⚠️ Unknown module: "${moduleName}"`);
|
|
216
|
+
console.log(` Available: ${AVAILABLE_MODULES.join(', ')}`);
|
|
217
|
+
process.exit(1);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const srcModuleDir = path.join(ROOT, 'modules', moduleName);
|
|
221
|
+
const destModuleDir = path.join(process.cwd(), '.agent', 'modules', moduleName);
|
|
222
|
+
|
|
223
|
+
fs.mkdirSync(destModuleDir, { recursive: true });
|
|
224
|
+
copyDirRecursive(srcModuleDir, destModuleDir);
|
|
225
|
+
|
|
226
|
+
console.log(`✅ Module "${moduleName}" installed to:`);
|
|
227
|
+
console.log(` ${destModuleDir}`);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// ── Step 4: Install data-guard hook (optional, --hooks flag) ──────────────
|
|
231
|
+
if (installHooks) {
|
|
232
|
+
console.log('');
|
|
233
|
+
installDataGuardHook();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// ── Summary ───────────────────────────────────────────────────────────────
|
|
237
|
+
console.log('');
|
|
238
|
+
console.log('Next steps:');
|
|
239
|
+
console.log(' 1. Open your project in Claude Code');
|
|
240
|
+
console.log(' 2. Type /setup-ai-first to initialize the workflow');
|
|
241
|
+
console.log(' 3. Type / to browse all available commands');
|
|
242
|
+
if (!moduleName) {
|
|
243
|
+
console.log('');
|
|
244
|
+
console.log(`Tip: re-run with --module <name> to install a stack profile.`);
|
|
245
|
+
console.log(` Available: ${AVAILABLE_MODULES.join(', ')}`);
|
|
246
|
+
}
|
|
247
|
+
if (!installHooks) {
|
|
248
|
+
console.log('');
|
|
249
|
+
console.log('Tip: re-run with --hooks to install data-guard hook (sensitive file protection).');
|
|
250
|
+
}
|
|
251
|
+
console.log('');
|
|
252
|
+
|
|
253
|
+
// ── Helpers ───────────────────────────────────────────────────────────────
|
|
254
|
+
|
|
255
|
+
function copyDirRecursive(src, dest) {
|
|
256
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
257
|
+
for (const entry of fs.readdirSync(src)) {
|
|
258
|
+
const srcPath = path.join(src, entry);
|
|
259
|
+
const destPath = path.join(dest, entry);
|
|
260
|
+
if (fs.statSync(srcPath).isDirectory()) {
|
|
261
|
+
copyDirRecursive(srcPath, destPath);
|
|
262
|
+
} else {
|
|
263
|
+
fs.copyFileSync(srcPath, destPath);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function installDataGuardHook() {
|
|
269
|
+
const projectRoot = process.cwd();
|
|
270
|
+
const hooksDir = path.join(projectRoot, '.claude', 'hooks');
|
|
271
|
+
const settingsPath = path.join(projectRoot, '.claude', 'settings.json');
|
|
272
|
+
|
|
273
|
+
// 1. Copy hook script
|
|
274
|
+
fs.mkdirSync(hooksDir, { recursive: true });
|
|
275
|
+
const srcHook = path.join(ROOT, 'hooks', 'data-guard.js');
|
|
276
|
+
const destHook = path.join(hooksDir, 'data-guard.js');
|
|
277
|
+
fs.copyFileSync(srcHook, destHook);
|
|
278
|
+
console.log(` ✅ Hook copied to: .claude/hooks/data-guard.js`);
|
|
279
|
+
|
|
280
|
+
// 2. Update .claude/settings.json
|
|
281
|
+
let settings = {};
|
|
282
|
+
if (fs.existsSync(settingsPath)) {
|
|
283
|
+
try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); } catch {}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Merge: add PreToolUse hook if not already present
|
|
287
|
+
if (!settings.hooks) settings.hooks = {};
|
|
288
|
+
if (!settings.hooks.PreToolUse) settings.hooks.PreToolUse = [];
|
|
289
|
+
|
|
290
|
+
const hookEntry = {
|
|
291
|
+
matcher: 'Read|Write|Edit|Bash',
|
|
292
|
+
hooks: [{ type: 'command', command: 'node .claude/hooks/data-guard.js' }],
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const alreadyRegistered = settings.hooks.PreToolUse.some(
|
|
296
|
+
h => h.hooks && h.hooks.some(hh => hh.command && hh.command.includes('data-guard.js'))
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
if (!alreadyRegistered) {
|
|
300
|
+
settings.hooks.PreToolUse.push(hookEntry);
|
|
301
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf8');
|
|
302
|
+
console.log(` ✅ Hook registered in: .claude/settings.json`);
|
|
303
|
+
} else {
|
|
304
|
+
console.log(` ℹ️ Hook already registered in .claude/settings.json`);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
console.log('');
|
|
308
|
+
console.log(' 🔒 Data guard active — AI will be blocked from reading:');
|
|
309
|
+
console.log(' .env*, *.key, *.pem, *secret*, *password*, *credential*');
|
|
310
|
+
console.log(' application-prod.*, appsettings.Production.json, ...');
|
|
311
|
+
}
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# /debug — Quick Debug Analysis
|
|
2
|
+
|
|
3
|
+
Use for: IDE errors, test failures, strange behavior, or "why does this code do X?"
|
|
4
|
+
Different from `/fix-bug`: analysis only, no full workflow, no ticket needed.
|
|
5
|
+
|
|
6
|
+
## Gate
|
|
7
|
+
# Gate — Universal Entry Procedure
|
|
8
|
+
|
|
9
|
+
Every command must execute this gate before proceeding with its specific logic.
|
|
10
|
+
|
|
11
|
+
## Step 0 — Sub-Agent Mode Check
|
|
12
|
+
|
|
13
|
+
Before anything else, check if `$ARGUMENTS` is a JSON payload from an orchestrator:
|
|
14
|
+
|
|
15
|
+
1. Attempt to parse `$ARGUMENTS` as JSON.
|
|
16
|
+
2. If it parses successfully **and** contains `"_agent_mode": true`:
|
|
17
|
+
- **Skip Steps 1, 2, and 3 of this Gate entirely.**
|
|
18
|
+
- Set target file = `payload.target_file`
|
|
19
|
+
- Set loaded context = `payload.context` (do NOT run context-loader.md)
|
|
20
|
+
- Set UC scope = `payload.uc_id` (process only this UC)
|
|
21
|
+
- Set line range = `payload.uc_section` (read only that PRD section)
|
|
22
|
+
- Proceed directly to the command-specific logic.
|
|
23
|
+
3. If `$ARGUMENTS` is not JSON or `_agent_mode` is absent → continue to Step 1 (normal mode).
|
|
24
|
+
|
|
25
|
+
## Step 0-B — Model Check
|
|
26
|
+
|
|
27
|
+
*Skip this step if `_agent_mode: true` (sub-agent — orchestrator already validated).*
|
|
28
|
+
|
|
29
|
+
Complex generation and review commands require strong reasoning.
|
|
30
|
+
Using a smaller model risks missed edge cases, incomplete spec analysis, and architecture violations.
|
|
31
|
+
|
|
32
|
+
Display and wait for response:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
⚙️ MODEL CHECK
|
|
36
|
+
──────────────────────────────────────────────────────────────────
|
|
37
|
+
Recommended : claude-opus-4-5 (or claude-opus-4)
|
|
38
|
+
Why needed : Spec analysis, architecture review, code generation
|
|
39
|
+
require deep reasoning. Smaller models miss edge cases.
|
|
40
|
+
|
|
41
|
+
To switch in Claude Code:
|
|
42
|
+
• Settings → Model → select "claude-opus"
|
|
43
|
+
• or: /model → choose claude-opus
|
|
44
|
+
|
|
45
|
+
Running on claude-opus?
|
|
46
|
+
Y — yes, on claude-opus → proceed
|
|
47
|
+
S — skip check (I accept lower quality risk with current model)
|
|
48
|
+
──────────────────────────────────────────────────────────────────
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- "Y" → proceed to Step 1.
|
|
52
|
+
- "S" → proceed to Step 1 (user accepts risk, add ⚠️ to final report).
|
|
53
|
+
- "N" or anything else → **STOP.** Output: "Please switch to claude-opus, then re-run this command."
|
|
54
|
+
|
|
55
|
+
## Step 1 — Resolve Target File
|
|
56
|
+
|
|
57
|
+
1. If `$ARGUMENTS` is provided and points to an existing file → use it directly as the target.
|
|
58
|
+
2. If `$ARGUMENTS` is a UC-ID, ticket ID, or partial name → search for matching files in the relevant directory.
|
|
59
|
+
3. If `$ARGUMENTS` is empty or no match found:
|
|
60
|
+
- List files in the relevant directory for this command (e.g., `specs/prd/**/*.md` for PRD commands, `specs/bdd/**/*.feature` for BDD commands).
|
|
61
|
+
- Present the list to the user and ask: "Which file do you want to work with? (Enter number or filename)"
|
|
62
|
+
- Wait for user selection before continuing.
|
|
63
|
+
|
|
64
|
+
## Step 2 — Execute Context Loader
|
|
65
|
+
|
|
66
|
+
Load all project context by following the procedure in `steps/context-loader.md`.
|
|
67
|
+
Store all loaded context in memory for use throughout this command session.
|
|
68
|
+
|
|
69
|
+
## Step 3 — CHECKPOINT
|
|
70
|
+
|
|
71
|
+
After completing Steps 1 and 2, display a summary and wait for confirmation:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
CHECKPOINT
|
|
75
|
+
-----------
|
|
76
|
+
Target : {resolved file path}
|
|
77
|
+
Project : {project.name from project-context.yaml}
|
|
78
|
+
Tech stack : {language} / {framework}
|
|
79
|
+
Module : {module if set, else "not configured"}
|
|
80
|
+
Domains : {comma-separated domain list}
|
|
81
|
+
|
|
82
|
+
Proceed? (Y/N)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Wait for explicit "Y" or "N" from the user before continuing.
|
|
86
|
+
- "Y" → proceed to the command-specific steps below.
|
|
87
|
+
- "N" → stop and ask what the user wants to change.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
*Note: For this command, the target in Step 1 is user-provided input (stack trace, test failure output, file path + description, or code question). No file discovery needed — go straight to context loading.*
|
|
91
|
+
|
|
92
|
+
## Context
|
|
93
|
+
# Context Loader — Load All Project Context
|
|
94
|
+
|
|
95
|
+
Execute these steps in order. Store everything in memory for the duration of the command session.
|
|
96
|
+
|
|
97
|
+
**Priority guide (anti-lost-in-middle):**
|
|
98
|
+
- Steps 1–2 are PROJECT-CONFIG — loaded first, resolve all paths and metadata.
|
|
99
|
+
- Step 3 is CRITICAL — architecture + coding standards, the highest-priority facts for generation.
|
|
100
|
+
- Step 4 is SAFETY — data protection rules, enforced silently for the entire session.
|
|
101
|
+
- Steps 5–6 are DOMAIN KNOWLEDGE — terminology and entity definitions.
|
|
102
|
+
- Step 7 is the WORKING MEMORY RECAP — locks critical facts into the top of working memory.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Step 1 — [PROJECT-CONFIG] Load project-context.yaml
|
|
107
|
+
|
|
108
|
+
Read `.agent/project-context.yaml`. Extract and store:
|
|
109
|
+
|
|
110
|
+
**Tech Stack:**
|
|
111
|
+
- `tech_stack.language` → active language (e.g., Java 17, TypeScript, C#, Go)
|
|
112
|
+
- `tech_stack.framework` → active framework (e.g., Spring Boot 3.2, Angular 17, .NET 8)
|
|
113
|
+
- `tech_stack.build_tool` → build tool (e.g., Maven, npm, dotnet, go)
|
|
114
|
+
- `tech_stack.test_framework` → test framework (e.g., JUnit 5 + Mockito, Jest, xUnit)
|
|
115
|
+
- `tech_stack.database` → database (e.g., PostgreSQL, MySQL, MongoDB)
|
|
116
|
+
- `tech_stack.module` → active module profile (e.g., java-spring, angular, dotnet, golang, context-engineering)
|
|
117
|
+
|
|
118
|
+
**Conventions:**
|
|
119
|
+
- `conventions.build_command` → how to compile/build
|
|
120
|
+
- `conventions.test_command` → how to run tests
|
|
121
|
+
- `conventions.service_run` → how to start the service
|
|
122
|
+
- `conventions.ticket_prefix` → ticket ID prefix (e.g., PROJ, FEAT, UC)
|
|
123
|
+
|
|
124
|
+
**Domains:**
|
|
125
|
+
- `domains` → list of active business domains
|
|
126
|
+
|
|
127
|
+
**Paths (if present):**
|
|
128
|
+
- `paths.specs_dir` → BDD specs root
|
|
129
|
+
- `paths.prd_dir` → PRD documents root
|
|
130
|
+
- `paths.refinement_dir` → findings/review output dir
|
|
131
|
+
- `paths.product_definitions_dir` → product definitions root
|
|
132
|
+
- `paths.domain_knowledge_dir` → domain knowledge root
|
|
133
|
+
- `paths.business_dictionary` → path to business-dictionary.md
|
|
134
|
+
- `paths.core_entities` → path to core-entities.md
|
|
135
|
+
- `paths.tech_docs_dir` → technical documentation root
|
|
136
|
+
- `paths.trace_dir` → trace state directory
|
|
137
|
+
|
|
138
|
+
If `paths` section is absent, use these defaults:
|
|
139
|
+
- `specs_dir` = `specs/bdd`
|
|
140
|
+
- `prd_dir` = `specs/prd`
|
|
141
|
+
- `refinement_dir` = `.agent/review`
|
|
142
|
+
- `product_definitions_dir` = `specs/product-definition`
|
|
143
|
+
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
144
|
+
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
145
|
+
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
146
|
+
- `tech_docs_dir` = `tech-docs`
|
|
147
|
+
- `trace_dir` = `.trace`
|
|
148
|
+
|
|
149
|
+
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
154
|
+
|
|
155
|
+
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
156
|
+
Merge framework-specific conventions (layer patterns, test patterns, naming rules) into the loaded context.
|
|
157
|
+
If the file does not exist → skip silently.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Step 3 — [CRITICAL] Load CLAUDE.md
|
|
162
|
+
|
|
163
|
+
*This is the highest-priority context — it defines HOW to write code and documents for this project.*
|
|
164
|
+
|
|
165
|
+
Read `CLAUDE.md`. Extract and store:
|
|
166
|
+
|
|
167
|
+
- **§1 Project Overview** → project name, language, framework, build/test commands, domains
|
|
168
|
+
- **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
|
|
169
|
+
- **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
|
|
170
|
+
- **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
|
|
171
|
+
- **§7 Git Conventions** → branch naming pattern, commit message format
|
|
172
|
+
|
|
173
|
+
If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Step 4 — [SAFETY] Load Data Protection Rules
|
|
178
|
+
|
|
179
|
+
Read `.agent/rules/data-protection.md` (or `rules/data-protection.md` from the framework installation).
|
|
180
|
+
|
|
181
|
+
Store the sensitive file patterns — you must **never** read, write, display, or reference content from files matching those patterns for the entire session.
|
|
182
|
+
|
|
183
|
+
If neither file exists → apply built-in defaults: never access `.env*`, `*.key`, `*.pem`, `*secret*`, `*password*`, `*credential*`.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Step 5 — [DOMAIN] Load Business Dictionary (conditional)
|
|
188
|
+
|
|
189
|
+
Check if the business dictionary file exists (use `paths.business_dictionary` resolved in Step 1).
|
|
190
|
+
|
|
191
|
+
If it exists, read it and extract:
|
|
192
|
+
- **Canonical Terms** → complete list of approved terms and their definitions
|
|
193
|
+
- **Banned Terms** → complete list of banned terms and their canonical replacements
|
|
194
|
+
- **Status / Enum Registry** → allowed enum values per entity
|
|
195
|
+
|
|
196
|
+
Store the banned terms list for **active enforcement** throughout the command session:
|
|
197
|
+
- When generating any text (PRD, BDD, code comments, tech docs), verify no banned terms appear
|
|
198
|
+
- Replace banned terms with their canonical equivalents automatically
|
|
199
|
+
|
|
200
|
+
If the file does not exist → skip silently. Do not warn or block.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Step 6 — [DOMAIN] Load Core Entities (conditional)
|
|
205
|
+
|
|
206
|
+
Check if the core entities file exists at `paths.core_entities` (resolved in Step 1).
|
|
207
|
+
Default path: `specs/domain-knowledge/core-entities.md`.
|
|
208
|
+
|
|
209
|
+
If it exists, read it and store:
|
|
210
|
+
- **Entity catalog** → for each entity: its name, purpose, owner service, key fields (name + type), business invariants, and relationships
|
|
211
|
+
- **Field name registry** → canonical field names to use in generated code and documents
|
|
212
|
+
- **Relationship map** → how entities relate to each other (1:N, N:N, embedded, etc.)
|
|
213
|
+
|
|
214
|
+
**How to use this catalog:**
|
|
215
|
+
- When generating code: use the field names, types, and relationships defined here — do NOT infer from existing code
|
|
216
|
+
- When generating PRD/BDD: reference entity names from this catalog for consistency
|
|
217
|
+
- When generating tech-docs: use this catalog as the source-of-truth for entity definitions
|
|
218
|
+
|
|
219
|
+
If the file does not exist → skip silently.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
224
|
+
|
|
225
|
+
After loading all context, synthesize and output a compact summary block.
|
|
226
|
+
This recap ensures the most critical facts are stated at the END of context loading
|
|
227
|
+
(recency effect — freshest in working memory when the task begins).
|
|
228
|
+
|
|
229
|
+
Output exactly this block:
|
|
230
|
+
```
|
|
231
|
+
[CTX LOADED]
|
|
232
|
+
Stack : {language} / {framework} / {database}
|
|
233
|
+
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
234
|
+
Ticket : {ticket_prefix}-
|
|
235
|
+
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
236
|
+
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
237
|
+
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
If any CRITICAL file is missing (CLAUDE.md), flag it clearly so the user can decide whether to proceed.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Context Load Complete
|
|
245
|
+
|
|
246
|
+
After completing all steps, you have loaded:
|
|
247
|
+
- Project identity, tech stack, module conventions
|
|
248
|
+
- Architecture rules and layer order ← **[CRITICAL — hold in working memory]**
|
|
249
|
+
- Coding standards and naming conventions ← **[CRITICAL — hold in working memory]**
|
|
250
|
+
- Data protection rules (sensitive file patterns to never access)
|
|
251
|
+
- Terminology rules with banned-term list ← **[DOMAIN — apply to every generated word]**
|
|
252
|
+
- Entity catalog (field names, types, invariants) ← **[DOMAIN — use for code generation]**
|
|
253
|
+
- All configured paths
|
|
254
|
+
|
|
255
|
+
Proceed to the next step of the calling command.
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Input — Paste one of:
|
|
261
|
+
1. Stack trace / error log
|
|
262
|
+
2. Test failure output
|
|
263
|
+
3. File path + description of unexpected behavior
|
|
264
|
+
4. A specific question about a code snippet
|
|
265
|
+
|
|
266
|
+
## Stack Trace Analysis
|
|
267
|
+
Read from **bottom up** — `Caused by:` is the real root cause:
|
|
268
|
+
```
|
|
269
|
+
Caused by: {RealException} ← start here
|
|
270
|
+
at {class}.{method}({file}:{line})
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Common Error Patterns
|
|
274
|
+
|
|
275
|
+
| Error | Likely Cause | Fix Direction |
|
|
276
|
+
|-------|-------------|---------------|
|
|
277
|
+
| NullPointerException | Null object access; Optional not handled | Check Optional.orElseThrow, null guards |
|
|
278
|
+
| ClassCastException | Wrong type assumption | Check type at assignment/return |
|
|
279
|
+
| OutOfMemoryError | Loading too much data | Add pagination |
|
|
280
|
+
| StackOverflowError | Infinite recursion | Find recursive call with no base case |
|
|
281
|
+
| Connection refused | Dependency not running | Check config URLs |
|
|
282
|
+
| 401 Unauthorized | Token expired, wrong config | Verify token, check auth config |
|
|
283
|
+
| 403 Forbidden | Wrong role | Check auth annotations |
|
|
284
|
+
| DB constraint violation | Duplicate key, null in NOT NULL | Check data and constraints |
|
|
285
|
+
| Serialization error | Circular reference | Check DTO/mapper config |
|
|
286
|
+
| Test assertion mismatch | Wrong mock or wrong expected | Re-read mock setup |
|
|
287
|
+
|
|
288
|
+
## Test Failure Analysis
|
|
289
|
+
```
|
|
290
|
+
Expected: {value}
|
|
291
|
+
Actual : {value}
|
|
292
|
+
at {test}.{method}(line {N})
|
|
293
|
+
```
|
|
294
|
+
1. What is the gap? 2. Is mock setup correct? 3. Is assertion logically correct?
|
|
295
|
+
|
|
296
|
+
## Output
|
|
297
|
+
|
|
298
|
+
# Report Footer — Standard Command Output Format
|
|
299
|
+
|
|
300
|
+
Every command report must end with this standard footer section.
|
|
301
|
+
|
|
302
|
+
## Status Badge
|
|
303
|
+
|
|
304
|
+
Choose one based on outcome:
|
|
305
|
+
- `✅ Complete` — all steps succeeded, no issues found
|
|
306
|
+
- `❌ Failed` — command could not complete due to a blocking error
|
|
307
|
+
- `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
|
|
308
|
+
|
|
309
|
+
## Output Artifacts
|
|
310
|
+
|
|
311
|
+
List every file created or modified by this command:
|
|
312
|
+
```
|
|
313
|
+
Output Artifacts:
|
|
314
|
+
{created|updated} {file-path} ({brief description})
|
|
315
|
+
{created|updated} {file-path} ({brief description})
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
|
|
319
|
+
|
|
320
|
+
## Next Command Suggestion
|
|
321
|
+
|
|
322
|
+
Suggest the logical next command based on workflow phase:
|
|
323
|
+
|
|
324
|
+
| Current command | Suggest next |
|
|
325
|
+
|-------------------------|-----------------------------------------------|
|
|
326
|
+
| /define-product | `/generate-prd {product-definition-file}` |
|
|
327
|
+
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
328
|
+
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
329
|
+
| /review-context (PRD) | `/generate-bdd {prd-file}` if APPROVED; fix PRD if NEEDS_FIX |
|
|
330
|
+
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
331
|
+
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
332
|
+
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
333
|
+
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
334
|
+
| /generate-code | `/generate-tests {UC-ID}` |
|
|
335
|
+
| /generate-tests | `/run-tests {UC-ID}` |
|
|
336
|
+
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
337
|
+
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
338
|
+
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
339
|
+
| /smoke-test | Create PR and link to ticket |
|
|
340
|
+
| /validate-traces | `/generate-code {UC-ID}` for gaps |
|
|
341
|
+
| /fix-bug | Create PR and link to ticket |
|
|
342
|
+
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
343
|
+
|
|
344
|
+
Format the footer as:
|
|
345
|
+
```
|
|
346
|
+
---
|
|
347
|
+
Status : {badge}
|
|
348
|
+
{Output Artifacts block}
|
|
349
|
+
Next : {suggested command with example arguments}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
```
|
|
354
|
+
/debug Analysis
|
|
355
|
+
|
|
356
|
+
## Error
|
|
357
|
+
{description}
|
|
358
|
+
|
|
359
|
+
## Root Cause
|
|
360
|
+
{technical explanation}
|
|
361
|
+
|
|
362
|
+
## Location
|
|
363
|
+
File: {path} | Line: {N} | Layer: {Controller/Service/Repository/Test}
|
|
364
|
+
|
|
365
|
+
## Suggested Fix
|
|
366
|
+
{specific code change}
|
|
367
|
+
|
|
368
|
+
## Related Rule
|
|
369
|
+
See CLAUDE.md §{section}
|
|
370
|
+
|
|
371
|
+
## Next Step
|
|
372
|
+
- To fully fix → /fix-bug {TICKET_ID}
|
|
373
|
+
- Just needed analysis → done
|
|
374
|
+
```
|