agentleFS
KubementatKubementat/ai_agent_skills/skills/opencode-agent-creator/SKILL.md

opencode-agent-creator

Skill2 starsChanged 8 months agoMITView on GitHub

Expert guide for creating, configuring, and managing Opencode Agents. Use this skill when the user wants to create a new agent or modify an existing one. Only works for opencode agents.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create new Primary or Subagents.

    line 12
  2. Distinctive:

    If the user hasn't provided all details, ask for:

    line 21
  3. Very specific:

    Create a Markdown file (e.g., agent-name.md).

    line 30
  4. Very specific:

    Check Directory: Ensure the target directory exists (mkdir -p).

    line 69
  5. Very specific:

    Write File: Use the write tool to save the file.

    line 70
  6. Distinctive:

    write - Create new files or overwrite existing ones

    line 79
  7. Distinctive:

    read - Read file contents from your codebase

    line 80

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

Overview

This skill provides the knowledge and procedures to create Opencode Agents. Agents are defined using Markdown files with YAML frontmatter for configuration and the file body for the system prompt.

Capabilities

  • Create new Primary or Subagents.
  • Configure agent permissions (tools, bash, tasks).
  • Set model parameters (temperature, specific models).
  • Save agent definitions to Project (.opencode/agent/) or Global (~/.config/opencode/agent/) scopes.

Usage

1. Gather Requirements

If the user hasn't provided all details, ask for:

  • Scope: Assume Global (~/.config/opencode/agent/) unless the user explicitly requests "Project" scope.
  • Name: What should the agent be called? (e.g., security-auditor, react-expert)
  • Role/Goal: What is the agent's primary purpose?
  • Mode: primary (full interaction) or subagent (specialized task)?
  • Tools: What tools should be enabled/disabled? (e.g., bash: false, write: false)

2. Construct the Agent File

Create a Markdown file (e.g., agent-name.md).

File Location

  • Global: ~/.config/opencode/agent/<agent-name>.md (Default)
  • Project: .opencode/agent/<agent-name>.md (Only if requested)

File Format

The file MUST start with YAML frontmatter followed by the system prompt.

---
description: <Short description for the UI/autocomplete>
mode: <primary|subagent>
model: <optional: specific-model-id>
temperature: <optional: 0.0-1.0>
hidden: <optional: true|false> (Only for subagents)
tools:
  <tool_name>: <true|false>
  # Examples:
  # bash: false
  # write: true
permission:
  <tool_name>: <allow|ask|deny>
  # bash permissions can be granular:
  # bash:
  #   "git status": allow
  #   "*": ask
---
<System Prompt Body>
You are the <Agent Name>. Your goal is...
Instructions:
- ...
- ...

3. Execution

  1. Check Directory: Ensure the target directory exists (mkdir -p).
  2. Write File: Use the write tool to save the file.
  3. Confirm: Inform the user the agent has been created and how to use it (e.g., "Switch using Tab" or "Invoke via @name").

Configuration Reference

built-in tools in opencode

  • bash - Execute shell commands in your project environment
  • edit - Modify existing files using exact string replacements
  • write - Create new files or overwrite existing ones
  • read - Read file contents from your codebase
  • grep - Search file contents using regular expressions
  • glob - Find files by pattern matching
  • list - List files and directories in a given path
  • lsp - Interact with your configured LSP servers to get code intelligence features like definitions, references, hover info, and call hierarchy (experimental)
  • patch - Apply patches to files
  • skill - Load a skill (a SKILL.md file) and return its content in the conversation
  • todowrite - Manage todo lists during coding sessions
  • todoread - Read existing todo lists
  • webfetch - Fetch web content
  • websearch - Search the web for information
  • question - Ask the user questions during execution

Permissions

  • Tools: edit, bash, webfetch can be set to ask, allow, or deny.
  • Task: Control which subagents can be called.

    permission:
      task:
        "*": deny
        "specific-agent": allow

Models

Common overrides:

  • Planning: Lower temperature (0.1)
  • Creative: Higher temperature (0.7)

References

  • Opencode agents documentation

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.