agent-identifier
它能做什么
这项技能说明如何编写 Claude Code 智能体文件。智能体是一个专注的助手,能够独立处理复杂任务。适合为 Claude Code 构建自己智能体的开发者。
适用场景
- ✓当你想为某项特定的自主工作创建新的 Claude Code 智能体时。
- ✓当你需要为智能体文件编写前置元数据时,例如名称、描述、模型或颜色。
- ✓当你希望清楚地编写智能体的触发示例和系统提示词时。
技能链接
https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/agent-identifier/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请创建一个 Claude Code 智能体,用于审查我的拉取请求中的安全问题。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体遵循文件格式规则,编写一份带有示例的清晰触发描述,并编写一份定义智能体行为方式的系统提示词。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Agent Development for Claude Code Plugins
Overview
Agents are autonomous subprocesses that handle complex, multi-step tasks independently. Understanding agent structure, triggering conditions, and system prompt design enables creating powerful autonomous capabilities.
Key concepts:
- Agents are FOR autonomous work, commands are FOR user-initiated actions
- Markdown file format with YAML frontmatter
- Triggering via description field with examples
- System prompt defines agent behavior
- Model and color customization
When to Use
Use this skill when the user asks to:
- Create an agent
- Add an agent
- Write a subagent
- Define agent frontmatter
- Decide when to use description examples
- Configure agent tools, colors, or model behavior
- Design autonomous agent structure, triggering conditions, or system prompts
When Not to Use
Do not use this skill for:
- Slash command design
- Hook configuration
- MCP server setup
- General plugin layout questions that belong to
plugin-structure
Agent File Structure
Complete Format
---
name: agent-identifier
description: Use this agent when [triggering conditions]. Examples:
<example>
Context: [Situation description]
user: "[User request]"
assistant: "[How assistant should respond and use this agent]"
<commentary>
[Why this agent should be triggered]
</commentary>
</example>
<example>
[Additional example...]
</example>
model: inherit
color: blue
tools: ["Read", "Write", "Grep"]
---
You are [agent role description]...
**Your Core Responsibilities:**
1. [Responsibility 1]
2. [Responsibility 2]
**Analysis Process:**
[Step-by-step workflow]
**Output Format:**
[What to return]
Frontmatter Fields
name (required)
Agent identifier used for namespacing and invocation.
Format: lowercase, numbers, hyphens only Length: 3-50 characters Pattern: Must start and end with alphanumeric
Good examples:
code-reviewertest-generatorapi-docs-writersecurity-analyzer
Bad examples:
helper(too generic)-agent-(starts/ends with hyphen)my_agent(underscores not allowed)ag(too short, < 3 chars)
description (required)
Defines when Claude should trigger this agent. This is the most critical field.
Must include:
- Triggering conditions ("Use this agent when...")
- Multiple
<example>blocks showing usage - Context, user request, and assistant response in each example
<commentary>explaining why agent triggers
Format:
Use this agent when [conditions]. Examples:
<example>
Context: [Scenario description]
user: "[What user says]"
assistant: "[How Claude should respond]"
<commentary>
[Why this agent is appropriate]
</commentary>
</example>
[More examples...]
Best practices:
- Include 2-4 concrete examples
- Show proactive and reactive triggering
- Cover different phrasings of same intent
- Explain reasoning in commentary
- Be specific about when NOT to use the agent
model (required)
Which model the agent should use.
Options:
inherit- Use same model as parent (recommended)sonnet- Claude Sonnet (balanced)opus- Claude Opus (most capable, expensive)haiku- Claude Haiku (fast, cheap)
Recommendation: Use inherit unless agent needs specific model capabilities.
color (required)
Visual identifier for agent in UI.
Options: blue, cyan, green, yellow, magenta, red
Guidelines:
- Choose distinct colors for different agents in same plugin
- Use consistent colors for similar agent types
- Blue/cyan: Analysis, review
- Green: Success-oriented tasks
- Yellow: Caution, validation
- Red: Critical, security
- Magenta: Creative, generation
tools (optional)
Restrict agent to specific tools.
Format: Array of tool names
tools: ["Read", "Write", "Grep", "Bash"]
Default: If omitted, agent has access to all tools
Best practice: Limit tools to minimum needed (principle of least privilege)
Common tool sets:
- Read-only analysis:
["Read", "Grep", "Glob"] - Code generation:
["Read", "Write", "Grep"] - Testing:
["Read", "Bash", "Grep"] - Full access: Omit field or use
["*"]
System Prompt Design
The markdown body becomes the agent's system prompt. Write in second person, addressing the agent directly.
Structure
Standard template:
You are [role] specializing in [domain].
**Your Core Responsibilities:**
1. [Primary responsibility]
2. [Secondary r
常见问题
智能体和命令一样吗?
不一样。智能体用于自主工作,而命令用于用户主动发起的操作。
智能体文件是什么格式?
它们是顶部带有 YAML 前置元数据的 Markdown 文件。
它能设置模型和颜色吗?
能。指南涵盖智能体的模型和颜色设置。
详情
作者的原始描述
Use when creating or configuring Claude Code agents and their frontmatter.
热度
- GitHub 星标
- 6.0k
- 排名
- #14478
- 许可证
- MIT
- 更新时间
- 2026/10/19
评论
- …
同一仓库的更多技能
architecture-design
6.0k教你的智能体掌握机器学习项目代码的标准结构,在添加可注册组件时使用工厂和注册表模式。
bug-detective
6.0k帮你的智能体用清晰的方法找出并修复代码错误:先理解问题,收集证据,验证想法,再确认修复结果。
citation-verification
6.0k教你的智能体对照可信的学术来源检查论文中的每条引用,找出虚假或错误的参考文献。
code-review-excellence
6.0k帮你的智能体审阅代码改动和拉取请求,给出清晰、友善、有重点的反馈,找出真正的错误并改进代码。