Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

create-custom-agent创建自定义 Agent

Agent Skill

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

总安装

5,033

周安装

214

GitHub Stars

1,531

下载量

1,763
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/dotnet/skills --skill create-custom-agent

简介

create-custom-agent 用于创建 VS Code 自定义代理文件,定义专用 AI 角色和工具集配置。

  • 它支持代理间交接和多步工作流,可限制工具使用范围以适应特定任务角色。
  • 适用于复杂开发流程中分工协作,如规划者、审查者等专业角色分离。
  • 不适用于纯指令文件创建,应配合 .agent.md 前端元数据和系统上下文使用。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Create Custom Agent

This skill helps you create VS Code custom agent files that define specialized AI personas for development tasks. Custom agents configure which tools are available, provide specialized instructions, and can chain together via handoffs.

When to Use

  • Creating a new custom agent from scratch
  • Scaffolding an .agent.md file with proper frontmatter
  • Setting up agent-to-agent handoffs for multi-step workflows
  • Configuring tool restrictions for specialized roles (planner, reviewer, etc.)
  • Creating workspace-shared or user-profile agents

When Not to Use

  • Creating instruction files (use .instructions.md instead)
  • Creating reusable prompts (use .prompt.md instead)
  • Modifying existing agents (edit the file directly)

Inputs

InputRequiredDescription
Agent nameYesDescriptive name for the agent (e.g., planner, code-reviewer)
DescriptionYesBrief description shown as placeholder text in chat
Purpose/PersonaYesWhat role the agent plays and how it should behave
ToolsRecommendedList of tools or tool sets the agent can use
HandoffsOptionalNext-step agents to transition to after completing work

Workflow

Step 1: Create the agent file

Create a file with .agent.md extension in the agents/ directory:

agents/<agent-name>.agent.md

Step 2: Add YAML frontmatter

Add the header with required and optional fields:

---
name: <agent-name>
description: <brief description for chat placeholder>
tools:
  - <tool-name>
  - <tool-set-name>
---

Available frontmatter fields:

FieldRequiredDescription
nameNoDisplay name (defaults to filename)
descriptionYesPlaceholder text shown in chat input
argument-hintNoHint text guiding user interaction
toolsNoList of available tools/tool sets
agentsNoList of allowed subagents (* for all, [] for none)
modelNoAI model name or prioritized array of models
handoffsNoList of next-step agent transitions
user-invokableNoShow in agents dropdown (default: true)
disable-model-invocationNoPrevent subagent invocation (default: false)
targetNoTarget environment: vscode or github-copilot
mcp-serversNoMCP server configs for GitHub Copilot target

Step 3: Configure tools

Specify which tools the agent can use:

tools:
  - search              # Built-in tool
  - fetch               # Built-in tool
  - codebase            # Tool set
  - myServer/*          # All tools from MCP server

Common tool patterns:

  • Read-only agents: ['search', 'fetch', 'codebase']
  • Full editing agents: ['*'] or specific editing tools
  • Specialized agents: Cherry-pick specific tools

Step 4: Add handoffs (optional)

Configure transitions to other agents:

handoffs:
  - label: Start Implementation
    agent: implementation
    prompt: Implement the plan outlined above.
    send: false
    model: GPT-5.2 (copilot)

Handoff fields:

  • label: Button text displayed to user
  • agent: Target agent identifier
  • prompt: Pre-filled prompt for target agent
  • send: Auto-submit prompt (default: false)
  • model: Optional model override for handoff

Step 5: Write agent instructions (body)

Add the agent's behavior instructions in Markdown:

You are a security-focused code reviewer. Your job is to:

1. Analyze code for security vulnerabilities
2. Check for common security anti-patterns
3. Suggest secure alternatives

## Guidelines

- Focus on OWASP Top 10 vulnerabilities
- Flag hardcoded secrets immediately
- Review authentication and authorization logic

## Reference other files

See [security guidelines](../security.md) for standards.

Tips for instructions:

  • Use Markdown links to reference other files
  • Reference tools with #tool:<tool-name> syntax
  • Be specific about agent behavior and constraints

Step 6: Validate the agent

Verify the agent loads correctly:

  1. Open Command Palette (Ctrl+Shift+P)
  2. Run "Chat: New Custom Agent" or check agents dropdown
  3. Use "Diagnostics" view (right-click in Chat view) to check for errors

Template

---
name: <agent-name>
description: <brief description for chat placeholder>
argument-hint: <optional hint for user input>
tools:
  - <tool-1>
  - <tool-2>
handoffs:
  - label: <button-text>
    agent: <target-agent>
    prompt: <pre-filled-prompt>
    send: false
---

# <Agent Title>

<One paragraph describing the agent's persona and purpose.>

## Role

<Describe the agent's specialized role and expertise.>

## Guidelines

- <Guideline 1>
- <Guideline 2>
- <Guideline 3>

## Workflow

1. <Step 1>
2. <Step 2>
3. <Step 3>

## Constraints

- <Constraint 1>
- <Constraint 2>

Example Agents

Planning Agent

---
name: planner
description: Generate an implementation plan
tools:
  - search
  - fetch
  - codebase
handoffs:
  - label: Start Implementation
    agent: implementation
    prompt: Implement the plan above.
---

# Planning Agent

You are a solution architect. Generate detailed implementation plans.

## Guidelines

- Analyze requirements thoroughly before planning
- Break work into discrete, testable steps
- Identify dependencies and risks
- Do NOT make code changes

Code Review Agent

---
name: code-reviewer
description: Review code for quality and security issues
tools:
  - search
  - codebase
---

# Code Review Agent

You are a senior engineer performing code review.

## Focus Areas

- Security vulnerabilities
- Performance concerns
- Code maintainability
- Test coverage gaps

## Output Format

Provide findings as:
1. **Critical**: Must fix before merge
2. **Warning**: Should address
3. **Suggestion**: Nice to have

Validation Checklist

  • File has .agent.md extension
  • File is in agents/ directory
  • YAML frontmatter is valid (proper indentation, no syntax errors)
  • Description is non-empty and descriptive
  • Tools list contains only available tools
  • Handoff agent names match existing agents
  • Instructions are clear and actionable
  • Agent appears in agents dropdown

Common Pitfalls

PitfallSolution
Agent not appearing in dropdownCheck file is in agents/ directory with .agent.md extension
YAML syntax errorsValidate frontmatter indentation and quoting
Tools not workingVerify tool names exist; unavailable tools are ignored
Handoffs not showingTarget agent must exist; check agent identifier
Instructions too vagueBe specific about role, constraints, and workflow
Agent invoked as subagent unexpectedlySet disable-model-invocation: true
Want agent only as subagentSet user-invokable: false

References

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

37.45%
按下载量换算660

Claude

29.65%
按下载量换算523

Cursor

19.57%
按下载量换算345

Gemini CLI

8.96%
按下载量换算158

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills