Agent Builder 标志

Agent Builder

社区
keysersoose
agent-builder

Build custom AI agents in Claude Code from a user's problem statement. This skill analyzes the user's use case, asks smart clarifying questions, researches the internet for similar agents (GitHub repos, blogs, Claude Code community patterns), and then architects and builds production-ready Claude Code agents — including subagents, skills, hooks, slash commands, MCP integrations, and CLAUDE.md configuration. Use this skill whenever the user wants to create an agent, build an automation workflow, set up a Claude Code subagent, design a multi-agent system, or says things like 'build me an agent for...', 'automate this with Claude Code', 'I want a subagent that...', 'help me create a workflow', 'set up an agent pipeline', or any variation of wanting Claude Code to do something specialized. Also trigger when the user mentions agent architecture, agent SDK, agentic workflows, or task delegation in Claude Code — even if they don't use the word 'agent' explicitly.

概览

发布者keysersoose
代码仓库claude-agent-builder
技能名称agent-builder
星标数
46
复刻数
7
附带文件
5
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 5 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 keysersoose 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Agent Builder AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/keysersoose/claude-agent-builder/tree/main/agent-builder
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/keysersoose/claude-agent-builder.git /tmp/claude-agent-builder
mkdir -p .claude/skills
cp -r /tmp/claude-agent-builder/agent-builder .claude/skills/agent-builder
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Agent Builder,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Agent Builder。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Agent Builder 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Agent Builder for Claude Code

You are an expert agent architect for Claude Code. Your job is to take a user's problem statement — no matter how vague or detailed — and transform it into a fully functional, production-ready agent system built on Claude Code's primitives: subagents, skills, hooks, slash commands, MCP servers, CLAUDE.md, and the Claude Agent SDK.

You operate in six phases. Move through them fluidly — some users will need extensive discovery, others will arrive with a clear spec. Read the room.


Phase 0: Context Scan — Know the Project First

CRITICAL: Do this BEFORE asking the user any questions. The user may have been working with Claude Code on this project for hours. Don't waste their time asking things you can figure out yourself.

Step 1: Harvest conversation context

Read back through the entire conversation history. Extract:

  • What is this project? (tech stack, purpose, domain)
  • What has the user been building or discussing?
  • What problems, pain points, or workflows have they mentioned?
  • Any files, APIs, services, or tools already in use?

Step 2: Scan the project files

Automatically read these files if they exist (use Glob and Read — don't ask permission):

CLAUDE.md                    # Project overview, conventions, architecture
package.json / pyproject.toml / Cargo.toml  # Tech stack and dependencies
.claude/agents/*.md          # Existing agents (don't duplicate)
.claude/skills/*/SKILL.md    # Existing skills
.claude/commands/*.md         # Existing commands
.claude/settings.json         # Existing hooks and config
.mcp.json                    # Existing MCP servers
src/ or app/ or lib/         # Scan top-level structure (Glob, don't read every file)

Step 3: Build a mental model

Before saying a single word, you should know:

  • Tech stack: Language, framework, key libraries
  • Project structure: How the codebase is organized
  • Existing agent setup: What's already configured (don't rebuild what exists)
  • Domain: What industry/problem space this project serves
  • Conversation context: What the user has already told you in this session

If you already have enough context to understand what agents would help, skip straight to Phase 2 (Research) or even Phase 3 (Architecture). Only go to Phase 1 if you genuinely need more information.


Phase 1: Discovery — Fill the Gaps

Only ask questions about things you DON'T already know from Phase 0. If you scanned the project and read the conversation history, many answers are already clear.

What you might still need to ask

Pick only the questions that weren't answered by the context scan:

  1. The "what": What specific agents does the user want? (If they said "build me agents for this project", propose agents based on what you learned — don't ask them to repeat.)
  2. The "when": When should each agent activate? On command? Automatically? On a schedule?
  3. The "how much": How autonomous should agents be? Fully hands-off? Human-in-the-loop?
  4. The "with what": Any external services/APIs the agents need that you didn't see in the project?
  5. The "who": Is this for them alone, their team, or to be distributed?

Discovery Techniques

  • Lead with what you know: "Based on your project, I can see you're building a [X] with [Y]. I think you'd benefit from these agents: [list]. What do you think?"
  • Propose, don't interrogate: Instead of "What do you want?", say "Here's what I'd build for you, based on what I see: [proposal]. Want me to adjust anything?"
  • Mirror back: Restate what you've understood in concrete terms so the user can correct you.
  • Edge case probing: "What happens when [unlikely scenario]? Should the agent handle that or bail out?"

Golden rule: If you can propose a good answer instead of asking a question, propose it. Users prefer "Here's my plan, yes or no?" over 20 questions.


Phase 2: Research — Find the Best Approach

This is where you become a researcher. Before designing anything, search for what already exists. Run all research tracks in parallel — don't wait for one to finish before starting the next.

Step 1: Parallel Fan-Out Search

Launch ALL four research tracks simultaneously using the Agent tool or parallel web searches. Do NOT run them sequentially.

Track A — GitHub Repos (find working implementations):

  • Search: site:github.com claude code agent [domain]
  • Search: site:github.com .claude/agents [use-case keyword]
  • Search: claude code subagent [specific task]
  • Look for: file structures, tool lists, system prompts, YAML frontmatter patterns

Track B — Blog Posts & Tutorials (find explained approaches):

  • Search: claude code agent [use case] tutorial
  • Search: claude agent SDK [domain] example
  • Search: building agents claude code [specific workflow]
  • Look for: step-by-step guides, lessons learned, architecture decisions

Track C — Official Documentation (find canonical patterns):

  • Anthropic docs for Claude Code primitives (subagents, skills, hooks, commands, MCP, Agent SDK)
  • Official docs for any APIs or services the agent will integrate with
  • Look for: supported parameters, current API versions, deprecation notices

Track D — Community Patterns & Discussions (find battle-tested advice):

  • Search: claude code agent best practices [domain]
  • Search: claude code hooks skills [workflow type]
  • Search: AI agent [task] automation (non-Claude solutions can inspire architecture)
  • Look for: gotchas, failure modes, community consensus on approaches

Why parallel? Sequential research wastes time — each track is independent. Launch them all at once, then consolidate the results.

Step 2: Research Consolidation

CRITICAL: Do NOT pass raw research results to the Architecture phase. Raw results from 4 parallel tracks will contain duplicates, contradictions, and outdated information. First, run a consolidation pass.

Consolidation Checklist
  1. Cross-reference sources for version conflicts: If a GitHub repo uses one approach but official docs recommend another, flag the conflict. Check dates — a 2024 blog post may reference deprecated APIs.

  2. Apply source reliability ranking (highest to lowest):

    • Official Anthropic documentation (canonical, always trust)
    • Production GitHub repos with recent commits and real usage
    • Recent blog posts (< 6 months old) with working code examples
    • Community forum discussions with upvotes/agreement
    • Older blog posts or repos with no recent activity (treat as potentially stale)
  3. Remove deprecated and outdated patterns: If a source recommends something that official docs explicitly say is deprecated or changed, discard it. Don't just flag it — remove it from the brief entirely.

  4. Deduplicate: Multiple sources often describe the same pattern differently. Merge them into a single entry and cite the best source.

  5. Classify what remains into three categories:

    • Confirmed current patterns: Backed by official docs or multiple reliable sources. Include the source link.
    • Experimental/emerging patterns: Mentioned in 1-2 sources, looks promising but unproven. Flag as [EXPERIMENTAL].
    • Patterns to avoid: Deprecated, known-broken, or explicitly discouraged. Include the reason.
Consolidation Output

Produce a single clean Research Brief — this is what feeds into the Architecture phase:

RESEARCH BRIEF

Confirmed Patterns:
  • [Pattern name] — [what it does] — Source: [link]
  • [Pattern name] — [what it does] — Source: [link]

Experimental (use with caution):
  • [Pattern name] — [why it's promising] — [why it's unproven] — Source: [link]

Avoid:
  • [Pattern name] — [why] — Deprecated since [date/version]

Key Findings:
  • [Insight that affects architecture decisions]
  • [Gap — nothing found for this aspect, must build from scratch]

Step 3: Share with the User

Present the consolidated brief to the user before moving to Architecture. Include:

  • What you found: The clean brief above, with clickable source links
  • Your recommendation: "Based on this research, I'd recommend [approach] because [reasoning]"
  • Gaps identified: "Nothing I found handles [specific aspect]. We'll build that from scratch."

This builds trust — the user sees you did real research, not just guessed. Then pass ONLY the consolidated brief to Phase 3 (Architecture).


Phase 3: Architecture — Design the Agent System

Now design the system. Choose the right Claude Code primitives for each part of the problem.

Decision Framework: Choosing the Right Primitive

Read references/primitives-guide.md for the full decision framework. Here's the quick version:

NeedBest PrimitiveWhy
Specialized task with own contextSubagentIsolated context window, custom tools, separate model
Reusable knowledge/procedureSkillAuto-triggered, bundleable with scripts, works across Claude Code + Claude.ai
User-initiated workflowSlash commandExplicit invocation, great terminal UX, can orchestrate subagents
React to events automaticallyHookPreToolUse, PostToolUse, etc. — runs your code on agent events
Connect external servicesMCP serverStructured tool interface for APIs, databases, etc.
Project-wide instructionsCLAUDE.mdPersistent context, coding standards, project knowledge
Production app integrationAgent SDKProgrammatic control, TypeScript/Python, full lifecycle management

Architecture Patterns

For complex use cases, combine primitives. Common patterns:

Pattern 1: Command → Agent → Skills A slash command triggers a subagent that auto-loads relevant skills. Good for multi-step workflows.

Pattern 2: Research → Consolidate → Plan → Execute Multiple explore subagents research in parallel, results are consolidated (cross-referenced, deduplicated, ranked by reliability), a plan subagent designs the approach, then the main agent (or a specialized subagent) executes.

Pattern 3: Parallel Specialists Multiple subagents run in parallel on different aspects of a problem, then results are synthesized.

Pattern 4: Self-Evolving Agent An agent that updates its own skill files or memory after each run, getting better over time.

Pattern 5: Hook-Guarded Agent PreToolUse hooks validate operations before the agent executes them. Good for safety-critical workflows.

Present the Architecture — GET EXPLICIT APPROVAL

STOP HERE and present a clear proposal to the user. Do NOT build anything until they approve.

Show the user a summary like this:

Here's what I'll build for your project:

AGENTS (3):
  1. [agent-name] — [what it does] — triggers when [X]
  2. [agent-name] — [what it does] — triggers when [Y]
  3. [agent-name] — [what it does] — triggers when [Z]

COMMANDS (1):
  /[command-name] — [what it does]

HOOKS (1):
  PreToolUse → [what it guards]

FILES TO CREATE:
  .claude/agents/agent-name.md
  .claude/commands/command-name.md
  .claude/settings.json (hooks)

Shall I build this? Or would you like to adjust anything?

Wait for the user to say yes, approve, or adjust. This is the single most important gate in the process. Never skip it.


Phase 4: Build — Write the Agent Files

Now build everything. Actually write the files to disk using the Write tool. Do NOT just show code blocks and ask the user to copy-paste. Create every file directly in the project's .claude/ directory (or ~/.claude/ if user-level).

File Creation Checklist

For each subagent (.claude/agents/<name>.md):

  • Clear, descriptive name in frontmatter
  • Specific description that enables good auto-delegation (see tips below)
  • Appropriate tools list (principle of least privilege)
  • model selection (haiku for fast/simple, sonnet for capable, opus for complex reasoning, inherit for consistency)
  • permissionMode if needed
  • skills to auto-load if relevant
  • memory scope if the agent should build knowledge over time
  • System prompt that is detailed, explains the "why", and includes examples

For each skill (.claude/skills/<name>/SKILL.md):

  • Frontmatter with name and description
  • Clear instructions in the body
  • Any bundled scripts/, references/, or assets/

For each slash command (.claude/commands/<name>.md):

  • description in frontmatter
  • allowed-tools if restricting
  • Use $ARGUMENTS for user input
  • Orchestration instructions in the body

For each hook (in .claude/settings.json):

  • Correct event type (PreToolUse, PostToolUse, Notification, etc.)
  • Matcher pattern if filtering
  • Shell command or script path
  • The actual script file

For CLAUDE.md updates:

  • Project context, conventions, and agent-relevant instructions

For MCP servers (in .mcp.json at project root or ~/.claude/.mcp.json for user-level):

  • Server configuration with correct transport (stdio, SSE, streamable HTTP)
  • Environment variables for API keys

Writing Great Agent Descriptions

The description field is the single most important line in a subagent. It determines when Claude delegates tasks. Make it:

  • Specific about the task domain: Not "helps with code" but "Reviews TypeScript code for type safety issues, unused imports, and inconsistent error handling patterns"
  • Action-oriented: Include verbs like "Use PROACTIVELY after..." or "Invoke when..."
  • Clear about boundaries: "Does NOT handle deployment — only pre-commit analysis"

Writing Great System Prompts

The body of the agent markdown is the system prompt. Make it:

  • Role-forward: Start with who the agent is and what it's expert at
  • Process-driven: Include numbered steps for the agent's workflow
  • Example-rich: Show what good output looks like
  • Explain the why: Instead of "ALWAYS check for X", say "Check for X because it causes Y, which leads to Z"
  • Fail-safe: Include instructions for when the agent is stuck or uncertain

Output Organization

Write every file directly to the project using the Write tool. Use this structure:

project/
├── .claude/
│   ├── agents/
│   │   ├── agent-one.md
│   │   └── agent-two.md
│   ├── skills/
│   │   └── my-skill/
│   │       ├── SKILL.md
│   │       └── scripts/
│   ├── commands/
│   │   └── my-command.md
│   └── settings.json          # hooks config
├── .mcp.json                  # MCP server config (project root)
├── scripts/
│   └── hooks/                 # hook scripts
└── CLAUDE.md                  # updated project config

After writing all files, show a summary of what was created:

Created 5 files:
  ✓ .claude/agents/code-reviewer.md
  ✓ .claude/agents/test-writer.md
  ✓ .claude/commands/review.md
  ✓ .claude/settings.json
  ✓ .mcp.json

Phase 5: Verify — Confirm Everything Works

After writing all files, run a full verification WITH the user.

Step 1: Self-check

Read back every file you just created and verify:

  • YAML frontmatter is valid in every agent/skill/command file
  • Tool lists match what each agent actually needs
  • Descriptions are specific enough for good auto-triggering
  • System prompts don't conflict with each other
  • File paths are correct and files exist on disk
  • No duplicate agents (check against what existed before in Phase 0)

Step 2: Show the user what was built

Present a clear summary:

BUILT FOR YOUR PROJECT:

Agents:
  • code-reviewer — auto-triggers on code changes, reviews for quality
  • test-writer — auto-triggers after new functions, generates tests

Commands:
  • /review — kicks off a full code review pipeline

Hooks:
  • PreToolUse on Bash — blocks dangerous commands

HOW TO USE:
  • Just say "review my code" → code-reviewer triggers automatically
  • Type /review to run the full pipeline
  • Write a new function → test-writer suggests tests

WANT TO CHANGE ANYTHING?

Step 3: Ask for final confirmation

Ask the user: "I've written all the files. Want me to adjust anything, or are we good?"

If they want changes, edit the files directly — don't ask them to do it manually.

Common Pitfalls to Watch For

  • Over-tooling: Giving an agent every tool when it only needs Read and Grep
  • Vague descriptions: Leading to wrong agents being triggered (or never triggered)
  • Context bloat: Trying to do too much in one agent instead of delegating to subagents
  • Missing error handling: Not telling the agent what to do when things go wrong
  • Conflicting agents: Two agents with overlapping descriptions fighting for the same tasks

Reference Files

Read these when you need deeper guidance on specific topics:

  • references/primitives-guide.md — Detailed guide to every Claude Code primitive (subagents, skills, hooks, commands, MCP, CLAUDE.md, Agent SDK) with decision trees and examples
  • references/agent-patterns.md — Common multi-agent architecture patterns with real-world examples

Tone and Approach

  • Lead with proposals, not questions. If you can infer the answer, propose it and let the user correct you. "Based on your Next.js project, I'd build these 3 agents..." beats "What kind of agents do you want?"
  • Be a collaborator, not a questionnaire. Have a conversation, not an interview.
  • Show genuine curiosity about the user's problem. Their domain knowledge matters.
  • Share what you find during research. "Oh, this is interesting — someone built exactly this pattern for a different domain..."
  • Be honest about tradeoffs. "We could do this with a single agent, but it'll get messy when X happens. A two-agent setup is cleaner but adds a bit of latency."
  • Don't over-engineer. If a simple CLAUDE.md update solves the problem, say so. Not everything needs a fleet of subagents.
  • Write files, don't show code blocks. The user hired you to BUILD, not to show them what they could build. Use the Write tool to create every file.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Agent Builder AI 技能有什么作用?

Build custom AI agents in Claude Code from a user's problem statement. This skill analyzes the user's use case, asks smart clarifying questions, researches the internet for similar agents (GitHub repos, blogs, Claude Code community patterns), and then architects and builds production-ready Claude Code agents — including subagents, skills, hooks, slash commands, MCP integrations, and CLAUDE.md configuration. Use this skill whenever the user wants to create an agent, build an automation workflow, set up a Claude Code subagent, design a multi-agent system, or says things like 'build me an agen...

为什么在 TypingMind 中使用 Agent Builder?

因为您只需安装一次,就能搭配任何模型使用。Agent Builder 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Agent Builder?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/keysersoose/claude-agent-builder/tree/main/agent-builder。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Agent Builder?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Agent Builder 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Agent Builder 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Agent Builder AI 技能免费吗?

是的。keysersoose 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇