@c0x12c/spartan-ai-toolkit 1.1.0 → 1.2.1
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/VERSION +1 -1
- package/bin/cli.js +155 -31
- package/claude-md/01-core.md +24 -38
- package/claude-md/11-backend-micronaut.md +4 -41
- package/claude-md/20-frontend-react.md +1 -0
- package/claude-md/60-research.md +11 -59
- package/commands/spartan/contribute.md +140 -0
- package/commands/spartan/daily.md +4 -4
- package/commands/spartan/env-setup.md +2 -2
- package/commands/spartan/fe-review.md +1 -1
- package/commands/spartan/kotlin-service.md +4 -4
- package/commands/spartan/migration.md +1 -1
- package/commands/spartan/qa.md +222 -0
- package/commands/spartan/research.md +3 -24
- package/commands/spartan/review.md +1 -1
- package/commands/spartan/sessions.md +143 -0
- package/commands/spartan/testcontainer.md +1 -1
- package/commands/spartan.md +141 -1
- package/lib/assembler.js +147 -2
- package/lib/assembler.test.js +159 -0
- package/lib/detector.js +166 -0
- package/lib/detector.test.js +221 -0
- package/lib/resolver.js +129 -1
- package/lib/resolver.test.js +159 -1
- package/package.json +2 -2
- package/packs/core.yaml +2 -0
- package/packs/frontend-react.yaml +2 -0
- package/packs/packs.compiled.json +7 -3
- package/rules/backend-micronaut/API_DESIGN.md +38 -0
- package/rules/backend-micronaut/CONTROLLERS.md +9 -378
- package/rules/backend-micronaut/KOTLIN.md +61 -246
- package/rules/backend-micronaut/RETROFIT_PLACEMENT.md +12 -12
- package/rules/backend-micronaut/SERVICES_AND_BEANS.md +21 -417
- package/rules/core/NAMING_CONVENTIONS.md +1 -1
- package/rules/database/ORM_AND_REPO.md +23 -127
- package/skills/api-endpoint-creator/SKILL.md +47 -152
- package/skills/api-endpoint-creator/error-handling-guide.md +1 -1
- package/skills/api-endpoint-creator/examples.md +50 -50
- package/skills/api-endpoint-creator/testing-patterns.md +6 -6
- package/skills/browser-qa/SKILL.md +180 -0
- package/skills/competitive-teardown/SKILL.md +0 -26
- package/skills/database-table-creator/SKILL.md +13 -460
- package/skills/database-table-creator/examples.md +23 -23
- package/skills/database-table-creator/kotlin-templates.md +400 -0
- package/skills/database-table-creator/migration-template.sql +1 -1
- package/skills/database-table-creator/validation-checklist.md +6 -6
- package/skills/deep-research/SKILL.md +0 -26
- package/skills/market-research/SKILL.md +0 -26
- package/skills/testing-strategies/SKILL.md +1 -1
- package/skills/ui-ux-pro-max/SKILL.md +1 -147
- package/skills/ui-ux-pro-max/python-setup.md +146 -0
- package/templates/workflow-backend-micronaut.md +1 -1
- package/templates/workflow-frontend-react.md +1 -1
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
10
10
|
"name": "spartan-ai-toolkit",
|
|
11
|
-
"description": "5 workflows,
|
|
11
|
+
"description": "5 workflows, 51 commands, 11 rules, 19 skills, 4 agents — organized in 11 packs with dependencies",
|
|
12
12
|
"source": "./toolkit",
|
|
13
|
-
"version": "1.1
|
|
13
|
+
"version": "1.2.1"
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spartan-ai-toolkit",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description": "Engineering discipline layer for Claude Code — 5 workflows,
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Engineering discipline layer for Claude Code — 5 workflows, 51 commands, 11 rules, 19 skills, 4 agents organized in 11 packs",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Khoa Tran",
|
|
7
7
|
"url": "https://github.com/spartan-stratos"
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.1
|
|
1
|
+
1.2.1
|
package/bin/cli.js
CHANGED
|
@@ -48,11 +48,15 @@ function blue(s) { return `${C.blue}${s}${C.reset}`; }
|
|
|
48
48
|
|
|
49
49
|
// ── Pack definitions (loaded from YAML manifests) ───────────────
|
|
50
50
|
import { PACKS, PACK_ORDER } from '../lib/packs.js';
|
|
51
|
-
import { assembleCLAUDEmd } from '../lib/assembler.js';
|
|
52
|
-
import { resolve as resolveDeps, resolveAliases, loadManifests } from '../lib/resolver.js';
|
|
51
|
+
import { assembleCLAUDEmd, assembleAGENTSmd } from '../lib/assembler.js';
|
|
52
|
+
import { resolve as resolveDeps, resolveAliases, loadManifests, loadExternalPacks } from '../lib/resolver.js';
|
|
53
|
+
import { detectStacks } from '../lib/detector.js';
|
|
53
54
|
|
|
54
55
|
const manifests = loadManifests(join(PKG_ROOT, 'packs'));
|
|
55
56
|
|
|
57
|
+
// Maps community pack names to their source directory (for file resolution)
|
|
58
|
+
const externalPackSources = {};
|
|
59
|
+
|
|
56
60
|
// ── Parse args ──────────────────────────────────────────────────
|
|
57
61
|
const args = process.argv.slice(2);
|
|
58
62
|
|
|
@@ -61,12 +65,18 @@ let packsArg = '';
|
|
|
61
65
|
let installAll = false;
|
|
62
66
|
let mode = 'global'; // default for claude-code
|
|
63
67
|
let showHelp = false;
|
|
68
|
+
let format = ''; // '' = default, 'agents-md' = export AGENTS.md
|
|
69
|
+
let autoDetect = false;
|
|
70
|
+
let packDirArg = ''; // external community pack directory
|
|
64
71
|
|
|
65
72
|
for (const arg of args) {
|
|
66
73
|
if (arg === '--help' || arg === '-h') showHelp = true;
|
|
67
74
|
else if (arg.startsWith('--agent=')) agent = arg.split('=')[1];
|
|
68
75
|
else if (arg.startsWith('--packs=')) packsArg = arg.split('=')[1];
|
|
76
|
+
else if (arg.startsWith('--format=')) format = arg.split('=')[1];
|
|
77
|
+
else if (arg.startsWith('--pack-dir=')) packDirArg = arg.split('=')[1];
|
|
69
78
|
else if (arg === '--all') installAll = true;
|
|
79
|
+
else if (arg === '--auto') autoDetect = true;
|
|
70
80
|
else if (arg === '--global') mode = 'global';
|
|
71
81
|
else if (arg === '--local') mode = 'local';
|
|
72
82
|
}
|
|
@@ -100,6 +110,9 @@ if (showHelp) {
|
|
|
100
110
|
Choices: claude-code, cursor, windsurf, codex, copilot
|
|
101
111
|
--packs=LIST Comma-separated packs (claude-code only)
|
|
102
112
|
Example: --packs=backend-micronaut,product
|
|
113
|
+
--auto Auto-detect tech stack and suggest packs (no menu)
|
|
114
|
+
--pack-dir=DIR Load community packs from an external directory
|
|
115
|
+
--format=NAME Output format: agents-md (exports AGENTS.md for cross-tool use)
|
|
103
116
|
--all Install all packs
|
|
104
117
|
--global Install to home dir (default for claude-code/codex)
|
|
105
118
|
--local Install to current project dir
|
|
@@ -124,6 +137,12 @@ ${lines.join('\n')}`).join('\n')}
|
|
|
124
137
|
|
|
125
138
|
${cyan('npx spartan-ai-toolkit@latest --agent=cursor')}
|
|
126
139
|
Install rules for Cursor (rules + AGENTS.md only)
|
|
140
|
+
|
|
141
|
+
${cyan('npx spartan-ai-toolkit@latest --auto')}
|
|
142
|
+
Auto-detect your tech stack and install matching packs
|
|
143
|
+
|
|
144
|
+
${cyan('npx spartan-ai-toolkit@latest --format=agents-md --packs=backend-micronaut')}
|
|
145
|
+
Export AGENTS.md for any AI coding tool
|
|
127
146
|
`);
|
|
128
147
|
process.exit(0);
|
|
129
148
|
}
|
|
@@ -220,6 +239,11 @@ function copyDir(src, dest) {
|
|
|
220
239
|
cpSync(src, dest, { recursive: true });
|
|
221
240
|
}
|
|
222
241
|
|
|
242
|
+
/** Get the source root for a pack (built-in uses PKG_ROOT, community uses pack-dir). */
|
|
243
|
+
function getPackSource(packName) {
|
|
244
|
+
return externalPackSources[packName] || PKG_ROOT;
|
|
245
|
+
}
|
|
246
|
+
|
|
223
247
|
/** Get all items for a category across selected packs, deduplicated. */
|
|
224
248
|
function gatherItems(selectedPacks, category) {
|
|
225
249
|
const seen = new Set();
|
|
@@ -237,6 +261,24 @@ function gatherItems(selectedPacks, category) {
|
|
|
237
261
|
return result;
|
|
238
262
|
}
|
|
239
263
|
|
|
264
|
+
/** Like gatherItems but includes the source root for each item (for community pack support). */
|
|
265
|
+
function gatherItemsWithSource(selectedPacks, category) {
|
|
266
|
+
const seen = new Set();
|
|
267
|
+
const result = [];
|
|
268
|
+
for (const pack of selectedPacks) {
|
|
269
|
+
const def = PACKS[pack];
|
|
270
|
+
if (!def) continue;
|
|
271
|
+
const srcRoot = getPackSource(pack);
|
|
272
|
+
for (const item of def[category]) {
|
|
273
|
+
if (!seen.has(item)) {
|
|
274
|
+
seen.add(item);
|
|
275
|
+
result.push({ item, srcRoot });
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return result;
|
|
280
|
+
}
|
|
281
|
+
|
|
240
282
|
// ── Pack selection (grouped menu) ───────────────────────────────
|
|
241
283
|
async function selectPacks(targets) {
|
|
242
284
|
// --all flag
|
|
@@ -253,6 +295,44 @@ async function selectPacks(targets) {
|
|
|
253
295
|
return resolveDeps(aliased, manifests);
|
|
254
296
|
}
|
|
255
297
|
|
|
298
|
+
// --auto flag: detect tech stack
|
|
299
|
+
if (autoDetect) {
|
|
300
|
+
const cwd = process.cwd();
|
|
301
|
+
console.log(`\n ${blue('Scanning')} ${dim(cwd)} ${blue('for tech stack...')}\n`);
|
|
302
|
+
const { detected, comingSoon } = detectStacks(cwd);
|
|
303
|
+
|
|
304
|
+
if (detected.length > 0) {
|
|
305
|
+
console.log(` ${bold('Detected stacks:')}`);
|
|
306
|
+
for (const d of detected) {
|
|
307
|
+
console.log(` ${green('✓')} ${bold(d.pack)} ${dim(`(${d.reason})`)}`);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (comingSoon.length > 0) {
|
|
311
|
+
console.log('');
|
|
312
|
+
for (const d of comingSoon) {
|
|
313
|
+
console.log(` ${yellow('~')} ${d.pack} ${dim(`(${d.reason})`)} ${dim('— coming soon, skipped')}`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
console.log('');
|
|
317
|
+
|
|
318
|
+
const packNames = detected.map(d => d.pack);
|
|
319
|
+
const confirm = await ask(` Install ${bold(packNames.join(' + '))}? [Y/n]: `);
|
|
320
|
+
if (confirm !== 'n' && confirm !== 'N') {
|
|
321
|
+
return resolveDeps(packNames, manifests);
|
|
322
|
+
}
|
|
323
|
+
// User said no — fall through to interactive menu
|
|
324
|
+
console.log('');
|
|
325
|
+
} else {
|
|
326
|
+
console.log(` ${dim('No stacks detected.')}`);
|
|
327
|
+
if (comingSoon.length > 0) {
|
|
328
|
+
for (const d of comingSoon) {
|
|
329
|
+
console.log(` ${yellow('~')} ${d.pack} ${dim(`(${d.reason})`)} ${dim('— coming soon')}`);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
console.log(` ${dim('Falling back to interactive menu...')}\n`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
256
336
|
// Check saved packs
|
|
257
337
|
if (existsSync(targets.packsFile)) {
|
|
258
338
|
let saved = readFileSync(targets.packsFile, 'utf-8').trim().split('\n').filter(Boolean);
|
|
@@ -358,9 +438,9 @@ async function installFull() {
|
|
|
358
438
|
cmdCount++;
|
|
359
439
|
}
|
|
360
440
|
|
|
361
|
-
const selectedCommands =
|
|
362
|
-
for (const cmd of selectedCommands) {
|
|
363
|
-
const src = join(
|
|
441
|
+
const selectedCommands = gatherItemsWithSource(selectedPacks, 'commands');
|
|
442
|
+
for (const { item: cmd, srcRoot } of selectedCommands) {
|
|
443
|
+
const src = join(srcRoot, 'commands', 'spartan', `${cmd}.md`);
|
|
364
444
|
if (existsSync(src)) {
|
|
365
445
|
copyFile(src, join(targets.commands, `${cmd}.md`));
|
|
366
446
|
console.log(` ${green('+')} /spartan:${cmd}`);
|
|
@@ -372,14 +452,13 @@ async function installFull() {
|
|
|
372
452
|
console.log(` ${bold(cmdCount + ' commands')} installed\n`);
|
|
373
453
|
|
|
374
454
|
// 3) Rules (now with subdirectory structure)
|
|
375
|
-
const
|
|
376
|
-
if (
|
|
455
|
+
const rulesWithSource = gatherItemsWithSource(selectedPacks, 'rules');
|
|
456
|
+
if (rulesWithSource.length > 0) {
|
|
377
457
|
console.log(`${blue('[3/5]')} ${bold('Installing rules...')}`);
|
|
378
458
|
let ruleCount = 0;
|
|
379
459
|
|
|
380
|
-
for (const rule of
|
|
381
|
-
|
|
382
|
-
const src = join(SRC.rules, rule);
|
|
460
|
+
for (const { item: rule, srcRoot } of rulesWithSource) {
|
|
461
|
+
const src = join(srcRoot, 'rules', rule);
|
|
383
462
|
const dest = join(targets.rules, rule);
|
|
384
463
|
if (existsSync(src)) {
|
|
385
464
|
copyFile(src, dest);
|
|
@@ -393,14 +472,14 @@ async function installFull() {
|
|
|
393
472
|
}
|
|
394
473
|
|
|
395
474
|
// 4) Skills
|
|
396
|
-
const
|
|
397
|
-
if (
|
|
475
|
+
const skillsWithSource = gatherItemsWithSource(selectedPacks, 'skills');
|
|
476
|
+
if (skillsWithSource.length > 0) {
|
|
398
477
|
console.log(`${blue('[4/5]')} ${bold('Installing skills...')}`);
|
|
399
478
|
ensureDir(targets.skills);
|
|
400
479
|
let skillCount = 0;
|
|
401
480
|
|
|
402
|
-
for (const skill of
|
|
403
|
-
const src = join(
|
|
481
|
+
for (const { item: skill, srcRoot } of skillsWithSource) {
|
|
482
|
+
const src = join(srcRoot, 'skills', skill);
|
|
404
483
|
if (existsSync(src)) {
|
|
405
484
|
copyDir(src, join(targets.skills, skill));
|
|
406
485
|
console.log(` ${green('+')} ${skill}`);
|
|
@@ -413,14 +492,14 @@ async function installFull() {
|
|
|
413
492
|
}
|
|
414
493
|
|
|
415
494
|
// 5) Agents
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
495
|
+
const agentsWithSource = gatherItemsWithSource(selectedPacks, 'agents');
|
|
496
|
+
if (agentsWithSource.length > 0) {
|
|
418
497
|
console.log(`${blue('[5/5]')} ${bold('Installing agents...')}`);
|
|
419
498
|
ensureDir(targets.agents);
|
|
420
499
|
let agentCount = 0;
|
|
421
500
|
|
|
422
|
-
for (const agentFile of
|
|
423
|
-
const src = join(
|
|
501
|
+
for (const { item: agentFile, srcRoot } of agentsWithSource) {
|
|
502
|
+
const src = join(srcRoot, 'agents', agentFile);
|
|
424
503
|
if (existsSync(src)) {
|
|
425
504
|
copyFile(src, join(targets.agents, agentFile));
|
|
426
505
|
console.log(` ${green('+')} ${agentFile.replace('.md', '')}`);
|
|
@@ -495,23 +574,15 @@ async function installRulesOnly() {
|
|
|
495
574
|
console.log(`\n${blue('[1/2]')} ${bold('Rules')} — ${dim('no rule packs selected')}\n`);
|
|
496
575
|
}
|
|
497
576
|
|
|
498
|
-
// Install AGENTS.md
|
|
577
|
+
// Install AGENTS.md — assembled from pack sections + agents
|
|
499
578
|
console.log(`${blue('[2/2]')} ${bold('Installing AGENTS.md...')}`);
|
|
500
579
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
agentsContent += 'Expert agents for your AI coding assistant.\n\n---\n\n';
|
|
505
|
-
for (const agentFile of allAgents) {
|
|
506
|
-
const src = join(SRC.agents, agentFile);
|
|
507
|
-
if (existsSync(src)) {
|
|
508
|
-
agentsContent += readFileSync(src, 'utf-8') + '\n\n---\n\n';
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
writeFileSync(targets.agentsMd, agentsContent.trimEnd() + '\n', 'utf-8');
|
|
580
|
+
if (targets.agentsMd) {
|
|
581
|
+
const agentsContent = assembleAGENTSmd(SRC.claudeMd, SRC.agents, selectedPacks, PACKS);
|
|
582
|
+
writeFileSync(targets.agentsMd, agentsContent, 'utf-8');
|
|
512
583
|
console.log(` ${green('+')} AGENTS.md\n`);
|
|
513
584
|
} else {
|
|
514
|
-
console.log(` ${dim('No
|
|
585
|
+
console.log(` ${dim('No AGENTS.md target')}\n`);
|
|
515
586
|
}
|
|
516
587
|
|
|
517
588
|
// Save selection
|
|
@@ -538,6 +609,49 @@ async function main() {
|
|
|
538
609
|
process.exit(1);
|
|
539
610
|
}
|
|
540
611
|
|
|
612
|
+
// Load community packs if --pack-dir is set
|
|
613
|
+
if (packDirArg) {
|
|
614
|
+
const packDirPath = pathResolve(process.cwd(), packDirArg);
|
|
615
|
+
const builtinNames = new Set(manifests.keys());
|
|
616
|
+
console.log(`\n ${blue('Loading community packs from')} ${dim(packDirPath)}`);
|
|
617
|
+
const { loaded, errors } = loadExternalPacks(packDirPath, builtinNames);
|
|
618
|
+
|
|
619
|
+
if (errors.length > 0) {
|
|
620
|
+
for (const err of errors) {
|
|
621
|
+
console.log(` ${yellow('!')} ${err}`);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if (loaded.size > 0) {
|
|
626
|
+
for (const [name, manifest] of loaded) {
|
|
627
|
+
manifests.set(name, manifest);
|
|
628
|
+
externalPackSources[name] = packDirPath;
|
|
629
|
+
// Add to PACKS and PACK_ORDER so menus and install work
|
|
630
|
+
PACKS[name] = {
|
|
631
|
+
description: manifest.description,
|
|
632
|
+
category: manifest.category || 'Community',
|
|
633
|
+
priority: manifest.priority ?? 500,
|
|
634
|
+
hidden: manifest.hidden || false,
|
|
635
|
+
comingSoon: manifest['coming-soon'] || false,
|
|
636
|
+
depends: manifest.depends || [],
|
|
637
|
+
commands: manifest.commands || [],
|
|
638
|
+
rules: manifest.rules || [],
|
|
639
|
+
skills: manifest.skills || [],
|
|
640
|
+
agents: manifest.agents || [],
|
|
641
|
+
claudeSections: manifest['claude-sections'] || [],
|
|
642
|
+
};
|
|
643
|
+
PACK_ORDER.push(name);
|
|
644
|
+
}
|
|
645
|
+
// Re-sort PACK_ORDER by priority
|
|
646
|
+
PACK_ORDER.sort((a, b) => (PACKS[a]?.priority ?? 999) - (PACKS[b]?.priority ?? 999));
|
|
647
|
+
|
|
648
|
+
const names = [...loaded.keys()].join(', ');
|
|
649
|
+
console.log(` ${green('+')} Loaded: ${bold(names)}\n`);
|
|
650
|
+
} else {
|
|
651
|
+
console.log(` ${dim('No valid community packs found')}\n`);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
541
655
|
let selectedPacks;
|
|
542
656
|
|
|
543
657
|
try {
|
|
@@ -554,6 +668,16 @@ async function main() {
|
|
|
554
668
|
closeRL();
|
|
555
669
|
}
|
|
556
670
|
|
|
671
|
+
// Export AGENTS.md alongside normal install when --format=agents-md
|
|
672
|
+
if (format === 'agents-md' && (agent === 'claude-code' || agent === 'codex')) {
|
|
673
|
+
const cwd = process.cwd();
|
|
674
|
+
const agentsMdPath = join(cwd, 'AGENTS.md');
|
|
675
|
+
console.log(`${blue('[+]')} ${bold('Exporting AGENTS.md for cross-tool use...')}`);
|
|
676
|
+
const agentsContent = assembleAGENTSmd(SRC.claudeMd, SRC.agents, selectedPacks, PACKS);
|
|
677
|
+
writeFileSync(agentsMdPath, agentsContent, 'utf-8');
|
|
678
|
+
console.log(` ${green('+')} AGENTS.md (works with Cursor, Copilot, Windsurf, Codex, and 20+ tools)\n`);
|
|
679
|
+
}
|
|
680
|
+
|
|
557
681
|
// Success
|
|
558
682
|
const userPacks = selectedPacks.filter(p => !PACKS[p]?.hidden);
|
|
559
683
|
console.log(`${bold(green('================================================'))}`);
|
package/claude-md/01-core.md
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
|
|
4
4
|
## Core Principles (Always Enforce)
|
|
5
5
|
|
|
6
|
-
### 1.
|
|
6
|
+
### 1. Match the User's Language
|
|
7
|
+
**Detect the language of the user's message and respond entirely in that same language.** This is not optional — it overrides the default English behavior of all commands. If the user writes in Vietnamese, ALL output must be in Vietnamese. If in French, respond in French. If in English, respond in English. This applies to everything: explanations, questions, gate prompts, debug reports, summaries, and PR descriptions. Only code syntax, variable names, file paths, and command names (e.g., `/spartan:fix`) stay in their original form.
|
|
8
|
+
|
|
9
|
+
### 2. Spec Before Code
|
|
7
10
|
- Task < 1 day → `/spartan:quickplan` for fast spec + plan
|
|
8
11
|
- Task > 1 day → `/spartan:project new` or `/spartan:project milestone-new`
|
|
9
12
|
- Never write production code without a written spec or plan
|
|
10
13
|
|
|
11
|
-
###
|
|
14
|
+
### 3. TDD is Non-Negotiable
|
|
12
15
|
- Red → Green → Refactor, always
|
|
13
16
|
- Write tests first, then the code that makes them pass
|
|
14
17
|
|
|
15
|
-
###
|
|
18
|
+
### 4. Atomic Commits
|
|
16
19
|
Each commit = one task, tests passing:
|
|
17
20
|
```
|
|
18
21
|
type(scope): what changed
|
|
@@ -21,7 +24,7 @@ type(scope): what changed
|
|
|
21
24
|
```
|
|
22
25
|
Types: `feat` · `fix` · `test` · `refactor` · `chore` · `docs`
|
|
23
26
|
|
|
24
|
-
###
|
|
27
|
+
### 5. Context Hygiene (Auto-Managed)
|
|
25
28
|
Claude proactively manages its own context window:
|
|
26
29
|
- When detecting context pressure (slow responses, forgetting earlier context, long conversation) → auto-run `/compact` to summarize and free space
|
|
27
30
|
- If compaction isn't enough → auto-save critical state to `.handoff/` and `.memory/`, then tell user to start a fresh session
|
|
@@ -35,7 +38,7 @@ Claude proactively manages its own context window:
|
|
|
35
38
|
- Response quality dropping → warn user + compact
|
|
36
39
|
- Multi-step command taking unusually long → consider compacting between steps
|
|
37
40
|
|
|
38
|
-
###
|
|
41
|
+
### 6. Auto Mode
|
|
39
42
|
When user says **"auto on"** or **"auto mode"**, all Spartan commands skip confirmation prompts and execute straight through. Claude will:
|
|
40
43
|
- Show the spec/plan/output but NOT pause to ask "does this match?" or "shall I proceed?"
|
|
41
44
|
- Continue to the next step automatically after each step completes
|
|
@@ -46,49 +49,32 @@ Turn off with **"auto off"**. Default is **auto off** (commands ask for confirma
|
|
|
46
49
|
|
|
47
50
|
Auto mode is ideal for experienced users who trust the workflow and want maximum velocity.
|
|
48
51
|
|
|
49
|
-
###
|
|
50
|
-
Three levels of protection, activated on-demand:
|
|
52
|
+
### 7. Safety Guardrails
|
|
51
53
|
|
|
52
54
|
| Command | What it does |
|
|
53
55
|
|---|---|
|
|
54
|
-
| `/spartan:careful` | Warn
|
|
55
|
-
| `/spartan:freeze <dir>` | Lock
|
|
56
|
-
| `/spartan:guard <dir>` | Both
|
|
57
|
-
|
|
58
|
-
**Careful mode overrides auto mode.** Even in auto mode, destructive operations always require "I confirm".
|
|
59
|
-
|
|
60
|
-
**Freeze prevents scope creep.** Claude won't "helpfully" fix files outside your focus area.
|
|
61
|
-
|
|
62
|
-
Deactivate: `/spartan:careful off`, `/spartan:unfreeze`, or `/spartan:guard off`.
|
|
56
|
+
| `/spartan:careful` | Warn before destructive ops (rm -rf, DROP, force-push) |
|
|
57
|
+
| `/spartan:freeze <dir>` | Lock edits to one directory only |
|
|
58
|
+
| `/spartan:guard <dir>` | Both combined. Deactivate with `off` or `/spartan:unfreeze` |
|
|
63
59
|
|
|
64
60
|
---
|
|
65
61
|
|
|
66
62
|
## Core Commands (always available)
|
|
67
63
|
|
|
68
|
-
###
|
|
69
|
-
| Command | Purpose |
|
|
70
|
-
|---|---|
|
|
71
|
-
| `/spartan` | **Smart router** — asks what you need, routes to right command |
|
|
72
|
-
| `/spartan:quickplan "task"` | Spec + plan + branch in one shot (< 1 day tasks) |
|
|
73
|
-
| `/spartan:debug "symptom"` | 4-phase root-cause investigation + Debug Report |
|
|
74
|
-
| `/spartan:init-project [name]` | Auto-generate project CLAUDE.md from codebase scan |
|
|
75
|
-
|
|
76
|
-
### Ship
|
|
77
|
-
| Command | Purpose |
|
|
78
|
-
|---|---|
|
|
79
|
-
| `/spartan:pr-ready` | Full pre-PR checklist + auto-generates PR description |
|
|
80
|
-
|
|
81
|
-
### Ops (daily routine, session management)
|
|
64
|
+
### Workflows (start here)
|
|
82
65
|
| Command | Purpose |
|
|
83
66
|
|---|---|
|
|
84
|
-
| `/spartan
|
|
85
|
-
| `/spartan:
|
|
86
|
-
| `/spartan:
|
|
67
|
+
| `/spartan` | **Smart router** — routes to the right workflow or command |
|
|
68
|
+
| `/spartan:build [backend\|frontend] "feature"` | Full feature workflow: understand → plan → TDD → review → PR |
|
|
69
|
+
| `/spartan:fix "symptom"` | Bug workflow: reproduce → investigate → fix → PR |
|
|
70
|
+
| `/spartan:onboard` | Codebase understanding: scan → map → setup |
|
|
87
71
|
|
|
88
|
-
###
|
|
72
|
+
### Individual Commands
|
|
89
73
|
| Command | Purpose |
|
|
90
74
|
|---|---|
|
|
91
|
-
| `/spartan:
|
|
92
|
-
| `/spartan:
|
|
93
|
-
| `/spartan:
|
|
94
|
-
| `/spartan:
|
|
75
|
+
| `/spartan:quickplan "task"` | Spec + plan + branch in one shot (< 1 day) |
|
|
76
|
+
| `/spartan:pr-ready` | Pre-PR checklist + auto PR description |
|
|
77
|
+
| `/spartan:daily` | Standup summary from git log |
|
|
78
|
+
| `/spartan:init-project` | Auto-generate CLAUDE.md from codebase |
|
|
79
|
+
| `/spartan:context-save` | Manage context: compact first, full save if needed |
|
|
80
|
+
| `/spartan:update` | Upgrade Spartan to latest version |
|
|
@@ -5,47 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
**Stack:** Kotlin + Micronaut — coroutines, Either error handling, Exposed ORM
|
|
7
7
|
|
|
8
|
-
Rules in `rules/backend-micronaut/`
|
|
9
|
-
- `KOTLIN.md` — Null safety (`!!` banned), Either errors, enums, conversions, style
|
|
10
|
-
- `CONTROLLERS.md` — Layered arch: Controller → Manager → Service/Repository, test patterns
|
|
11
|
-
- `SERVICES_AND_BEANS.md` — Service vs Manager separation, 3-tier bean hierarchy
|
|
12
|
-
- `API_DESIGN.md` — RPC-style, query params only (no path params), model location
|
|
13
|
-
- `RETROFIT_PLACEMENT.md` — Never place Retrofit interfaces in kapt-enabled modules
|
|
8
|
+
Rules in `rules/backend-micronaut/` and `rules/database/` are loaded automatically.
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
### Feature Development Workflow (Backend)
|
|
18
|
-
|
|
19
|
-
When building a backend feature, follow this pipeline:
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
Epic → Spec → Plan → Build → Review
|
|
23
|
-
↑ ↑ ↑ ↑
|
|
24
|
-
Gate 1 Gate 2 Gate 3 Gate 4
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
**Build phases:** Database → Business Logic → API Layer → Tests
|
|
28
|
-
|
|
29
|
-
See `templates/workflow-backend-micronaut.md` for the full workflow with:
|
|
30
|
-
- Stack-specific quality gates (Kotlin rules, Exposed ORM checks, API conventions)
|
|
31
|
-
- Concrete code patterns (Controller, Manager, Repository, Factory, DTO, Test)
|
|
32
|
-
- Real file locations per module
|
|
33
|
-
- Parallel vs sequential task planning
|
|
34
|
-
|
|
35
|
-
For small tasks (< 1 day), `/spartan:quickplan` covers spec + plan in one shot.
|
|
36
|
-
|
|
37
|
-
### Backend Skills
|
|
38
|
-
|
|
39
|
-
- `/api-endpoint-creator` — Generate full Controller → Manager → Repository stack
|
|
40
|
-
- `/backend-api-design` — RPC-style API design reference
|
|
41
|
-
- `/kotlin-best-practices` — Null safety, Either, coroutines quick reference
|
|
42
|
-
- `/testing-strategies` — Integration test patterns for Micronaut
|
|
43
|
-
- `/security-checklist` — Auth, validation, OWASP prevention
|
|
44
|
-
|
|
45
|
-
### Backend Agents
|
|
46
|
-
|
|
47
|
-
- `micronaut-backend-expert` — Deep Micronaut framework expertise
|
|
48
|
-
- `solution-architect-cto` — Strategic tech decisions, system design
|
|
10
|
+
**Workflow:** `/spartan:build backend "feature"` handles the full pipeline (plan → migration → endpoint → tests → review → PR).
|
|
49
11
|
|
|
50
12
|
### Backend Commands
|
|
51
13
|
|
|
@@ -53,4 +15,5 @@ For small tasks (< 1 day), `/spartan:quickplan` covers spec + plan in one shot.
|
|
|
53
15
|
|---|---|
|
|
54
16
|
| `/spartan:kotlin-service [name]` | Scaffold Micronaut microservice |
|
|
55
17
|
| `/spartan:review` | PR review with Kotlin/Micronaut conventions |
|
|
56
|
-
| `/spartan:testcontainer [type]` | Setup Testcontainers
|
|
18
|
+
| `/spartan:testcontainer [type]` | Setup Testcontainers |
|
|
19
|
+
| `/spartan:migration "desc"` | Create database migration |
|
|
@@ -42,3 +42,4 @@ For small tasks (< 1 day), `/spartan:quickplan` covers spec + plan in one shot.
|
|
|
42
42
|
| `/spartan:fe-review` | PR review with Next.js App Router conventions |
|
|
43
43
|
| `/spartan:figma-to-code [url]` | Convert Figma screen to production code via MCP |
|
|
44
44
|
| `/spartan:e2e [feature]` | Scaffold Playwright E2E testing |
|
|
45
|
+
| `/spartan:qa [url] [feature]` | Real browser QA — opens Chromium, tests flows, finds bugs |
|
package/claude-md/60-research.md
CHANGED
|
@@ -3,73 +3,25 @@
|
|
|
3
3
|
|
|
4
4
|
## Startup Research Pipeline
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
**Workflows:**
|
|
7
|
+
- `/spartan:startup "idea"` — Full pipeline: brainstorm → validate → research → pitch
|
|
8
|
+
- `/spartan:research "topic"` — Deep research with source tracking and report
|
|
7
9
|
|
|
8
|
-
**
|
|
9
|
-
```
|
|
10
|
-
STAGE 1: DISCOVER STAGE 2: FILTER STAGE 3: DIG STAGE 4: BUILD
|
|
11
|
-
─────────────── ────────────── ───────────── ──────────────
|
|
12
|
-
/spartan:kickoff /spartan:validate /spartan:research /spartan:pitch
|
|
13
|
-
/spartan:brainstorm /spartan:deep-dive /spartan:outreach
|
|
14
|
-
/spartan:teardown /spartan:fundraise
|
|
10
|
+
**Stage shortcuts** (jump to a specific stage):
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
Pick top 3 Kill bad ones Real numbers Ready to send
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Combo Commands
|
|
21
|
-
|
|
22
|
-
| Command | Stages | What It Does |
|
|
23
|
-
|---|---|---|
|
|
24
|
-
| `/spartan:kickoff "theme"` | 1 → 2 | Create project + brainstorm + validate top picks |
|
|
25
|
-
| `/spartan:deep-dive "project"` | 3 | Market research + competitor teardowns + synthesis |
|
|
26
|
-
| `/spartan:fundraise "project"` | 4 | Pitch deck + one-pager + investor emails |
|
|
27
|
-
| `/spartan:full-run "theme"` | 1 → 4 | Whole pipeline with pauses at every gate |
|
|
28
|
-
|
|
29
|
-
### Single Commands
|
|
30
|
-
|
|
31
|
-
| Command | Purpose |
|
|
32
|
-
|---|---|
|
|
33
|
-
| `/spartan:research "topic"` | Deep research with web search and structured report |
|
|
34
|
-
| `/spartan:pitch "type"` | Create investor materials (deck, memo, one-pager) |
|
|
35
|
-
| `/spartan:outreach "investor"` | Draft personalized investor emails |
|
|
36
|
-
| `/spartan:content "source"` | Turn research into platform-native content |
|
|
37
|
-
| `/spartan:write "topic"` | Write blog posts and articles (human voice, no AI slop) |
|
|
38
|
-
|
|
39
|
-
### Research Skills
|
|
40
|
-
|
|
41
|
-
These skills are used by the commands above. You can also use them directly.
|
|
42
|
-
|
|
43
|
-
| Skill | What It Does |
|
|
44
|
-
|---|---|
|
|
45
|
-
| `brainstorm` | Generate and filter startup ideas |
|
|
46
|
-
| `idea-validation` | Score ideas: GO / TEST MORE / PASS |
|
|
47
|
-
| `market-research` | TAM/SAM/SOM, trends, demand signals |
|
|
48
|
-
| `competitive-teardown` | Deep competitor analysis |
|
|
49
|
-
| `deep-research` | Web research with source checking |
|
|
50
|
-
| `investor-materials` | Pitch decks, one-pagers, memos |
|
|
51
|
-
| `investor-outreach` | Personalized investor emails |
|
|
52
|
-
| `article-writing` | Blog posts and long-form content |
|
|
53
|
-
| `content-engine` | Platform-native content from research |
|
|
54
|
-
| `startup-pipeline` | Orchestrates the full pipeline |
|
|
55
|
-
|
|
56
|
-
### Research Agents
|
|
57
|
-
|
|
58
|
-
| Agent | Role |
|
|
12
|
+
| Command | Stage |
|
|
59
13
|
|---|---|
|
|
60
|
-
| `
|
|
61
|
-
|
|
|
14
|
+
| `/spartan:kickoff "theme"` | Brainstorm + validate |
|
|
15
|
+
| `/spartan:deep-dive "project"` | Market research + teardowns |
|
|
16
|
+
| `/spartan:fundraise "project"` | Pitch + outreach |
|
|
62
17
|
|
|
63
|
-
|
|
18
|
+
**Other commands:** `pitch`, `outreach`, `content`, `write`
|
|
64
19
|
|
|
65
|
-
|
|
66
|
-
- **12 frameworks**: Lean Canvas, Design Sprint, Business Model Canvas, JTBD, Mom Test, Value Proposition Canvas, and more
|
|
67
|
-
- **13 templates**: Idea canvas, competitor analysis, user interview, validation checklist, PRD, project readme, epic, feature spec, implementation plan, quality gates, design doc, workflow-backend-micronaut, workflow-frontend-react
|
|
20
|
+
**Agents:** `research-planner` (plans research), `idea-killer` (stress-tests ideas)
|
|
68
21
|
|
|
69
22
|
### Rules
|
|
70
23
|
|
|
71
|
-
- Be a brutal, honest
|
|
24
|
+
- Be a brutal, honest advisor. No sugarcoating.
|
|
72
25
|
- Ask tough questions when ideas are vague.
|
|
73
|
-
- Always analyze competitors and risks.
|
|
74
26
|
- Push for validation before building.
|
|
75
27
|
- Save research outputs in the right stage folder.
|