diff --git a/.kilo/KILO_SPEC.md b/.kilo/KILO_SPEC.md index 790269e..30d706c 100644 --- a/.kilo/KILO_SPEC.md +++ b/.kilo/KILO_SPEC.md @@ -388,6 +388,7 @@ provider/model-id | `ollama-cloud/kimi-k2-thinking` | ollama-cloud | Kimi K2 Thinking | | `ollama-cloud/kimi-k2.5` | ollama-cloud | Kimi K2.5 | | `ollama-cloud/nemotron-3-super` | ollama-cloud | Nemotron 3 Super | +| `ollama-cloud/nemotron-3-nano:30b` | ollama-cloud | Nemotron 3 Nano 30B | | `ollama-cloud/qwen3-coder:480b` | ollama-cloud | Qwen3 Coder 480B | | `ollama-cloud/gpt-oss:20b` | ollama-cloud | GPT OSS 20B | | `ollama-cloud/gpt-oss:120b` | ollama-cloud | GPT OSS 120B | @@ -415,26 +416,34 @@ Provider availability depends on configuration. Common providers include: | Agent | Role | Model | |-------|------|-------| -| `@RequirementRefiner` | Converts vague ideas to strict User Stories | ollama-cloud/kimi-k2-thinking | -| `@HistoryMiner` | Finds duplicates and past solutions in git | ollama-cloud/gpt-oss:20b | -| `@SystemAnalyst` | Designs technical specifications | qwen/qwen3.6-plus:free | -| `@SDETEngineer` | Writes tests following TDD | qwen/qwen3-coder:free | -| `@LeadDeveloper` | Primary code writer | qwen/qwen3-coder:free | -| `@FrontendDeveloper` | UI implementation with multimodal | ollama-cloud/kimi-k2.5 | -| `@CodeSkeptic` | Adversarial code reviewer | ollama-cloud/minimax-m2.5 | -| `@TheFixer` | Iteratively fixes bugs | ollama-cloud/minimax-m2.5 | -| `@PerformanceEngineer` | Reviews for performance issues | ollama-cloud/nemotron-3-super | -| `@SecurityAuditor` | Scans for vulnerabilities | ollama-cloud/deepseek-v3.2 | -| `@ReleaseManager` | Git operations and deployments | ollama-cloud/devstral-2 | -| `@Evaluator` | Scores agent effectiveness | ollama-cloud/gpt-oss:120b | -| `@PromptOptimizer` | Improves agent prompts | openrouter/qwen/qwen3.6-plus:free | -| `@ProductOwner` | Manages issue checklists | openrouter/qwen/qwen3.6-plus:free | -| `@Orchestrator` | Routes tasks between agents | ollama-cloud/glm-5 | -| `@AgentArchitect` | Manages agent network per Kilo.ai spec | ollama-cloud/gpt-oss:120b | -| `@CapabilityAnalyst` | Analyzes task coverage, identifies gaps | ollama-cloud/gpt-oss:120b | -| `@MarkdownValidator` | Validates Markdown for Gitea issues | qwen/qwen3.6-plus:free | -| `@BackendDeveloper` | Node.js, Express, APIs, database specialist | ollama-cloud/deepseek-v3.2 | -| `@WorkflowArchitect` | Creates workflow definitions with complete architecture | ollama-cloud/gpt-oss:120b | +| `@AgentArchitect` | Creates, modifies, and reviews new agents, workflows, and skills based on capability gap analysis. | ollama-cloud/nemotron-3-super | +| `@BackendDeveloper` | Backend specialist for Node. | ollama-cloud/deepseek-v3.2 | +| `@BrowserAutomation` | Browser automation agent using Playwright MCP for E2E testing, form filling, navigation, and web interaction. | ollama-cloud/glm-5 | +| `@CapabilityAnalyst` | Analyzes task requirements against available agents, workflows, and skills. | ollama-cloud/nemotron-3-super | +| `@CodeSkeptic` | Adversarial code reviewer. | ollama-cloud/minimax-m2.5 | +| `@Evaluator` | Scores agent effectiveness after task completion for continuous improvement. | ollama-cloud/nemotron-3-super | +| `@FrontendDeveloper` | Handles UI implementation with multimodal capabilities. | ollama-cloud/kimi-k2.5 | +| `@GoDeveloper` | Go backend specialist for Gin, Echo, APIs, and database integration. | ollama-cloud/qwen3-coder:480b | +| `@HistoryMiner` | Analyzes git history to find duplicates and past solutions, preventing regression and duplicate work. | ollama-cloud/nemotron-3-super | +| `@LeadDeveloper` | Primary code writer for backend and core logic. | ollama-cloud/qwen3-coder:480b | +| `@MarkdownValidator` | Validates and corrects Markdown descriptions for Gitea issues. | ollama-cloud/nemotron-3-nano:30b | +| `@MemoryManager` | Manages agent memory systems - short-term (context), long-term (vector store), and episodic (experiences). | ollama-cloud/nemotron-3-super | +| `@Orchestrator` | Main dispatcher. | ollama-cloud/glm-5 | +| `@PerformanceEngineer` | Reviews code for performance issues. | ollama-cloud/nemotron-3-super | +| `@Planner` | Advanced task planner using Chain of Thought, Tree of Thoughts, and Plan-Execute-Reflect. | ollama-cloud/nemotron-3-super | +| `@ProductOwner` | Manages issue checklists, status labels, tracks progress and coordinates with human users. | ollama-cloud/glm-5 | +| `@PromptOptimizer` | Improves agent system prompts based on performance failures. | qwen/qwen3.6-plus:free | +| `@Reflector` | Self-reflection agent using Reflexion pattern - learns from mistakes. | ollama-cloud/nemotron-3-super | +| `@ReleaseManager` | Manages git operations, semantic versioning, branching, and deployments. | ollama-cloud/devstral-2:123b | +| `@RequirementRefiner` | Converts vague ideas and bug reports into strict User Stories with acceptance criteria checklists. | ollama-cloud/kimi-k2-thinking | +| `@SdetEngineer` | Writes tests following TDD methodology. | ollama-cloud/qwen3-coder:480b | +| `@SecurityAuditor` | Scans for security vulnerabilities, OWASP Top 10, dependency CVEs, and hardcoded secrets. | ollama-cloud/nemotron-3-super | +| `@SystemAnalyst` | Designs technical specifications, data schemas, and API contracts before implementation. | qwen/qwen3.6-plus:free | +| `@TheFixer` | Iteratively fixes bugs based on specific error reports and test failures. | ollama-cloud/minimax-m2.5 | +| `@VisualTester` | Visual regression testing agent that compares screenshots and detects UI differences using pixelmatch and image diff. | ollama-cloud/glm-5 | +| `@WorkflowArchitect` | Creates and maintains workflow definitions with complete architecture, Gitea integration, and quality gates. | ollama-cloud/gpt-oss:120b | + + **Note:** For AgentArchitect, use `subagent_type: "system-analyst"` with prompt "You are Agent Architect..." (workaround for unsupported agent-architect type). diff --git a/scripts/sync-agents.cjs b/scripts/sync-agents.cjs new file mode 100644 index 0000000..fabb69d --- /dev/null +++ b/scripts/sync-agents.cjs @@ -0,0 +1,129 @@ +#!/usr/bin/env node +/** + * Sync Agent Models - Source of truth: .kilo/agents/*.md frontmatter + * Run: node scripts/sync-agents.cjs [--check | --fix] + */ + +const fs = require('fs'); +const path = require('path'); + +const ROOT = path.resolve(__dirname, '..'); +const AGENTS_DIR = path.join(ROOT, '.kilo', 'agents'); +const KILO_SPEC = path.join(ROOT, '.kilo', 'KILO_SPEC.md'); +const AGENTS_MD = path.join(ROOT, 'AGENTS.md'); + +function parseFrontmatter(content) { + const match = content.match(/^---\n([\s\S]*?)\n---/); + if (!match) return {}; + const frontmatter = {}; + for (const line of match[1].split('\n')) { + const idx = line.indexOf(':'); + if (idx > 0) { + const key = line.slice(0, idx).trim(); + let val = line.slice(idx + 1).trim(); + if (val.startsWith('"') && val.endsWith('"')) val = val.slice(1, -1); + frontmatter[key] = val; + } + } + return frontmatter; +} + +function getAllAgents() { + const agents = {}; + for (const file of fs.readdirSync(AGENTS_DIR).filter(f => f.endsWith('.md'))) { + const content = fs.readFileSync(path.join(AGENTS_DIR, file), 'utf-8'); + const fm = parseFrontmatter(content); + const name = file.replace('.md', ''); + agents[name] = { + description: fm.description || '', + model: fm.model || '', + mode: fm.mode || 'all', + color: fm.color || '' + }; + } + return agents; +} + +function categorizeAgent(name) { + const cats = { + core: ['requirement-refiner', 'history-miner', 'system-analyst', 'sdet-engineer', 'lead-developer', 'frontend-developer', 'backend-developer', 'go-developer', 'devops-engineer'], + quality: ['code-skeptic', 'the-fixer', 'performance-engineer', 'security-auditor', 'visual-tester'], + meta: ['orchestrator', 'release-manager', 'evaluator', 'prompt-optimizer', 'product-owner', 'agent-architect', 'capability-analyst', 'workflow-architect', 'markdown-validator'], + testing: ['browser-automation'], + cognitive: ['planner', 'reflector', 'memory-manager'] + }; + for (const [cat, list] of Object.entries(cats)) { + if (list.includes(name)) return cat; + } + return 'meta'; +} + +function updateKiloSpec(agents) { + let content = fs.readFileSync(KILO_SPEC, 'utf-8'); + const rows = Object.entries(agents) + .filter(([_, a]) => a.model) + .map(([name, a]) => { + const dn = name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(''); + return `| \`@${dn}\` | ${a.description.split('.')[0]}. | ${a.model} |`; + }).join('\n'); + const table = `### Pipeline Agents\n\n| Agent | Role | Model |\n|-------|------|-------|\n${rows}`; + content = content.replace(/### Pipeline Agents\n\n\| Agent \| Role \| Model \|[\s\S]*?(?=\n\n\*\*Note)/, table + '\n\n'); + fs.writeFileSync(KILO_SPEC, content); +} + +function updateAgentsMd(agents) { + let content = fs.readFileSync(AGENTS_MD, 'utf-8'); + const catNames = { core: '### Core Development', quality: '### Quality Assurance', meta: '### Meta & Process', testing: '### Testing', cognitive: '### Cognitive Enhancement (New)' }; + const triggers = { 'requirement-refiner': 'Issue status: new', 'history-miner': 'Status: planned', 'system-analyst': 'Status: researching', 'sdet-engineer': 'Status: designed', 'lead-developer': 'Status: testing', 'frontend-developer': 'When UI work needed', 'backend-developer': 'When backend needed', 'go-developer': 'When Go backend needed', 'devops-engineer': 'When deployment/infra needed', 'code-skeptic': 'Status: implementing', 'the-fixer': 'When review fails', 'performance-engineer': 'After code-skeptic', 'security-auditor': 'After performance', 'visual-tester': 'When UI changes', 'orchestrator': 'Manages all agent routing', 'release-manager': 'Status: releasing', 'evaluator': 'Status: evaluated', 'prompt-optimizer': 'When score < 7', 'product-owner': 'Manages issues', 'agent-architect': 'When gaps identified', 'capability-analyst': 'When starting new task', 'workflow-architect': 'New workflow needed', 'markdown-validator': 'Before issue creation', 'browser-automation': 'E2E testing needed', 'planner': 'Complex tasks', 'reflector': 'After each agent', 'memory-manager': 'Context management' }; + + const byCat = {}; + for (const [name, a] of Object.entries(agents)) { + const cat = categorizeAgent(name); + (byCat[cat] = byCat[cat] || []).push([name, a]); + } + + for (const [cat, heading] of Object.entries(catNames)) { + const list = byCat[cat] || []; + if (!list.length) continue; + const rows = list.map(([name, a]) => { + const dn = name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(''); + return `| \`@${dn}\` | ${a.description.split('.')[0]} | ${triggers[name] || 'Manual invocation'} |`; + }).join('\n'); + const table = `${heading}\n| Agent | Role | When Invoked |\n|-------|------|--------------|\n${rows}`; + const regex = new RegExp(`${heading}[\s\S]*?(?=###|$)`); + if (regex.test(content)) content = content.replace(regex, table + '\n\n'); + } + fs.writeFileSync(AGENTS_MD, content); +} + +function main() { + const args = process.argv.slice(2); + const fix = args.includes('--fix'); + const check = args.includes('--check'); + + console.log('=== Agent Sync Tool ===\n'); + console.log('Source of truth: .kilo/agents/*.md frontmatter\n'); + + const agents = getAllAgents(); + console.log(`Found ${Object.keys(agents).length} agents\n`); + + const issues = Object.entries(agents).filter(([_, a]) => !a.model || !a.description); + if (issues.length) { + console.log('Issues found:'); + issues.forEach(([n, a]) => console.log(` ${n}: ${!a.model ? 'missing model' : ''} ${!a.description ? 'missing description' : ''}`)); + process.exit(1); + } + + if (fix) { + console.log('Updating KILO_SPEC.md...'); + updateKiloSpec(agents); + console.log('Updating AGENTS.md...'); + updateAgentsMd(agents); + console.log('✅ Done!'); + } else { + console.log('✅ All agents have model and description'); + if (check) console.log('\nRun with --fix to update documentation.'); + } +} + +main();