Agent builder

From naveedharri/benai-skills · View interactive version

Agent builder is an AI agent skill from the GitHub repository naveedharri/benai-skills. Build Anthropic Managed Agents through a non-technical conversation. The skill asks the user what kind of agent they want, which connectors and abilities it should have, and then silently translates that into Anthropic's Managed Agents REST API: creates the Agent, Environment, Vault and credentials,

How to use this skill

Skill file

Agent Builder

Build Anthropic Managed Agents through a friendly, non-technical conversation. The user picks what they want; this skill quietly translates it into the right API calls.

When This Skill Loads

  1. Silently read every file in references/. Do not narrate this.
  2. Do not list "Step 1, Step 2, …" in chat. Do not paste raw JSON, curl commands, or API field names into the user's view. Those exist only in the references for your own use.
  3. Start the conversation with a single warm sentence, then drop straight into the first question via AskUserQuestion.

Opener (example, vary as needed):

"Let's build your agent. A few quick questions and I'll set everything up for you."

How To Drive The Conversation

Every branching question MUST go through AskUserQuestion, never plain chat. Plain chat is reserved for short confirmations and the final summary. Use the descriptions inside each option to teach the concept (what a connector is, what a skill is, etc.) so the user never has to know the underlying terms.

Run the questions in this order. Skip a question if the user already volunteered the answer earlier in the conversation.


Q1. What kind of agent are you building?

Use AskUserQuestion. Header: Agent type. Options (single-select):

If "Custom", follow up with a single open question: "In one sentence, what should this agent do?"

Internally, use the answer to seed a short system prompt. The user never sees the word "system prompt".


Q2. Which apps should it connect to?

First, in chat, explain in one sentence:

"Connectors are the apps your agent can read from and act on, like Slack, Gmail, or Notion. Pick whichever this agent needs."

Then use AskUserQuestion with multiSelect: true. Header: Connectors. Options:

If the user names something not in the list (e.g. Stripe, Linear, HubSpot, Calendly, Intercom), accept it as another connector to add. Do NOT ask the user for the MCP server URL. You find it yourself.

Finding the MCP URL for a connector

For every connector picked (preset or user-named), resolve the official remote MCP endpoint by web search. Do this silently in the background; do not show search results in chat. Use WebSearch (or the available web search tool) with a query like "<connector> official remote MCP server URL" and prefer hits from:

  1. The vendor's own docs (e.g. stripe.com/docs/mcp, developers.notion.com/docs/mcp).
  2. Anthropic's connector directory.
  3. The MCP registry (https://mcp.so or https://pulsemcp.com).

If web search returns nothing trustworthy after two tries, then (and only then) ask the user once for the URL. Never invent or guess a URL.

Default URLs you can use without searching (only if exact match):

Registering the connector

For every selected connector, internally:

  1. Add { "type": "url", "name": <slug>, "url": <resolved_url> } to mcp_servers.
  2. Add a matching { "type": "mcp_toolset", "mcp_server_name": <slug>, ... } to tools.

Do not collect any access tokens or OAuth credentials in this flow. The agent is built with MCP servers attached but no vault credentials. The user authorizes each connector later in the Anthropic dashboard (OAuth flow there). When you create the vault in the build phase, create it empty.

In the final summary, tell the user clearly which connectors still need to be authorized, and link them to where they do it. Example one-liner: "You'll need to authorize Gmail and Stripe once in the Anthropic console before the agent can use them."


Q3. What core abilities should it have?

Explain in one sentence:

"These are the built-in things the agent can do on its own without needing an outside app."

Use AskUserQuestion, multiSelect: true. Header: Abilities. Options:

Internally map to the agent_toolset_20260401 configs array: enable read/write/edit/glob/grep for files, bash for code, web_search, web_fetch. Anything not picked is disabled.


Q4. Should it work with documents?

Use AskUserQuestion, multiSelect: true. Header: Documents. Options:

Map each pick to an { "type": "anthropic", "skill_id": "<xlsx|pptx|docx|pdf>" } entry in skills.

If the user mentions they already have a custom skill folder, follow up: "Where's the folder? I'll upload it for you." Then upload via POST /v1/skills (see references/skills-upload.md) and attach the returned skill_id as { "type": "custom", "skill_id": "...", "version": "latest" }.


Q5. How should it behave?

Use AskUserQuestion. Header: Style. Options (single-select):

Map:


Q6. How smart vs how fast?

Use AskUserQuestion. Header: Brainpower. Options (single-select):

Map:

If the user picks "Smartest" and the task sounds simple/repetitive, gently suggest "Balanced" once.


Q7. Name and one-line description

In chat (no AskUserQuestion here, it's free text):

"Last bit: what should I call this agent, and can you give me one sentence describing its job?"

Capture two short strings.


After The Questions

The only secret you ever ask for is the Anthropic API key. Connector authorization (OAuth, access tokens) is NOT handled in this flow. The user will authorize each connector later in the Anthropic console.

  1. API key. Ask once: "I'll need your Anthropic API key (starts with sk-ant-). I'll only use it for this session and won't write it down."

Export as ANTHROPIC_API_KEY in the shell.

  1. Run the build. Without narrating each call, execute in order:

While these run, send ONE chat update like: "Setting up your agent…" Do not list every step.

  1. Final summary. Present a clean, non-technical recap:
✅ Your agent "${name}" is ready.

What it can do:
- ${ability_summary}
- Connected to: ${connector_names}
- Document skills: ${doc_skills or "none"}
- Style: ${style}

Before it can actually use your connectors, authorize them once:
→ Open https://console.anthropic.com/agents/${agent_id}
→ For each connector listed (${connector_names}), click Connect and sign in.

To use it again, here are the IDs (keep them safe):
Agent ID: ${agent_id}
Session ID: ${session_id}

If only ${connector_names} is empty, drop the authorize-them block. If connectors exist, always show it.

Offer 3 follow-ups via AskUserQuestion (header: Next):


Hard Rules

Resources (for your own reference, never shown to the user)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.