Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

opencode-devopencode DEV 搜索

Agent Skill

opencode-dev 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

259

周安装

11

GitHub Stars

2

下载量

91
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:opencode-dev(opencode DEV 搜索)
来源仓库:https://github.com/benjaminwestern/google-engineer-skills
仓库路径:skills/opencode-dev
安装命令:
npx skills add https://github.com/benjaminwestern/google-engineer-skills --skill opencode-dev
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/benjaminwestern/google-engineer-skills --skill opencode-dev

简介

opencode-dev 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 它可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 可通过 npx skills add 命令从 GitHub 仓库安装。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

OpenCode Development

Create and manage OpenCode agents, tools, MCP servers, and workflows.

Quick Start

# Create a new agent
Create a documentation agent that reviews code and writes docs

# Create a custom tool
Create a tool called "deploy" that runs deployment scripts

# Add an MCP server
Add the PostgreSQL MCP server

# Create agent workflow
Create a workflow where a planner agent delegates to a coder agent

Finding Configuration Location

Search Order

  1. Project-specific: Look for .opencode/ folder in current directory
  2. Parent directories: Search up the tree for .opencode/ folder
  3. Global config: Default to ~/.config/opencode/opencode.json
# Find closest .opencode folder
find . -maxdepth 3 -type d -name ".opencode" 2>/dev/null | head -1

# Or search upward
pwd | tr '/' '\n' | tac | while read -r dir; do
  test -d "$dir/.opencode" && echo "$dir/.opencode" && break
done

Determine Target Path

// Logic to determine where to save configurations
function getTargetPath() {
  // 1. Check for .opencode in current and parent directories
  let currentDir = process.cwd();
  while (currentDir !== '/') {
    const opencodePath = path.join(currentDir, '.opencode');
    if (fs.existsSync(opencodePath)) {
      return opencodePath;
    }
    currentDir = path.dirname(currentDir);
  }

  // 2. Default to global config
  return path.join(os.homedir(), '.config/opencode');
}

Creating Agents

Method 1: Markdown Agent File

Best for: Simple agents with prompts and basic configuration

Location: .opencode/agents/<agent-name>.md or ~/.config/opencode/agents/<agent-name>.md

---
description: What this agent does
mode: subagent
model: anthropic/claude-sonnet-4-20250514
temperature: 0.3
tools:
  write: false
  edit: false
  bash: true
permissions:
  edit: deny
  bash:
    "*": ask
    "git *": allow
---

You are a specialized agent. Your purpose is to...

Focus on:
- Task 1
- Task 2
- Task 3

Method 2: JSON Configuration

Best for: Complex agents with detailed tool/permission configurations

Location: .opencode/opencode.json or ~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "agent": {
    "my-agent": {
      "description": "What this agent does",
      "mode": "subagent",
      "model": "anthropic/claude-sonnet-4-20250514",
      "temperature": 0.3,
      "prompt": "You are a specialized agent...",
      "tools": {
        "write": false,
        "edit": false,
        "bash": true
      },
      "permissions": {
        "edit": "deny",
        "bash": {
          "*": "ask",
          "git *": "allow"
        }
      }
    }
  }
}

Agent Options Reference

OptionTypeDescription
descriptionstringRequired. What the agent does
modestringprimary, subagent, or all
modelstringModel ID (e.g., anthropic/claude-sonnet-4-20250514)
temperaturenumber0.0-1.0, creativity control
top_pnumber0.0-1.0, response diversity
stepsnumberMax agentic iterations
promptstringSystem prompt or {file:./path.txt}
toolsobjectTool enable/disable map
permissionsobjectPermission configuration
hiddenbooleanHide from @ autocomplete
colorstringUI color (hex or theme name)
disablebooleanDisable the agent

Agent Modes

  • primary: Main agents you interact with directly (switch with Tab key)
  • subagent: Invoked via @mention or by other agents via Task tool
  • all: Can be used as both primary and subagent

Creating Custom Tools

Simple Tool Definition

Location: .opencode/opencode.json or ~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "customTools": [
    {
      "name": "deploy",
      "description": "Deploy the application to production",
      "command": "./scripts/deploy.sh {{environment}}",
      "parameters": {
        "environment": {
          "type": "string",
          "description": "Deployment environment",
          "enum": ["staging", "production"]
        }
      }
    }
  ]
}

Advanced Tool with Validation

{
  "customTools": [
    {
      "name": "database-query",
      "description": "Run a database query",
      "command": "psql -d {{database}} -c \"{{query}}\"",
      "parameters": {
        "database": {
          "type": "string",
          "description": "Database name"
        },
        "query": {
          "type": "string",
          "description": "SQL query to execute"
        }
      },
      "validation": {
        "database": {
          "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
          "message": "Invalid database name"
        }
      }
    }
  ]
}

Tool Parameters

PropertyTypeDescription
namestringRequired. Tool name
descriptionstringRequired. What the tool does
commandstringRequired. Shell command to execute
parametersobjectParameter definitions
validationobjectParameter validation rules

Parameter Types

{
  "parameters": {
    "stringParam": {
      "type": "string",
      "description": "A string parameter",
      "default": "default value"
    },
    "numberParam": {
      "type": "number",
      "description": "A numeric parameter",
      "minimum": 0,
      "maximum": 100
    },
    "booleanParam": {
      "type": "boolean",
      "description": "A boolean flag"
    },
    "enumParam": {
      "type": "string",
      "description": "A choice parameter",
      "enum": ["option1", "option2", "option3"]
    }
  }
}

Configuring MCP Servers

Basic MCP Server

{
  "$schema": "https://opencode.ai/config.json",
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"]
    }
  }
}

MCP Server with Environment Variables

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "{{env.GITHUB_TOKEN}}"
      }
    }
  }
}

MCP Server with Permissions

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
    }
  },
  "permissions": {
    "postgres_*": "ask"
  }
}

Managing Prompts

External Prompt Files

Create prompt files in .opencode/prompts/:

# Create prompts directory
mkdir -p .opencode/prompts

# Create a prompt file
cat > .opencode/prompts/code-reviewer.txt << 'EOF'
You are an expert code reviewer. Focus on:
- Security vulnerabilities
- Performance issues
- Code maintainability
- Best practices

Provide specific, actionable feedback.
EOF

Reference in agent config:

{
  "agent": {
    "reviewer": {
      "description": "Code reviewer agent",
      "mode": "subagent",
      "prompt": "{file:./prompts/code-reviewer.txt}"
    }
  }
}

Inline Prompts

{
  "agent": {
    "reviewer": {
      "description": "Code reviewer agent",
      "mode": "subagent",
      "prompt": "You are a code reviewer. Focus on security, performance, and maintainability."
    }
  }
}

Creating Agent Workflows

Subagent Delegation Pattern

Orchestrator Agent (primary):

{
  "agent": {
    "orchestrator": {
      "description": "Orchestrates complex tasks by delegating to subagents",
      "mode": "primary",
      "prompt": "You are a task orchestrator. For complex tasks:\n1. Break down into subtasks\n2. Use the Task tool to delegate to appropriate subagents\n3. Synthesize results\n\nAvailable subagents:\n- @planner: Creates implementation plans\n- @coder: Writes and edits code\n- @reviewer: Reviews code quality",
      "permissions": {
        "task": {
          "*": "allow"
        }
      }
    }
  }
}

Planner Subagent:

---
description: Creates detailed implementation plans
mode: subagent
tools:
  write: false
  edit: false
---

You are a technical planner. Create detailed, actionable plans.

Structure your plans:
1. Overview
2. Files to modify/create
3. Step-by-step implementation
4. Testing strategy
5. Potential risks

Coder Subagent:

{
  "agent": {
    "coder": {
      "description": "Writes and edits code based on plans",
      "mode": "subagent",
      "tools": {
        "write": true,
        "edit": true,
        "read": true
      }
    }
  }
}

Workflow Definition File

Create complex workflows in .opencode/workflows/:

# .opencode/workflows/feature-development.yaml
name: Feature Development

trigger: primary agent delegates feature requests

steps:
  1_plan:
    agent: planner
    prompt: "Analyze requirements and create implementation plan for: {{task}}"
    output: plan

  2_implement:
    agent: coder
    prompt: "Implement based on plan:\n{{plan}}"
    tools: [write, edit, read]

  3_review:
    agent: reviewer
    prompt: "Review the implementation for quality and issues"
    tools: [read]
    optional: true

  4_finalize:
    agent: orchestrator
    prompt: "Summarize changes and suggest next steps"

Configuration Structure

Complete opencode.json Example

{
  "$schema": "https://opencode.ai/config.json",

  "agent": {
    "build": {
      "mode": "primary",
      "model": "anthropic/claude-sonnet-4-20250514"
    },
    "plan": {
      "mode": "primary",
      "permissions": {
        "edit": "ask",
        "bash": "ask"
      }
    },
    "docs-writer": {
      "description": "Writes technical documentation",
      "mode": "subagent",
      "prompt": "{file:./prompts/docs-writer.txt}",
      "tools": {
        "bash": false
      }
    },
    "security-auditor": {
      "description": "Performs security audits",
      "mode": "subagent",
      "tools": {
        "write": false,
        "edit": false
      }
    }
  },

  "customTools": [
    {
      "name": "deploy",
      "description": "Deploy to environment",
      "command": "./scripts/deploy.sh {{env}}",
      "parameters": {
        "env": {
          "type": "string",
          "enum": ["staging", "production"]
        }
      }
    }
  ],

  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
    }
  },

  "permissions": {
    "bash": "ask",
    "edit": "allow",
    "postgres_*": "ask"
  }
}

Directory Structure

.opencode/
├── opencode.json          # Main configuration
├── agents/                # Markdown agent definitions
│   ├── docs-writer.md
│   ├── security-auditor.md
│   └── code-reviewer.md
├── prompts/               # External prompt files
│   ├── docs-writer.txt
│   ├── security-prompt.txt
│   └── code-reviewer.txt
├── workflows/             # Workflow definitions
│   └── feature-development.yaml
└── tools/                 # Custom tool scripts
    ├── deploy.sh
    └── test-runner.sh

Examples

Example 1: Create a Documentation Agent

# 1. Find or create .opencode directory
mkdir -p .opencode/agents .opencode/prompts

# 2. Create the prompt file
cat > .opencode/prompts/docs-writer.txt << 'EOF'
You are a technical documentation writer. Create clear, comprehensive documentation.

Guidelines:
- Use clear, concise language
- Include code examples
- Structure with headers and lists
- Explain "why" not just "how"
EOF

# 3. Create the agent
cat > .opencode/agents/docs-writer.md << 'EOF'
---
description: Writes and maintains technical documentation
mode: subagent
temperature: 0.3
tools:
  bash: false
---

You are a technical writer. Create documentation that is:
- Clear and concise
- Well-structured
- Includes examples
- Accessible to the target audience
EOF

Example 2: Create a Code Review Agent

{
  "agent": {
    "code-reviewer": {
      "description": "Reviews code for quality and best practices",
      "mode": "subagent",
      "model": "anthropic/claude-sonnet-4-20250514",
      "temperature": 0.1,
      "prompt": "You are an expert code reviewer. Focus on:\n- Security vulnerabilities\n- Performance issues\n- Maintainability\n- Best practices\n\nProvide specific, actionable feedback.",
      "tools": {
        "write": false,
        "edit": false,
        "read": true,
        "grep": true
      },
      "permissions": {
        "edit": "deny"
      }
    }
  }
}

Example 3: Create a Deployment Tool

{
  "customTools": [
    {
      "name": "deploy-app",
      "description": "Deploy application to specified environment",
      "command": "bash scripts/deploy.sh --env {{environment}} --version {{version}}",
      "parameters": {
        "environment": {
          "type": "string",
          "description": "Target deployment environment",
          "enum": ["development", "staging", "production"],
          "default": "staging"
        },
        "version": {
          "type": "string",
          "description": "Version to deploy (git tag or branch)",
          "default": "main"
        }
      }
    }
  ]
}

Example 4: Create Agent Workflow

Orchestrator (primary agent):

{
  "agent": {
    "feature-orchestrator": {
      "description": "Orchestrates feature development workflow",
      "mode": "primary",
      "prompt": "You coordinate feature development:\n1. Use @planner to create implementation plan\n2. Use @implementer to write code\n3. Use @tester to verify\n4. Summarize results\n\nDelegate tasks using Task tool.",
      "permissions": {
        "task": {
          "planner": "allow",
          "implementer": "allow",
          "tester": "allow"
        }
      }
    }
  }
}

Subagents:

---
description: Creates implementation plans
mode: subagent
tools:
  write: false
  edit: false
---

Create detailed implementation plans with file structure, steps, and considerations.
---
description: Implements code based on plans
mode: subagent
tools:
  write: true
  edit: true
  read: true
---

Implement features according to the provided plan. Follow best practices.

Example 5: Add MCP Server

{
  "mcpServers": {
    "sqlite": {
      "command": "uvx",
      "args": ["mcp-server-sqlite", "--db-path", "./data.db"]
    }
  },
  "permissions": {
    "sqlite_*": "ask"
  }
}

Helper Scripts

Script: opencode-init.sh

Initialize OpenCode configuration in current project:

#!/bin/bash
# opencode-init.sh - Initialize OpenCode configuration

OPENCODE_DIR=".opencode"

# Create directory structure
mkdir -p "$OPENCODE_DIR"/{agents,prompts,workflows,tools}

# Create base opencode.json
cat > "$OPENCODE_DIR/opencode.json" << 'EOF'
{
  "$schema": "https://opencode.ai/config.json",
  "agent": {},
  "customTools": [],
  "mcpServers": {},
  "permissions": {}
}
EOF

echo "OpenCode configuration initialized in $OPENCODE_DIR/"

Script: create-agent.sh

Create a new agent:

#!/bin/bash
# create-agent.sh - Create a new OpenCode agent

AGENT_NAME="$1"
AGENT_MODE="${2:-subagent}"

if [ -z "$AGENT_NAME" ]; then
  echo "Usage: create-agent.sh <agent-name> [mode]"
  exit 1
fi

# Find .opencode directory
OPENCODE_DIR=""
CURRENT_DIR="$(pwd)"
while [ "$CURRENT_DIR" != "/" ]; do
  if [ -d "$CURRENT_DIR/.opencode" ]; then
    OPENCODE_DIR="$CURRENT_DIR/.opencode"
    break
  fi
  CURRENT_DIR="$(dirname "$CURRENT_DIR")"
done

# Default to global if not found
if [ -z "$OPENCODE_DIR" ]; then
  OPENCODE_DIR="$HOME/.config/opencode"
  mkdir -p "$OPENCODE_DIR/agents"
fi

cat > "$OPENCODE_DIR/agents/$AGENT_NAME.md" << EOF
---
description: $AGENT_NAME agent
mode: $AGENT_MODE
---

You are a $AGENT_NAME agent. Your purpose is to...
EOF

echo "Created agent: $OPENCODE_DIR/agents/$AGENT_NAME.md"

Best Practices

Agent Design

  1. Clear descriptions: Make agent purpose obvious from description
  2. Appropriate restrictions: Limit tools based on agent role
  3. Specific prompts: Give clear instructions and guidelines
  4. Temperature tuning: Use low temps (0.1-0.3) for analysis, higher (0.5-0.7) for creative tasks

Tool Design

  1. Validate inputs: Use parameter validation
  2. Clear descriptions: Help LLM understand when to use the tool
  3. Safe defaults: Set sensible defaults for optional parameters
  4. Idempotent: Tools should be safe to run multiple times

MCP Server Security

  1. Use permissions: Set ask for destructive operations
  2. Limit scope: Configure servers with minimal required access
  3. Env variables: Store secrets in environment variables, not config

Workflow Organization

  1. Single responsibility: Each agent should have a focused purpose
  2. Clear handoffs: Define what each subagent returns
  3. Error handling: Plan for subagent failures
  4. Progress tracking: Use todo lists for complex workflows

Troubleshooting

Agent not appearing

  • Check agent file has correct YAML frontmatter
  • Verify JSON syntax in opencode.json
  • Restart OpenCode to reload config

Tools not available

  • Check permissions configuration
  • Verify tool is enabled (not set to false)
  • Check for conflicting permission rules

MCP server errors

  • Verify MCP server is installed (npm list -g or pip list)
  • Check server command is in PATH
  • Review server logs for errors

Permission denied

  • Check global permissions first
  • Verify agent-specific permissions aren't more restrictive
  • Use glob patterns carefully (order matters)

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.93%
按下载量换算33

Claude

26.72%
按下载量换算24

Cursor

17.96%
按下载量换算16

Gemini CLI

9.61%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills