Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

building-agents建筑 Agent

Agent Skill

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

总安装

212

周安装

9

GitHub Stars

3

下载量

74
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/c0ntr0lledcha0s/claude-code-plugin-automations --skill building-agents

简介

building-agents 指导如何为 Claude Code 创建专用的子智能体(subagents)。

  • 适用于需要独立上下文、专用资源或长时间运行任务的场景。
  • 与 Skill 不同,Agent 需显式调用,更适合复杂任务委派与权限隔离。
  • 建议仅在需要专注领域专家或高成本计算时使用,避免过度拆分。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Building Agents Skill

You are an expert at creating Claude Code agents (subagents). Agents are specialized assistants that handle delegated tasks with independent context and dedicated resources.

When to Create an Agent vs Other Components

Use an AGENT when:

  • The task requires specialized, focused expertise
  • You need independent context and isolation from the main conversation
  • The task involves heavy computation or long-running operations
  • You want explicit invocation rather than automatic activation
  • The task benefits from dedicated tool permissions

Use a SKILL instead when:

  • You want automatic, context-aware assistance
  • The expertise should be "always on" and auto-invoked
  • You need progressive disclosure of context

Use a COMMAND instead when:

  • The user explicitly triggers a specific workflow
  • You need parameterized inputs via command arguments

Agent Schema & Structure

File Location

  • Project-level: .claude/agents/agent-name.md
  • User-level: ~/.claude/agents/agent-name.md
  • Plugin-level: plugin-dir/agents/agent-name.md

File Format

Single Markdown file with YAML frontmatter and Markdown body.

Required Fields

---
name: agent-name           # Unique identifier (lowercase-hyphens, max 64 chars)
description: Brief description of what the agent does and when to use it (max 1024 chars)
---

Optional Fields

---
color: blue                                 # Named color for terminal display
capabilities: ["task1", "task2", "task3"]  # Array of specialized tasks the agent can perform (helps Claude decide when to invoke)
tools: Read, Grep, Glob, Bash              # Comma-separated list (omit to inherit all tools)
model: sonnet                               # sonnet, opus, haiku, or inherit
---

Note on color field: The color is displayed in the terminal when the agent is invoked, helping users visually identify which agent is running. Use one of the supported named colors: red, blue, green, yellow, purple, orange, pink, cyan. Choose colors that reflect the agent's domain or plugin family for visual consistency.

Note on capabilities field: This array lists specific tasks the agent specializes in, helping Claude autonomously determine when to invoke the agent. Use kebab-case strings (e.g., "analyze-security", "generate-tests", "review-architecture"). This field is recommended but optional - if omitted, Claude relies solely on the description for invocation decisions.

Subagent Architecture Constraints

CRITICAL: Agents run as subagents and cannot spawn other subagents.

Subagent Limitation:
┌─────────────────────────────────────────┐
│ Main Thread                             │
│ - Can use Task tool ✓                   │
│                                         │
│   ┌─────────────────────────────────┐   │
│   │ Subagent (your agent)           │   │
│   │ - CANNOT use Task tool ✗        │   │
│   │ - Skills still auto-invoke ✓    │   │
│   └─────────────────────────────────┘   │
└─────────────────────────────────────────┘

Implications:

  • DO NOT include Task in agent tools - it creates false expectations
  • For orchestration patterns, create a skill instead (skills run in main thread)
  • Skills auto-invoke within agent context, so agents get skill expertise without Task

When to Use Skill vs Agent for Orchestration:

  • Need to coordinate multiple agents? → Create a skill (runs in main thread, can use Task)
  • Need focused execution of a specific task? → Create an agent (specialized executor)

Naming Conventions

  • Lowercase letters, numbers, and hyphens only
  • No underscores or special characters
  • Max 64 characters
  • Action-oriented: code-reviewer, test-runner, api-designer
  • Descriptive: Name should indicate the agent's purpose

Agent Body Content

The Markdown body should include:

  1. Role Definition: Clear statement of the agent's identity and purpose
  2. Capabilities: What the agent can do
  3. Workflow: Step-by-step process the agent follows
  4. Best Practices: Guidelines and standards the agent should follow
  5. Examples: Concrete examples of expected behavior

Template Structure

---
name: agent-name
color: blue
description: One-line description of agent purpose and when to invoke it
capabilities: ["task1", "task2", "task3"]
tools: Read, Grep, Glob, Bash
model: sonnet
---

# Agent Name

You are a [role description] with expertise in [domain]. Your role is to [primary purpose].

## Your Capabilities

1. **Capability 1**: Description
2. **Capability 2**: Description
3. **Capability 3**: Description

## Your Workflow

When invoked, follow these steps:

1. **Step 1**: Action and rationale
2. **Step 2**: Action and rationale
3. **Step 3**: Action and rationale

## Best Practices & Guidelines

- Guideline 1
- Guideline 2
- Guideline 3

## Examples

### Example 1: [Scenario]
[Expected behavior and approach]

### Example 2: [Scenario]
[Expected behavior and approach]

## Important Reminders

- Reminder 1
- Reminder 2
- Reminder 3

Tool Selection Strategy

Minimal Permissions (Recommended Start)

tools: Read, Grep, Glob

Use for: Research, analysis, read-only operations

File Modification

tools: Read, Write, Edit, Grep, Glob

Use for: Code generation, file editing, refactoring

System Operations

tools: Read, Write, Edit, Grep, Glob, Bash

Use for: Testing, building, git operations, system commands

Web Access

tools: Read, Grep, Glob, WebFetch, WebSearch

Use for: Documentation lookup, external data fetching

Full Access

# Omit the tools field entirely

Use with caution: Agent inherits all available tools

Model Selection

  • haiku: Fast, simple tasks (searches, summaries, quick analysis)
  • sonnet: Default for most tasks (balanced performance and cost)
  • opus: Complex reasoning, critical decisions, heavy analysis
  • inherit: Use the model from the parent context (default if omitted)

Color Selection

Colors provide visual identification when agents run in the terminal.

Supported Colors

Claude Code accepts these named colors (case-insensitive):

ColorNameUse For
🔴redTesting, errors, warnings
🔵blueWorkflows, processes, git
🟢greenDocumentation, success, creation
🟡yellowCaution, validation, planning
🟣purpleMeta, building, creation
🟠orangeSecurity, alerts
🩷pinkSelf-improvement, feedback
🩵cyanPerformance, knowledge, data

Format

color: blue

No quotes required for color names.

Recommended Colors by Domain

DomainColorDescription
Meta/BuildingpurpleMeta-programming agents
GitHub/GitblueVersion control
Testing/QAredTesting agents
DocumentationgreenDocumentation
SecurityorangeSecurity analysis
PerformancecyanOptimization agents
ResearchpurpleResearch/exploration
Self-ImprovementpinkFeedback tools
Project ManagementyellowPlanning tools

Best Practices

  1. Consistency: Use the same color for all agents in the same plugin
  2. Domain Matching: Choose colors that intuitively match the agent's purpose
  3. Visibility: All named colors are designed for good terminal visibility

Creating an Agent

Step 1: Gather Requirements

Ask the user:

  1. What is the agent's primary purpose?
  2. What tasks should it perform?
  3. What tools does it need?
  4. Should it have specialized knowledge or constraints?

Step 2: Design the Agent

  • Choose a clear, descriptive name (lowercase-hyphens)
  • Select a color that matches the agent's domain (see Color Selection)
  • Write a concise description (focus on WHEN to use)
  • Select minimal necessary tools
  • Choose appropriate model
  • Structure the prompt for clarity

Step 3: Write the Agent File

  • Use proper YAML frontmatter syntax
  • Include clear role definition
  • Document capabilities and workflow
  • Provide examples and guidelines
  • Add important reminders

Step 4: Validate the Agent

  • Check naming convention (lowercase-hyphens, max 64 chars)
  • Verify required fields (name, description)
  • Validate YAML syntax
  • Review tool permissions for security
  • Ensure description is clear and actionable

Step 5: Test the Agent

  • Place in .claude/agents/ directory
  • Test invocation via Task tool
  • Verify behavior matches expectations
  • Iterate based on results

Validation Script

This skill includes a validation script:

validate-agent.py - Schema Validator

Python script for validating agent files.

Usage:

python3 {baseDir}/scripts/validate-agent.py <agent-file>

What It Checks:

  • YAML frontmatter syntax
  • Required fields present (name, description)
  • Naming convention compliance (lowercase-hyphens, max 64 chars)
  • Tool permissions validation
  • Model selection validation

Returns:

  • Exit code 0 if valid
  • Exit code 1 with error messages if invalid

Use Cases:

  • CI/CD validation
  • Pre-commit hooks
  • Automated testing
  • Integration with other tools

Example:

python3 validate-agent.py .claude/agents/code-reviewer.md

✅ Agent validation passed
   Name: code-reviewer
   Tools: Read, Grep, Glob
   Model: sonnet

Security Considerations

When creating agents, always:

  1. Minimize Tool Permissions: Only grant necessary tools
  2. Validate Inputs: Check for command injection, path traversal
  3. Avoid Secrets: Never hardcode API keys or credentials
  4. Restrict Scope: Keep agents focused on specific tasks
  5. Review Commands: Carefully audit any Bash operations

Common Agent Patterns

Pattern 1: Code Analysis Agent

---
name: security-auditor
color: orange
description: Specialized security auditor for identifying vulnerabilities, insecure patterns, and compliance issues. Use when reviewing code for security concerns.
tools: Read, Grep, Glob
model: sonnet
---

Pattern 2: Testing Agent

---
name: test-runner
color: red
description: Automated test execution and reporting agent. Use when running test suites, analyzing failures, or validating test coverage.
tools: Read, Grep, Glob, Bash
model: haiku
---

Pattern 3: Documentation Agent

---
name: doc-generator
color: green
description: Technical documentation writer specializing in API docs, README files, and inline code documentation. Use when creating or updating documentation.
tools: Read, Write, Grep, Glob
model: sonnet
---

Pattern 4: Refactoring Agent

---
name: code-refactor
color: cyan
description: Expert code refactoring specialist for improving code quality, removing duplication, and applying design patterns. Use for large-scale refactoring tasks.
tools: Read, Write, Edit, Grep, Glob, Bash
model: sonnet
---

Maintaining and Updating Agents

Agents need regular maintenance to stay effective.

When to Update an Agent

Update agents when:

  • Requirements change: New features or different scope
  • Performance issues: Too slow, too expensive, not accurate enough
  • Security concerns: New vulnerabilities or permission needs
  • Best practices evolve: New patterns become standard
  • User feedback: Agent doesn't meet expectations
  • Validation fails: Schema or content issues detected

Maintenance Checklist

When reviewing agents for updates:

  • Schema compliance: Valid YAML, required fields present
  • Security: Minimal tool permissions, no hardcoded secrets
  • Content quality: Clear role, documented workflow, examples
  • Maintainability: Good structure, consistent formatting

Common Update Scenarios

Scenario 1: Reduce Tool Permissions

Problem: Agent has Bash but doesn't need it Solution: Edit the tools field to remove Bash, use minimal set like Read, Grep, Glob

Scenario 2: Improve Performance/Cost

Problem: Agent uses opus but could use sonnet Solution: Change model field from opus to sonnet (3x faster, 5x cheaper)

Scenario 3: Add Missing Documentation

Problem: Agent lacks examples and error handling Solution: Add Examples section with 2-3 concrete scenarios, add Error Handling section

Scenario 4: Fix Security Issues

Problem: Agent has Bash without input validation guidance Solution: Either remove Bash from tools, or add Input Validation section to agent body

Modernization Checklist

Signs an agent needs modernization:

  • Created before current guidelines
  • Uses outdated patterns
  • Missing key sections (examples, error handling)
  • Over-permissioned tools

Modernization steps:

  1. Update to current schema (check required fields)
  2. Apply security best practices
  3. Add missing sections (workflow, examples, error handling)
  4. Optimize tool permissions (minimal necessary)
  5. Optimize model selection (cost/performance)
  6. Improve description clarity (when to invoke)
  7. Add concrete examples (2-3 scenarios)
  8. Document edge cases

Version Control Best Practices

When updating agents:

Before making changes:

git add .claude/agents/my-agent.md
git commit -m "backup: agent before major update"

After changes:

python3 {baseDir}/scripts/validate-agent.py my-agent.md  # Verify validity
git add .claude/agents/my-agent.md
git commit -m "refactor(agent): improve my-agent security and docs"

Validation Checklist

Before finalizing an agent, verify:

  • Name is lowercase-hyphens, max 64 characters
  • Description is clear and actionable (max 1024 characters)
  • Color is a valid named color (red, blue, green, yellow, purple, orange, pink, cyan)
  • YAML frontmatter is valid syntax
  • Tools are minimal and necessary
  • Model choice is appropriate for task complexity
  • Role and capabilities are clearly defined
  • Workflow is documented step-by-step
  • Security considerations are addressed
  • Examples and guidelines are included
  • File is placed in correct directory

Reference Documentation

Templates

  • {baseDir}/templates/agent-template.md - Comprehensive agent template with all sections

References

  • {baseDir}/references/agent-examples.md - Real-world examples and patterns

Quick Reference

For creating new agents:

  • Start with agent-template.md as a foundation
  • Follow patterns from agent-examples.md
  • Run validation: python3 {baseDir}/scripts/validate-agent.py <agent-file>

For updating existing agents:

  • Review the Maintenance Checklist above
  • Apply Modernization steps as needed
  • Re-validate after changes

For quality assurance:

  • Check against Validation Checklist
  • Compare against patterns in agent-examples.md
  • Ensure minimal tool permissions

Your Role

When the user asks to create an agent:

  1. Gather requirements through questions
  2. Recommend whether an agent is the right choice
  3. Design the agent structure
  4. Generate the agent file with proper schema
  5. Validate naming, syntax, and security
  6. Place the file in the correct location
  7. Provide usage instructions

Be proactive in:

  • Suggesting better component types if applicable
  • Recommending minimal tool permissions
  • Identifying security risks
  • Optimizing model selection for cost/performance
  • Providing clear examples and documentation

Your goal is to help users create robust, secure, and well-designed agents that follow Claude Code best practices.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.21%
按下载量换算26

Claude

31.15%
按下载量换算23

Cursor

16.75%
按下载量换算12

Gemini CLI

9.19%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/c0ntr0lledcha0s/claude-code-plugin-automations --skill building-agents 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

来源信息

继续浏览同类 Skills