跳到正文
cccskills
免费在 GitHub 公开

subagent-authoring

Create subagent definitions for Claude Code and OpenCode that delegate to skills. Use when creating new subagents or refactoring existing ones to follow the delegation pattern.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md6.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Subagent Authoring

Create subagents that delegate to skills for Claude Code and OpenCode.

When to Use This Skill

Use this skill when:

  • Creating a new subagent definition
  • Refactoring an existing agent to delegate to a skill
  • Ensuring consistency between Claude Code and OpenCode agent implementations

The Delegation Pattern

Agents should be thin wrappers that delegate all implementation to skills:

Claude Code agent (.claude/agents/<name>.md):

---
name: agent-name
description: Brief description of what the agent does
tools: Read, Grep, Glob, Skill(skill-name), ...
---

Use the `<skill-name>` skill to accomplish this task.

OpenCode agent (.config/opencode/agents/<name>.md):

---
description: Brief description of what the agent does
mode: subagent
tools:
  read: true
  grep: true
  glob: true
  skill: true
permission:
  bash:
    ...
---

Use the `<skill-name>` skill to accomplish this task.

Claude Code Agent Structure

Frontmatter Fields

FieldRequiredDescription
nameYesAgent identifier (lowercase, no spaces)
descriptionYes1-2 sentence description of what the agent does
toolsYesList of tools and skills the agent can use
modelNoSpecific model to use (e.g., sonnet)

tools Format

  • Read, Write, Edit, Grep, Glob, Bash - Core tools
  • Skill(skill-name) - Load a skill
  • Bash(command:*) - Allow bash command with any arguments (note the colon)

Bash permission syntax (Claude Code uses colons, not spaces):

# Allow git commit with any arguments
Bash(git commit:*)

# Allow all git commands
Bash(git:*)

# Allow specific script
Bash(~/.agents/skills/my-skill/scripts/helper.py:*)

Example:

tools: Read, Grep, Glob, Bash(git status:*), Bash(git commit:*), Skill(code-linting)

Documentation: https://docs.anthropic.com/en/docs/claude-code/settings#tool-permissions

Naming Conventions

Subagent names should be agent nouns formed with the -er suffix (meaning "one who does X"):

  • ✅ git-committer, git-stager, code-linter, test-runner, task-implementer
  • ❌ git-commit, commit-helper, committing-agent

The -er suffix creates agent/instrument nouns:

  • committer = one who commits
  • stager = one who stages
  • implementer = one who implements

OpenCode Agent Structure

Frontmatter Fields

FieldRequiredDescription
descriptionYes1-2 sentence description
modeYesAgent mode (subagent, primary)
toolsYesMap of tool names to boolean enablement
permissionYesMap of tool categories to permission rules

tools Format

tools:
  read: true
  grep: true
  glob: true
  bash: true
  edit: false
  write: false
  skill: true

Common tool mappings

Claude ToolOpenCode Equivalent
Readread: true
Writewrite: true
Editedit: true
Grepgrep: true
Globglob: true
Bashbash: true
Skill(x)skill: true

Agent Body

The agent body should be 5-20 lines maximum and contain only:

Use the `<skill-name>` skill to accomplish this task.

Do NOT include:

  • Full implementation steps
  • Duplicated content between Claude and OpenCode
  • More than ~20 lines of content

Examples

Minimal Agent (Claude)

---
name: code-linter
description: Code linting specialist
tools: Read, Grep, Glob, Bash, Skill(code-linting)
---

Use the `code-linting` skill to run linters.

Minimal Agent (OpenCode)

---
description: Code linting specialist
mode: subagent
tools:
  read: true
  grep: true
  glob: true
  bash: true
  skill: true
---

Use the `code-linting` skill to run linters.

Agent with Bash Permissions (OpenCode)

OpenCode uses spaces in permission patterns (unlike Claude Code which uses colons):

---
description: Run tests
mode: subagent
tools:
  bash: true
  read: true
  grep: true
  glob: true
  skill: true
permission:
  bash:
    "*": "ask"
    "pytest *": "allow"
    "npm test": "allow"
    "git status": "allow"
    "git commit *": "allow"
---

Use the `test-running` skill to run tests.

Documentation: https://opencode.ai/docs/permissions

Primary Mode Agent (OpenCode)

---
description: Orchestrates development workflow
mode: primary
tools:
  read: true
  write: true
  edit: true
  bash: true
  grep: true
  glob: true
  todowrite: true
  todoread: true
---

Use the `task-orchestration` skill to orchestrate the development workflow.

Mode Selection

ModeUse When
subagentAgent is invoked by another agent or command
primaryAgent is the main agent handling the conversation

Why This Pattern?

  1. Single source of truth: Skills contain all implementation content
  2. Easier maintenance: Changes to skills automatically propagate
  3. Platform consistency: Agents are thin wrappers with platform-specific config
  4. Token efficiency: Skills load progressively via progressive disclosure
  5. No duplication: Implementation lives in one place

Anti-Pattern to Avoid

BAD - Agent with full implementation:

---
name: code-linter
description: Code linting specialist
tools: Read, Grep, Glob, Bash
---

You are a senior code reviewer responsible for ensuring that code changes pass
all linters...

## When to Use This Agent PROACTIVELY

Always use immediately after:
- Creating new source code files
- Modifying existing code...

## What This Agent Does

1. **Discovers** all appropriate linters...
2. **Runs** formatting checks...
3. **Auto-fixes** issues...
4. **Reports** remaining issues...

## Linting Process

Run linters according to repository guidelines. First look for linting
commands in the following order:
...

GOOD - Agent that delegates:

---
name: code-linter
description: Code linting specialist
tools: Read, Grep, Glob, Bash, Skill(code-linting)
---

Use the `code-linting` skill to run linters.

Workflow

  1. Create the skill first (or identify existing skill to use)
  2. Create/refactor Claude agent with proper frontmatter and delegation
  3. Create/refactor OpenCode agent with matching content and platform-specific config
  4. Verify both agents delegate correctly

Related Skills

  • agent-command-authoring - For creating commands that delegate to skills
  • skill-authoring - For creating skills themselves

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Applies local reliability, viewport, tab-safety, stale-ref, widget, and browser-boundary lessons to every agent-browser automation. Use alongside the upstream agent-browser skill whenever navigating, clicking, filling, testing, extracting, taking screenshots, or debugging any website with agent-browser.

中文简介正在准备中。当前显示原文说明。

aspiers/ai-config152026年10月9日 更新

Size the agent-browser Chromium window to fill its current screen, leaving a configurable bottom margin for the desktop panel. Use before any agent-browser automation that needs the full screen visible without elements overlapping or scrolling off (e.g. Xero, dense web apps).

中文简介正在准备中。当前显示原文说明。

aspiers/ai-config152026年10月9日 更新

Create Claude Code slash commands, OpenCode command files, Pi prompt templates, and Codex custom prompts that delegate to the right subagent or skill. Use when creating new commands, porting commands across agent platforms, or refactoring existing commands to follow platform conventions.

中文简介正在准备中。当前显示原文说明。

aspiers/ai-config152026年10月9日 更新

Adds or changes allowed commands in AI agent permission configs for OpenCode and Claude Code. Use when a command needs adding to an agent's allow list, when permission settings for existing commands need changing, when setting up a new AI tool that requires command permissions, or when the user asks to stop being prompted for a particular command.

中文简介正在准备中。当前显示原文说明。

aspiers/ai-config152026年10月9日 更新

bc

免费

Creates a Beads issue for a described problem or piece of work without doing the work itself. Use when the user invokes `/bc` or `$bc`, or asks to file, log, or record a bead for something. To also carry out the work, use the `bx` skill instead.

中文简介正在准备中。当前显示原文说明。

aspiers/ai-config152026年10月9日 更新

bdr

免费

Stores a persistent memory or learning with `bd remember` so it survives across sessions. Use when the user invokes `/bdr` or `$bdr`, or asks to remember, note, or persist an insight in a Beads workspace.

中文简介正在准备中。当前显示原文说明。

aspiers/ai-config152026年10月9日 更新

查看 aspiers 的全部技能

报告此技能的问题