@patricksardinha/agentkit-cli 0.3.0 → 0.4.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/dist/cli.cjs +59 -107
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +59 -107
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/init.ts +1 -1
- package/src/generators/claudeMdGenerator.ts +3 -14
- package/src/generators/workflowGenerator.ts +9 -36
- package/tests/generators/blueprintSupport.test.ts +35 -30
- package/tests/generators/claudeMdGenerator.test.ts +48 -0
- package/tests/generators/workflowGenerator.test.ts +40 -0
package/dist/cli.cjs
CHANGED
|
@@ -114,25 +114,6 @@ async function isGitRepo(projectPath) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
// src/utils/blueprintParser.ts
|
|
118
|
-
function parseBlueprint(content) {
|
|
119
|
-
const features = [];
|
|
120
|
-
const sectionRegex = /^## (.+)$/gm;
|
|
121
|
-
const sections = [];
|
|
122
|
-
let m;
|
|
123
|
-
while ((m = sectionRegex.exec(content)) !== null) {
|
|
124
|
-
sections.push({ name: m[1].trim(), start: m.index });
|
|
125
|
-
}
|
|
126
|
-
for (let i = 0; i < sections.length; i++) {
|
|
127
|
-
const section = sections[i];
|
|
128
|
-
const end = i + 1 < sections.length ? sections[i + 1].start : content.length;
|
|
129
|
-
const body = content.slice(section.start, end);
|
|
130
|
-
const items = [...body.matchAll(/^[-*]\s+(.+)$/gm)].map((r) => r[1].trim());
|
|
131
|
-
features.push({ name: section.name, items });
|
|
132
|
-
}
|
|
133
|
-
return features;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
117
|
// src/templates/react.ts
|
|
137
118
|
function claudeMd(stack) {
|
|
138
119
|
const lang = stack.hasTypeScript ? "TypeScript" : "JavaScript";
|
|
@@ -567,73 +548,17 @@ function generateClaudeMd(stack, blueprintContent) {
|
|
|
567
548
|
base = claudeMd7(stack);
|
|
568
549
|
}
|
|
569
550
|
if (!blueprintContent) return base;
|
|
570
|
-
const
|
|
571
|
-
if (features.length === 0) return base;
|
|
572
|
-
const featureLines = features.map((f, i) => {
|
|
573
|
-
const sub = f.items.length > 0 ? "\n" + f.items.map((it) => ` - ${it}`).join("\n") : "";
|
|
574
|
-
return `${i + 1}. **${f.name}**${sub}`;
|
|
575
|
-
}).join("\n");
|
|
576
|
-
const featureSection = `
|
|
577
|
-
## Features (Blueprint)
|
|
578
|
-
|
|
579
|
-
${featureLines}
|
|
580
|
-
`;
|
|
551
|
+
const blueprintNote = "\n> A PROJECT_BLUEPRINT.md is present \u2014 Claude Code will read it during Phase 0.\n";
|
|
581
552
|
const conventionsIdx = base.indexOf("\n## Conventions");
|
|
582
553
|
if (conventionsIdx !== -1) {
|
|
583
|
-
return base.slice(0, conventionsIdx) +
|
|
584
|
-
}
|
|
585
|
-
return base + featureSection;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
// src/utils/agentParser.ts
|
|
589
|
-
function toSlug(name) {
|
|
590
|
-
return name.toLowerCase().replace(/[·•&]/g, " ").replace(/[^\w\s-]/g, "").trim().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
591
|
-
}
|
|
592
|
-
function getFieldValue(lines, pattern) {
|
|
593
|
-
for (const line of lines) {
|
|
594
|
-
const m = line.match(pattern);
|
|
595
|
-
if (m) return (m[1] ?? "").trim();
|
|
596
|
-
}
|
|
597
|
-
return "";
|
|
598
|
-
}
|
|
599
|
-
function extractAgentsFromWorkflow(content) {
|
|
600
|
-
const agents = [];
|
|
601
|
-
const blocks = content.split(/(?=^### Agent \d)/m).filter((b) => /^### Agent \d/.test(b.trimStart()));
|
|
602
|
-
for (const block of blocks) {
|
|
603
|
-
const lines = block.split("\n");
|
|
604
|
-
const headerMatch = lines[0].match(/^### Agent (\d+)\s*[·•]\s*(.+)$/);
|
|
605
|
-
if (!headerMatch) continue;
|
|
606
|
-
const number = parseInt(headerMatch[1], 10);
|
|
607
|
-
const name = headerMatch[2].trim();
|
|
608
|
-
const fullName = `Agent ${number} \xB7 ${name}`;
|
|
609
|
-
const slug = toSlug(name);
|
|
610
|
-
const scope = getFieldValue(lines, /Périmètre\s*:\s*(.+)/);
|
|
611
|
-
const criterion = getFieldValue(lines, /Critère[s]?\s*:\s*(.+)/);
|
|
612
|
-
const outputs = [];
|
|
613
|
-
const produitIdx = lines.findIndex((l) => /Produit\s*:/.test(l));
|
|
614
|
-
if (produitIdx !== -1) {
|
|
615
|
-
const inlineVal = (lines[produitIdx].match(/Produit\s*:\s*(.+)/)?.[1] ?? "").trim();
|
|
616
|
-
if (inlineVal) {
|
|
617
|
-
outputs.push(inlineVal);
|
|
618
|
-
} else {
|
|
619
|
-
for (let i = produitIdx + 1; i < lines.length; i++) {
|
|
620
|
-
const line = lines[i];
|
|
621
|
-
if (/^\s+[-]/.test(line)) {
|
|
622
|
-
outputs.push(line.trim().replace(/^-\s*/, ""));
|
|
623
|
-
} else if (line.trim() !== "" && !/^\s/.test(line)) {
|
|
624
|
-
break;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
agents.push({ number, name, fullName, slug, scope, outputs, criterion });
|
|
554
|
+
return base.slice(0, conventionsIdx) + blueprintNote + base.slice(conventionsIdx);
|
|
630
555
|
}
|
|
631
|
-
return
|
|
556
|
+
return base + blueprintNote;
|
|
632
557
|
}
|
|
633
558
|
|
|
634
559
|
// src/generators/workflowGenerator.ts
|
|
635
|
-
function generateWorkflow(stack, blueprintContent) {
|
|
636
|
-
if (blueprintContent) return
|
|
560
|
+
function generateWorkflow(stack, blueprintContent, projectName) {
|
|
561
|
+
if (blueprintContent) return blueprintPlaceholder(projectName ?? stack.framework);
|
|
637
562
|
switch (stack.framework) {
|
|
638
563
|
case "react":
|
|
639
564
|
return workflow(stack);
|
|
@@ -651,35 +576,16 @@ function generateWorkflow(stack, blueprintContent) {
|
|
|
651
576
|
return workflow7(stack);
|
|
652
577
|
}
|
|
653
578
|
}
|
|
654
|
-
function
|
|
655
|
-
|
|
656
|
-
const agentBlocks = features.map((feature, i) => {
|
|
657
|
-
const n = i + 1;
|
|
658
|
-
const slug = toSlug(feature.name);
|
|
659
|
-
const outputLines = feature.items.length > 0 ? feature.items.map((item) => ` - ${item}`).join("\n") : ` - src/${slug}/`;
|
|
660
|
-
return `### Agent ${n} \xB7 ${feature.name}
|
|
661
|
-
P\xE9rim\xE8tre : Impl\xE9menter la fonctionnalit\xE9 ${feature.name.toLowerCase()}
|
|
662
|
-
Produit :
|
|
663
|
-
${outputLines}
|
|
664
|
-
Crit\xE8re : npm test (tests ${feature.name.toLowerCase()} passent)`;
|
|
665
|
-
});
|
|
666
|
-
const ciN = features.length + 1;
|
|
667
|
-
agentBlocks.push(
|
|
668
|
-
`### Agent ${ciN} \xB7 Tests & CI
|
|
669
|
-
P\xE9rim\xE8tre : Couverture de tests compl\xE8te et configuration du pipeline CI
|
|
670
|
-
Produit :
|
|
671
|
-
- tests/
|
|
672
|
-
- .github/workflows/
|
|
673
|
-
Crit\xE8re : npm test passe, pipeline CI vert`
|
|
674
|
-
);
|
|
675
|
-
return `# Agent Workflow \u2014 ${stack.framework} (Blueprint)
|
|
579
|
+
function blueprintPlaceholder(projectName) {
|
|
580
|
+
return `# AGENT_WORKFLOW.md \u2014 ${projectName}
|
|
676
581
|
|
|
677
|
-
|
|
678
|
-
|
|
582
|
+
> This file will be filled in by Claude Code during Phase 0.
|
|
583
|
+
> Claude Code will read PROJECT_BLUEPRINT.md, propose a decomposition,
|
|
584
|
+
> and replace this content after human validation.
|
|
679
585
|
|
|
680
|
-
|
|
586
|
+
---
|
|
681
587
|
|
|
682
|
-
|
|
588
|
+
*Waiting for Phase 0 decomposition...*
|
|
683
589
|
`;
|
|
684
590
|
}
|
|
685
591
|
|
|
@@ -894,6 +800,52 @@ ${outputLines}
|
|
|
894
800
|
`;
|
|
895
801
|
}
|
|
896
802
|
|
|
803
|
+
// src/utils/agentParser.ts
|
|
804
|
+
function toSlug(name) {
|
|
805
|
+
return name.toLowerCase().replace(/[·•&]/g, " ").replace(/[^\w\s-]/g, "").trim().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
806
|
+
}
|
|
807
|
+
function getFieldValue(lines, pattern) {
|
|
808
|
+
for (const line of lines) {
|
|
809
|
+
const m = line.match(pattern);
|
|
810
|
+
if (m) return (m[1] ?? "").trim();
|
|
811
|
+
}
|
|
812
|
+
return "";
|
|
813
|
+
}
|
|
814
|
+
function extractAgentsFromWorkflow(content) {
|
|
815
|
+
const agents = [];
|
|
816
|
+
const blocks = content.split(/(?=^### Agent \d)/m).filter((b) => /^### Agent \d/.test(b.trimStart()));
|
|
817
|
+
for (const block of blocks) {
|
|
818
|
+
const lines = block.split("\n");
|
|
819
|
+
const headerMatch = lines[0].match(/^### Agent (\d+)\s*[·•]\s*(.+)$/);
|
|
820
|
+
if (!headerMatch) continue;
|
|
821
|
+
const number = parseInt(headerMatch[1], 10);
|
|
822
|
+
const name = headerMatch[2].trim();
|
|
823
|
+
const fullName = `Agent ${number} \xB7 ${name}`;
|
|
824
|
+
const slug = toSlug(name);
|
|
825
|
+
const scope = getFieldValue(lines, /Périmètre\s*:\s*(.+)/);
|
|
826
|
+
const criterion = getFieldValue(lines, /Critère[s]?\s*:\s*(.+)/);
|
|
827
|
+
const outputs = [];
|
|
828
|
+
const produitIdx = lines.findIndex((l) => /Produit\s*:/.test(l));
|
|
829
|
+
if (produitIdx !== -1) {
|
|
830
|
+
const inlineVal = (lines[produitIdx].match(/Produit\s*:\s*(.+)/)?.[1] ?? "").trim();
|
|
831
|
+
if (inlineVal) {
|
|
832
|
+
outputs.push(inlineVal);
|
|
833
|
+
} else {
|
|
834
|
+
for (let i = produitIdx + 1; i < lines.length; i++) {
|
|
835
|
+
const line = lines[i];
|
|
836
|
+
if (/^\s+[-]/.test(line)) {
|
|
837
|
+
outputs.push(line.trim().replace(/^-\s*/, ""));
|
|
838
|
+
} else if (line.trim() !== "" && !/^\s/.test(line)) {
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
agents.push({ number, name, fullName, slug, scope, outputs, criterion });
|
|
845
|
+
}
|
|
846
|
+
return agents;
|
|
847
|
+
}
|
|
848
|
+
|
|
897
849
|
// src/utils/logger.ts
|
|
898
850
|
var import_chalk = __toESM(require("chalk"), 1);
|
|
899
851
|
var logger = {
|
|
@@ -993,7 +945,7 @@ function registerInit(program2) {
|
|
|
993
945
|
}
|
|
994
946
|
const genSpinner = (0, import_ora.default)("G\xE9n\xE9ration des fichiers\u2026").start();
|
|
995
947
|
const claudeMdContent = generateClaudeMd(stack, blueprintContent);
|
|
996
|
-
const workflowContent = generateWorkflow(stack, blueprintContent);
|
|
948
|
+
const workflowContent = generateWorkflow(stack, blueprintContent, projectName);
|
|
997
949
|
const agents = extractAgentsFromWorkflow(workflowContent);
|
|
998
950
|
const playbookContent = generatePlaybook({ agents, projectName, hasBlueprint: !!blueprintContent });
|
|
999
951
|
await (0, import_promises4.writeFile)(claudeMdPath, claudeMdContent, "utf-8");
|
package/dist/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts","../src/commands/init.ts","../src/detectors/stackDetector.ts","../src/detectors/gitDetector.ts","../src/utils/blueprintParser.ts","../src/templates/react.ts","../src/templates/nextjs.ts","../src/templates/tauri.ts","../src/templates/fastapi.ts","../src/templates/express.ts","../src/templates/node.ts","../src/templates/unknown.ts","../src/generators/claudeMdGenerator.ts","../src/utils/agentParser.ts","../src/generators/workflowGenerator.ts","../src/generators/playbookGenerator.ts","../src/generators/skillsGenerator.ts","../src/utils/logger.ts","../src/commands/add.ts","../src/commands/status.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander'\nimport { registerInit } from './commands/init.js'\nimport { registerAdd } from './commands/add.js'\nimport { registerStatus } from './commands/status.js'\n\nconst program = new Command()\n\nprogram\n .name('agentkit')\n .description('Scaffolder des workflows multi-agents Claude Code')\n .version('0.1.0')\n\nregisterInit(program)\nregisterAdd(program)\nregisterStatus(program)\n\nprogram.parse()\n","import type { Command } from 'commander'\nimport { writeFile, readFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport inquirer from 'inquirer'\nimport ora from 'ora'\nimport { detectStack } from '../detectors/stackDetector.js'\nimport { isGitRepo } from '../detectors/gitDetector.js'\nimport { generateClaudeMd } from '../generators/claudeMdGenerator.js'\nimport { generateWorkflow } from '../generators/workflowGenerator.js'\nimport { generatePlaybook } from '../generators/playbookGenerator.js'\nimport { generateSkills } from '../generators/skillsGenerator.js'\nimport { extractAgentsFromWorkflow } from '../utils/agentParser.js'\nimport { logger } from '../utils/logger.js'\nimport type { StackInfo } from '../detectors/stackDetector.js'\nimport { basename } from 'node:path'\n\nconst FRAMEWORK_LABELS: Record<StackInfo['framework'], string> = {\n react: 'React',\n nextjs: 'Next.js',\n tauri: 'Tauri',\n fastapi: 'FastAPI (Python)',\n express: 'Express',\n node: 'Node.js',\n unknown: 'Unknown (generic)',\n}\n\nasync function fileExists(path: string): Promise<boolean> {\n try {\n await readFile(path)\n return true\n } catch {\n return false\n }\n}\n\nexport function registerInit(program: Command): void {\n program\n .command('init')\n .description('Génère CLAUDE.md et AGENT_WORKFLOW.md dans le dossier courant')\n .option('-f, --force', 'Écrase les fichiers existants sans confirmation')\n .option('--blueprint <path>', 'Fichier blueprint .md à utiliser pour personnaliser les fichiers générés')\n .action(async (options: { force?: boolean; blueprint?: string }) => {\n const cwd = process.cwd()\n\n const spinner = ora('Détection de la stack…').start()\n const [stack, isGit] = await Promise.all([detectStack(cwd), isGitRepo(cwd)])\n spinner.stop()\n\n if (!isGit) {\n logger.warn('Ce dossier n\\'est pas un repo git — lancez git init si nécessaire')\n }\n\n const label = FRAMEWORK_LABELS[stack.framework]\n logger.info(`Stack détectée : ${label} (${stack.language})`)\n\n const { confirmed } = await inquirer.prompt<{ confirmed: boolean }>([\n {\n type: 'confirm',\n name: 'confirmed',\n message: `Générer les fichiers pour ${label} ?`,\n default: true,\n },\n ])\n\n if (!confirmed) {\n logger.warn('Annulé.')\n return\n }\n\n const claudeMdPath = join(cwd, 'CLAUDE.md')\n const workflowPath = join(cwd, 'AGENT_WORKFLOW.md')\n const playbookPath = join(cwd, 'PLAYBOOK.md')\n\n // Resolve project name from package.json or directory name\n let projectName = basename(cwd)\n try {\n const pkg = JSON.parse(await readFile(join(cwd, 'package.json'), 'utf-8')) as { name?: string }\n if (pkg.name) projectName = pkg.name\n } catch { /* fallback to dirname */ }\n\n if (!options.force) {\n const existing: string[] = []\n if (await fileExists(claudeMdPath)) existing.push('CLAUDE.md')\n if (await fileExists(workflowPath)) existing.push('AGENT_WORKFLOW.md')\n if (await fileExists(playbookPath)) existing.push('PLAYBOOK.md')\n\n if (existing.length > 0) {\n const { overwrite } = await inquirer.prompt<{ overwrite: boolean }>([\n {\n type: 'confirm',\n name: 'overwrite',\n message: `${existing.join(' et ')} existe déjà. Écraser ?`,\n default: false,\n },\n ])\n if (!overwrite) {\n logger.warn('Annulé.')\n return\n }\n }\n }\n\n // Load blueprint if provided\n let blueprintContent: string | undefined\n if (options.blueprint) {\n try {\n blueprintContent = await readFile(options.blueprint, 'utf-8')\n } catch {\n logger.error(`Blueprint introuvable : ${options.blueprint}`)\n process.exit(1)\n }\n }\n\n const genSpinner = ora('Génération des fichiers…').start()\n const claudeMdContent = generateClaudeMd(stack, blueprintContent)\n const workflowContent = generateWorkflow(stack, blueprintContent)\n const agents = extractAgentsFromWorkflow(workflowContent)\n const playbookContent = generatePlaybook({ agents, projectName, hasBlueprint: !!blueprintContent })\n await writeFile(claudeMdPath, claudeMdContent, 'utf-8')\n await writeFile(workflowPath, workflowContent, 'utf-8')\n await writeFile(playbookPath, playbookContent, 'utf-8')\n await generateSkills(agents, cwd)\n genSpinner.succeed('Fichiers générés')\n\n logger.success('CLAUDE.md → créé')\n logger.success('AGENT_WORKFLOW.md → créé')\n logger.success('PLAYBOOK.md → créé')\n logger.success(`agents/ → ${agents.length} dossier(s) créé(s)`)\n })\n}\n","import { readFile, access } from 'node:fs/promises'\nimport { join } from 'node:path'\n\nexport interface StackInfo {\n framework: 'react' | 'nextjs' | 'tauri' | 'fastapi' | 'express' | 'node' | 'unknown'\n language: 'typescript' | 'javascript' | 'python' | 'unknown'\n hasTypeScript: boolean\n extras: string[]\n}\n\nasync function pathExists(p: string): Promise<boolean> {\n try {\n await access(p)\n return true\n } catch {\n return false\n }\n}\n\nasync function readJson(p: string): Promise<Record<string, unknown> | null> {\n try {\n const raw = await readFile(p, 'utf-8')\n return JSON.parse(raw) as Record<string, unknown>\n } catch {\n return null\n }\n}\n\nasync function readText(p: string): Promise<string | null> {\n try {\n return await readFile(p, 'utf-8')\n } catch {\n return null\n }\n}\n\nexport async function detectStack(projectPath: string): Promise<StackInfo> {\n const info: StackInfo = {\n framework: 'unknown',\n language: 'unknown',\n hasTypeScript: false,\n extras: [],\n }\n\n const packageJson = await readJson(join(projectPath, 'package.json'))\n const requirementsTxt = await readText(join(projectPath, 'requirements.txt'))\n const hasTauriDir = await pathExists(join(projectPath, 'src-tauri'))\n const hasTsConfig = await pathExists(join(projectPath, 'tsconfig.json'))\n\n if (packageJson !== null) {\n const deps = (packageJson.dependencies as Record<string, string>) ?? {}\n const devDeps = (packageJson.devDependencies as Record<string, string>) ?? {}\n const allDeps = { ...deps, ...devDeps }\n\n info.hasTypeScript = 'typescript' in allDeps || hasTsConfig\n info.language = info.hasTypeScript ? 'typescript' : 'javascript'\n\n // Order matters: most specific first\n if ('next' in allDeps) {\n info.framework = 'nextjs'\n } else if (hasTauriDir || '@tauri-apps/api' in allDeps || '@tauri-apps/cli' in allDeps) {\n info.framework = 'tauri'\n } else if ('react' in allDeps) {\n info.framework = 'react'\n } else if ('express' in allDeps) {\n info.framework = 'express'\n } else {\n info.framework = 'node'\n }\n\n if ('vitest' in allDeps || 'jest' in allDeps) info.extras.push('testing')\n if ('prisma' in allDeps || '@prisma/client' in allDeps) info.extras.push('prisma')\n if ('tailwindcss' in allDeps) info.extras.push('tailwind')\n }\n\n if (requirementsTxt !== null && info.framework === 'unknown') {\n info.language = 'python'\n if (/\\bfastapi\\b/i.test(requirementsTxt)) {\n info.framework = 'fastapi'\n }\n }\n\n if (hasTauriDir && info.framework === 'unknown') {\n info.framework = 'tauri'\n }\n\n return info\n}\n","import { access } from 'node:fs/promises'\nimport { join } from 'node:path'\n\nexport async function isGitRepo(projectPath: string): Promise<boolean> {\n try {\n await access(join(projectPath, '.git'))\n return true\n } catch {\n return false\n }\n}\n","export interface BlueprintFeature {\n name: string\n items: string[]\n}\n\nexport function parseBlueprint(content: string): BlueprintFeature[] {\n const features: BlueprintFeature[] = []\n\n // Locate all ## headings (not # or ###)\n const sectionRegex = /^## (.+)$/gm\n const sections: Array<{ name: string; start: number }> = []\n let m: RegExpExecArray | null\n while ((m = sectionRegex.exec(content)) !== null) {\n sections.push({ name: m[1].trim(), start: m.index })\n }\n\n for (let i = 0; i < sections.length; i++) {\n const section = sections[i]\n const end = i + 1 < sections.length ? sections[i + 1].start : content.length\n const body = content.slice(section.start, end)\n\n const items = [...body.matchAll(/^[-*]\\s+(.+)$/gm)].map((r) => r[1].trim())\n\n features.push({ name: section.name, items })\n }\n\n return features\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n const testLine = stack.extras.includes('testing') ? '- `npm test` — run tests\\n' : ''\n return `# CLAUDE.md — React Project\n\n## Stack\n- Framework : React (${lang})\n- Language : ${lang}\n- Build : Vite\n\n## Commands\n- \\`npm run dev\\` — development server\n- \\`npm run build\\` — production build\n${testLine}\n## Structure\nsrc/\n components/ ← UI components (PascalCase)\n hooks/ ← custom hooks (prefix: use*)\n pages/ ← page-level components\n utils/ ← shared helpers\n\n## Conventions\n1. Components in PascalCase\n2. Hooks prefixed with \\`use\\`\n3. Props interfaces named \\`*Props\\`\n4. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# Agent Workflow — React Project\n\n## Stack détectée\nFramework: React | Language: ${lang}\n\n## Agents\n\n### Agent 1 · Components\nPérimètre : composants UI réutilisables\nProduit : src/components/\nCritère : composants documentés et testés\n\n### Agent 2 · State & Hooks\nPérimètre : state management, hooks personnalisés\nProduit : src/hooks/\nCritère : hooks testés unitairement\n\n### Agent 3 · Pages & Routing\nPérimètre : assemblage des pages, react-router\nProduit : src/pages/\nCritère : navigation fonctionnelle\n\n### Agent 4 · Tests & CI\nPérimètre : couverture de tests, configuration CI\nProduit : tests/, .github/workflows/\nCritère : npm test passe\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const hasTailwind = stack.extras.includes('tailwind')\n const hasPrisma = stack.extras.includes('prisma')\n return `# CLAUDE.md — Next.js Project\n\n## Stack\n- Framework : Next.js (TypeScript)\n- Rendering : App Router (RSC + Client Components)\n- Styling : ${hasTailwind ? 'Tailwind CSS' : 'CSS Modules'}\n${hasPrisma ? '- Database : Prisma ORM\\n' : ''}\n## Commands\n- \\`npm run dev\\` — development server (http://localhost:3000)\n- \\`npm run build\\` — production build\n- \\`npm start\\` — production server\n- \\`npm test\\` — run tests\n\n## Structure\nsrc/\n app/ ← App Router pages and layouts\n components/ ← shared UI components\n lib/ ← server utilities, db clients\n utils/ ← shared helpers\n\n## Conventions\n1. Server Components by default, \\`'use client'\\` only when needed\n2. API routes in \\`src/app/api/\\`\n3. Environment variables via \\`src/env.ts\\` (validated)\n4. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const hasPrisma = stack.extras.includes('prisma')\n return `# Agent Workflow — Next.js Project\n\n## Stack détectée\nFramework: Next.js | Language: TypeScript\n\n## Agents\n\n### Agent 1 · Data Layer\nPérimètre : schéma${hasPrisma ? ' Prisma' : ''}, types, server actions\nProduit : src/lib/, ${hasPrisma ? 'prisma/schema.prisma' : 'src/types/'}\nCritère : types compilent, migrations propres\n\n### Agent 2 · UI Components\nPérimètre : composants réutilisables (Server + Client)\nProduit : src/components/\nCritère : composants rendus sans erreur\n\n### Agent 3 · Pages & Layout\nPérimètre : App Router, layouts, pages\nProduit : src/app/\nCritère : navigation fonctionnelle, build passe\n\n### Agent 4 · API & Tests\nPérimètre : API routes, tests e2e/unitaires\nProduit : src/app/api/, tests/\nCritère : npm test passe\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# CLAUDE.md — Tauri Project\n\n## Stack\n- Framework : Tauri (Rust + ${lang} frontend)\n- Language : Rust (backend) + ${lang} (frontend)\n- Build : Cargo + Vite\n\n## Commands\n- \\`npm run tauri dev\\` — development (hot reload)\n- \\`npm run tauri build\\` — production bundle\n- \\`npm run build\\` — frontend only\n- \\`npm test\\` — run tests\n\n## Structure\nsrc/ ← frontend (${lang})\n components/\n utils/\nsrc-tauri/ ← Rust backend\n src/\n main.rs ← Tauri entry point\n commands.rs ← Tauri commands (IPC)\n tauri.conf.json\n\n## Conventions\n1. IPC commands defined in \\`src-tauri/src/commands.rs\\`\n2. Frontend invokes via \\`@tauri-apps/api/tauri\\`\n3. No direct filesystem access from frontend\n4. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# Agent Workflow — Tauri Project\n\n## Stack détectée\nFramework: Tauri | Language: Rust + ${lang}\n\n## Agents\n\n### Agent 1 · Rust Commands\nPérimètre : commandes Tauri (IPC), permissions\nProduit : src-tauri/src/commands.rs, tauri.conf.json\nCritère : \\`cargo build\\` passe\n\n### Agent 2 · Frontend UI\nPérimètre : interface ${lang}, intégration IPC\nProduit : src/components/, src/utils/\nCritère : appels IPC fonctionnels\n\n### Agent 3 · Build & Packaging\nPérimètre : configuration build, icônes, installeurs\nProduit : src-tauri/tauri.conf.json, icons/\nCritère : \\`npm run tauri build\\` produit un bundle\n\n### Agent 4 · Tests\nPérimètre : tests Rust + tests frontend\nProduit : src-tauri/tests/, tests/\nCritère : \\`cargo test\\` + \\`npm test\\` passent\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(_stack: StackInfo): string {\n return `# CLAUDE.md — FastAPI Project\n\n## Stack\n- Framework : FastAPI (Python)\n- Language : Python 3.11+\n- Server : Uvicorn\n- Validation: Pydantic v2\n\n## Commands\n- \\`uvicorn main:app --reload\\` — development server (http://localhost:8000)\n- \\`pytest\\` — run tests\n- \\`pip install -r requirements.txt\\` — install dependencies\n\n## Structure\napp/\n main.py ← FastAPI app entry point\n routers/ ← API route groups\n models/ ← Pydantic models\n services/ ← business logic\n dependencies/ ← FastAPI dependencies (DI)\ntests/ ← pytest tests\n\n## Conventions\n1. Routers grouped by domain in \\`app/routers/\\`\n2. Pydantic models for all request/response bodies\n3. Business logic in \\`app/services/\\`, not in routes\n4. Async endpoints by default (\\`async def\\`)\n5. Environment variables via \\`python-dotenv\\` + \\`pydantic-settings\\`\n`\n}\n\nexport function workflow(_stack: StackInfo): string {\n return `# Agent Workflow — FastAPI Project\n\n## Stack détectée\nFramework: FastAPI | Language: Python\n\n## Agents\n\n### Agent 1 · Models & Schemas\nPérimètre : modèles Pydantic, schémas DB (SQLAlchemy/SQLModel)\nProduit : app/models/\nCritère : modèles validés, migrations propres\n\n### Agent 2 · Services\nPérimètre : logique métier, accès base de données\nProduit : app/services/\nCritère : services testés unitairement (pytest)\n\n### Agent 3 · Routers & API\nPérimètre : routes FastAPI, dépendances, auth\nProduit : app/routers/, app/dependencies/\nCritère : endpoints documentés (OpenAPI), tests d'intégration\n\n### Agent 4 · Tests & CI\nPérimètre : couverture pytest, configuration CI\nProduit : tests/, .github/workflows/\nCritère : \\`pytest\\` passe à 100%\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n const hasPrisma = stack.extras.includes('prisma')\n return `# CLAUDE.md — Express Project\n\n## Stack\n- Framework : Express (${lang})\n- Language : ${lang}\n- Runtime : Node.js 20+\n${hasPrisma ? '- Database : Prisma ORM\\n' : ''}\n## Commands\n- \\`npm run dev\\` — development server (nodemon)\n- \\`npm run build\\` — compile TypeScript\n- \\`npm start\\` — production server\n- \\`npm test\\` — run tests\n\n## Structure\nsrc/\n routes/ ← Express routers (one per domain)\n controllers/ ← request handlers\n services/ ← business logic\n middleware/ ← Express middleware\n utils/ ← shared helpers\n\n## Conventions\n1. Routes grouped by domain in \\`src/routes/\\`\n2. Business logic in \\`src/services/\\`, not in controllers\n3. Middleware for cross-cutting concerns (auth, validation)\n4. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# Agent Workflow — Express Project\n\n## Stack détectée\nFramework: Express | Language: ${lang}\n\n## Agents\n\n### Agent 1 · Data & Models\nPérimètre : modèles de données, accès DB\nProduit : src/models/, src/services/db.ts\nCritère : connexion DB fonctionnelle\n\n### Agent 2 · Services\nPérimètre : logique métier\nProduit : src/services/\nCritère : services testés unitairement\n\n### Agent 3 · Routes & Controllers\nPérimètre : routes Express, validation, auth\nProduit : src/routes/, src/controllers/, src/middleware/\nCritère : endpoints répondent correctement\n\n### Agent 4 · Tests & CI\nPérimètre : tests d'intégration, configuration CI\nProduit : tests/, .github/workflows/\nCritère : npm test passe\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# CLAUDE.md — Node.js Project\n\n## Stack\n- Runtime : Node.js 20+\n- Language : ${lang}\n\n## Commands\n- \\`npm run dev\\` — development (with watch)\n- \\`npm run build\\` — compile${stack.hasTypeScript ? ' TypeScript' : ''}\n- \\`npm start\\` — run production build\n- \\`npm test\\` — run tests\n\n## Structure\nsrc/\n index.ts ← entry point\n lib/ ← core library code\n utils/ ← shared helpers\n\n## Conventions\n1. Modules follow single-responsibility principle\n2. Async/await over callbacks\n3. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# Agent Workflow — Node.js Project\n\n## Stack détectée\nRuntime: Node.js | Language: ${lang}\n\n## Agents\n\n### Agent 1 · Core Library\nPérimètre : logique principale\nProduit : src/lib/\nCritère : module fonctionne et testé\n\n### Agent 2 · CLI / API\nPérimètre : interface utilisateur (CLI ou API)\nProduit : src/index.ts, src/cli.ts\nCritère : commandes fonctionnelles\n\n### Agent 3 · Tests & CI\nPérimètre : couverture de tests, configuration CI\nProduit : tests/, .github/workflows/\nCritère : npm test passe\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(_stack: StackInfo): string {\n return `# CLAUDE.md\n\n## Stack\nStack non détectée automatiquement — à remplir manuellement.\n\n## Commands\n- À définir selon le projet\n\n## Structure\nsrc/ ← code source\ntests/ ← tests\n\n## Conventions\n1. Tout output console passe par un logger centralisé\n2. À compléter selon les conventions du projet\n`\n}\n\nexport function workflow(_stack: StackInfo): string {\n return `# Agent Workflow\n\n## Stack détectée\nStack inconnue — workflow générique.\n\n## Agents\n\n### Agent 1 · Setup\nPérimètre : configuration initiale du projet\nProduit : structure de base\nCritère : projet compilable\n\n### Agent 2 · Core\nPérimètre : logique principale\nProduit : src/\nCritère : fonctionnalités principales opérationnelles\n\n### Agent 3 · Tests\nPérimètre : couverture de tests\nProduit : tests/\nCritère : tests passent\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\nimport { parseBlueprint } from '../utils/blueprintParser.js'\nimport * as react from '../templates/react.js'\nimport * as nextjs from '../templates/nextjs.js'\nimport * as tauri from '../templates/tauri.js'\nimport * as fastapi from '../templates/fastapi.js'\nimport * as express from '../templates/express.js'\nimport * as node from '../templates/node.js'\nimport * as unknown from '../templates/unknown.js'\n\nexport function generateClaudeMd(stack: StackInfo, blueprintContent?: string): string {\n let base: string\n switch (stack.framework) {\n case 'react': base = react.claudeMd(stack); break\n case 'nextjs': base = nextjs.claudeMd(stack); break\n case 'tauri': base = tauri.claudeMd(stack); break\n case 'fastapi': base = fastapi.claudeMd(stack); break\n case 'express': base = express.claudeMd(stack); break\n case 'node': base = node.claudeMd(stack); break\n default: base = unknown.claudeMd(stack)\n }\n\n if (!blueprintContent) return base\n\n const features = parseBlueprint(blueprintContent)\n if (features.length === 0) return base\n\n const featureLines = features\n .map((f, i) => {\n const sub = f.items.length > 0 ? '\\n' + f.items.map((it) => ` - ${it}`).join('\\n') : ''\n return `${i + 1}. **${f.name}**${sub}`\n })\n .join('\\n')\n\n const featureSection = `\\n## Features (Blueprint)\\n\\n${featureLines}\\n`\n\n const conventionsIdx = base.indexOf('\\n## Conventions')\n if (conventionsIdx !== -1) {\n return base.slice(0, conventionsIdx) + featureSection + base.slice(conventionsIdx)\n }\n return base + featureSection\n}\n","import type { Agent } from '../types/agent.js'\n\nexport function toSlug(name: string): string {\n return name\n .toLowerCase()\n .replace(/[·•&]/g, ' ')\n .replace(/[^\\w\\s-]/g, '')\n .trim()\n .replace(/\\s+/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n}\n\nfunction getFieldValue(lines: string[], pattern: RegExp): string {\n for (const line of lines) {\n const m = line.match(pattern)\n if (m) return (m[1] ?? '').trim()\n }\n return ''\n}\n\nexport function extractAgentsFromWorkflow(content: string): Agent[] {\n const agents: Agent[] = []\n\n // Split into blocks starting with \"### Agent N\"\n const blocks = content\n .split(/(?=^### Agent \\d)/m)\n .filter((b) => /^### Agent \\d/.test(b.trimStart()))\n\n for (const block of blocks) {\n const lines = block.split('\\n')\n\n const headerMatch = lines[0].match(/^### Agent (\\d+)\\s*[·•]\\s*(.+)$/)\n if (!headerMatch) continue\n\n const number = parseInt(headerMatch[1], 10)\n const name = headerMatch[2].trim()\n const fullName = `Agent ${number} · ${name}`\n const slug = toSlug(name)\n\n const scope = getFieldValue(lines, /Périmètre\\s*:\\s*(.+)/)\n const criterion = getFieldValue(lines, /Critère[s]?\\s*:\\s*(.+)/)\n\n // Outputs: may be inline or multi-line (indented \"- item\")\n const outputs: string[] = []\n const produitIdx = lines.findIndex((l) => /Produit\\s*:/.test(l))\n if (produitIdx !== -1) {\n const inlineVal = (lines[produitIdx].match(/Produit\\s*:\\s*(.+)/)?.[1] ?? '').trim()\n if (inlineVal) {\n outputs.push(inlineVal)\n } else {\n for (let i = produitIdx + 1; i < lines.length; i++) {\n const line = lines[i]\n if (/^\\s+[-]/.test(line)) {\n outputs.push(line.trim().replace(/^-\\s*/, ''))\n } else if (line.trim() !== '' && !/^\\s/.test(line)) {\n break\n }\n }\n }\n }\n\n agents.push({ number, name, fullName, slug, scope, outputs, criterion })\n }\n\n return agents\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\nimport { parseBlueprint } from '../utils/blueprintParser.js'\nimport { toSlug } from '../utils/agentParser.js'\nimport * as react from '../templates/react.js'\nimport * as nextjs from '../templates/nextjs.js'\nimport * as tauri from '../templates/tauri.js'\nimport * as fastapi from '../templates/fastapi.js'\nimport * as express from '../templates/express.js'\nimport * as node from '../templates/node.js'\nimport * as unknown from '../templates/unknown.js'\n\nexport function generateWorkflow(stack: StackInfo, blueprintContent?: string): string {\n if (blueprintContent) return blueprintWorkflow(stack, blueprintContent)\n\n switch (stack.framework) {\n case 'react': return react.workflow(stack)\n case 'nextjs': return nextjs.workflow(stack)\n case 'tauri': return tauri.workflow(stack)\n case 'fastapi': return fastapi.workflow(stack)\n case 'express': return express.workflow(stack)\n case 'node': return node.workflow(stack)\n default: return unknown.workflow(stack)\n }\n}\n\nfunction blueprintWorkflow(stack: StackInfo, blueprintContent: string): string {\n const features = parseBlueprint(blueprintContent)\n\n const agentBlocks = features.map((feature, i) => {\n const n = i + 1\n const slug = toSlug(feature.name)\n const outputLines =\n feature.items.length > 0\n ? feature.items.map((item) => ` - ${item}`).join('\\n')\n : ` - src/${slug}/`\n return `### Agent ${n} · ${feature.name}\nPérimètre : Implémenter la fonctionnalité ${feature.name.toLowerCase()}\nProduit :\n${outputLines}\nCritère : npm test (tests ${feature.name.toLowerCase()} passent)`\n })\n\n const ciN = features.length + 1\n agentBlocks.push(\n `### Agent ${ciN} · Tests & CI\nPérimètre : Couverture de tests complète et configuration du pipeline CI\nProduit :\n - tests/\n - .github/workflows/\nCritère : npm test passe, pipeline CI vert`,\n )\n\n return `# Agent Workflow — ${stack.framework} (Blueprint)\n\n## Stack détectée\nFramework: ${stack.framework} | Language: ${stack.language}\n\n## Agents\n\n${agentBlocks.join('\\n\\n')}\n`\n}\n","import type { Agent } from '../types/agent.js'\n\nexport interface PlaybookInput {\n agents: Agent[]\n projectName: string\n hasBlueprint: boolean\n}\n\nexport function generatePlaybook({ agents, projectName, hasBlueprint }: PlaybookInput): string {\n const agentBlocks = agents.map((a) => agentBlock(a)).join('\\n---\\n\\n')\n\n const phase0 = hasBlueprint\n ? `## Phase 0 — Agent Decomposition (run this first)\n\n> A \\`PROJECT_BLUEPRINT.md\\` was provided.\n> Claude Code reads it and decomposes the project into specialized agents\n> before writing a single line of code.\n\n**Read these files in order:**\n1. \\`CLAUDE.md\\`\n2. \\`PROJECT_BLUEPRINT.md\\`\n\n**Then decompose the project into agents** following these rules:\n\n- One agent = one coherent technical layer (never mix two layers)\n- Each agent must have a runnable success criterion (\\`npm test\\`, \\`cargo build\\`…)\n- Agents must be ordered by dependency (no feature without infra first)\n- Maximum 6 agents — if you have more, group related ones\n- Always respect this order:\n 1. Infra & Configuration\n 2. Data layer (DB schema, models, services)\n 3. External integrations (auth, APIs, local services like Ollama)\n 4. UI & pages\n 5. Advanced features (RAG, export, realtime…)\n 6. Build & release (CI/CD, packaging, installers)\n\n**Write the result directly into \\`AGENT_WORKFLOW.md\\`** — replace its current\ncontent with your decomposition.\n\n**Then ask for human validation:**\n> \"I have decomposed the project into N agents: [list them].\n> Should I proceed with execution?\"\n\nWait for confirmation before moving to Phase 1.\n\n---\n\n`\n : `## Phase 0 — Project Discovery (run this first)\n\n> No \\`PROJECT_BLUEPRINT.md\\` was provided.\n> Before writing any code, Claude Code asks the user what they want to build,\n> then decomposes the project into agents — exactly as if a blueprint had been provided.\n\n**Ask the user these questions and wait for their answers:**\n\n1. What is this project? (one sentence describing the goal)\n2. What are the main features you want to build? (list them)\n3. Are there any tech constraints or architecture preferences?\n (e.g. offline-only, specific DB, no auth, specific framework)\n\n**Once you have the answers, decompose the project into agents**\nfollowing these rules:\n\n- One agent = one coherent technical layer (never mix two layers)\n- Each agent must have a runnable success criterion (\\`npm test\\`, \\`cargo build\\`…)\n- Agents must be ordered by dependency (no feature without infra first)\n- Maximum 6 agents — if you have more, group related ones\n- Always respect this order:\n 1. Infra & Configuration\n 2. Data layer (DB schema, models, services)\n 3. External integrations (auth, APIs, local services like Ollama)\n 4. UI & pages\n 5. Advanced features (RAG, export, realtime…)\n 6. Build & release (CI/CD, packaging, installers)\n\n**Write the result directly into \\`AGENT_WORKFLOW.md\\`** — replace its current\ncontent with your decomposition.\n\n**Then ask for human validation:**\n> \"I have decomposed the project into N agents: [list them].\n> Should I proceed with execution?\"\n\nWait for confirmation before moving to Phase 1.\n\n---\n\n`\n\n return `# PLAYBOOK.md — ${projectName}\n\n> **One instruction to give Claude Code:**\n> \"Read PLAYBOOK.md and execute the procedure.\"\n>\n> Claude Code handles the rest autonomously — project discovery or blueprint reading,\n> agent decomposition, execution, success validation, retries, and human escalation.\n> No API key required. No additional cost beyond your LLM subscription.\n\n---\n\n## Global Execution Rules\n\nBefore each agent:\n1. Read \\`CLAUDE.md\\`\n2. Read \\`agents/agent-{N}-{slug}/skills.md\\` (current agent's file)\n3. Read the agent's section in \\`AGENT_WORKFLOW.md\\`\n\nAfter each agent:\n- Run the success criterion command\n- ✅ Passes → announce \"✅ Agent N complete\" and move to the next\n- ❌ Fails → analyze the root cause, fix, rerun (max 3 attempts)\n- After 3 consecutive failures → stop and ask for human validation\n\n**Never move to the next agent without a passing success criterion.**\n**Stay strictly within your current agent's defined scope.**\n\n---\n\n${phase0}## Phase 1 — Execution\n\n${agentBlocks}\n\n---\n\n## Future Iterations\n\nWhen a new agent is added via \\`agentkit add --feature <description>\\`:\n1. A new agent block is appended to \\`AGENT_WORKFLOW.md\\`\n2. The folder \\`agents/agent-{N}-{slug}/\\` is created with \\`skills.md\\`\n3. This \\`PLAYBOOK.md\\` is regenerated to include the new agent\n4. Execution resumes at the new agent only — completed agents are not rerun\n\nWhen you receive the instruction to continue after an iteration:\n> \"Read PLAYBOOK.md and execute only the agents that haven't been completed yet.\"\n\n---\n\n## Human Validation Required\n\nStop and wait for confirmation in these situations:\n- **3 consecutive failures** on the same success criterion\n- **Missing external dependency**: API key, env variable, unavailable service\n- **Conflict** between the detected stack and the user's stated constraints\n- **Destructive operation**: overwriting files not listed in deliverables\n- **End of Phase 0**: agent decomposition must be validated before execution\n`\n}\n\nfunction agentBlock(agent: Agent): string {\n const skillsPath = `agents/agent-${agent.number}-${agent.slug}/skills.md`\n const outputLines =\n agent.outputs.length > 0\n ? agent.outputs.map((o) => `- ${o}`).join('\\n')\n : '- (see skills.md for details)'\n\n return `### Agent ${agent.number} · ${agent.name}\n\n**Scope**: ${agent.scope}\n\n**Skills**: \\`${skillsPath}\\`\n\n**Deliverables**:\n${outputLines}\n\n**Success criterion**:\n\\`\\`\\`bash\n${agent.criterion || 'npm run build && npm test'}\n\\`\\`\\`\n\n**On failure**:\n1. Read the full error output\n2. Fix the root cause — not the symptoms\n3. Rerun the success criterion (max 3 attempts)\n4. After 3 failures → ask for human validation\n`\n}","import { mkdir, writeFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport type { Agent } from '../types/agent.js'\n\nexport async function generateSkills(agents: Agent[], outputDir: string): Promise<void> {\n for (const agent of agents) {\n const agentDir = join(outputDir, 'agents', `agent-${agent.number}-${agent.slug}`)\n await mkdir(agentDir, { recursive: true })\n await writeFile(join(agentDir, 'skills.md'), skillsMd(agent), 'utf-8')\n await writeFile(join(agentDir, 'context.md'), contextMd(agent), 'utf-8')\n }\n}\n\nfunction skillsMd(agent: Agent): string {\n return `# Skills — ${agent.fullName}\n\n> Ce fichier est lu par l'agent avant de commencer.\n\n## Contexte technique\n\n<!-- À remplir : bibliothèques, versions, décisions d'architecture spécifiques à cet agent -->\n\n## Documentation de référence\n\n<!-- À remplir : liens vers docs, exemples, ADRs pertinents -->\n\n## Conventions spécifiques\n\n<!-- À remplir : règles propres à cet agent (naming, patterns, structure de fichiers) -->\n`\n}\n\nfunction contextMd(agent: Agent): string {\n const outputLines =\n agent.outputs.length > 0\n ? agent.outputs.map((o) => `- ${o}`).join('\\n')\n : '- (voir AGENT_WORKFLOW.md)'\n\n return `# Context — ${agent.fullName}\n\n> Ce fichier fournit le contexte additionnel à l'agent avant exécution.\n> À compléter avant de lancer cet agent.\n\n## Périmètre\n\n${agent.scope}\n\n## Fichiers produits attendus\n\n${outputLines}\n\n## Critère de succès\n\n\\`${agent.criterion || 'npm run build && npm test'}\\`\n`\n}\n","import chalk from 'chalk'\n\nexport const logger = {\n info: (message: string): void => {\n process.stdout.write(chalk.blue('ℹ') + ' ' + message + '\\n')\n },\n success: (message: string): void => {\n process.stdout.write(chalk.green('✔') + ' ' + message + '\\n')\n },\n warn: (message: string): void => {\n process.stdout.write(chalk.yellow('⚠') + ' ' + message + '\\n')\n },\n error: (message: string): void => {\n process.stderr.write(chalk.red('✖') + ' ' + message + '\\n')\n },\n}\n","import type { Command } from 'commander'\nimport { readFile, writeFile } from 'node:fs/promises'\nimport { join, basename } from 'node:path'\nimport inquirer from 'inquirer'\nimport { logger } from '../utils/logger.js'\nimport { extractAgentsFromWorkflow, toSlug } from '../utils/agentParser.js'\nimport { generatePlaybook } from '../generators/playbookGenerator.js'\nimport { generateSkills } from '../generators/skillsGenerator.js'\nimport type { Agent } from '../types/agent.js'\n\nfunction featureToAgentName(description: string): string {\n const clean = description\n .replace(/^(add|implement|create|build|integrate|setup|configure|refactor|improve)\\s+/i, '')\n .trim()\n return clean.replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\nexport interface AddFeatureResult {\n agent: Agent\n agentDirPath: string\n}\n\nexport async function addFeatureToProject(\n description: string,\n projectDir: string,\n): Promise<AddFeatureResult> {\n const workflowPath = join(projectDir, 'AGENT_WORKFLOW.md')\n const playbookPath = join(projectDir, 'PLAYBOOK.md')\n\n let workflowContent = ''\n try {\n workflowContent = await readFile(workflowPath, 'utf-8')\n } catch {\n throw new Error(`AGENT_WORKFLOW.md not found in ${projectDir} — run agentkit init first`)\n }\n\n const existingAgents = extractAgentsFromWorkflow(workflowContent)\n const nextNumber = existingAgents.length + 1\n const name = featureToAgentName(description)\n const slug = toSlug(name)\n const fullName = `Agent ${nextNumber} · ${name}`\n\n const newAgent: Agent = {\n number: nextNumber,\n name,\n fullName,\n slug,\n scope: description,\n outputs: [`agents/agent-${nextNumber}-${slug}/`],\n criterion: 'npm run build && npm test',\n }\n\n const agentBlock = `\n### ${fullName}\nPérimètre : ${description}\nProduit :\n - agents/agent-${nextNumber}-${slug}/\nCritère : npm run build && npm test\n`\n\n await writeFile(workflowPath, workflowContent + agentBlock, 'utf-8')\n await generateSkills([newAgent], projectDir)\n\n let projectName = basename(projectDir)\n try {\n const pkg = JSON.parse(\n await readFile(join(projectDir, 'package.json'), 'utf-8'),\n ) as { name?: string }\n if (pkg.name) projectName = pkg.name\n } catch { /* use dirname fallback */ }\n\n const allAgents = [...existingAgents, newAgent]\n\n // When adding a feature iteration, hasBlueprint is false —\n // Phase 0 decomposition only runs during the initial init with --blueprint.\n const playbookContent = generatePlaybook({\n agents: allAgents,\n projectName,\n hasBlueprint: false,\n })\n await writeFile(playbookPath, playbookContent, 'utf-8')\n\n return {\n agent: newAgent,\n agentDirPath: join(projectDir, 'agents', `agent-${nextNumber}-${slug}`),\n }\n}\n\nexport function registerAdd(program: Command): void {\n const addCmd = program\n .command('add')\n .description('Add resources to the agentkit project')\n .option('--feature <description>', 'Add an agent from a feature description and regenerate PLAYBOOK.md')\n .action(async (options: { feature?: string }) => {\n if (options.feature) {\n try {\n const result = await addFeatureToProject(options.feature, process.cwd())\n logger.success(`Agent added : ${result.agent.fullName}`)\n logger.success(`Folder created : agents/agent-${result.agent.number}-${result.agent.slug}/`)\n logger.success('PLAYBOOK.md : regenerated')\n } catch (err) {\n logger.error(err instanceof Error ? err.message : String(err))\n process.exit(1)\n }\n } else {\n addCmd.help()\n }\n })\n\n addCmd\n .command('agent')\n .description('Add a new agent to AGENT_WORKFLOW.md (interactive)')\n .action(async () => {\n const cwd = process.cwd()\n const workflowPath = join(cwd, 'AGENT_WORKFLOW.md')\n\n let existing = ''\n try {\n existing = await readFile(workflowPath, 'utf-8')\n } catch {\n logger.error('AGENT_WORKFLOW.md not found — run agentkit init first')\n process.exit(1)\n }\n\n const agentCount = (existing.match(/^### Agent \\d+/gm) ?? []).length\n const nextNumber = agentCount + 1\n\n const answers = await inquirer.prompt<{\n name: string\n scope: string\n outputs: string\n criterion: string\n }>([\n {\n type: 'input',\n name: 'name',\n message: `Agent name (e.g. \"Agent ${nextNumber} · Feature X\"):`,\n default: `Agent ${nextNumber}`,\n },\n {\n type: 'input',\n name: 'scope',\n message: 'Scope (one sentence):',\n },\n {\n type: 'input',\n name: 'outputs',\n message: 'Deliverables (comma-separated):',\n },\n {\n type: 'input',\n name: 'criterion',\n message: 'Success criterion:',\n },\n ])\n\n const outputLines = answers.outputs\n .split(',')\n .map((o: string) => ` - ${o.trim()}`)\n .join('\\n')\n\n const agentSection = `\n### ${answers.name}\nPérimètre : ${answers.scope}\nProduit :\n${outputLines}\nCritère : ${answers.criterion}\n`\n\n await writeFile(workflowPath, existing + agentSection, 'utf-8')\n logger.success(`Agent \"${answers.name}\" added to AGENT_WORKFLOW.md`)\n })\n}","import type { Command } from 'commander'\nimport { readFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport chalk from 'chalk'\nimport { detectStack } from '../detectors/stackDetector.js'\nimport { isGitRepo } from '../detectors/gitDetector.js'\nimport { logger } from '../utils/logger.js'\n\nexport function registerStatus(program: Command): void {\n program\n .command('status')\n .description('Affiche l\\'état du workflow agentkit dans le dossier courant')\n .action(async () => {\n const cwd = process.cwd()\n\n const [stack, isGit, claudeMd, workflow] = await Promise.all([\n detectStack(cwd),\n isGitRepo(cwd),\n readFile(join(cwd, 'CLAUDE.md'), 'utf-8').catch(() => null),\n readFile(join(cwd, 'AGENT_WORKFLOW.md'), 'utf-8').catch(() => null),\n ])\n\n process.stdout.write('\\n' + chalk.bold('AgentKit Status') + '\\n')\n process.stdout.write('─'.repeat(40) + '\\n')\n\n process.stdout.write(\n chalk.bold('Git repo : ') +\n (isGit ? chalk.green('✔ oui') : chalk.red('✖ non')) +\n '\\n',\n )\n\n process.stdout.write(\n chalk.bold('Stack : ') + chalk.cyan(stack.framework) + ' (' + stack.language + ')\\n',\n )\n\n process.stdout.write(\n chalk.bold('CLAUDE.md : ') +\n (claudeMd !== null ? chalk.green('✔ présent') : chalk.yellow('✖ absent — lancez agentkit init')) +\n '\\n',\n )\n\n process.stdout.write(\n chalk.bold('AGENT_WORKFLOW.md : ') +\n (workflow !== null ? chalk.green('✔ présent') : chalk.yellow('✖ absent — lancez agentkit init')) +\n '\\n',\n )\n\n if (workflow !== null) {\n const agentMatches = workflow.match(/^### Agent \\d+/gm) ?? []\n process.stdout.write(\n chalk.bold('Agents définis : ') + chalk.cyan(String(agentMatches.length)) + '\\n',\n )\n }\n\n process.stdout.write('─'.repeat(40) + '\\n\\n')\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uBAAwB;;;ACAxB,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AA,QAAM,KAAK,iBAAiB,KACzBF,cAAa,OAAO,cAAAE,QAAM,MAAM,mBAAW,IAAI,cAAAA,QAAM,OAAO,2CAAiC,KAC9F;AAAA,IACJ;AAEA,YAAQ,OAAO;AAAA,MACb,cAAAA,QAAM,KAAK,sBAAsB,KAC9BD,cAAa,OAAO,cAAAC,QAAM,MAAM,mBAAW,IAAI,cAAAA,QAAM,OAAO,2CAAiC,KAC9F;AAAA,IACJ;AAEA,QAAID,cAAa,MAAM;AACrB,YAAM,eAAeA,UAAS,MAAM,kBAAkB,KAAK,CAAC;AAC5D,cAAQ,OAAO;AAAA,QACb,cAAAC,QAAM,KAAK,wBAAqB,IAAI,cAAAA,QAAM,KAAK,OAAO,aAAa,MAAM,CAAC,IAAI;AAAA,MAChF;AAAA,IACF;AAEA,YAAQ,OAAO,MAAM,SAAI,OAAO,EAAE,IAAI,MAAM;AAAA,EAC9C,CAAC;AACL;;;AnBlDA,IAAM,UAAU,IAAI,yBAAQ;AAE5B,QACG,KAAK,UAAU,EACf,YAAY,mDAAmD,EAC/D,QAAQ,OAAO;AAElB,aAAa,OAAO;AACpB,YAAY,OAAO;AACnB,eAAe,OAAO;AAEtB,QAAQ,MAAM;","names":["import_promises","import_node_path","import_promises","import_node_path","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","import_promises","import_node_path","chalk","import_node_path","program","ora","inquirer","import_promises","import_node_path","import_inquirer","agentBlock","program","inquirer","import_promises","import_node_path","import_chalk","program","claudeMd","workflow","chalk"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/commands/init.ts","../src/detectors/stackDetector.ts","../src/detectors/gitDetector.ts","../src/templates/react.ts","../src/templates/nextjs.ts","../src/templates/tauri.ts","../src/templates/fastapi.ts","../src/templates/express.ts","../src/templates/node.ts","../src/templates/unknown.ts","../src/generators/claudeMdGenerator.ts","../src/generators/workflowGenerator.ts","../src/generators/playbookGenerator.ts","../src/generators/skillsGenerator.ts","../src/utils/agentParser.ts","../src/utils/logger.ts","../src/commands/add.ts","../src/commands/status.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander'\nimport { registerInit } from './commands/init.js'\nimport { registerAdd } from './commands/add.js'\nimport { registerStatus } from './commands/status.js'\n\nconst program = new Command()\n\nprogram\n .name('agentkit')\n .description('Scaffolder des workflows multi-agents Claude Code')\n .version('0.1.0')\n\nregisterInit(program)\nregisterAdd(program)\nregisterStatus(program)\n\nprogram.parse()\n","import type { Command } from 'commander'\nimport { writeFile, readFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport inquirer from 'inquirer'\nimport ora from 'ora'\nimport { detectStack } from '../detectors/stackDetector.js'\nimport { isGitRepo } from '../detectors/gitDetector.js'\nimport { generateClaudeMd } from '../generators/claudeMdGenerator.js'\nimport { generateWorkflow } from '../generators/workflowGenerator.js'\nimport { generatePlaybook } from '../generators/playbookGenerator.js'\nimport { generateSkills } from '../generators/skillsGenerator.js'\nimport { extractAgentsFromWorkflow } from '../utils/agentParser.js'\nimport { logger } from '../utils/logger.js'\nimport type { StackInfo } from '../detectors/stackDetector.js'\nimport { basename } from 'node:path'\n\nconst FRAMEWORK_LABELS: Record<StackInfo['framework'], string> = {\n react: 'React',\n nextjs: 'Next.js',\n tauri: 'Tauri',\n fastapi: 'FastAPI (Python)',\n express: 'Express',\n node: 'Node.js',\n unknown: 'Unknown (generic)',\n}\n\nasync function fileExists(path: string): Promise<boolean> {\n try {\n await readFile(path)\n return true\n } catch {\n return false\n }\n}\n\nexport function registerInit(program: Command): void {\n program\n .command('init')\n .description('Génère CLAUDE.md et AGENT_WORKFLOW.md dans le dossier courant')\n .option('-f, --force', 'Écrase les fichiers existants sans confirmation')\n .option('--blueprint <path>', 'Fichier blueprint .md à utiliser pour personnaliser les fichiers générés')\n .action(async (options: { force?: boolean; blueprint?: string }) => {\n const cwd = process.cwd()\n\n const spinner = ora('Détection de la stack…').start()\n const [stack, isGit] = await Promise.all([detectStack(cwd), isGitRepo(cwd)])\n spinner.stop()\n\n if (!isGit) {\n logger.warn('Ce dossier n\\'est pas un repo git — lancez git init si nécessaire')\n }\n\n const label = FRAMEWORK_LABELS[stack.framework]\n logger.info(`Stack détectée : ${label} (${stack.language})`)\n\n const { confirmed } = await inquirer.prompt<{ confirmed: boolean }>([\n {\n type: 'confirm',\n name: 'confirmed',\n message: `Générer les fichiers pour ${label} ?`,\n default: true,\n },\n ])\n\n if (!confirmed) {\n logger.warn('Annulé.')\n return\n }\n\n const claudeMdPath = join(cwd, 'CLAUDE.md')\n const workflowPath = join(cwd, 'AGENT_WORKFLOW.md')\n const playbookPath = join(cwd, 'PLAYBOOK.md')\n\n // Resolve project name from package.json or directory name\n let projectName = basename(cwd)\n try {\n const pkg = JSON.parse(await readFile(join(cwd, 'package.json'), 'utf-8')) as { name?: string }\n if (pkg.name) projectName = pkg.name\n } catch { /* fallback to dirname */ }\n\n if (!options.force) {\n const existing: string[] = []\n if (await fileExists(claudeMdPath)) existing.push('CLAUDE.md')\n if (await fileExists(workflowPath)) existing.push('AGENT_WORKFLOW.md')\n if (await fileExists(playbookPath)) existing.push('PLAYBOOK.md')\n\n if (existing.length > 0) {\n const { overwrite } = await inquirer.prompt<{ overwrite: boolean }>([\n {\n type: 'confirm',\n name: 'overwrite',\n message: `${existing.join(' et ')} existe déjà. Écraser ?`,\n default: false,\n },\n ])\n if (!overwrite) {\n logger.warn('Annulé.')\n return\n }\n }\n }\n\n // Load blueprint if provided\n let blueprintContent: string | undefined\n if (options.blueprint) {\n try {\n blueprintContent = await readFile(options.blueprint, 'utf-8')\n } catch {\n logger.error(`Blueprint introuvable : ${options.blueprint}`)\n process.exit(1)\n }\n }\n\n const genSpinner = ora('Génération des fichiers…').start()\n const claudeMdContent = generateClaudeMd(stack, blueprintContent)\n const workflowContent = generateWorkflow(stack, blueprintContent, projectName)\n const agents = extractAgentsFromWorkflow(workflowContent)\n const playbookContent = generatePlaybook({ agents, projectName, hasBlueprint: !!blueprintContent })\n await writeFile(claudeMdPath, claudeMdContent, 'utf-8')\n await writeFile(workflowPath, workflowContent, 'utf-8')\n await writeFile(playbookPath, playbookContent, 'utf-8')\n await generateSkills(agents, cwd)\n genSpinner.succeed('Fichiers générés')\n\n logger.success('CLAUDE.md → créé')\n logger.success('AGENT_WORKFLOW.md → créé')\n logger.success('PLAYBOOK.md → créé')\n logger.success(`agents/ → ${agents.length} dossier(s) créé(s)`)\n })\n}\n","import { readFile, access } from 'node:fs/promises'\nimport { join } from 'node:path'\n\nexport interface StackInfo {\n framework: 'react' | 'nextjs' | 'tauri' | 'fastapi' | 'express' | 'node' | 'unknown'\n language: 'typescript' | 'javascript' | 'python' | 'unknown'\n hasTypeScript: boolean\n extras: string[]\n}\n\nasync function pathExists(p: string): Promise<boolean> {\n try {\n await access(p)\n return true\n } catch {\n return false\n }\n}\n\nasync function readJson(p: string): Promise<Record<string, unknown> | null> {\n try {\n const raw = await readFile(p, 'utf-8')\n return JSON.parse(raw) as Record<string, unknown>\n } catch {\n return null\n }\n}\n\nasync function readText(p: string): Promise<string | null> {\n try {\n return await readFile(p, 'utf-8')\n } catch {\n return null\n }\n}\n\nexport async function detectStack(projectPath: string): Promise<StackInfo> {\n const info: StackInfo = {\n framework: 'unknown',\n language: 'unknown',\n hasTypeScript: false,\n extras: [],\n }\n\n const packageJson = await readJson(join(projectPath, 'package.json'))\n const requirementsTxt = await readText(join(projectPath, 'requirements.txt'))\n const hasTauriDir = await pathExists(join(projectPath, 'src-tauri'))\n const hasTsConfig = await pathExists(join(projectPath, 'tsconfig.json'))\n\n if (packageJson !== null) {\n const deps = (packageJson.dependencies as Record<string, string>) ?? {}\n const devDeps = (packageJson.devDependencies as Record<string, string>) ?? {}\n const allDeps = { ...deps, ...devDeps }\n\n info.hasTypeScript = 'typescript' in allDeps || hasTsConfig\n info.language = info.hasTypeScript ? 'typescript' : 'javascript'\n\n // Order matters: most specific first\n if ('next' in allDeps) {\n info.framework = 'nextjs'\n } else if (hasTauriDir || '@tauri-apps/api' in allDeps || '@tauri-apps/cli' in allDeps) {\n info.framework = 'tauri'\n } else if ('react' in allDeps) {\n info.framework = 'react'\n } else if ('express' in allDeps) {\n info.framework = 'express'\n } else {\n info.framework = 'node'\n }\n\n if ('vitest' in allDeps || 'jest' in allDeps) info.extras.push('testing')\n if ('prisma' in allDeps || '@prisma/client' in allDeps) info.extras.push('prisma')\n if ('tailwindcss' in allDeps) info.extras.push('tailwind')\n }\n\n if (requirementsTxt !== null && info.framework === 'unknown') {\n info.language = 'python'\n if (/\\bfastapi\\b/i.test(requirementsTxt)) {\n info.framework = 'fastapi'\n }\n }\n\n if (hasTauriDir && info.framework === 'unknown') {\n info.framework = 'tauri'\n }\n\n return info\n}\n","import { access } from 'node:fs/promises'\nimport { join } from 'node:path'\n\nexport async function isGitRepo(projectPath: string): Promise<boolean> {\n try {\n await access(join(projectPath, '.git'))\n return true\n } catch {\n return false\n }\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n const testLine = stack.extras.includes('testing') ? '- `npm test` — run tests\\n' : ''\n return `# CLAUDE.md — React Project\n\n## Stack\n- Framework : React (${lang})\n- Language : ${lang}\n- Build : Vite\n\n## Commands\n- \\`npm run dev\\` — development server\n- \\`npm run build\\` — production build\n${testLine}\n## Structure\nsrc/\n components/ ← UI components (PascalCase)\n hooks/ ← custom hooks (prefix: use*)\n pages/ ← page-level components\n utils/ ← shared helpers\n\n## Conventions\n1. Components in PascalCase\n2. Hooks prefixed with \\`use\\`\n3. Props interfaces named \\`*Props\\`\n4. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# Agent Workflow — React Project\n\n## Stack détectée\nFramework: React | Language: ${lang}\n\n## Agents\n\n### Agent 1 · Components\nPérimètre : composants UI réutilisables\nProduit : src/components/\nCritère : composants documentés et testés\n\n### Agent 2 · State & Hooks\nPérimètre : state management, hooks personnalisés\nProduit : src/hooks/\nCritère : hooks testés unitairement\n\n### Agent 3 · Pages & Routing\nPérimètre : assemblage des pages, react-router\nProduit : src/pages/\nCritère : navigation fonctionnelle\n\n### Agent 4 · Tests & CI\nPérimètre : couverture de tests, configuration CI\nProduit : tests/, .github/workflows/\nCritère : npm test passe\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const hasTailwind = stack.extras.includes('tailwind')\n const hasPrisma = stack.extras.includes('prisma')\n return `# CLAUDE.md — Next.js Project\n\n## Stack\n- Framework : Next.js (TypeScript)\n- Rendering : App Router (RSC + Client Components)\n- Styling : ${hasTailwind ? 'Tailwind CSS' : 'CSS Modules'}\n${hasPrisma ? '- Database : Prisma ORM\\n' : ''}\n## Commands\n- \\`npm run dev\\` — development server (http://localhost:3000)\n- \\`npm run build\\` — production build\n- \\`npm start\\` — production server\n- \\`npm test\\` — run tests\n\n## Structure\nsrc/\n app/ ← App Router pages and layouts\n components/ ← shared UI components\n lib/ ← server utilities, db clients\n utils/ ← shared helpers\n\n## Conventions\n1. Server Components by default, \\`'use client'\\` only when needed\n2. API routes in \\`src/app/api/\\`\n3. Environment variables via \\`src/env.ts\\` (validated)\n4. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const hasPrisma = stack.extras.includes('prisma')\n return `# Agent Workflow — Next.js Project\n\n## Stack détectée\nFramework: Next.js | Language: TypeScript\n\n## Agents\n\n### Agent 1 · Data Layer\nPérimètre : schéma${hasPrisma ? ' Prisma' : ''}, types, server actions\nProduit : src/lib/, ${hasPrisma ? 'prisma/schema.prisma' : 'src/types/'}\nCritère : types compilent, migrations propres\n\n### Agent 2 · UI Components\nPérimètre : composants réutilisables (Server + Client)\nProduit : src/components/\nCritère : composants rendus sans erreur\n\n### Agent 3 · Pages & Layout\nPérimètre : App Router, layouts, pages\nProduit : src/app/\nCritère : navigation fonctionnelle, build passe\n\n### Agent 4 · API & Tests\nPérimètre : API routes, tests e2e/unitaires\nProduit : src/app/api/, tests/\nCritère : npm test passe\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# CLAUDE.md — Tauri Project\n\n## Stack\n- Framework : Tauri (Rust + ${lang} frontend)\n- Language : Rust (backend) + ${lang} (frontend)\n- Build : Cargo + Vite\n\n## Commands\n- \\`npm run tauri dev\\` — development (hot reload)\n- \\`npm run tauri build\\` — production bundle\n- \\`npm run build\\` — frontend only\n- \\`npm test\\` — run tests\n\n## Structure\nsrc/ ← frontend (${lang})\n components/\n utils/\nsrc-tauri/ ← Rust backend\n src/\n main.rs ← Tauri entry point\n commands.rs ← Tauri commands (IPC)\n tauri.conf.json\n\n## Conventions\n1. IPC commands defined in \\`src-tauri/src/commands.rs\\`\n2. Frontend invokes via \\`@tauri-apps/api/tauri\\`\n3. No direct filesystem access from frontend\n4. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# Agent Workflow — Tauri Project\n\n## Stack détectée\nFramework: Tauri | Language: Rust + ${lang}\n\n## Agents\n\n### Agent 1 · Rust Commands\nPérimètre : commandes Tauri (IPC), permissions\nProduit : src-tauri/src/commands.rs, tauri.conf.json\nCritère : \\`cargo build\\` passe\n\n### Agent 2 · Frontend UI\nPérimètre : interface ${lang}, intégration IPC\nProduit : src/components/, src/utils/\nCritère : appels IPC fonctionnels\n\n### Agent 3 · Build & Packaging\nPérimètre : configuration build, icônes, installeurs\nProduit : src-tauri/tauri.conf.json, icons/\nCritère : \\`npm run tauri build\\` produit un bundle\n\n### Agent 4 · Tests\nPérimètre : tests Rust + tests frontend\nProduit : src-tauri/tests/, tests/\nCritère : \\`cargo test\\` + \\`npm test\\` passent\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(_stack: StackInfo): string {\n return `# CLAUDE.md — FastAPI Project\n\n## Stack\n- Framework : FastAPI (Python)\n- Language : Python 3.11+\n- Server : Uvicorn\n- Validation: Pydantic v2\n\n## Commands\n- \\`uvicorn main:app --reload\\` — development server (http://localhost:8000)\n- \\`pytest\\` — run tests\n- \\`pip install -r requirements.txt\\` — install dependencies\n\n## Structure\napp/\n main.py ← FastAPI app entry point\n routers/ ← API route groups\n models/ ← Pydantic models\n services/ ← business logic\n dependencies/ ← FastAPI dependencies (DI)\ntests/ ← pytest tests\n\n## Conventions\n1. Routers grouped by domain in \\`app/routers/\\`\n2. Pydantic models for all request/response bodies\n3. Business logic in \\`app/services/\\`, not in routes\n4. Async endpoints by default (\\`async def\\`)\n5. Environment variables via \\`python-dotenv\\` + \\`pydantic-settings\\`\n`\n}\n\nexport function workflow(_stack: StackInfo): string {\n return `# Agent Workflow — FastAPI Project\n\n## Stack détectée\nFramework: FastAPI | Language: Python\n\n## Agents\n\n### Agent 1 · Models & Schemas\nPérimètre : modèles Pydantic, schémas DB (SQLAlchemy/SQLModel)\nProduit : app/models/\nCritère : modèles validés, migrations propres\n\n### Agent 2 · Services\nPérimètre : logique métier, accès base de données\nProduit : app/services/\nCritère : services testés unitairement (pytest)\n\n### Agent 3 · Routers & API\nPérimètre : routes FastAPI, dépendances, auth\nProduit : app/routers/, app/dependencies/\nCritère : endpoints documentés (OpenAPI), tests d'intégration\n\n### Agent 4 · Tests & CI\nPérimètre : couverture pytest, configuration CI\nProduit : tests/, .github/workflows/\nCritère : \\`pytest\\` passe à 100%\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n const hasPrisma = stack.extras.includes('prisma')\n return `# CLAUDE.md — Express Project\n\n## Stack\n- Framework : Express (${lang})\n- Language : ${lang}\n- Runtime : Node.js 20+\n${hasPrisma ? '- Database : Prisma ORM\\n' : ''}\n## Commands\n- \\`npm run dev\\` — development server (nodemon)\n- \\`npm run build\\` — compile TypeScript\n- \\`npm start\\` — production server\n- \\`npm test\\` — run tests\n\n## Structure\nsrc/\n routes/ ← Express routers (one per domain)\n controllers/ ← request handlers\n services/ ← business logic\n middleware/ ← Express middleware\n utils/ ← shared helpers\n\n## Conventions\n1. Routes grouped by domain in \\`src/routes/\\`\n2. Business logic in \\`src/services/\\`, not in controllers\n3. Middleware for cross-cutting concerns (auth, validation)\n4. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# Agent Workflow — Express Project\n\n## Stack détectée\nFramework: Express | Language: ${lang}\n\n## Agents\n\n### Agent 1 · Data & Models\nPérimètre : modèles de données, accès DB\nProduit : src/models/, src/services/db.ts\nCritère : connexion DB fonctionnelle\n\n### Agent 2 · Services\nPérimètre : logique métier\nProduit : src/services/\nCritère : services testés unitairement\n\n### Agent 3 · Routes & Controllers\nPérimètre : routes Express, validation, auth\nProduit : src/routes/, src/controllers/, src/middleware/\nCritère : endpoints répondent correctement\n\n### Agent 4 · Tests & CI\nPérimètre : tests d'intégration, configuration CI\nProduit : tests/, .github/workflows/\nCritère : npm test passe\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# CLAUDE.md — Node.js Project\n\n## Stack\n- Runtime : Node.js 20+\n- Language : ${lang}\n\n## Commands\n- \\`npm run dev\\` — development (with watch)\n- \\`npm run build\\` — compile${stack.hasTypeScript ? ' TypeScript' : ''}\n- \\`npm start\\` — run production build\n- \\`npm test\\` — run tests\n\n## Structure\nsrc/\n index.ts ← entry point\n lib/ ← core library code\n utils/ ← shared helpers\n\n## Conventions\n1. Modules follow single-responsibility principle\n2. Async/await over callbacks\n3. Tout output console passe par un logger centralisé\n`\n}\n\nexport function workflow(stack: StackInfo): string {\n const lang = stack.hasTypeScript ? 'TypeScript' : 'JavaScript'\n return `# Agent Workflow — Node.js Project\n\n## Stack détectée\nRuntime: Node.js | Language: ${lang}\n\n## Agents\n\n### Agent 1 · Core Library\nPérimètre : logique principale\nProduit : src/lib/\nCritère : module fonctionne et testé\n\n### Agent 2 · CLI / API\nPérimètre : interface utilisateur (CLI ou API)\nProduit : src/index.ts, src/cli.ts\nCritère : commandes fonctionnelles\n\n### Agent 3 · Tests & CI\nPérimètre : couverture de tests, configuration CI\nProduit : tests/, .github/workflows/\nCritère : npm test passe\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\n\nexport function claudeMd(_stack: StackInfo): string {\n return `# CLAUDE.md\n\n## Stack\nStack non détectée automatiquement — à remplir manuellement.\n\n## Commands\n- À définir selon le projet\n\n## Structure\nsrc/ ← code source\ntests/ ← tests\n\n## Conventions\n1. Tout output console passe par un logger centralisé\n2. À compléter selon les conventions du projet\n`\n}\n\nexport function workflow(_stack: StackInfo): string {\n return `# Agent Workflow\n\n## Stack détectée\nStack inconnue — workflow générique.\n\n## Agents\n\n### Agent 1 · Setup\nPérimètre : configuration initiale du projet\nProduit : structure de base\nCritère : projet compilable\n\n### Agent 2 · Core\nPérimètre : logique principale\nProduit : src/\nCritère : fonctionnalités principales opérationnelles\n\n### Agent 3 · Tests\nPérimètre : couverture de tests\nProduit : tests/\nCritère : tests passent\n`\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\nimport * as react from '../templates/react.js'\nimport * as nextjs from '../templates/nextjs.js'\nimport * as tauri from '../templates/tauri.js'\nimport * as fastapi from '../templates/fastapi.js'\nimport * as express from '../templates/express.js'\nimport * as node from '../templates/node.js'\nimport * as unknown from '../templates/unknown.js'\n\nexport function generateClaudeMd(stack: StackInfo, blueprintContent?: string): string {\n let base: string\n switch (stack.framework) {\n case 'react': base = react.claudeMd(stack); break\n case 'nextjs': base = nextjs.claudeMd(stack); break\n case 'tauri': base = tauri.claudeMd(stack); break\n case 'fastapi': base = fastapi.claudeMd(stack); break\n case 'express': base = express.claudeMd(stack); break\n case 'node': base = node.claudeMd(stack); break\n default: base = unknown.claudeMd(stack)\n }\n\n if (!blueprintContent) return base\n\n const blueprintNote = '\\n> A PROJECT_BLUEPRINT.md is present — Claude Code will read it during Phase 0.\\n'\n\n const conventionsIdx = base.indexOf('\\n## Conventions')\n if (conventionsIdx !== -1) {\n return base.slice(0, conventionsIdx) + blueprintNote + base.slice(conventionsIdx)\n }\n return base + blueprintNote\n}\n","import type { StackInfo } from '../detectors/stackDetector.js'\nimport * as react from '../templates/react.js'\nimport * as nextjs from '../templates/nextjs.js'\nimport * as tauri from '../templates/tauri.js'\nimport * as fastapi from '../templates/fastapi.js'\nimport * as express from '../templates/express.js'\nimport * as node from '../templates/node.js'\nimport * as unknown from '../templates/unknown.js'\n\nexport function generateWorkflow(stack: StackInfo, blueprintContent?: string, projectName?: string): string {\n if (blueprintContent) return blueprintPlaceholder(projectName ?? stack.framework)\n\n switch (stack.framework) {\n case 'react': return react.workflow(stack)\n case 'nextjs': return nextjs.workflow(stack)\n case 'tauri': return tauri.workflow(stack)\n case 'fastapi': return fastapi.workflow(stack)\n case 'express': return express.workflow(stack)\n case 'node': return node.workflow(stack)\n default: return unknown.workflow(stack)\n }\n}\n\nfunction blueprintPlaceholder(projectName: string): string {\n return `# AGENT_WORKFLOW.md — ${projectName}\n\n> This file will be filled in by Claude Code during Phase 0.\n> Claude Code will read PROJECT_BLUEPRINT.md, propose a decomposition,\n> and replace this content after human validation.\n\n---\n\n*Waiting for Phase 0 decomposition...*\n`\n}\n","import type { Agent } from '../types/agent.js'\n\nexport interface PlaybookInput {\n agents: Agent[]\n projectName: string\n hasBlueprint: boolean\n}\n\nexport function generatePlaybook({ agents, projectName, hasBlueprint }: PlaybookInput): string {\n const agentBlocks = agents.map((a) => agentBlock(a)).join('\\n---\\n\\n')\n\n const phase0 = hasBlueprint\n ? `## Phase 0 — Agent Decomposition (run this first)\n\n> A \\`PROJECT_BLUEPRINT.md\\` was provided.\n> Claude Code reads it and decomposes the project into specialized agents\n> before writing a single line of code.\n\n**Read these files in order:**\n1. \\`CLAUDE.md\\`\n2. \\`PROJECT_BLUEPRINT.md\\`\n\n**Then decompose the project into agents** following these rules:\n\n- One agent = one coherent technical layer (never mix two layers)\n- Each agent must have a runnable success criterion (\\`npm test\\`, \\`cargo build\\`…)\n- Agents must be ordered by dependency (no feature without infra first)\n- Maximum 6 agents — if you have more, group related ones\n- Always respect this order:\n 1. Infra & Configuration\n 2. Data layer (DB schema, models, services)\n 3. External integrations (auth, APIs, local services like Ollama)\n 4. UI & pages\n 5. Advanced features (RAG, export, realtime…)\n 6. Build & release (CI/CD, packaging, installers)\n\n**Write the result directly into \\`AGENT_WORKFLOW.md\\`** — replace its current\ncontent with your decomposition.\n\n**Then ask for human validation:**\n> \"I have decomposed the project into N agents: [list them].\n> Should I proceed with execution?\"\n\nWait for confirmation before moving to Phase 1.\n\n---\n\n`\n : `## Phase 0 — Project Discovery (run this first)\n\n> No \\`PROJECT_BLUEPRINT.md\\` was provided.\n> Before writing any code, Claude Code asks the user what they want to build,\n> then decomposes the project into agents — exactly as if a blueprint had been provided.\n\n**Ask the user these questions and wait for their answers:**\n\n1. What is this project? (one sentence describing the goal)\n2. What are the main features you want to build? (list them)\n3. Are there any tech constraints or architecture preferences?\n (e.g. offline-only, specific DB, no auth, specific framework)\n\n**Once you have the answers, decompose the project into agents**\nfollowing these rules:\n\n- One agent = one coherent technical layer (never mix two layers)\n- Each agent must have a runnable success criterion (\\`npm test\\`, \\`cargo build\\`…)\n- Agents must be ordered by dependency (no feature without infra first)\n- Maximum 6 agents — if you have more, group related ones\n- Always respect this order:\n 1. Infra & Configuration\n 2. Data layer (DB schema, models, services)\n 3. External integrations (auth, APIs, local services like Ollama)\n 4. UI & pages\n 5. Advanced features (RAG, export, realtime…)\n 6. Build & release (CI/CD, packaging, installers)\n\n**Write the result directly into \\`AGENT_WORKFLOW.md\\`** — replace its current\ncontent with your decomposition.\n\n**Then ask for human validation:**\n> \"I have decomposed the project into N agents: [list them].\n> Should I proceed with execution?\"\n\nWait for confirmation before moving to Phase 1.\n\n---\n\n`\n\n return `# PLAYBOOK.md — ${projectName}\n\n> **One instruction to give Claude Code:**\n> \"Read PLAYBOOK.md and execute the procedure.\"\n>\n> Claude Code handles the rest autonomously — project discovery or blueprint reading,\n> agent decomposition, execution, success validation, retries, and human escalation.\n> No API key required. No additional cost beyond your LLM subscription.\n\n---\n\n## Global Execution Rules\n\nBefore each agent:\n1. Read \\`CLAUDE.md\\`\n2. Read \\`agents/agent-{N}-{slug}/skills.md\\` (current agent's file)\n3. Read the agent's section in \\`AGENT_WORKFLOW.md\\`\n\nAfter each agent:\n- Run the success criterion command\n- ✅ Passes → announce \"✅ Agent N complete\" and move to the next\n- ❌ Fails → analyze the root cause, fix, rerun (max 3 attempts)\n- After 3 consecutive failures → stop and ask for human validation\n\n**Never move to the next agent without a passing success criterion.**\n**Stay strictly within your current agent's defined scope.**\n\n---\n\n${phase0}## Phase 1 — Execution\n\n${agentBlocks}\n\n---\n\n## Future Iterations\n\nWhen a new agent is added via \\`agentkit add --feature <description>\\`:\n1. A new agent block is appended to \\`AGENT_WORKFLOW.md\\`\n2. The folder \\`agents/agent-{N}-{slug}/\\` is created with \\`skills.md\\`\n3. This \\`PLAYBOOK.md\\` is regenerated to include the new agent\n4. Execution resumes at the new agent only — completed agents are not rerun\n\nWhen you receive the instruction to continue after an iteration:\n> \"Read PLAYBOOK.md and execute only the agents that haven't been completed yet.\"\n\n---\n\n## Human Validation Required\n\nStop and wait for confirmation in these situations:\n- **3 consecutive failures** on the same success criterion\n- **Missing external dependency**: API key, env variable, unavailable service\n- **Conflict** between the detected stack and the user's stated constraints\n- **Destructive operation**: overwriting files not listed in deliverables\n- **End of Phase 0**: agent decomposition must be validated before execution\n`\n}\n\nfunction agentBlock(agent: Agent): string {\n const skillsPath = `agents/agent-${agent.number}-${agent.slug}/skills.md`\n const outputLines =\n agent.outputs.length > 0\n ? agent.outputs.map((o) => `- ${o}`).join('\\n')\n : '- (see skills.md for details)'\n\n return `### Agent ${agent.number} · ${agent.name}\n\n**Scope**: ${agent.scope}\n\n**Skills**: \\`${skillsPath}\\`\n\n**Deliverables**:\n${outputLines}\n\n**Success criterion**:\n\\`\\`\\`bash\n${agent.criterion || 'npm run build && npm test'}\n\\`\\`\\`\n\n**On failure**:\n1. Read the full error output\n2. Fix the root cause — not the symptoms\n3. Rerun the success criterion (max 3 attempts)\n4. After 3 failures → ask for human validation\n`\n}","import { mkdir, writeFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport type { Agent } from '../types/agent.js'\n\nexport async function generateSkills(agents: Agent[], outputDir: string): Promise<void> {\n for (const agent of agents) {\n const agentDir = join(outputDir, 'agents', `agent-${agent.number}-${agent.slug}`)\n await mkdir(agentDir, { recursive: true })\n await writeFile(join(agentDir, 'skills.md'), skillsMd(agent), 'utf-8')\n await writeFile(join(agentDir, 'context.md'), contextMd(agent), 'utf-8')\n }\n}\n\nfunction skillsMd(agent: Agent): string {\n return `# Skills — ${agent.fullName}\n\n> Ce fichier est lu par l'agent avant de commencer.\n\n## Contexte technique\n\n<!-- À remplir : bibliothèques, versions, décisions d'architecture spécifiques à cet agent -->\n\n## Documentation de référence\n\n<!-- À remplir : liens vers docs, exemples, ADRs pertinents -->\n\n## Conventions spécifiques\n\n<!-- À remplir : règles propres à cet agent (naming, patterns, structure de fichiers) -->\n`\n}\n\nfunction contextMd(agent: Agent): string {\n const outputLines =\n agent.outputs.length > 0\n ? agent.outputs.map((o) => `- ${o}`).join('\\n')\n : '- (voir AGENT_WORKFLOW.md)'\n\n return `# Context — ${agent.fullName}\n\n> Ce fichier fournit le contexte additionnel à l'agent avant exécution.\n> À compléter avant de lancer cet agent.\n\n## Périmètre\n\n${agent.scope}\n\n## Fichiers produits attendus\n\n${outputLines}\n\n## Critère de succès\n\n\\`${agent.criterion || 'npm run build && npm test'}\\`\n`\n}\n","import type { Agent } from '../types/agent.js'\n\nexport function toSlug(name: string): string {\n return name\n .toLowerCase()\n .replace(/[·•&]/g, ' ')\n .replace(/[^\\w\\s-]/g, '')\n .trim()\n .replace(/\\s+/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n}\n\nfunction getFieldValue(lines: string[], pattern: RegExp): string {\n for (const line of lines) {\n const m = line.match(pattern)\n if (m) return (m[1] ?? '').trim()\n }\n return ''\n}\n\nexport function extractAgentsFromWorkflow(content: string): Agent[] {\n const agents: Agent[] = []\n\n // Split into blocks starting with \"### Agent N\"\n const blocks = content\n .split(/(?=^### Agent \\d)/m)\n .filter((b) => /^### Agent \\d/.test(b.trimStart()))\n\n for (const block of blocks) {\n const lines = block.split('\\n')\n\n const headerMatch = lines[0].match(/^### Agent (\\d+)\\s*[·•]\\s*(.+)$/)\n if (!headerMatch) continue\n\n const number = parseInt(headerMatch[1], 10)\n const name = headerMatch[2].trim()\n const fullName = `Agent ${number} · ${name}`\n const slug = toSlug(name)\n\n const scope = getFieldValue(lines, /Périmètre\\s*:\\s*(.+)/)\n const criterion = getFieldValue(lines, /Critère[s]?\\s*:\\s*(.+)/)\n\n // Outputs: may be inline or multi-line (indented \"- item\")\n const outputs: string[] = []\n const produitIdx = lines.findIndex((l) => /Produit\\s*:/.test(l))\n if (produitIdx !== -1) {\n const inlineVal = (lines[produitIdx].match(/Produit\\s*:\\s*(.+)/)?.[1] ?? '').trim()\n if (inlineVal) {\n outputs.push(inlineVal)\n } else {\n for (let i = produitIdx + 1; i < lines.length; i++) {\n const line = lines[i]\n if (/^\\s+[-]/.test(line)) {\n outputs.push(line.trim().replace(/^-\\s*/, ''))\n } else if (line.trim() !== '' && !/^\\s/.test(line)) {\n break\n }\n }\n }\n }\n\n agents.push({ number, name, fullName, slug, scope, outputs, criterion })\n }\n\n return agents\n}\n","import chalk from 'chalk'\n\nexport const logger = {\n info: (message: string): void => {\n process.stdout.write(chalk.blue('ℹ') + ' ' + message + '\\n')\n },\n success: (message: string): void => {\n process.stdout.write(chalk.green('✔') + ' ' + message + '\\n')\n },\n warn: (message: string): void => {\n process.stdout.write(chalk.yellow('⚠') + ' ' + message + '\\n')\n },\n error: (message: string): void => {\n process.stderr.write(chalk.red('✖') + ' ' + message + '\\n')\n },\n}\n","import type { Command } from 'commander'\nimport { readFile, writeFile } from 'node:fs/promises'\nimport { join, basename } from 'node:path'\nimport inquirer from 'inquirer'\nimport { logger } from '../utils/logger.js'\nimport { extractAgentsFromWorkflow, toSlug } from '../utils/agentParser.js'\nimport { generatePlaybook } from '../generators/playbookGenerator.js'\nimport { generateSkills } from '../generators/skillsGenerator.js'\nimport type { Agent } from '../types/agent.js'\n\nfunction featureToAgentName(description: string): string {\n const clean = description\n .replace(/^(add|implement|create|build|integrate|setup|configure|refactor|improve)\\s+/i, '')\n .trim()\n return clean.replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\nexport interface AddFeatureResult {\n agent: Agent\n agentDirPath: string\n}\n\nexport async function addFeatureToProject(\n description: string,\n projectDir: string,\n): Promise<AddFeatureResult> {\n const workflowPath = join(projectDir, 'AGENT_WORKFLOW.md')\n const playbookPath = join(projectDir, 'PLAYBOOK.md')\n\n let workflowContent = ''\n try {\n workflowContent = await readFile(workflowPath, 'utf-8')\n } catch {\n throw new Error(`AGENT_WORKFLOW.md not found in ${projectDir} — run agentkit init first`)\n }\n\n const existingAgents = extractAgentsFromWorkflow(workflowContent)\n const nextNumber = existingAgents.length + 1\n const name = featureToAgentName(description)\n const slug = toSlug(name)\n const fullName = `Agent ${nextNumber} · ${name}`\n\n const newAgent: Agent = {\n number: nextNumber,\n name,\n fullName,\n slug,\n scope: description,\n outputs: [`agents/agent-${nextNumber}-${slug}/`],\n criterion: 'npm run build && npm test',\n }\n\n const agentBlock = `\n### ${fullName}\nPérimètre : ${description}\nProduit :\n - agents/agent-${nextNumber}-${slug}/\nCritère : npm run build && npm test\n`\n\n await writeFile(workflowPath, workflowContent + agentBlock, 'utf-8')\n await generateSkills([newAgent], projectDir)\n\n let projectName = basename(projectDir)\n try {\n const pkg = JSON.parse(\n await readFile(join(projectDir, 'package.json'), 'utf-8'),\n ) as { name?: string }\n if (pkg.name) projectName = pkg.name\n } catch { /* use dirname fallback */ }\n\n const allAgents = [...existingAgents, newAgent]\n\n // When adding a feature iteration, hasBlueprint is false —\n // Phase 0 decomposition only runs during the initial init with --blueprint.\n const playbookContent = generatePlaybook({\n agents: allAgents,\n projectName,\n hasBlueprint: false,\n })\n await writeFile(playbookPath, playbookContent, 'utf-8')\n\n return {\n agent: newAgent,\n agentDirPath: join(projectDir, 'agents', `agent-${nextNumber}-${slug}`),\n }\n}\n\nexport function registerAdd(program: Command): void {\n const addCmd = program\n .command('add')\n .description('Add resources to the agentkit project')\n .option('--feature <description>', 'Add an agent from a feature description and regenerate PLAYBOOK.md')\n .action(async (options: { feature?: string }) => {\n if (options.feature) {\n try {\n const result = await addFeatureToProject(options.feature, process.cwd())\n logger.success(`Agent added : ${result.agent.fullName}`)\n logger.success(`Folder created : agents/agent-${result.agent.number}-${result.agent.slug}/`)\n logger.success('PLAYBOOK.md : regenerated')\n } catch (err) {\n logger.error(err instanceof Error ? err.message : String(err))\n process.exit(1)\n }\n } else {\n addCmd.help()\n }\n })\n\n addCmd\n .command('agent')\n .description('Add a new agent to AGENT_WORKFLOW.md (interactive)')\n .action(async () => {\n const cwd = process.cwd()\n const workflowPath = join(cwd, 'AGENT_WORKFLOW.md')\n\n let existing = ''\n try {\n existing = await readFile(workflowPath, 'utf-8')\n } catch {\n logger.error('AGENT_WORKFLOW.md not found — run agentkit init first')\n process.exit(1)\n }\n\n const agentCount = (existing.match(/^### Agent \\d+/gm) ?? []).length\n const nextNumber = agentCount + 1\n\n const answers = await inquirer.prompt<{\n name: string\n scope: string\n outputs: string\n criterion: string\n }>([\n {\n type: 'input',\n name: 'name',\n message: `Agent name (e.g. \"Agent ${nextNumber} · Feature X\"):`,\n default: `Agent ${nextNumber}`,\n },\n {\n type: 'input',\n name: 'scope',\n message: 'Scope (one sentence):',\n },\n {\n type: 'input',\n name: 'outputs',\n message: 'Deliverables (comma-separated):',\n },\n {\n type: 'input',\n name: 'criterion',\n message: 'Success criterion:',\n },\n ])\n\n const outputLines = answers.outputs\n .split(',')\n .map((o: string) => ` - ${o.trim()}`)\n .join('\\n')\n\n const agentSection = `\n### ${answers.name}\nPérimètre : ${answers.scope}\nProduit :\n${outputLines}\nCritère : ${answers.criterion}\n`\n\n await writeFile(workflowPath, existing + agentSection, 'utf-8')\n logger.success(`Agent \"${answers.name}\" added to AGENT_WORKFLOW.md`)\n })\n}","import type { Command } from 'commander'\nimport { readFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport chalk from 'chalk'\nimport { detectStack } from '../detectors/stackDetector.js'\nimport { isGitRepo } from '../detectors/gitDetector.js'\nimport { logger } from '../utils/logger.js'\n\nexport function registerStatus(program: Command): void {\n program\n .command('status')\n .description('Affiche l\\'état du workflow agentkit dans le dossier courant')\n .action(async () => {\n const cwd = process.cwd()\n\n const [stack, isGit, claudeMd, workflow] = await Promise.all([\n detectStack(cwd),\n isGitRepo(cwd),\n readFile(join(cwd, 'CLAUDE.md'), 'utf-8').catch(() => null),\n readFile(join(cwd, 'AGENT_WORKFLOW.md'), 'utf-8').catch(() => null),\n ])\n\n process.stdout.write('\\n' + chalk.bold('AgentKit Status') + '\\n')\n process.stdout.write('─'.repeat(40) + '\\n')\n\n process.stdout.write(\n chalk.bold('Git repo : ') +\n (isGit ? chalk.green('✔ oui') : chalk.red('✖ non')) +\n '\\n',\n )\n\n process.stdout.write(\n chalk.bold('Stack : ') + chalk.cyan(stack.framework) + ' (' + stack.language + ')\\n',\n )\n\n process.stdout.write(\n chalk.bold('CLAUDE.md : ') +\n (claudeMd !== null ? chalk.green('✔ présent') : chalk.yellow('✖ absent — lancez agentkit init')) +\n '\\n',\n )\n\n process.stdout.write(\n chalk.bold('AGENT_WORKFLOW.md : ') +\n (workflow !== null ? chalk.green('✔ présent') : chalk.yellow('✖ absent — lancez agentkit init')) +\n '\\n',\n )\n\n if (workflow !== null) {\n const agentMatches = workflow.match(/^### Agent \\d+/gm) ?? []\n process.stdout.write(\n chalk.bold('Agents définis : ') + chalk.cyan(String(agentMatches.length)) + '\\n',\n )\n }\n\n process.stdout.write('─'.repeat(40) + '\\n\\n')\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uBAAwB;;;ACAxB,IAAAA,mBAAoC;AACpC,IAAAC,oBAAqB;AACrB,sBAAqB;AACrB,iBAAgB;;;ACJhB,sBAAiC;AACjC,uBAAqB;AASrB,eAAe,WAAW,GAA6B;AACrD,MAAI;AACF,cAAM,wBAAO,CAAC;AACd,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,SAAS,GAAoD;AAC1E,MAAI;AACF,UAAM,MAAM,UAAM,0BAAS,GAAG,OAAO;AACrC,WAAO,KAAK,MAAM,GAAG;AAAA,EACvB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,SAAS,GAAmC;AACzD,MAAI;AACF,WAAO,UAAM,0BAAS,GAAG,OAAO;AAAA,EAClC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAsB,YAAY,aAAyC;AACzE,QAAM,OAAkB;AAAA,IACtB,WAAW;AAAA,IACX,UAAU;AAAA,IACV,eAAe;AAAA,IACf,QAAQ,CAAC;AAAA,EACX;AAEA,QAAM,cAAc,MAAM,aAAS,uBAAK,aAAa,cAAc,CAAC;AACpE,QAAM,kBAAkB,MAAM,aAAS,uBAAK,aAAa,kBAAkB,CAAC;AAC5E,QAAM,cAAc,MAAM,eAAW,uBAAK,aAAa,WAAW,CAAC;AACnE,QAAM,cAAc,MAAM,eAAW,uBAAK,aAAa,eAAe,CAAC;AAEvE,MAAI,gBAAgB,MAAM;AACxB,UA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,IAAI,cAAAA,QAAM,OAAO,2CAAiC,KAC9F;AAAA,IACJ;AAEA,YAAQ,OAAO;AAAA,MACb,cAAAA,QAAM,KAAK,sBAAsB,KAC9BD,cAAa,OAAO,cAAAC,QAAM,MAAM,mBAAW,IAAI,cAAAA,QAAM,OAAO,2CAAiC,KAC9F;AAAA,IACJ;AAEA,QAAID,cAAa,MAAM;AACrB,YAAM,eAAeA,UAAS,MAAM,kBAAkB,KAAK,CAAC;AAC5D,cAAQ,OAAO;AAAA,QACb,cAAAC,QAAM,KAAK,wBAAqB,IAAI,cAAAA,QAAM,KAAK,OAAO,aAAa,MAAM,CAAC,IAAI;AAAA,MAChF;AAAA,IACF;AAEA,YAAQ,OAAO,MAAM,SAAI,OAAO,EAAE,IAAI,MAAM;AAAA,EAC9C,CAAC;AACL;;;AlBlDA,IAAM,UAAU,IAAI,yBAAQ;AAE5B,QACG,KAAK,UAAU,EACf,YAAY,mDAAmD,EAC/D,QAAQ,OAAO;AAElB,aAAa,OAAO;AACpB,YAAY,OAAO;AACnB,eAAe,OAAO;AAEtB,QAAQ,MAAM;","names":["import_promises","import_node_path","import_promises","import_node_path","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","claudeMd","workflow","import_promises","import_node_path","chalk","import_node_path","program","ora","inquirer","import_promises","import_node_path","import_inquirer","agentBlock","program","inquirer","import_promises","import_node_path","import_chalk","program","claudeMd","workflow","chalk"]}
|