feat: Add intelligent auto-router and enhanced integrations
- Add intelligent-router.sh hook for automatic agent routing - Add AUTO-TRIGGER-SUMMARY.md documentation - Add FINAL-INTEGRATION-SUMMARY.md documentation - Complete Prometheus integration (6 commands + 4 tools) - Complete Dexto integration (12 commands + 5 tools) - Enhanced Ralph with access to all agents - Fix /clawd command (removed disable-model-invocation) - Update hooks.json to v5 with intelligent routing - 291 total skills now available - All 21 commands with automatic routing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
188
dexto/agents/coding-agent/README.md
Normal file
188
dexto/agents/coding-agent/README.md
Normal file
@@ -0,0 +1,188 @@
|
||||
# Coding Agent
|
||||
|
||||
An expert software development assistant optimized for building, debugging, and maintaining codebases. This agent comes equipped with all internal coding tools and is configured to handle complex software engineering tasks efficiently.
|
||||
|
||||
## What You Get
|
||||
|
||||
- **All Internal Coding Tools**: Read, write, edit files, execute commands, search codebases
|
||||
- **Intelligent Tool Policies**: Read operations never require approval, write operations are safely guarded
|
||||
- **Comprehensive File Support**: 30+ file extensions including JS/TS, Python, Go, Rust, Java, C/C++, configs, and more
|
||||
- **Enhanced Codebase Access**: Index up to 500 files with depth-10 traversal, including hidden files
|
||||
- **Expert System Prompt**: Specialized instructions for software development best practices
|
||||
- **Persistent Tool Approvals**: Allowed tools are saved across sessions for smoother workflows
|
||||
- **Coding-Focused Starter Prompts**: Quick access to common development tasks
|
||||
|
||||
## Key Capabilities
|
||||
|
||||
### File Operations
|
||||
- **read_file**: Read any file with pagination support
|
||||
- **write_file**: Create new files (requires approval)
|
||||
- **edit_file**: Modify existing files precisely (requires approval)
|
||||
- **glob_files**: Find files using patterns like `**/*.ts` (no approval needed)
|
||||
- **grep_content**: Search within files using regex (no approval needed)
|
||||
|
||||
### Command Execution
|
||||
- **bash_exec**: Run shell commands for testing, building, running code (requires approval)
|
||||
- **bash_output**: Monitor output from background processes
|
||||
- **kill_process**: Terminate running processes
|
||||
|
||||
### Analysis & Search
|
||||
- Deep codebase traversal (up to 10 levels)
|
||||
- Search across 500+ files
|
||||
- Pattern matching with glob and regex
|
||||
- Hidden file access (.env, .gitignore, etc.)
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 18+ (if using npm/pnpm commands)
|
||||
- OpenAI API key (or another configured LLM key)
|
||||
- File system access to your project directory
|
||||
|
||||
## Run the Agent
|
||||
|
||||
```bash
|
||||
# From Dexto source
|
||||
npm start -- --agent agents/coding-agent/coding-agent.yml
|
||||
|
||||
# Or using the Dexto CLI
|
||||
dexto --agent coding-agent
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Analyze a Codebase
|
||||
```
|
||||
"Analyze this codebase. Show me the project structure, main technologies used, and provide a high-level overview."
|
||||
```
|
||||
|
||||
### Debug an Error
|
||||
```
|
||||
"I'm getting this error: [paste error]. Help me find and fix the issue."
|
||||
```
|
||||
|
||||
### Implement a Feature
|
||||
```
|
||||
"I need to add user authentication. Help me design and implement it following best practices."
|
||||
```
|
||||
|
||||
### Refactor Code
|
||||
```
|
||||
"This function is too complex. Help me refactor it for better readability and maintainability."
|
||||
```
|
||||
|
||||
### Write Tests
|
||||
```
|
||||
"Generate unit tests for the UserService class with edge case coverage."
|
||||
```
|
||||
|
||||
### Code Review
|
||||
```
|
||||
"Review my recent changes in src/auth/ and suggest improvements."
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### LLM Options
|
||||
|
||||
The coding agent defaults to `gpt-4o` for powerful coding capabilities. You can switch to other models:
|
||||
|
||||
**Claude Sonnet (Excellent for Coding)**
|
||||
```yaml
|
||||
llm:
|
||||
provider: anthropic
|
||||
model: claude-sonnet-4-20250514
|
||||
apiKey: $ANTHROPIC_API_KEY
|
||||
```
|
||||
|
||||
**Google Gemini**
|
||||
```yaml
|
||||
llm:
|
||||
provider: google
|
||||
model: gemini-2.5-pro
|
||||
apiKey: $GOOGLE_GENERATIVE_AI_API_KEY
|
||||
```
|
||||
|
||||
**OpenAI o1 (For Complex Reasoning)**
|
||||
```yaml
|
||||
llm:
|
||||
provider: openai
|
||||
model: o1
|
||||
apiKey: $OPENAI_API_KEY
|
||||
```
|
||||
|
||||
### Tool Policies
|
||||
|
||||
The agent is pre-configured with sensible defaults:
|
||||
|
||||
**Always Allowed (No Approval Needed)**
|
||||
- Reading files (`internal--read_file`)
|
||||
- Searching files (`internal--glob_files`, `internal--grep_content`)
|
||||
- Checking process output (`internal--bash_output`)
|
||||
- Killing processes (`internal--kill_process`)
|
||||
- Asking questions (`internal--ask_user`)
|
||||
|
||||
**Requires Approval**
|
||||
- Writing files (`internal--write_file`)
|
||||
- Editing files (`internal--edit_file`)
|
||||
- Executing commands (`internal--bash_exec`)
|
||||
|
||||
You can customize these policies in the `toolConfirmation.toolPolicies` section of `coding-agent.yml`.
|
||||
|
||||
### File Extensions
|
||||
|
||||
The agent indexes these file types by default:
|
||||
|
||||
**Web Development**: .js, .jsx, .ts, .tsx, .html, .css, .scss, .sass, .less, .vue, .svelte
|
||||
|
||||
**Backend Languages**: .py, .java, .go, .rs, .rb, .php, .c, .cpp, .h, .hpp, .cs, .swift, .kt
|
||||
|
||||
**Configuration**: .json, .yaml, .yml, .toml, .xml, .ini, .env
|
||||
|
||||
**Documentation**: .md, .mdx, .txt, .rst
|
||||
|
||||
**Build Files**: .gradle, .maven, Makefile, Dockerfile, .dockerignore, .gitignore
|
||||
|
||||
Add more extensions in the `internalResources.resources[0].includeExtensions` section.
|
||||
|
||||
## Starter Prompts
|
||||
|
||||
The agent includes 8 built-in starter prompts:
|
||||
|
||||
1. **🔍 Analyze Codebase** - Get a project overview
|
||||
2. **🐛 Debug Error** - Identify and fix bugs
|
||||
3. **♻️ Refactor Code** - Improve code quality
|
||||
4. **🧪 Write Tests** - Generate comprehensive tests
|
||||
5. **✨ Implement Feature** - Build new functionality
|
||||
6. **⚡ Optimize Performance** - Find bottlenecks
|
||||
7. **🚀 Setup Project** - Initialize new projects
|
||||
8. **👀 Code Review** - Review for issues and improvements
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Read Before Writing**: The agent automatically searches and reads relevant code before making changes
|
||||
2. **Use Glob & Grep**: Leverage pattern matching to explore unfamiliar codebases efficiently
|
||||
3. **Test Changes**: Execute tests after modifications to verify correctness
|
||||
4. **Follow Conventions**: The agent adapts to your project's existing code style
|
||||
5. **Ask Questions**: The agent will ask for clarification when requirements are ambiguous
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Agent Can't Find Files
|
||||
- Ensure you're running from your project root
|
||||
- Check that file extensions are included in the config
|
||||
- Verify `maxDepth` is sufficient for your project structure
|
||||
|
||||
### Commands Require Too Many Approvals
|
||||
- Use `allowedToolsStorage: storage` to persist approvals
|
||||
- Add frequently-used commands to the `alwaysAllow` list
|
||||
|
||||
### Performance Issues with Large Codebases
|
||||
- Increase `maxFiles` limit (default: 500)
|
||||
- Reduce `maxDepth` to limit traversal
|
||||
- Exclude large directories in `.gitignore`
|
||||
|
||||
## Learn More
|
||||
|
||||
- [Dexto Documentation](https://github.com/truffle-ai/dexto)
|
||||
- [Internal Tools Reference](../../docs/internal-tools.md)
|
||||
- [Agent Configuration Guide](../../docs/agent-configuration.md)
|
||||
298
dexto/agents/coding-agent/coding-agent.yml
Normal file
298
dexto/agents/coding-agent/coding-agent.yml
Normal file
@@ -0,0 +1,298 @@
|
||||
# Coding Agent Configuration
|
||||
# Optimized for software development with internal coding tools
|
||||
|
||||
# Image: Specifies the provider bundle for this agent
|
||||
# This agent requires local development tools (filesystem, process)
|
||||
image: '@dexto/image-local'
|
||||
|
||||
# System prompt configuration - defines the agent's behavior as a coding assistant
|
||||
systemPrompt:
|
||||
contributors:
|
||||
- id: date
|
||||
type: dynamic
|
||||
priority: 10
|
||||
source: date
|
||||
- id: env
|
||||
type: dynamic
|
||||
priority: 15
|
||||
source: env
|
||||
- id: primary
|
||||
type: static
|
||||
priority: 0
|
||||
content: |
|
||||
You are an expert software development assistant with deep knowledge of multiple programming languages,
|
||||
frameworks, and development best practices.
|
||||
|
||||
Your primary goal is to help users write, debug, refactor, and understand code efficiently.
|
||||
|
||||
Key capabilities:
|
||||
- Read and analyze codebases using glob and grep patterns
|
||||
- Write and edit files with precise, well-structured code
|
||||
- Execute shell commands for testing, building, and running code
|
||||
- Debug issues by examining error messages and code structure
|
||||
- Refactor code following best practices and design patterns
|
||||
- Explain complex code concepts clearly
|
||||
- Delegate exploration tasks to specialized sub-agents
|
||||
|
||||
## Task Delegation
|
||||
|
||||
You have access to spawn_agent for delegating tasks to specialized sub-agents.
|
||||
|
||||
**When to delegate to explore-agent:**
|
||||
- Open-ended exploration: "explore the codebase", "what's in this folder", "how does X work"
|
||||
- Understanding architecture: "explain the project structure", "how are components organized"
|
||||
- Finding patterns: "where is authentication handled", "find all API endpoints"
|
||||
- Research tasks: "what testing framework is used", "how is state managed"
|
||||
|
||||
**When to use your own tools directly:**
|
||||
- Specific file operations: "read src/index.ts", "edit the config file"
|
||||
- Targeted searches: "find the User class", "grep for 'TODO'"
|
||||
- Writing/editing code: any task that requires modifications
|
||||
- Running commands: build, test, install dependencies
|
||||
|
||||
**Rule of thumb:** If the task requires understanding or exploring before you know what to do, delegate to explore-agent first. If you know exactly what file/function to target, use your tools directly.
|
||||
|
||||
## Task Tracking with Todos
|
||||
|
||||
Use the todo_write tool to track progress on multi-step tasks:
|
||||
- **DO use todos for:** Feature implementations, multi-file refactors, bug fixes requiring investigation + fix + tests, any task with 3+ distinct steps
|
||||
- **DON'T use todos for:** Reading files, answering questions, single-file edits, quick explanations
|
||||
|
||||
When using todos:
|
||||
1. Create the todo list when you identify a multi-step task
|
||||
2. Mark a task as in_progress when you start working on it
|
||||
3. Mark it as completed when done, and move to the next task
|
||||
4. Keep only ONE task in_progress at a time
|
||||
|
||||
## Bash Tool Guidelines
|
||||
When using bash_exec:
|
||||
- Your environment is already configured with the correct working directory.
|
||||
- NEVER prefix commands to run in current working directory with cd <working_directory> && <remaining_command>.
|
||||
- Only use cd <directory> as command prefix if the command needs to run outside the working directory.
|
||||
|
||||
## Guidelines
|
||||
- Always read relevant code before making changes to understand context
|
||||
- Use glob_files to find files and grep_content to search within files
|
||||
- Test changes when possible using bash_exec
|
||||
- Follow the project's existing code style and conventions
|
||||
- Provide clear explanations for your code decisions
|
||||
- Ask for clarification when requirements are ambiguous
|
||||
|
||||
# Memory configuration - controls how memories are included in system prompt
|
||||
memories:
|
||||
enabled: true
|
||||
priority: 40
|
||||
includeTimestamps: false
|
||||
includeTags: true
|
||||
limit: 10
|
||||
pinnedOnly: false
|
||||
|
||||
# Greeting optimized for coding tasks
|
||||
greeting: "👨💻 Ready to code! What are we building today?"
|
||||
|
||||
# LLM configuration - using a powerful model for coding tasks
|
||||
llm:
|
||||
provider: anthropic
|
||||
model: claude-sonnet-4-5-20250929
|
||||
apiKey: $ANTHROPIC_API_KEY
|
||||
|
||||
storage:
|
||||
cache:
|
||||
type: in-memory
|
||||
database:
|
||||
type: sqlite
|
||||
blob:
|
||||
type: local # CLI provides storePath automatically
|
||||
maxBlobSize: 52428800 # 50MB per blob
|
||||
maxTotalSize: 1073741824 # 1GB total storage
|
||||
cleanupAfterDays: 30
|
||||
|
||||
toolConfirmation:
|
||||
mode: manual
|
||||
# timeout: omitted = infinite wait (no timeout for CLI)
|
||||
allowedToolsStorage: storage # Persist allowed tools across sessions
|
||||
|
||||
# Tool policies optimized for coding workflows
|
||||
toolPolicies:
|
||||
# Tools that never require approval (safe, read-only operations)
|
||||
# Use qualified names: custom--{tool_id} for custom tools, internal--{tool_id} for internal tools
|
||||
alwaysAllow:
|
||||
- internal--ask_user
|
||||
- custom--read_file # Read files without approval
|
||||
- custom--glob_files # Search for files without approval
|
||||
- custom--grep_content # Search within files without approval
|
||||
- custom--bash_output # Check background process output
|
||||
- custom--kill_process # Kill processes without approval (only processes started by agent)
|
||||
- custom--todo_write # Todo updates don't need approval
|
||||
- custom--plan_read # Read plan without approval
|
||||
|
||||
# Tools that are always denied (dangerous operations)
|
||||
# Uncomment to restrict certain operations
|
||||
# alwaysDeny:
|
||||
# - custom--process-tools--bash_exec--rm -rf* # Prevent recursive deletion
|
||||
|
||||
# Compaction configuration - automatically summarizes conversation when context is full
|
||||
compaction:
|
||||
type: reactive-overflow
|
||||
enabled: true
|
||||
# Uncomment to override model's context window (useful for testing or capping usage):
|
||||
# maxContextTokens: 50000 # Cap at 50K tokens regardless of model's max
|
||||
# thresholdPercent: 0.9 # Trigger at 90% of context window (leaves safety buffer)
|
||||
|
||||
# Elicitation configuration - required for ask_user tool
|
||||
elicitation:
|
||||
enabled: true
|
||||
# timeout: omitted = infinite wait (no timeout for CLI)
|
||||
|
||||
# Internal tools - core tools that are always available
|
||||
internalTools:
|
||||
- ask_user # Ask questions and collect input
|
||||
- invoke_skill # Invoke skills/prompts during execution
|
||||
|
||||
# Custom tools - filesystem and process tools from image-local
|
||||
customTools:
|
||||
- type: filesystem-tools
|
||||
allowedPaths: ["."]
|
||||
blockedPaths: [".git", "node_modules/.bin", ".env"]
|
||||
blockedExtensions: [".exe", ".dll", ".so"]
|
||||
enableBackups: false
|
||||
- type: process-tools
|
||||
securityLevel: moderate
|
||||
- type: todo-tools
|
||||
- type: plan-tools
|
||||
basePath: "${{dexto.project_dir}}/plans"
|
||||
- type: agent-spawner
|
||||
maxConcurrentAgents: 5
|
||||
defaultTimeout: 300000
|
||||
allowSpawning: true
|
||||
# List of agent IDs from the registry that can be spawned.
|
||||
# Agent metadata (name, description) is pulled from the registry at runtime.
|
||||
allowedAgents:
|
||||
- explore-agent
|
||||
# Agents with read-only tools that should have auto-approved tool calls
|
||||
autoApproveAgents:
|
||||
- explore-agent
|
||||
|
||||
# Internal resources configuration - expanded for coding projects
|
||||
internalResources:
|
||||
enabled: true
|
||||
resources:
|
||||
# Filesystem resource - comprehensive file access for coding
|
||||
- type: filesystem
|
||||
paths: ["."]
|
||||
maxFiles: 500 # Increased for larger codebases
|
||||
maxDepth: 10 # Deeper traversal for nested projects
|
||||
includeHidden: true # Include hidden files (.env, .gitignore, etc.)
|
||||
includeExtensions:
|
||||
# Web development
|
||||
- .js
|
||||
- .jsx
|
||||
- .ts
|
||||
- .tsx
|
||||
- .html
|
||||
- .css
|
||||
- .scss
|
||||
- .sass
|
||||
- .less
|
||||
- .vue
|
||||
- .svelte
|
||||
# Backend languages
|
||||
- .py
|
||||
- .java
|
||||
- .go
|
||||
- .rs
|
||||
- .rb
|
||||
- .php
|
||||
- .c
|
||||
- .cpp
|
||||
- .h
|
||||
- .hpp
|
||||
- .cs
|
||||
- .swift
|
||||
- .kt
|
||||
# Shell and config
|
||||
- .sh
|
||||
- .bash
|
||||
- .zsh
|
||||
- .fish
|
||||
# Config and data
|
||||
- .json
|
||||
- .yaml
|
||||
- .yml
|
||||
- .toml
|
||||
- .xml
|
||||
- .ini
|
||||
- .env
|
||||
# Documentation
|
||||
- .md
|
||||
- .mdx
|
||||
- .txt
|
||||
- .rst
|
||||
# Build and package files
|
||||
- .gradle
|
||||
- .maven
|
||||
- .dockerignore
|
||||
- .gitignore
|
||||
|
||||
# Blob resource - for handling build artifacts, images, etc.
|
||||
- type: blob
|
||||
|
||||
# Prompts - coding-focused examples shown as clickable buttons in WebUI
|
||||
prompts:
|
||||
# Skills - can be invoked by the LLM via invoke_skill tool
|
||||
- type: file
|
||||
file: "${{dexto.agent_dir}}/skills/code-review.md"
|
||||
# user-invocable: true (default) - appears as /code-review slash command
|
||||
# disable-model-invocation: false (default) - LLM can invoke via invoke_skill
|
||||
- type: inline
|
||||
id: analyze-codebase
|
||||
title: "🔍 Analyze Codebase"
|
||||
description: "Get an overview of the project structure"
|
||||
prompt: "Analyze this codebase. Show me the project structure, main technologies used, and provide a high-level overview."
|
||||
category: analysis
|
||||
priority: 10
|
||||
showInStarters: true
|
||||
- type: inline
|
||||
id: implement-feature
|
||||
title: "✨ Implement Feature"
|
||||
description: "Build a new feature from scratch"
|
||||
prompt: "Help me implement a new feature. I'll describe what I need, and you can design and implement it following best practices."
|
||||
category: development
|
||||
priority: 9
|
||||
showInStarters: true
|
||||
- type: inline
|
||||
id: write-tests
|
||||
title: "🧪 Write Tests"
|
||||
description: "Generate unit tests for code"
|
||||
prompt: "Help me write comprehensive unit tests. Identify the testing framework and create tests that cover edge cases."
|
||||
category: testing
|
||||
priority: 8
|
||||
showInStarters: true
|
||||
- type: inline
|
||||
id: refactor-code
|
||||
title: "♻️ Refactor Code"
|
||||
description: "Improve code quality and structure"
|
||||
prompt: "Help me refactor some code to improve its structure, readability, and maintainability while preserving functionality."
|
||||
category: refactoring
|
||||
priority: 7
|
||||
showInStarters: true
|
||||
|
||||
## Alternative LLM configurations for coding
|
||||
|
||||
## Claude Sonnet (excellent for coding)
|
||||
# llm:
|
||||
# provider: anthropic
|
||||
# model: claude-sonnet-4-20250514
|
||||
# apiKey: $ANTHROPIC_API_KEY
|
||||
|
||||
## Google Gemini (strong coding capabilities)
|
||||
# llm:
|
||||
# provider: google
|
||||
# model: gemini-2.5-pro
|
||||
# apiKey: $GOOGLE_GENERATIVE_AI_API_KEY
|
||||
|
||||
## OpenAI o1 (for complex reasoning tasks)
|
||||
# llm:
|
||||
# provider: openai
|
||||
# model: o1
|
||||
# apiKey: $OPENAI_API_KEY
|
||||
46
dexto/agents/coding-agent/skills/code-review.md
Normal file
46
dexto/agents/coding-agent/skills/code-review.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Code Review
|
||||
description: Perform a thorough code review on the specified files or changes
|
||||
arguments:
|
||||
- name: focus
|
||||
description: Optional focus area (security, performance, style, all)
|
||||
required: false
|
||||
---
|
||||
|
||||
# Code Review Skill
|
||||
|
||||
You are now performing a code review. Follow these guidelines:
|
||||
|
||||
## Review Checklist
|
||||
|
||||
1. **Correctness**: Does the code do what it's supposed to do?
|
||||
2. **Security**: Are there any security vulnerabilities (injection, XSS, etc.)?
|
||||
3. **Performance**: Are there any obvious performance issues?
|
||||
4. **Readability**: Is the code easy to understand?
|
||||
5. **Maintainability**: Will this code be easy to maintain?
|
||||
6. **Error Handling**: Are errors handled appropriately?
|
||||
7. **Tests**: Are there adequate tests for the changes?
|
||||
|
||||
## Output Format
|
||||
|
||||
Structure your review as:
|
||||
|
||||
### Summary
|
||||
Brief overview of what the code does and overall assessment.
|
||||
|
||||
### Issues Found
|
||||
List any problems, categorized by severity:
|
||||
- **Critical**: Must fix before merge
|
||||
- **Major**: Should fix, but not blocking
|
||||
- **Minor**: Nice to have improvements
|
||||
- **Nitpick**: Style/preference suggestions
|
||||
|
||||
### Positive Highlights
|
||||
Note any particularly good patterns or practices.
|
||||
|
||||
### Recommendations
|
||||
Actionable suggestions for improvement.
|
||||
|
||||
---
|
||||
|
||||
Begin the code review now. If no specific files were mentioned, ask the user what they'd like reviewed.
|
||||
Reference in New Issue
Block a user