agentleFS
CowboyLogicCowboyLogic/ai-dev/skills/client-config-opencode/references/agents.md

ai-dev / references

AGENTS.md4 starsChanged 11 days agoMITView on GitHub

[!NOTE] This file covers V1 agent config (agent map, prompt, permission, disable, temperature). Native V2 uses agents, system, permissions arrays, disabled, and request.body, defaults new custom agents to mode: primary, and has no scout agent. See v2/agents.md. Switch primary agents with Tab (agent_cycle) or Shift+Tab (agent_cycle_reverse). Invoke subagents with @general, @explore, @scout, or let the primary agent call them automatically. When a subagent creates a child session: session_child_first (default Leader+Down) enters it, session_child_cycle/session_child_cycle_reverse (default Right/Left) cycle siblings, session_parent (default Up)…

  • Commits and pushes

The file

We split this agents.md into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When a subagent creates a child session: session_child_first (default Leader+Down) enters it, …

    line 23
  2. Distinctive:

    Create agents as markdown files with YAML frontmatter:

    line 83
  3. Distinctive:

    Use glob patterns for fine-grained bash control:

    line 120
  4. Very specific:

    Must be a primary mode agent.

    line 159

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
agents.md

V1 Agents Reference

[!NOTE] This file covers V1 agent config (agent map, prompt, permission, disable, temperature). Native V2 uses agents, system, permissions arrays, disabled, and request.body, defaults new custom agents to mode: primary, and has no scout agent. See v2/agents.md.

Built-in agents

AgentModeDefault behavior
buildprimaryFull tool access — default for development work
planprimaryfile edits and bash set to ask — analysis/planning
generalsubagentFull access (except todo) — multi-step research tasks, parallelizable
exploresubagentRead-only codebase exploration — find files/patterns fast
scoutsubagentRead-only external docs/dependency research — clones deps into opencode's cache, cross-references upstream source
compactionprimary (hidden)Summarises context when it fills up
titleprimary (hidden)Generates session titles
summaryprimary (hidden)Generates session summaries

Switch primary agents with Tab (agent_cycle) or Shift+Tab (agent_cycle_reverse). Invoke subagents with @general, @explore, @scout, or let the primary agent call them automatically. When a subagent creates a child session: session_child_first (default Leader+Down) enters it, session_child_cycle/session_child_cycle_reverse (default Right/Left) cycle siblings, session_parent (default Up) returns.


Agent configuration in opencode.json

{
  "agent": {
    "build": {
      "model": "anthropic/claude-opus-4-5",
      "steps": 50
    },
    "plan": {
      "prompt": "{file:~/.config/opencode/prompts/plan.md}"
    },
    "my-reviewer": {
      "description": "Reviews code for security and quality issues",
      "mode": "subagent",
      "model": "anthropic/claude-sonnet-4-5",
      "temperature": 0.1,
      "color": "#e06c75",
      "permission": {
        "edit": "deny",
        "bash": "deny"
      }
    }
  }
}

Agent fields reference

FieldDescriptionExample
descriptionPurpose — used for @ autocomplete and auto-routing. Required"Reviews code for quality"
mode"primary" (user-selectable), "subagent" (invoked by agents), "all" — defaults to "all" if unset"subagent"
modelOverride default model for this agent"anthropic/claude-opus-4-5"
variantDefault model variant (applies only when using the agent's configured model)"high"
promptSystem prompt — inline string or {file:path} (path relative to the config file)"{file:./prompts/reviewer.md}"
temperatureResponse randomness, typically 0.0–1.0; unset uses model defaults0.1
top_pResponse diversity control0.9
stepsMax agentic iterations before falling back to text30
permissionTool access rules (see permissions.md){"edit": "deny"}
colorHex #RRGGBB or theme color name"#e06c75" or "accent"
disableSet true to disable agenttrue
hiddenHide a subagent from @ autocomplete (still invocable via the Task tool)true
optionsGeneric options object{}
toolsDeprecated — use permission (true ≈ {"*": "allow"}, false ≈ {"*": "deny"}){"write": false}
maxStepsDeprecated — use steps—

Theme color names: primary, secondary, accent, success, warning, error, info

Any other key in an agent entry is passed straight to the provider as a model option (e.g. "reasoningEffort": "high" for OpenAI reasoning models).


Agent markdown files (alternative to JSON)

Create agents as markdown files with YAML frontmatter:

Global: ~/.config/opencode/agents/<name>.md Project: .opencode/agents/<name>.md

---
description: Reviews code for security vulnerabilities and quality issues
mode: subagent
model: anthropic/claude-sonnet-4-5
temperature: 0.1
color: "#e06c75"
permission:
  edit: deny
  bash: deny
  read: allow
---

# Security Reviewer

You are a security-focused code reviewer. When reviewing code:

1. Check for injection vulnerabilities (SQL, command, XSS)
2. Identify exposed secrets or credentials
3. Flag insecure dependencies
4. Look for auth and authorization flaws
5. Note insecure data handling

Always provide specific line references and concrete remediation steps.

Invoke via CLI: opencode agent create for interactive setup.


Granular bash permissions in agents

Use glob patterns for fine-grained bash control:

{
  "agent": {
    "build": {
      "permission": {
        "bash": {
          "*": "ask",
          "git status": "allow",
          "git diff *": "allow",
          "git add *": "allow",
          "git commit *": "allow",
          "git push *": "deny",
          "npm run *": "allow",
          "rm *": "ask"
        },
        "task": {
          "*": "deny",
          "code-reviewer": "ask",
          "orchestrator-*": "allow"
        }
      }
    }
  }
}

The task permission controls which subagents this agent can invoke via the Task tool, using glob patterns on subagent names. A denied subagent is removed from the Task tool description entirely.


Default agent

{ "default_agent": "build" }

Must be a primary mode agent. The default is build.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.