context-forge
Version:
AI orchestration platform with autonomous teams, enhancement planning, migration tools, 25+ slash commands, checkpoints & hooks. Multi-IDE: Claude, Cursor, Windsurf, Cline, Copilot
111 lines • 4.93 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClaudeAdapter = void 0;
const base_1 = require("./base");
const path_1 = __importDefault(require("path"));
const claudeMd_1 = require("../generators/claudeMd");
const implementation_1 = require("../generators/implementation");
const projectStructure_1 = require("../generators/projectStructure");
const uiUx_1 = require("../generators/uiUx");
const bugTracking_1 = require("../generators/bugTracking");
const prp_1 = require("../generators/prp");
const slashCommands_1 = require("../generators/slashCommands");
class ClaudeAdapter extends base_1.IDEAdapter {
get name() {
return 'Claude Code';
}
get description() {
return "Anthropic's official CLI for Claude (recommended)";
}
get configFiles() {
return ['CLAUDE.md', 'Docs/', 'PRPs/', '.claude/'];
}
get supportsValidation() {
return true;
}
get supportsPRP() {
return true;
}
async generateFiles(outputPath) {
const files = [];
const docsPath = path_1.default.join(outputPath, 'Docs');
// Generate CLAUDE.md
files.push({
path: path_1.default.join(outputPath, 'CLAUDE.md'),
content: await (0, claudeMd_1.generateClaudeMd)(this.config),
description: 'Main context file for Claude Code',
});
// Generate Docs files
files.push({
path: path_1.default.join(docsPath, 'Implementation.md'),
content: await (0, implementation_1.generateImplementation)(this.config),
description: 'Staged development plan',
});
files.push({
path: path_1.default.join(docsPath, 'project_structure.md'),
content: await (0, projectStructure_1.generateProjectStructure)(this.config),
description: 'Project organization guide',
});
files.push({
path: path_1.default.join(docsPath, 'UI_UX_doc.md'),
content: await (0, uiUx_1.generateUiUx)(this.config),
description: 'Design specifications',
});
files.push({
path: path_1.default.join(docsPath, 'Bug_tracking.md'),
content: await (0, bugTracking_1.generateBugTracking)(this.config),
description: 'Bug tracking template',
});
// Generate PRPs if enabled
if (this.config.extras.prp) {
const prpPath = path_1.default.join(outputPath, 'PRPs');
const projectSlug = this.config.projectName.toLowerCase().replace(/\s+/g, '-');
// In retrofit mode, generate PRPs for planned features
if (this.config.isRetrofit &&
this.config.plannedFeatures &&
this.config.plannedFeatures.length > 0) {
// Generate a PRP for each planned feature
for (const feature of this.config.plannedFeatures) {
const featureName = feature.split(':')[0].toLowerCase().replace(/\s+/g, '-');
files.push({
path: path_1.default.join(prpPath, `${featureName}-prp.md`),
content: await (0, prp_1.generatePRP)({
...this.config,
prd: {
...this.config.prd,
content: `Feature: ${feature}`,
},
}, 'base'),
description: `PRP for: ${feature}`,
});
}
}
else {
// Regular mode - generate base PRP
files.push({
path: path_1.default.join(prpPath, `${projectSlug}-prp.md`),
content: await (0, prp_1.generatePRP)(this.config, 'base'),
description: 'Base implementation PRP',
});
// Add planning PRP for complex projects
if (this.config.timeline === 'enterprise' || this.config.teamSize !== 'solo') {
files.push({
path: path_1.default.join(prpPath, `${projectSlug}-planning.md`),
content: await (0, prp_1.generatePRP)(this.config, 'planning'),
description: 'Architecture planning PRP',
});
}
}
}
// Generate slash commands
const slashCommands = await (0, slashCommands_1.generateSlashCommands)(this.config);
const commandFiles = (0, slashCommands_1.generateSlashCommandFiles)(slashCommands);
files.push(...commandFiles);
return files;
}
}
exports.ClaudeAdapter = ClaudeAdapter;
//# sourceMappingURL=claude.js.map