mcpbeat Sign in

Agent Command Authoring Skill for Claude

Create Claude Code slash commands and OpenCode command files that delegate to subagents. Use when creating new commands or refactoring existing ones to follow the delegation pattern.

2k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
532
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/majiayu000/claude-skill-registry --skill agent-command-authoring

What comes with it

719 bytes besides the instruction
metadata.json

What it tells the agent to use

found in the instruction text
Bash runs shell commands — read the instruction before connecting
Task spawns other agents

The instruction itself

19 sections, as written by the author

Agent Command Authoring

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

When to Use This Skill

Use this skill when:

  • Creating a new custom command
  • Refactoring an existing command to delegate to a subagent
  • Ensuring consistency between Claude Code and OpenCode command implementations

The Delegation Pattern

Commands should be thin wrappers that delegate to subagents (which in turn

delegate to skills):

command → subagent → skill

Claude Code command (.claude/commands/<name>.md):

---
description: Brief description of what the command does
allowed-tools: Task(subagent-name)
---

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

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

---
description: Brief description of what the command does
agent: <subagent-name>
---

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

Claude Code Command Structure

Frontmatter Fields

| Field | Required | Description |

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

| description | Yes | 1-2 sentence description of what the command does |

| allowed-tools | Yes | Task(subagent-name) to invoke the subagent |

| argument-hint | No | Hint for command arguments (e.g., [feature_name [subtask_number]]) |

allowed-tools Format

For commands that delegate to subagents:

  • Task(subagent-name) - Invoke a subagent

Example:

allowed-tools: Task(git-committer)

Naming Conventions

Command names should use the imperative form of verbs (telling the agent what to do):

  • commit, stage, lint, test, review, reflect
  • committing, git-committer, do-linting

The imperative form gives commands their characteristic feel:

  • "commit" = "perform a commit"
  • "stage" = "stage changes"
  • "test" = "run tests"

OpenCode Command Structure

Frontmatter Fields

| Field | Required | Description |

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

| description | Yes | 1-2 sentence description of what the command does |

| agent | Yes | Name of the subagent to invoke |

Example:

---
description: Create well-formatted commits using conventional commits style
agent: git-committer
---

Command Body

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

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

Do NOT include:

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

Examples

Minimal Command (Claude Code)

---
description: Create well-formatted commits using conventional commits style
allowed-tools: Task(git-committer)
---

Use the `git-committer` subagent to create a well-formatted commit.

Minimal Command (OpenCode)

---
description: Create well-formatted commits using conventional commits style
agent: git-committer
---

Use the `git-committer` subagent to create a well-formatted commit.

Command with Arguments (Claude Code)

---
description: Generate a PRP
argument-hint: [feature_name]
allowed-tools: Task(prp-generator)
---

Use the `prp-generator` subagent to create a Product Requirements Prompt.

Why This Pattern?

  • Single source of truth: Skills contain all implementation content
  • Easier maintenance: Changes to skills automatically propagate
  • Platform consistency: Commands are thin wrappers with platform-specific frontmatter
  • Token efficiency: Subagents load skills progressively via progressive disclosure
  • No duplication: Implementation lives in one place (the skill)
  • Isolation: Subagents run in their own context with appropriate permissions

Anti-Pattern to Avoid

BAD - Command with full implementation:

---
description: Stage changes
allowed-tools: Bash(git add:*)
---

# Staging Changes

Stage relevant changes via `git add`...

1. Run `git status` to check for already staged changes
2. Verify no staged changes exist...
3. Run `git status` again...
4. Carefully review which files are relevant...
5. Stage only the relevant files...
6. Run `git status` again...

BAD - Command that delegates directly to skill (skipping subagent):

---
description: Stage changes via git add
allowed-tools: Skill(git-staging)
---

Use the `git-staging` skill to stage relevant changes.

GOOD - Command that delegates to subagent:

---
description: Stage changes via git add
allowed-tools: Task(git-stager)
---

Use the `git-stager` subagent to stage relevant changes.

Workflow

  • Check for existing skill: Identify the skill the command should use
  • Check for existing subagent: Look for a subagent that delegates to that skill
  • Claude Code: .claude/agents/<name>.md
  • OpenCode: .config/opencode/agent/<name>.md
  • If no subagent exists: Ask the user if they want one created
  • If yes, use the subagent-authoring skill to create it first
  • If no, stop and explain the command cannot be created without a subagent
  • Create/refactor Claude Code command with allowed-tools: Task(subagent-name)
  • Create/refactor OpenCode command with agent: subagent-name
  • Verify the full chain works: command → subagent → skill

Missing Subagent Handling

Before creating a command, always verify the target subagent exists:

# Check Claude Code subagent
ls ~/.claude/agents/<subagent-name>.md

# Check OpenCode subagent
ls ~/.config/opencode/agent/<subagent-name>.md

If either file is missing, ask the user:

> "The subagent <subagent-name> doesn't exist yet. Would you like me to

> create it using the subagent-authoring skill before proceeding with

> the command?"

Do NOT create commands that reference non-existent subagents.

  • subagent-authoring - For creating subagent definitions that delegate to skills
  • skill-authoring - For creating skills themselves

Other skills for the same job

different authors, same section of the catalogue
Skill Creator
by anthropics
vendor ×10

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

56k tokens scripts
Skill Creator
by vercel-labs
vendor ×10

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

12k tokens scripts
Skill Creator
by JayZeeDesign
×9

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

10k tokens scripts
Template Skill
by JayZeeDesign
×7

Replace with description of the skill and when Claude should use it.

35 tokens
Dispatching Parallel Agents
by ZhanlinCui
×5

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

2k tokens
Skill Development
by anthropics
vendor ×4

This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.

9k tokens
Find Skills
by sanity-io
vendor ×4

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

1k tokens
Writing Skills
by ZhanlinCui
×4

Use when creating new skills, editing existing skills, or verifying skills work before deployment

26k tokens scripts

How to use it

Copy the folder

Take majiayu000/agent-command-authoring from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.