agents.dev 1.0.0 → 1.0.2
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/README.md +112 -58
- package/definitions/dev.auditor.yaml +54 -0
- package/definitions/dev.coder.yaml +60 -0
- package/definitions/dev.feature.yaml +108 -0
- package/definitions/dev.log.yaml +51 -0
- package/definitions/dev.milestone.yaml +62 -0
- package/definitions/dev.ops.yaml +39 -0
- package/definitions/dev.project.yaml +91 -0
- package/definitions/dev.requirements.yaml +76 -0
- package/definitions/dev.review.yaml +72 -0
- package/definitions/dev.tasks.yaml +70 -0
- package/dist/generators/agents.js +135 -0
- package/dist/generators/docs.js +89 -0
- package/dist/index.js +89 -0
- package/dist/parsers/markdown.js +86 -0
- package/dist/transformers/gemini.js +36 -0
- package/dist/transformers/kilo.js +18 -0
- package/dist/transformers/opencode.js +18 -0
- package/dist/transformers/roo.js +20 -0
- package/dist/types.js +12 -0
- package/package.json +19 -4
- package/definitions/backend-architect.yaml +0 -12
- package/src/index.ts +0 -140
- package/src/transformers/gemini.ts +0 -31
- package/src/transformers/kilo.ts +0 -21
- package/src/transformers/opencode.ts +0 -21
- package/src/transformers/roo.ts +0 -23
- package/src/types.ts +0 -12
- package/test-inquirer.ts +0 -19
- package/tsconfig.json +0 -15
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toOpenCodeCommand = toOpenCodeCommand;
|
|
4
|
+
function toOpenCodeCommand(agent) {
|
|
5
|
+
// OpenCode generic config/prompt
|
|
6
|
+
const parts = [];
|
|
7
|
+
parts.push(`<!--- OpenCode Agent Config --->`);
|
|
8
|
+
parts.push(`# ${agent.name} ${agent.emoji || ''}`);
|
|
9
|
+
parts.push(`**Role**: ${agent.role}\n`);
|
|
10
|
+
parts.push(`## Instructions`);
|
|
11
|
+
parts.push(agent.systemPrompt.trim());
|
|
12
|
+
parts.push('\n');
|
|
13
|
+
if (agent.rules && agent.rules.length > 0) {
|
|
14
|
+
parts.push(`## Constraints`);
|
|
15
|
+
agent.rules.forEach(rule => parts.push(`- ${rule}`));
|
|
16
|
+
}
|
|
17
|
+
return parts.join('\n');
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toRooRules = toRooRules;
|
|
4
|
+
function toRooRules(agent) {
|
|
5
|
+
// Roo Code / Cline usually expects a clear set of rules and role definition.
|
|
6
|
+
const parts = [];
|
|
7
|
+
parts.push(`# ${agent.name} (${agent.role})`);
|
|
8
|
+
parts.push(`\n${agent.systemPrompt.trim()}\n`);
|
|
9
|
+
if (agent.rules && agent.rules.length > 0) {
|
|
10
|
+
parts.push(`## Analytical Rules & Guidelines`);
|
|
11
|
+
agent.rules.forEach(rule => parts.push(`- ${rule}`));
|
|
12
|
+
parts.push('\n');
|
|
13
|
+
}
|
|
14
|
+
// Tools might be handled differently in Roo, but listing them as preferences is safe
|
|
15
|
+
if (agent.tools && agent.tools.length > 0) {
|
|
16
|
+
parts.push(`## Tool Usage Preferences`);
|
|
17
|
+
agent.tools.forEach(tool => parts.push(`- Prefer using ${tool} when applicable.`));
|
|
18
|
+
}
|
|
19
|
+
return parts.join('\n');
|
|
20
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.AgentSchema = zod_1.z.object({
|
|
6
|
+
name: zod_1.z.string().min(1, "Name is required"),
|
|
7
|
+
role: zod_1.z.string().min(1, "Role is required"),
|
|
8
|
+
emoji: zod_1.z.string().optional(),
|
|
9
|
+
systemPrompt: zod_1.z.string().min(10, "System prompt must be at least 10 characters"),
|
|
10
|
+
rules: zod_1.z.array(zod_1.z.string()).optional(),
|
|
11
|
+
tools: zod_1.z.array(zod_1.z.string()).optional()
|
|
12
|
+
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents.dev",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agents.dev": "./dist/index.js",
|
|
8
|
+
"agents-install": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"definitions"
|
|
13
|
+
],
|
|
6
14
|
"scripts": {
|
|
7
15
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
-
"start": "npx ts-node src/index.ts
|
|
16
|
+
"start": "npx ts-node src/index.ts",
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
9
19
|
},
|
|
10
|
-
"keywords": [
|
|
20
|
+
"keywords": [
|
|
21
|
+
"agents",
|
|
22
|
+
"ai",
|
|
23
|
+
"cli",
|
|
24
|
+
"workflow"
|
|
25
|
+
],
|
|
11
26
|
"author": "",
|
|
12
27
|
"license": "ISC",
|
|
13
28
|
"type": "commonjs",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
name: Backend Architect
|
|
2
|
-
role: Senior Backend Engineer specializes in scalable APIs
|
|
3
|
-
emoji: 🏗️
|
|
4
|
-
systemPrompt: |
|
|
5
|
-
You are a Senior Backend Engineer. Your goal is to design and implement scalable, robust, and secure backend systems.
|
|
6
|
-
You prefer Node.js with TypeScript or Python with FastAPI.
|
|
7
|
-
You always consider performance implications.
|
|
8
|
-
rules:
|
|
9
|
-
- Follow RESTful API design principles.
|
|
10
|
-
- Use environment variables for secrets.
|
|
11
|
-
- Write unit tests for all business logic.
|
|
12
|
-
- Document API endpoints.
|
package/src/index.ts
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import YAML from 'yaml';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import inquirer from 'inquirer';
|
|
7
|
-
import { AgentDefinition, AgentSchema } from './types';
|
|
8
|
-
import { toGeminiSystemPrompt } from './transformers/gemini';
|
|
9
|
-
import { toRooRules } from './transformers/roo';
|
|
10
|
-
import { toKiloConfig } from './transformers/kilo';
|
|
11
|
-
import { toOpenCodeCommand } from './transformers/opencode';
|
|
12
|
-
|
|
13
|
-
const program = new Command();
|
|
14
|
-
|
|
15
|
-
program
|
|
16
|
-
.name('agents')
|
|
17
|
-
.description('Agent Installer CLI')
|
|
18
|
-
.version('1.0.0');
|
|
19
|
-
|
|
20
|
-
program
|
|
21
|
-
.command('build')
|
|
22
|
-
.description('Build agent definitions into target formats')
|
|
23
|
-
.option('-o, --out <dir>', 'Output directory', '.')
|
|
24
|
-
.option('-t, --target <targets>', 'Comma-separated target formats (gemini, roo, kilo, opencode)')
|
|
25
|
-
.action(async (options) => {
|
|
26
|
-
const definitionsDir = path.join(process.cwd(), 'definitions');
|
|
27
|
-
const outDir = path.resolve(options.out);
|
|
28
|
-
|
|
29
|
-
// Determine targets
|
|
30
|
-
let selectedTargets: string[] = [];
|
|
31
|
-
if (options.target) {
|
|
32
|
-
selectedTargets = options.target.split(',').map((t: string) => t.trim().toLowerCase());
|
|
33
|
-
} else {
|
|
34
|
-
const answers = await inquirer.prompt([
|
|
35
|
-
{
|
|
36
|
-
type: 'checkbox',
|
|
37
|
-
name: 'targets',
|
|
38
|
-
message: 'Select target formats to build:',
|
|
39
|
-
choices: [
|
|
40
|
-
{ name: 'Gemini CLI', value: 'gemini', checked: true },
|
|
41
|
-
{ name: 'Roo Code', value: 'roo', checked: false },
|
|
42
|
-
{ name: 'Kilo Code', value: 'kilo', checked: false },
|
|
43
|
-
{ name: 'OpenCode', value: 'opencode', checked: false }
|
|
44
|
-
],
|
|
45
|
-
validate: (answer) => {
|
|
46
|
-
if (answer.length < 1) {
|
|
47
|
-
return 'You must choose at least one target.';
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
]);
|
|
53
|
-
selectedTargets = answers.targets;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (selectedTargets.length === 0) {
|
|
57
|
-
console.log(chalk.yellow('No targets selected. Exiting.'));
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
console.log(chalk.blue(`Building agents from ${definitionsDir} to ${outDir}...`));
|
|
62
|
-
console.log(chalk.blue(`Targets: ${selectedTargets.join(', ')}`));
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
if (outDir !== process.cwd()) {
|
|
66
|
-
await fs.ensureDir(outDir);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const files = await fs.readdir(definitionsDir);
|
|
70
|
-
|
|
71
|
-
for (const file of files) {
|
|
72
|
-
if (!file.endsWith('.yaml') && !file.endsWith('.yml')) continue;
|
|
73
|
-
|
|
74
|
-
const content = await fs.readFile(path.join(definitionsDir, file), 'utf-8');
|
|
75
|
-
const rawAgent = YAML.parse(content);
|
|
76
|
-
const parseResult = AgentSchema.safeParse(rawAgent);
|
|
77
|
-
|
|
78
|
-
if (!parseResult.success) {
|
|
79
|
-
console.error(chalk.red(`Validation failed for ${file}:`));
|
|
80
|
-
parseResult.error.issues.forEach((err) => {
|
|
81
|
-
console.error(chalk.red(` - ${err.path.join('.')}: ${err.message}`));
|
|
82
|
-
});
|
|
83
|
-
continue; // Skip this agent
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const agent = parseResult.data;
|
|
87
|
-
const slug = file.replace(/\.(yaml|yml)$/, '');
|
|
88
|
-
|
|
89
|
-
console.log(chalk.green(`Processing agent: ${agent.name} (${slug})`));
|
|
90
|
-
|
|
91
|
-
// specific outputs
|
|
92
|
-
const allTargets = [
|
|
93
|
-
{
|
|
94
|
-
id: 'gemini',
|
|
95
|
-
subDir: '.gemini/commands/dev',
|
|
96
|
-
ext: 'md',
|
|
97
|
-
content: toGeminiSystemPrompt(agent),
|
|
98
|
-
name: `${slug}.md`
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 'roo',
|
|
102
|
-
subDir: '.roo/commands',
|
|
103
|
-
ext: 'md',
|
|
104
|
-
content: toRooRules(agent),
|
|
105
|
-
name: `${slug}.md`
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: 'kilo',
|
|
109
|
-
subDir: '.kilocode/workflows',
|
|
110
|
-
ext: 'md',
|
|
111
|
-
content: toKiloConfig(agent),
|
|
112
|
-
name: `${slug}.md`
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
id: 'opencode',
|
|
116
|
-
subDir: '.opencode/command',
|
|
117
|
-
ext: 'md',
|
|
118
|
-
content: toOpenCodeCommand(agent),
|
|
119
|
-
name: `${slug}.md`
|
|
120
|
-
}
|
|
121
|
-
];
|
|
122
|
-
|
|
123
|
-
const targetsToBuild = allTargets.filter(t => selectedTargets.includes(t.id));
|
|
124
|
-
|
|
125
|
-
for (const target of targetsToBuild) {
|
|
126
|
-
const targetDir = path.join(outDir, target.subDir);
|
|
127
|
-
await fs.ensureDir(targetDir);
|
|
128
|
-
await fs.writeFile(path.join(targetDir, target.name), target.content);
|
|
129
|
-
console.log(chalk.gray(` -> ${target.subDir}/${target.name}`));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
console.log(chalk.bold.green('Build complete!'));
|
|
133
|
-
|
|
134
|
-
} catch (err) {
|
|
135
|
-
console.error(chalk.red('Build failed:'), err);
|
|
136
|
-
process.exit(1);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
program.parse(process.argv);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AgentDefinition } from '../types';
|
|
2
|
-
|
|
3
|
-
export function toGeminiSystemPrompt(agent: AgentDefinition): string {
|
|
4
|
-
const parts = [];
|
|
5
|
-
|
|
6
|
-
// Identity
|
|
7
|
-
parts.push(`# Identity\n`);
|
|
8
|
-
parts.push(`You are **${agent.name}** ${agent.emoji || ''}`);
|
|
9
|
-
parts.push(`Role: ${agent.role}\n`);
|
|
10
|
-
|
|
11
|
-
// System Prompt
|
|
12
|
-
parts.push(`# Core Instructions\n`);
|
|
13
|
-
parts.push(agent.systemPrompt.trim());
|
|
14
|
-
parts.push('\n');
|
|
15
|
-
|
|
16
|
-
// Rules
|
|
17
|
-
if (agent.rules && agent.rules.length > 0) {
|
|
18
|
-
parts.push(`# Rules & Guidelines\n`);
|
|
19
|
-
agent.rules.forEach(rule => parts.push(`- ${rule}`));
|
|
20
|
-
parts.push('\n');
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Tools (if any)
|
|
24
|
-
if (agent.tools && agent.tools.length > 0) {
|
|
25
|
-
parts.push(`# Preferred Tools\n`);
|
|
26
|
-
agent.tools.forEach(tool => parts.push(`- ${tool}`));
|
|
27
|
-
parts.push('\n');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return parts.join('\n');
|
|
31
|
-
}
|
package/src/transformers/kilo.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AgentDefinition } from '../types';
|
|
2
|
-
|
|
3
|
-
export function toKiloConfig(agent: AgentDefinition): string {
|
|
4
|
-
// Kilo Code generic config/prompt
|
|
5
|
-
const parts = [];
|
|
6
|
-
|
|
7
|
-
parts.push(`<!--- Kilo Code Agent Config --->`);
|
|
8
|
-
parts.push(`# ${agent.name} ${agent.emoji || ''}`);
|
|
9
|
-
parts.push(`**Role**: ${agent.role}\n`);
|
|
10
|
-
|
|
11
|
-
parts.push(`## Instructions`);
|
|
12
|
-
parts.push(agent.systemPrompt.trim());
|
|
13
|
-
parts.push('\n');
|
|
14
|
-
|
|
15
|
-
if (agent.rules && agent.rules.length > 0) {
|
|
16
|
-
parts.push(`## Constraints`);
|
|
17
|
-
agent.rules.forEach(rule => parts.push(`- ${rule}`));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return parts.join('\n');
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AgentDefinition } from '../types';
|
|
2
|
-
|
|
3
|
-
export function toOpenCodeCommand(agent: AgentDefinition): string {
|
|
4
|
-
// OpenCode generic config/prompt
|
|
5
|
-
const parts = [];
|
|
6
|
-
|
|
7
|
-
parts.push(`<!--- OpenCode Agent Config --->`);
|
|
8
|
-
parts.push(`# ${agent.name} ${agent.emoji || ''}`);
|
|
9
|
-
parts.push(`**Role**: ${agent.role}\n`);
|
|
10
|
-
|
|
11
|
-
parts.push(`## Instructions`);
|
|
12
|
-
parts.push(agent.systemPrompt.trim());
|
|
13
|
-
parts.push('\n');
|
|
14
|
-
|
|
15
|
-
if (agent.rules && agent.rules.length > 0) {
|
|
16
|
-
parts.push(`## Constraints`);
|
|
17
|
-
agent.rules.forEach(rule => parts.push(`- ${rule}`));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return parts.join('\n');
|
|
21
|
-
}
|
package/src/transformers/roo.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AgentDefinition } from '../types';
|
|
2
|
-
|
|
3
|
-
export function toRooRules(agent: AgentDefinition): string {
|
|
4
|
-
// Roo Code / Cline usually expects a clear set of rules and role definition.
|
|
5
|
-
const parts = [];
|
|
6
|
-
|
|
7
|
-
parts.push(`# ${agent.name} (${agent.role})`);
|
|
8
|
-
parts.push(`\n${agent.systemPrompt.trim()}\n`);
|
|
9
|
-
|
|
10
|
-
if (agent.rules && agent.rules.length > 0) {
|
|
11
|
-
parts.push(`## Analytical Rules & Guidelines`);
|
|
12
|
-
agent.rules.forEach(rule => parts.push(`- ${rule}`));
|
|
13
|
-
parts.push('\n');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Tools might be handled differently in Roo, but listing them as preferences is safe
|
|
17
|
-
if (agent.tools && agent.tools.length > 0) {
|
|
18
|
-
parts.push(`## Tool Usage Preferences`);
|
|
19
|
-
agent.tools.forEach(tool => parts.push(`- Prefer using ${tool} when applicable.`));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return parts.join('\n');
|
|
23
|
-
}
|
package/src/types.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export const AgentSchema = z.object({
|
|
4
|
-
name: z.string().min(1, "Name is required"),
|
|
5
|
-
role: z.string().min(1, "Role is required"),
|
|
6
|
-
emoji: z.string().optional(),
|
|
7
|
-
systemPrompt: z.string().min(10, "System prompt must be at least 10 characters"),
|
|
8
|
-
rules: z.array(z.string()).optional(),
|
|
9
|
-
tools: z.array(z.string()).optional()
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export type AgentDefinition = z.infer<typeof AgentSchema>;
|
package/test-inquirer.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import inquirer from 'inquirer';
|
|
2
|
-
|
|
3
|
-
(async () => {
|
|
4
|
-
console.log('Testing inquirer checkbox...');
|
|
5
|
-
const answers = await inquirer.prompt([
|
|
6
|
-
{
|
|
7
|
-
type: 'checkbox',
|
|
8
|
-
name: 'targets',
|
|
9
|
-
message: 'Select target formats:',
|
|
10
|
-
choices: [
|
|
11
|
-
{ name: 'Gemini CLI', value: 'gemini', checked: true },
|
|
12
|
-
{ name: 'Roo Code', value: 'roo', checked: true },
|
|
13
|
-
{ name: 'Kilo Code', value: 'kilo', checked: true },
|
|
14
|
-
{ name: 'OpenCode', value: 'opencode', checked: true }
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
]);
|
|
18
|
-
console.log('Selected:', answers.targets);
|
|
19
|
-
})();
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2020",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"outDir": "./dist",
|
|
10
|
-
"rootDir": "./src",
|
|
11
|
-
"resolveJsonModule": true
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*"],
|
|
14
|
-
"exclude": ["node_modules"]
|
|
15
|
-
}
|