From 895ee0aa628912cd77ea3dad680697ac4c17bc01 Mon Sep 17 00:00:00 2001 From: Piotr Kapuscinski Date: Mon, 10 Nov 2025 21:09:17 +0100 Subject: [PATCH] Convert all agents to markdown format with frontmatter configuration - Move all agent prompts from .txt files to .md files - Add frontmatter configuration to each agent file - Update opencode.json to reference new markdown files - Add missing plan.md agent for analysis and planning - Include docs-writer agent in main configuration - Remove deprecated prompts/ directory Benefits: - Unified markdown format for all agents - Self-contained agent configuration - Better maintainability and version control - Consistent structure across all agents --- prompts/build.txt => .opencode/agent/build.md | 11 ++++++ .../cleanup.txt => .opencode/agent/cleanup.md | 16 ++++++++ .opencode/agent/plan.md | 38 +++++++++++++++++++ .../review.txt => .opencode/agent/review.md | 16 ++++++++ .../agent/security.md | 12 ++++++ opencode.json | 26 ++++++++++--- 6 files changed, 114 insertions(+), 5 deletions(-) rename prompts/build.txt => .opencode/agent/build.md (76%) rename prompts/cleanup.txt => .opencode/agent/cleanup.md (77%) create mode 100644 .opencode/agent/plan.md rename prompts/review.txt => .opencode/agent/review.md (80%) rename prompts/security.txt => .opencode/agent/security.md (81%) diff --git a/prompts/build.txt b/.opencode/agent/build.md similarity index 76% rename from prompts/build.txt rename to .opencode/agent/build.md index c14cf7e..7a44fac 100644 --- a/prompts/build.txt +++ b/.opencode/agent/build.md @@ -1,3 +1,14 @@ +--- +description: Full-stack development agent with access to all tools for building, testing, and deploying software +mode: primary +model: anthropic/claude-sonnet-4-20250514 +temperature: 0.5 +tools: + write: true + edit: true + bash: true +--- + You are a full-stack development agent with access to all tools for building, testing, and deploying software. Your responsibilities: diff --git a/prompts/cleanup.txt b/.opencode/agent/cleanup.md similarity index 77% rename from prompts/cleanup.txt rename to .opencode/agent/cleanup.md index e2dfad7..4a06a82 100644 --- a/prompts/cleanup.txt +++ b/.opencode/agent/cleanup.md @@ -1,3 +1,19 @@ +--- +description: Repository cleanup specialist with expertise in maintaining clean, efficient codebases +mode: subagent +model: anthropic/claude-sonnet-4-20250514 +temperature: 0.2 +tools: + write: true + edit: false + bash: true +permission: + bash: + "rm -rf": "ask" + "git *": "allow" + "*": "ask" +--- + You are a repository cleanup specialist with expertise in maintaining clean, efficient codebases. Your responsibilities: diff --git a/.opencode/agent/plan.md b/.opencode/agent/plan.md new file mode 100644 index 0000000..1142acc --- /dev/null +++ b/.opencode/agent/plan.md @@ -0,0 +1,38 @@ +--- +description: Analysis and planning agent (read-only, optimized for fast analysis) +mode: primary +model: anthropic/claude-haiku-4-20250514 +temperature: 0.1 +tools: + write: false + edit: false + bash: false +--- + +You are an analysis and planning agent focused on understanding codebases, analyzing requirements, and creating structured plans. + +Your responsibilities: +1. Analyze repository structure and code organization +2. Understand project requirements and dependencies +3. Identify potential issues and improvement opportunities +4. Create detailed implementation plans +5. Assess technical feasibility +6. Provide architectural recommendations + +Analysis Approach: +- Read and understand existing code thoroughly +- Identify patterns and conventions +- Analyze dependencies and relationships +- Consider scalability and maintainability +- Evaluate security implications +- Plan systematic approaches + +Focus Areas: +- Code structure and architecture +- Requirements analysis +- Technical planning +- Risk assessment +- Implementation strategies +- Best practices recommendations + +Never make direct changes. Focus on analysis, planning, and providing actionable insights. \ No newline at end of file diff --git a/prompts/review.txt b/.opencode/agent/review.md similarity index 80% rename from prompts/review.txt rename to .opencode/agent/review.md index 4699105..8076f98 100644 --- a/prompts/review.txt +++ b/.opencode/agent/review.md @@ -1,3 +1,19 @@ +--- +description: Code reviewer focused on quality, performance, and best practices +mode: subagent +model: anthropic/claude-sonnet-4-20250514 +temperature: 0.1 +tools: + write: false + edit: false + bash: true +permission: + bash: + "git diff": "allow" + "git log*": "allow" + "*": "ask" +--- + You are a code reviewer focused on ensuring high-quality, maintainable, and secure code. Your responsibilities: diff --git a/prompts/security.txt b/.opencode/agent/security.md similarity index 81% rename from prompts/security.txt rename to .opencode/agent/security.md index 4233ae2..e67f7c5 100644 --- a/prompts/security.txt +++ b/.opencode/agent/security.md @@ -1,3 +1,15 @@ +--- +description: Security auditor for identifying vulnerabilities and security issues +mode: subagent +model: anthropic/claude-sonnet-4-20250514 +temperature: 0.1 +tools: + write: false + edit: false + bash: false + webfetch: true +--- + You are a security expert specializing in code security analysis and vulnerability assessment. Your responsibilities: diff --git a/opencode.json b/opencode.json index 28ef712..68a6ec5 100644 --- a/opencode.json +++ b/opencode.json @@ -2,9 +2,11 @@ "$schema": "https://opencode.ai/config.json", "agent": { "build": { + "description": "Full-stack development agent with access to all tools for building, testing, and deploying software", "mode": "primary", "model": "anthropic/claude-sonnet-4-20250514", - "prompt": "{file:./prompts/build.txt}", + "temperature": 0.5, + "prompt": "{file:./.opencode/agent/build.md}", "tools": { "write": true, "edit": true, @@ -12,9 +14,11 @@ } }, "plan": { + "description": "Analysis and planning agent (read-only, optimized for fast analysis)", "mode": "primary", "model": "anthropic/claude-haiku-4-20250514", "temperature": 0.1, + "prompt": "{file:./.opencode/agent/plan.md}", "tools": { "write": false, "edit": false, @@ -22,11 +26,11 @@ } }, "cleanup": { - "description": "Specialized agent for repository cleanup and maintenance", + "description": "Repository cleanup specialist with expertise in maintaining clean, efficient codebases", "mode": "subagent", "model": "anthropic/claude-sonnet-4-20250514", "temperature": 0.2, - "prompt": "{file:./prompts/cleanup.txt}", + "prompt": "{file:./.opencode/agent/cleanup.md}", "tools": { "write": true, "edit": false, @@ -45,7 +49,7 @@ "mode": "subagent", "model": "anthropic/claude-sonnet-4-20250514", "temperature": 0.1, - "prompt": "{file:./prompts/security.txt}", + "prompt": "{file:./.opencode/agent/security.md}", "tools": { "write": false, "edit": false, @@ -58,7 +62,7 @@ "mode": "subagent", "model": "anthropic/claude-sonnet-4-20250514", "temperature": 0.1, - "prompt": "{file:./prompts/review.txt}", + "prompt": "{file:./.opencode/agent/review.md}", "tools": { "write": false, "edit": false, @@ -71,6 +75,18 @@ "*": "ask" } } + }, + "docs-writer": { + "description": "Technical writer for creating and maintaining documentation", + "mode": "subagent", + "model": "anthropic/claude-sonnet-4-20250514", + "temperature": 0.3, + "prompt": "{file:./.opencode/agent/docs-writer.md}", + "tools": { + "write": true, + "edit": true, + "bash": false + } } } } \ No newline at end of file