Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

agent-command-authoringAgent 命令编写

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

233

周安装

10

GitHub Stars

10

下载量

82
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/aspiers/ai-config --skill agent-command-authoring

简介

agent-command-authoring 用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查,适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。

  • 适用于创建自定义命令、确保 Claude Code 与 OpenCode 命令一致性等场景。
  • 通过 npx skills add 命令从 GitHub 安装,具体用法请参考原始 README 和 SKILL.md 文件。
  • 使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。
  • 该技能由 aspiers/ai-config 项目提供,支持多宿主环境集成,适合命令架构设计。

SKILL.md

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

FieldRequiredDescription
descriptionYes1-2 sentence description of what the command does
allowed-toolsYesTask(subagent-name) to invoke the subagent
argument-hintNoHint 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

FieldRequiredDescription
descriptionYes1-2 sentence description of what the command does
agentYesName 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?

  1. Single source of truth: Skills contain all implementation content
  2. Easier maintenance: Changes to skills automatically propagate
  3. Platform consistency: Commands are thin wrappers with platform-specific frontmatter
  4. Token efficiency: Subagents load skills progressively via progressive disclosure
  5. No duplication: Implementation lives in one place (the skill)
  6. 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), for commands that do not need session context:

---
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 (for context-independent tasks):

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

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

EXCEPTION - Commands that are inherently session-context-dependent (e.g. "review what I just wrote", "remove duplication I just introduced") should skip the subagent and invoke the skill directly. Subagents start with a fresh context and will not know what was recently worked on unless the parent agent tells them — which defeats the purpose of the command.

---
description: Remove code duplication you just introduced
allowed-tools: Skill(code-refactoring-dry)
---

Use the `code-refactoring-dry` skill to remove duplication in the files you
have worked on in this session.

In OpenCode, omit the agent: field entirely for the same effect (the command then runs in the primary agent's context).

Workflow

  1. Check for existing skill: Identify the skill the command should use
  2. Check for existing subagent: Look for a subagent that delegates to that skill

- Claude Code: .claude/agents/<name>.md - OpenCode: .config/opencode/agents/<name>.md

  1. 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

  1. Create/refactor Claude Code command with allowed-tools: Task(subagent-name)
  2. Create/refactor OpenCode command with agent: subagent-name
  3. 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/agents/<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.

Related Skills

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

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.7%
按下载量换算30

Claude

30%
按下载量换算25

Cursor

17.45%
按下载量换算14

Gemini CLI

9.21%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills