aimapper
Version:
Universal build tool for managing coding agent rules - Support Claude Code, Cursor, Windsurf, GitHub Copilot, and more
22 lines (21 loc) • 710 B
JavaScript
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
const agentsSpec = {
builder(context) {
const { dryRun, files, sourceDir } = context;
// Read all rule files and combine them
const sections = [];
for (const file of files) {
const content = readFileSync(join(sourceDir, file), 'utf8');
sections.push(content.trim());
}
const rulesContent = sections.join('\n\n---\n\n');
if (!dryRun) {
writeFileSync('AGENTS.md', rulesContent, 'utf8');
}
},
displayName: 'Universal Agents',
id: 'agents',
outputPaths: ['AGENTS.md'],
};
export { agentsSpec as agents };