Agent tuning

From wildwasser/opencode-agents · View interactive version

Agent tuning is an AI agent skill from the GitHub repository wildwasser/opencode-agents. Configure and optimize AI coding agents (OpenCode/Claude). Use when setting up or improving agent behavior.

How to use this skill

Skill file

Configuration Locations

OpenCode

~/.config/opencode/
├── opencode.json          # Main config
├── agent/                 # Custom agent prompts
│   ├── oscar.md
│   ├── scout.md
│   ├── ivan.md
│   └── jester.md
├── skills/                # Reusable skills
│   └── <name>/SKILL.md
└── rules/                 # Always-active rules
    └── RULES.md

Claude Code

~/.claude/
├── settings.json          # Main config
├── agents/                # Custom agents
│   └── <name>.md
├── skills/                # Reusable skills
│   └── <name>/SKILL.md
└── CLAUDE.md              # Global instructions

Agent File Structure

Frontmatter (YAML)

---
tools:
  read: true
  write: false
  edit: false
  glob: true
  grep: true
  bash: true
  task: false
  webfetch: true
  todoread: true
  todowrite: true
  question: true    # Ask user questions
  skill: true       # Load skills

permission:
  bash:
    "git *": allow
    "gh *": allow
    "*": deny
---

Tool Reference

| Tool | Purpose | Risk Level |

|------|---------|------------|

| read | Read files | Low |

| write | Create/overwrite files | High |

| edit | Modify files | High |

| glob | Find files by pattern | Low |

| grep | Search file contents | Low |

| list | List directories | Low |

| bash | Execute commands | Variable |

| task | Delegate to subagents | Low |

| webfetch | Fetch web content | Medium |

| todoread | Read task list | Low |

| todowrite | Update task list | Low |

| question | Ask user questions | Low |

| skill | Load skill files | Low |

Permission Patterns

Restrictive (Read-Only Agent)

tools:
  read: true
  write: false
  edit: false
  bash: true

permission:
  bash:
    "ls *": allow
    "cat *": allow
    "git status": allow
    "*": deny

Permissive (Full Access)

tools:
  read: true
  write: true
  edit: true
  bash: true

permission:
  bash:
    "*": allow

Balanced (Common Pattern)

tools:
  read: true
  write: true
  edit: true
  bash: true

permission:
  bash:
    # Safe commands
    "ls *": allow
    "cat *": allow
    "head *": allow
    "tail *": allow
    
    # Git operations
    "git *": allow
    
    # Python in venv only
    ".venv/bin/*": allow
    
    # Deny everything else
    "*": deny

Agent Roles

Orchestrator (Oscar-style)

Researcher (Scout-style)

Implementor (Ivan-style)

Reviewer (Jester-style)

Tuning Tips

1. Start Restrictive

Begin with minimal permissions, expand as needed.

2. Use Specific Bash Patterns

# Good - specific
".venv/bin/pytest *": allow

# Bad - too broad
"*pytest*": allow

3. Separate Concerns

4. Test Permission Changes

After modifying permissions, test that:

Debugging

Check Active Config

# OpenCode
cat ~/.config/opencode/opencode.json

# View agent prompt
cat ~/.config/opencode/agent/<name>.md

Common Issues

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.