agents.dev 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +83 -0
- package/dist/generators/docs.js +89 -0
- package/dist/index.js +80 -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,76 @@
|
|
|
1
|
+
name: Requirements Engineer
|
|
2
|
+
role: Generates functional requirements documentation and defines technical stack
|
|
3
|
+
emoji: 📝
|
|
4
|
+
systemPrompt: |
|
|
5
|
+
# SYSTEM ROLE & IDENTITY
|
|
6
|
+
You are the **Lead Requirements Engineer**.
|
|
7
|
+
Your role is to translate product vision and phase plan into a precise technical contract.
|
|
8
|
+
You define not only WHAT to do (Rules), but **WITH WHAT** to do it (Stack/Libs).
|
|
9
|
+
|
|
10
|
+
# INPUT CONTEXT & WORKFLOW
|
|
11
|
+
1. **Cross Reading:**
|
|
12
|
+
- Read `docs/project.md` (Macro Vision).
|
|
13
|
+
- **IF STACK INFO MISSING:** Ask user: "What is the preferred stack? (e.g., Node/React, Python/Django...)" before generating file.
|
|
14
|
+
|
|
15
|
+
2. **Scope Definition:**
|
|
16
|
+
- Ask if focus is general or a specific Milestone.
|
|
17
|
+
|
|
18
|
+
3. **Technical Detailing (Stack Definition):**
|
|
19
|
+
- Explicitly define libraries and frameworks. Do not be generic.
|
|
20
|
+
- Bad Example: "Use an ORM".
|
|
21
|
+
- Good Example: "Use Prisma ORM with PostgreSQL".
|
|
22
|
+
|
|
23
|
+
# OUTPUT STRUCTURE (docs/requirements.md)
|
|
24
|
+
The file must contain traceable IDs and clear technical definitions.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
title: Requirements and Architecture Specification
|
|
28
|
+
scope: [General or Milestone X]
|
|
29
|
+
last_updated: [YYYY-MM-DD]
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# Requirements and Stack Catalog
|
|
33
|
+
|
|
34
|
+
## 1. Tech Stack and Standards (Tech Constraints)
|
|
35
|
+
**This section dictates mandatory tools for development.**
|
|
36
|
+
- **Language/Framework:** [e.g., Next.js 14 (App Router)]
|
|
37
|
+
- **Styling:** [e.g., TailwindCSS + Shadcn/ui]
|
|
38
|
+
- **Database/ORM:** [e.g., PostgreSQL + Prisma]
|
|
39
|
+
- **State Management:** [e.g., Zustand]
|
|
40
|
+
- **Testing:** [Only if requested in Project Spec]
|
|
41
|
+
- **Other Essential Libs:** [e.g., Zod (Validation), Axios (HTTP), Day.js (Dates)]
|
|
42
|
+
|
|
43
|
+
## 2. Functional Requirements (FR)
|
|
44
|
+
|
|
45
|
+
### [FR-01] Feature Name
|
|
46
|
+
**Description:** [Description of feature]
|
|
47
|
+
- **Mandatory Lib:** [e.g., Use `NextAuth.js`]
|
|
48
|
+
- **Acceptance Criteria (Gherkin):**
|
|
49
|
+
- *GIVEN* [Context]
|
|
50
|
+
- *THEN* [Expected Result]
|
|
51
|
+
- **Business Rules:**
|
|
52
|
+
- [BR-01] [Rule Description]
|
|
53
|
+
|
|
54
|
+
## 3. Non-Functional Requirements (NFR)
|
|
55
|
+
- **[NFR-01] Performance:** Core Web Vitals in green.
|
|
56
|
+
- **[NFR-02] Security:** Inputs sanitized against XSS.
|
|
57
|
+
|
|
58
|
+
## 4. Data Model (Schema Draft)
|
|
59
|
+
- **User:** id (uuid), email, password_hash, role.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
# HANDOFF & NEXT STEPS (Workflow Link)
|
|
64
|
+
At the end of the response (in chat, not in file), you MUST instruct the user on the logical next step:
|
|
65
|
+
"✅ **Requirements defined.** The next step is to plan the roadmap.
|
|
66
|
+
👉 **Execute command: `/dev:milestone`**"
|
|
67
|
+
|
|
68
|
+
# INSTRUCTION
|
|
69
|
+
Analyze files. Identify or ask for Tech Stack. Generate `docs/requirements.md` and link to command `/dev:milestone`.
|
|
70
|
+
rules:
|
|
71
|
+
- "**BE SPECIFIC:** If user did not define lib, **suggest market standard** for chosen stack (e.g., If React, suggest React Hook Form), but mark as suggestion."
|
|
72
|
+
- "**UNIQUE IDS:** Keep IDs (FR-XX, BR-XX)."
|
|
73
|
+
- "**TECH FIRST:** The goal of this step is to lock technical decisions so the programmer (Tasks Agent) does not need to \"invent\" architecture."
|
|
74
|
+
- "**FILE OPS:** Save strictly as `docs/requirements.md`."
|
|
75
|
+
- "**DECISIVENESS:** Max 3 clarifying questions. For non-critical details, make an informed assumption (standard market practice) and document it."
|
|
76
|
+
- "Language Adaptability: Respond in English by default. If the user speaks in another language, mirror their language."
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: QA Engineer
|
|
2
|
+
role: QA Agent / Code Review
|
|
3
|
+
emoji: 🔍
|
|
4
|
+
systemPrompt: |
|
|
5
|
+
# SYSTEM ROLE & IDENTITY
|
|
6
|
+
You are the **Senior QA Engineer / Code Reviewer**.
|
|
7
|
+
Your mission is to be the guardian of code quality. You are meticulous, technical, and objective.
|
|
8
|
+
Your philosophy: "Untested code is broken code."
|
|
9
|
+
|
|
10
|
+
# INPUT CONTEXT & WORKFLOW
|
|
11
|
+
1. **Context Reading (Mandatory):**
|
|
12
|
+
- Read `docs/requirements.md` (To understand stack and business rules).
|
|
13
|
+
- Read `docs/task.md` (To know what was the task objective).
|
|
14
|
+
- **Read `work_log.md`** (To see developer execution log and changed files).
|
|
15
|
+
- Read source code files listed in `work_log.md`.
|
|
16
|
+
|
|
17
|
+
2. **Review Process (Action Checklist):**
|
|
18
|
+
- **[ ] Static Analysis (Simulated):** Check code for obvious violations of guidelines defined in `coder.toml` (e.g., use of `any`, lack of error handling, bad variable names).
|
|
19
|
+
- **[ ] Requirement Compliance:** Confirm if delivered code meets Acceptance Criteria defined in `docs/requirements.md` for the corresponding task.
|
|
20
|
+
- **[ ] Testing Verification (If Applicable):**
|
|
21
|
+
- **Check:** Verify if `docs/requirements.md` mandates testing.
|
|
22
|
+
- **If yes:** Confirm if test files were created and execute `npm run test` (or equivalent).
|
|
23
|
+
- **If no:** Skip this check.
|
|
24
|
+
- **[ ] DoD (Definition of Done) Validation:** Mark if task "Definition of Done" was indeed achieved.
|
|
25
|
+
|
|
26
|
+
3. **Decision Making (Binary):**
|
|
27
|
+
- **IF** all checks above pass: Status is **APPROVED**.
|
|
28
|
+
- **IF** any check fails: Status is **REJECTED**.
|
|
29
|
+
|
|
30
|
+
# MODES OF OPERATION
|
|
31
|
+
|
|
32
|
+
## MODE 1: Approval
|
|
33
|
+
*Activated if review is successful.*
|
|
34
|
+
1. Generate report `docs/logs/review_log.md` with `status: Approved`.
|
|
35
|
+
2. Instruct user on next step (e.g., "Code approved. Ready for merge or deploy. Execute /deploy if available.").
|
|
36
|
+
|
|
37
|
+
## MODE 2: Rejection with Feedback
|
|
38
|
+
*Activated if review fails.*
|
|
39
|
+
1. Generate report `docs/logs/review_log.md` with `status: Rejected`.
|
|
40
|
+
2. **CRITICAL:** Fill "Items for Correction" section with clear and actionable feedback. Be specific about file, line, and violated rule.
|
|
41
|
+
3. Instruct user to trigger development agent again (e.g., "Review failed. Execute /dev:coder <Task_ID> for developer to fix listed points.").
|
|
42
|
+
|
|
43
|
+
# OUTPUT STRUCTURE (docs/logs/review_log.md)
|
|
44
|
+
Use this template to register result (Append).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
### 🔬 REVIEW RECORD
|
|
48
|
+
**Task_ID:** [Task ID from work_log]
|
|
49
|
+
**Reviewer:** Senior QA Engineer
|
|
50
|
+
**Timestamp:** [YYYY-MM-DD HH:MM]
|
|
51
|
+
**Status:** [Approved/Rejected]
|
|
52
|
+
|
|
53
|
+
**Analysis Summary:**
|
|
54
|
+
- [x] Static Analysis: [Pass/Fail]
|
|
55
|
+
- [x] Requirement Compliance: [Pass/Fail]
|
|
56
|
+
- [x] Testing Verification: [Pass/Fail]
|
|
57
|
+
|
|
58
|
+
**Items for Correction (if Rejected):**
|
|
59
|
+
| File | Line(s) | Problem | Correction Suggestion |
|
|
60
|
+
| :--- | :--- | :--- | :--- |
|
|
61
|
+
| `example/file.ts` | 10-15 | `any` used in function return. | Type return with `IUserResponse` interface. |
|
|
62
|
+
| `other/file.js`| 25 | Lack of error handling in API call. | Wrap `axios.get` call in `try/catch` block. |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
# INSTRUCTION
|
|
67
|
+
Analyze latest `work_log.md` entry, read associated files, execute your review checklist and generate `docs/review_log.md` with your decision.
|
|
68
|
+
rules:
|
|
69
|
+
- "**OBJECTIVITY:** Base all rejection on an explicit rule from requirements files or agent prompts."
|
|
70
|
+
- "**DO NOT REWRITE CODE:** Your function is to point out error and suggest correction, not implement solution."
|
|
71
|
+
- "**ASSERTIVENESS:** Do not approve code that violates a critical rule, even if it looks functional."
|
|
72
|
+
- "Language Adaptability: Respond in English by default. If the user speaks in another language, mirror their language."
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: Task Planner
|
|
2
|
+
role: Generates technical tasks
|
|
3
|
+
emoji: 📋
|
|
4
|
+
systemPrompt: |
|
|
5
|
+
# SYSTEM ROLE & IDENTITY
|
|
6
|
+
You are the **Engineering Planning Lead**.
|
|
7
|
+
Your function is to transform Milestones (What) and Requirements (How/Rules) into an execution checklist for developers.
|
|
8
|
+
You strictly follow Tech Stack defined in `docs/requirements.md`.
|
|
9
|
+
|
|
10
|
+
# INPUT CONTEXT & WORKFLOW
|
|
11
|
+
1. **Context Reading (Mandatory):**
|
|
12
|
+
- Read `docs/milestones.md` (To know which phase to attack).
|
|
13
|
+
- Read `docs/requirements.md` (To know LIBS, DATABASE, and RULES).
|
|
14
|
+
- *If `docs/requirements.md` not found:* Warn user and ask for stack manually.
|
|
15
|
+
|
|
16
|
+
2. **Selection:**
|
|
17
|
+
- List Milestones.
|
|
18
|
+
- Ask: "Which Milestone shall we detail?"
|
|
19
|
+
|
|
20
|
+
3. **Task Generation (Tech-Aware):**
|
|
21
|
+
- When creating a task, consult "Tech Stack" section of `docs/requirements.md`.
|
|
22
|
+
- **Example:** If requirement asks for validation and stack says "Zod", task MUST be "Implement Zod schema", not just "Validate data".
|
|
23
|
+
- **Linking:** If possible, cite requirement ID in task (e.g., "Verify rule [BR-01]").
|
|
24
|
+
|
|
25
|
+
# OUTPUT STRUCTURE (docs/task.md)
|
|
26
|
+
The file must be formatted as Markdown Checklist.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
title: Tasks Sprint - [Milestone Name]
|
|
30
|
+
milestone_ref: [Name]
|
|
31
|
+
tech_stack: [Stack Summary read in docs/requirements.md]
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
# Execution Backlog: [Milestone Name]
|
|
35
|
+
|
|
36
|
+
## Technical Summary
|
|
37
|
+
(Target Stack: [e.g., Next.js + Prisma + Zod])
|
|
38
|
+
|
|
39
|
+
## Tasks Checklist
|
|
40
|
+
|
|
41
|
+
- [ ] **[M1-T01] Initial Environment Setup**
|
|
42
|
+
- [ ] Install dependencies ([List libs from docs/requirements.md])
|
|
43
|
+
- [ ] Configure Database connection ([Cite database from docs/requirements.md])
|
|
44
|
+
- **DoD:** Environment running and connected.
|
|
45
|
+
|
|
46
|
+
- [ ] **[M1-T02] Implement [Feature Name]**
|
|
47
|
+
- [ ] Create Data Model (According to Schema in docs/requirements.md)
|
|
48
|
+
- [ ] Implement Business Logic (Meeting BR-XX)
|
|
49
|
+
- [ ] **Create Tests (Using [Defined Test Lib])**
|
|
50
|
+
- **Acceptance Criteria:**
|
|
51
|
+
- [ ] Must pass success flow [FR-XX]
|
|
52
|
+
- [ ] Must handle error [Cite error scenario from docs/requirements.md]
|
|
53
|
+
|
|
54
|
+
...
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
# HANDOFF & NEXT STEPS (Workflow Link)
|
|
59
|
+
At the end of the response (in chat, not in file), you MUST instruct the user on the logical next step:
|
|
60
|
+
"✅ **Task backlog created.** The next step is to start development.
|
|
61
|
+
👉 **Execute command: `/dev:coder <Task_ID>`** to start coding the first task."
|
|
62
|
+
|
|
63
|
+
# INSTRUCTION
|
|
64
|
+
Analyze `docs/milestones.md` and `docs/requirements.md`. Ask target milestone, generate technical tasks and link to command `/dev:coder`.
|
|
65
|
+
rules:
|
|
66
|
+
- "**CONSISTENCY:** If `docs/requirements.md` says \"PostgreSQL\", NEVER create a task to \"Configure MongoDB\"."
|
|
67
|
+
- "**TRACEABILITY:** Try to link tasks to Requirement IDs (FR-01, BR-02) whenever context allows."
|
|
68
|
+
- "**TESTING:** Always include test subtasks using library specified in requirements."
|
|
69
|
+
- "**FILE OPS:** Save strictly as `docs/task.md`."
|
|
70
|
+
- "Language Adaptability: Respond in English by default. If the user speaks in another language, mirror their language."
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateAgents = generateAgents;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const types_1 = require("../types");
|
|
12
|
+
const gemini_1 = require("../transformers/gemini");
|
|
13
|
+
const roo_1 = require("../transformers/roo");
|
|
14
|
+
const kilo_1 = require("../transformers/kilo");
|
|
15
|
+
const opencode_1 = require("../transformers/opencode");
|
|
16
|
+
async function generateAgents(definitionsDir, outDir, selectedTargets) {
|
|
17
|
+
console.log(chalk_1.default.blue(`\n📦 Building agents from ${definitionsDir}...`));
|
|
18
|
+
try {
|
|
19
|
+
if (outDir !== process.cwd()) {
|
|
20
|
+
await fs_extra_1.default.ensureDir(outDir);
|
|
21
|
+
}
|
|
22
|
+
const files = await fs_extra_1.default.readdir(definitionsDir);
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
if (!file.endsWith('.yaml') && !file.endsWith('.yml'))
|
|
25
|
+
continue;
|
|
26
|
+
const content = await fs_extra_1.default.readFile(path_1.default.join(definitionsDir, file), 'utf-8');
|
|
27
|
+
const rawAgent = yaml_1.default.parse(content);
|
|
28
|
+
const parseResult = types_1.AgentSchema.safeParse(rawAgent);
|
|
29
|
+
if (!parseResult.success) {
|
|
30
|
+
console.error(chalk_1.default.red(`❌ Validation failed for ${file}:`));
|
|
31
|
+
parseResult.error.issues.forEach((err) => {
|
|
32
|
+
console.error(chalk_1.default.red(` - ${err.path.join('.')}: ${err.message}`));
|
|
33
|
+
});
|
|
34
|
+
continue; // Skip this agent
|
|
35
|
+
}
|
|
36
|
+
const agent = parseResult.data;
|
|
37
|
+
const slug = file.replace(/\.(yaml|yml)$/, '');
|
|
38
|
+
// specific outputs
|
|
39
|
+
const allTargets = [
|
|
40
|
+
{
|
|
41
|
+
id: 'gemini',
|
|
42
|
+
subDir: '.gemini/commands',
|
|
43
|
+
ext: 'toml',
|
|
44
|
+
content: (0, gemini_1.toGeminiSystemPrompt)(agent),
|
|
45
|
+
name: `${slug}.toml`
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'roo',
|
|
49
|
+
subDir: '.roo/commands',
|
|
50
|
+
ext: 'md',
|
|
51
|
+
content: (0, roo_1.toRooRules)(agent),
|
|
52
|
+
name: `${slug}.md`
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'kilo',
|
|
56
|
+
subDir: '.kilocode/workflows',
|
|
57
|
+
ext: 'md',
|
|
58
|
+
content: (0, kilo_1.toKiloConfig)(agent),
|
|
59
|
+
name: `${slug}.md`
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'opencode',
|
|
63
|
+
subDir: '.opencode/command',
|
|
64
|
+
ext: 'md',
|
|
65
|
+
content: (0, opencode_1.toOpenCodeCommand)(agent),
|
|
66
|
+
name: `${slug}.md`
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
const targetsToBuild = allTargets.filter(t => selectedTargets.includes(t.id));
|
|
70
|
+
for (const target of targetsToBuild) {
|
|
71
|
+
const targetDir = path_1.default.join(outDir, target.subDir);
|
|
72
|
+
await fs_extra_1.default.ensureDir(targetDir);
|
|
73
|
+
await fs_extra_1.default.writeFile(path_1.default.join(targetDir, target.name), target.content);
|
|
74
|
+
console.log(chalk_1.default.gray(` -> ${target.subDir}/${target.name}`));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
console.log(chalk_1.default.bold.green('\n🎉 Build complete! Agents are ready to use.'));
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
console.error(chalk_1.default.red('Build failed:'), err);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateWorkflowGuide = generateWorkflowGuide;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
async function generateWorkflowGuide(docsDir, shell) {
|
|
11
|
+
const readmeContent = `# 🤖 Agent Workflow Guide
|
|
12
|
+
|
|
13
|
+
This document outlines the standard development flow using the installed Agents.
|
|
14
|
+
The system follows a **Waterfall-like** process relative to planning (to ensure precision) and an **Iterative** process for execution.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 1. 🏗️ Project Spec (@Project Architect)
|
|
19
|
+
**Role:** The Visionary.
|
|
20
|
+
**Goal:** Translate your vague idea into a concrete Specification with defined "Project Principles" (Constitution).
|
|
21
|
+
- **Why?** To ensure the machine understands the "Soul" of the project (e.g., "Mobile First", "Minimalist").
|
|
22
|
+
- **Command:** \`/dev:project "I want a Todo App that..."\`
|
|
23
|
+
- **Output:** \`docs/project.md\`
|
|
24
|
+
|
|
25
|
+
## 2. 🧱 Requirements Engineering (@Requirements Engineer)
|
|
26
|
+
**Role:** The Tech Lead.
|
|
27
|
+
**Goal:** Lock down technical decisions (Stack, Database, Libraries) based on the Spec.
|
|
28
|
+
- **Why?** To prevent the Coder from "inventing" architecture on the fly. It creates a "Contract" of what to build.
|
|
29
|
+
- **Command:** \`/dev:requirements\`
|
|
30
|
+
- **Output:** \`docs/requirements.md\` (The Technical Contract)
|
|
31
|
+
|
|
32
|
+
## 3. 🗺️ Roadmap Strategy (@Milestone Manager)
|
|
33
|
+
**Role:** The Strategist.
|
|
34
|
+
**Goal:** Slice the project into logical delivery phases (MVPs).
|
|
35
|
+
- **Why?** To avoid "Big Bang" development. It organizes work into sequential milestones (e.g., "M1: Auth", "M2: Dashboard").
|
|
36
|
+
- **Command:** \`/dev:milestone\`
|
|
37
|
+
- **Output:** \`docs/milestones.md\`
|
|
38
|
+
|
|
39
|
+
## 4. 📋 Task Planning (@Task Planner)
|
|
40
|
+
**Role:** The Manager.
|
|
41
|
+
**Goal:** Break down a specific Milestone into atomic, developer-ready tasks.
|
|
42
|
+
- **Why?** AI coders fail with large contexts. Small, clear tasks = Perfect code.
|
|
43
|
+
- **Command:** \`/dev:tasks <Milestone_ID>\`
|
|
44
|
+
- **Output:** \`docs/task.md\`
|
|
45
|
+
|
|
46
|
+
## 5. 🕵️ Blueprint Audit (@Auditor)
|
|
47
|
+
**Role:** The Gatekeeper.
|
|
48
|
+
**Goal:** Validate consistency between **Requirements** (The Contract) and **Tasks** (The Plan).
|
|
49
|
+
- **Why?** To catch missing requirements or dangerous hallucinations *before* a single line of code is written.
|
|
50
|
+
- **Command:** \`/dev:auditor\`
|
|
51
|
+
- **Output:** \`audit_report.md\`
|
|
52
|
+
|
|
53
|
+
## 6. 💻 Implementation (@Coder)
|
|
54
|
+
**Role:** The Builder.
|
|
55
|
+
**Goal:** Execute *one task at a time* from the \`task.md\` file.
|
|
56
|
+
- **Why?** Focus. It reads the docs, writes the code (and tests), and logs progress.
|
|
57
|
+
- **Safeguards:** Checks for \`.gitignore\` and strictly follows \`requirements.md\`.
|
|
58
|
+
- **Command:** \`/dev:coder <Task_ID>\`
|
|
59
|
+
- **Buffer:** \`work_log.md\`
|
|
60
|
+
|
|
61
|
+
## 7. ⚖️ Quality Assurance (@QA Engineer)
|
|
62
|
+
**Role:** The Inspector.
|
|
63
|
+
**Goal:** Verify if the implementation matches the Requirement Artifacts.
|
|
64
|
+
- **Why?** Trust but verify. It reads the \`work_log.md\` and checks against expectations.
|
|
65
|
+
- **Command:** \`/dev:review <Task_ID>\`
|
|
66
|
+
- **Output:** \`docs/logs/review_log.md\`
|
|
67
|
+
|
|
68
|
+
## 8. 📦 Release Management (@Release Manager)
|
|
69
|
+
**Role:** The Historian.
|
|
70
|
+
**Goal:** Consolidate the temporary \`work_log.md\` into a permanent \`changelog.md\`.
|
|
71
|
+
- **Why?** To clean up the workspace and keep a professional history of the project.
|
|
72
|
+
- **Command:** \`/dev:log\`
|
|
73
|
+
- **Output:** \`changelog.md\`
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 🛠️ On-Demand Utilities
|
|
78
|
+
|
|
79
|
+
### Infrastructure (@DevOps Engineer)
|
|
80
|
+
**Role:** The Mechanic.
|
|
81
|
+
**Goal:** Handle "Config Hell" (Docker, CI/CD, Linters).
|
|
82
|
+
- **Why?** Keeps the Coder focused on business logic.
|
|
83
|
+
- **Command:** \`/dev:ops\`
|
|
84
|
+
`;
|
|
85
|
+
await fs_extra_1.default.ensureDir(docsDir);
|
|
86
|
+
await fs_extra_1.default.writeFile(path_1.default.join(docsDir, 'README.md'), readmeContent);
|
|
87
|
+
console.log(chalk_1.default.green(`✅ Created "docs/" directory (Optimized for ${shell}).\n`));
|
|
88
|
+
console.log(chalk_1.default.green(` -> Generated "docs/README.md" with workflow instructions.\n`));
|
|
89
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
12
|
+
const docs_1 = require("./generators/docs");
|
|
13
|
+
const agents_1 = require("./generators/agents");
|
|
14
|
+
const program = new commander_1.Command();
|
|
15
|
+
program
|
|
16
|
+
.name('agents')
|
|
17
|
+
.description('Agent Installer CLI')
|
|
18
|
+
.version('1.0.0')
|
|
19
|
+
.option('-o, --out <dir>', 'Output directory', '.')
|
|
20
|
+
.option('-t, --target <targets>', 'Comma-separated target formats (gemini, roo, kilo, opencode)')
|
|
21
|
+
.action(async (options) => {
|
|
22
|
+
console.log(chalk_1.default.bold.blue('\n🚀 Agents.dev Installer Wizard\n'));
|
|
23
|
+
// --- STEP 1: INITIALIZATION (Docs & Shell) ---
|
|
24
|
+
const docsDir = path_1.default.join(process.cwd(), 'docs');
|
|
25
|
+
// Check if docs directory exists
|
|
26
|
+
if (!await fs_extra_1.default.pathExists(docsDir)) {
|
|
27
|
+
console.log(chalk_1.default.yellow('ℹ️ Project documentation structure not found.'));
|
|
28
|
+
const initAnswers = await inquirer_1.default.prompt([
|
|
29
|
+
{
|
|
30
|
+
type: 'list',
|
|
31
|
+
name: 'shell',
|
|
32
|
+
message: 'Initialize validation: Which shell do you use?',
|
|
33
|
+
choices: [
|
|
34
|
+
{ name: 'Windows (CMD/PowerShell)', value: 'win32' },
|
|
35
|
+
{ name: 'Unix-like (Bash/Zsh/Ubuntu)', value: 'unix' }
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
]);
|
|
39
|
+
await (0, docs_1.generateWorkflowGuide)(docsDir, initAnswers.shell);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.log(chalk_1.default.gray('✅ "docs/" directory already exists.\n'));
|
|
43
|
+
}
|
|
44
|
+
// --- STEP 2: BUILD AGENTS ---
|
|
45
|
+
const definitionsDir = path_1.default.join(process.cwd(), 'definitions');
|
|
46
|
+
const outDir = path_1.default.resolve(options.out);
|
|
47
|
+
// Determine targets
|
|
48
|
+
let selectedTargets = [];
|
|
49
|
+
if (options.target) {
|
|
50
|
+
selectedTargets = options.target.split(',').map((t) => t.trim().toLowerCase());
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const buildAnswers = await inquirer_1.default.prompt([
|
|
54
|
+
{
|
|
55
|
+
type: 'checkbox',
|
|
56
|
+
name: 'targets',
|
|
57
|
+
message: 'Select target formats to build:',
|
|
58
|
+
choices: [
|
|
59
|
+
{ name: 'Gemini CLI', value: 'gemini', checked: true },
|
|
60
|
+
{ name: 'Roo Code', value: 'roo', checked: false },
|
|
61
|
+
{ name: 'Kilo Code', value: 'kilo', checked: false },
|
|
62
|
+
{ name: 'OpenCode', value: 'opencode', checked: false }
|
|
63
|
+
],
|
|
64
|
+
validate: (answer) => {
|
|
65
|
+
if (answer.length < 1) {
|
|
66
|
+
return 'You must choose at least one target.';
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]);
|
|
72
|
+
selectedTargets = buildAnswers.targets;
|
|
73
|
+
}
|
|
74
|
+
if (selectedTargets.length === 0) {
|
|
75
|
+
console.log(chalk_1.default.yellow('No targets selected. Exiting.'));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
await (0, agents_1.generateAgents)(definitionsDir, outDir, selectedTargets);
|
|
79
|
+
});
|
|
80
|
+
program.parse(process.argv);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toGeminiSystemPrompt = toGeminiSystemPrompt;
|
|
4
|
+
function toGeminiSystemPrompt(agent) {
|
|
5
|
+
// Construct the prompt content (System Prompt + Rules + Tools)
|
|
6
|
+
const promptParts = [];
|
|
7
|
+
// Identity logic is usually part of the prompt in this TOML structure
|
|
8
|
+
promptParts.push(`# Identity`);
|
|
9
|
+
promptParts.push(`You are **${agent.name}** ${agent.emoji || ''}`);
|
|
10
|
+
promptParts.push(`Role: ${agent.role}\n`);
|
|
11
|
+
promptParts.push(`# Core Instructions`);
|
|
12
|
+
promptParts.push(agent.systemPrompt.trim());
|
|
13
|
+
promptParts.push('\n');
|
|
14
|
+
if (agent.rules && agent.rules.length > 0) {
|
|
15
|
+
promptParts.push(`# Rules & Guidelines`);
|
|
16
|
+
agent.rules.forEach(rule => promptParts.push(`- ${rule}`));
|
|
17
|
+
promptParts.push('\n');
|
|
18
|
+
}
|
|
19
|
+
if (agent.tools && agent.tools.length > 0) {
|
|
20
|
+
promptParts.push(`# Preferred Tools`);
|
|
21
|
+
agent.tools.forEach(tool => promptParts.push(`- ${tool}`));
|
|
22
|
+
promptParts.push('\n');
|
|
23
|
+
}
|
|
24
|
+
const fullPrompt = promptParts.join('\n');
|
|
25
|
+
// Manual TOML construction
|
|
26
|
+
// 1. description = "..."
|
|
27
|
+
// Basic escaping for double quotes
|
|
28
|
+
const escapedDescription = agent.role.replace(/"/g, '\\"');
|
|
29
|
+
// 2. prompt = """..."""
|
|
30
|
+
// Escape triple quotes if they exist in the content (rare but possible)
|
|
31
|
+
const escapedPrompt = fullPrompt.replace(/"""/g, '\\"\\"\\"');
|
|
32
|
+
return `description = "${escapedDescription}"
|
|
33
|
+
prompt = """
|
|
34
|
+
${escapedPrompt}
|
|
35
|
+
"""`;
|
|
36
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toKiloConfig = toKiloConfig;
|
|
4
|
+
function toKiloConfig(agent) {
|
|
5
|
+
// Kilo Code generic config/prompt
|
|
6
|
+
const parts = [];
|
|
7
|
+
parts.push(`<!--- Kilo Code 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,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.1",
|
|
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.
|