ai
Use when calling the app's AI gateway from agent tools — chat completions, embeddings, listing models, configuring defaults or BYOK, reading token/cost usage
Use when designing, deploying, or debugging a Butterbase Agent (declarative LLM/tool graph), registering an MCP server for tool use, or wiring access controls and rate limits. Agents are first-class app resources defined by a `graph_spec` and invoked over
$ npx -y skills add butterbase-ai/butterbase-skills --skill agents --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/agentsContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when designing, deploying, or debugging a Butterbase Agent (declarative LLM/tool graph), registering an MCP server for tool use, or wiring access controls and rate limits. Agents are first-class app resources defined by a `graph_spec` and invoked over
name: agents description: Use when designing, deploying, or debugging a Butterbase Agent (declarative LLM/tool graph), registering an MCP server for tool use, or wiring access controls and rate limits. Agents are first-class app resources defined by a `graph_spec` and invoked over `/v1/<app_id>/agents/<name>/runs`.
A Butterbase agent is a **declarative graph** of LLM and tool nodes — not a free-running chat loop. The runtime traverses the graph, calls tools (builtin / MCP / function), and resolves the `end` node's `output_template`. State, rate limits, and budgets are enforced by the control plane.
Don't use for plain LLM chat completions — use the `ai` skill (`manage_ai` / `/v1/ai/chat`). Agents are for stateful, multi-step, tool-using workflows.
| Field | Required | Notes | |---|---|---| | `spec_version` | yes | Literal `"1"`. | | `entry` | yes | ID of the first node. | | `nodes` | yes | Record `{ id → node }`. | | `edges` | yes | `[{ from, to }]`. Both endpoints must exist in `nodes`. | | `tools` | yes | `{ builtin: [], mcp_servers: [], functions: [] }` — declares what nodes can call. | | `limits` | yes | `max_steps` (1–200), `max_tool_calls` (0–500), `max_parallel_tools` (1–16), `timeout_seconds` (5–3600), `human_timeout_seconds` (60–7×24×3600). |
**Node types:**
**`toolRef`** is a discriminated union by `source`:
Each may carry `mode_override` (`read_only` | `read_write`) and `exposed_to_override` (`developer_only` | `end_user`).
| Name | Purpose | Args | |---|---|---| | `query_table` | Select rows (RLS enforced) | `table`, `filter`, `limit` (≤200) | | `insert_row` | Insert | `table`, `values` | | `update_row` | Update by id | `table`, `id`, `patch` | | `delete_row` | Delete by id | `table`, `id` | | `read_storage` | Get object (≤5 MB) | `key` | | `write_storage` | Put object (≤1 MB b64) | `key`, `content_base64`, `content_type?` | | `auth_user_lookup` | Find a user | `email` OR `id` |
All builtins respect role: `end_user` runs as `butterbase_user` with their user id (RLS applies); `developer_only` runs as `butterbase_service`.
Register before referencing in `graph_spec.tools.mcp_servers`. Transports: `sse`, `http`, `streamable_http`. The control plane **probes** on register (calls `listTools()`), stores `status='healthy'|'unhealthy'`. Re-probe with the same endpoint after a server URL change.
| Field | Default | Notes | |---|---|---| | `visibility` | `private` | `private` (owner only), `authenticated` (any app user), `public` (anyone, with rate limits). | | `max_runs_per_user_per_hour` | null | null = unlimited. | | `max_runs_per_ip_per_hour` | null | Primary public-agent throttle. | | `max_runs_per_app_per_hour` | null | App-wide cap. | | `daily_budget_usd` | null | Hard kill once exceeded. | | `max_concurrent_runs` | null | | | `safety_acknowledged` | false | **Required true** if visibility ≠ private AND any node calls a write tool (`insert_row`, `update_row`, `delete_row`, `write_storage`, or a write-mode MCP/function tool). |
1. **Sketch the graph in prose first.** "User asks X → LLM rephrases → query_table for context → LLM answers → end." Concrete node IDs. 2. **Write the spec** as a JSON file in the repo (e.g. `agents/<name>.json`) — versioning it in git makes templates portable and lets `butterbase repo push` carry it to clones. 3. **Validate without persisting** — call `validate_agent_spec` (MCP) or pass the file to a `validate_agent_spec` call. Surface any Zod issues to the user with field paths. 4. **Register MCP servers** if used: `agent_mcp_servers` table (MCP-tool wrapper TBD; use the dashboard or POST `/v1/<app_id>/agent-mcp-servers` directly). Wait for `status: healthy`. 5. **Create** — `create_agent` with name, graph_spec, default_model, access fields. If `visibility ≠ 'private'` and any write tool is reachable, require the user to explicitly say "yes, I acknowledge" and set `safety_acknowledged: true`. 6. **Smoke** — `invoke_agent` with a small input. Poll `get_agent_run` until terminal. Show the user the run timeline (steps, tool calls, final output).
1. `list_agent_runs` filtered by agent name, then `get_agent_run(run_id)` for the event timeline. 2. Check `error.code`: `validation_failed` (spec issue), `tool_error` (named tool, named arg), `budget_exceeded`, `rate_limited`, `timeout`. 3. For tool errors, re-run the same `args_template` with the underlying tool directly (`select_rows`, `invoke_function`, etc.) to confirm the issue is in the tool's surface, not the agent runtime. 4. For `human_input_required` checkpoints, resume with `resume_agent_run(run_id, user_input)`.
Claude Code plugin for Butterbase — the AI-Native Backend-as-a-Service. This plugin gives Claude deep knowledge of Butterbase's 42+ MCP tools, guides you through common workflows, and auto-configures the MCP server connection.
Repo: butterbase-ai/butterbase-skills
Use when calling the app's AI gateway from agent tools — chat completions, embeddings, listing models, configuring defaults or BYOK, reading token/cost usage
Use when configuring OAuth providers (Google/GitHub/Apple/X/etc.), setting up post-login auth hooks, tuning JWT lifetimes, or generating service API keys
Use when building a new Butterbase app from scratch, creating a full-stack application, or when the user asks to set up a complete backend with database, auth,…
Use when contributing to the Butterbase codebase, adding new MCP tools, creating API routes, writing migrations, or understanding the monorepo architecture
Use when users report access denied errors, see wrong data, RLS policies are not working, or when troubleshooting Row-Level Security issues in Butterbase
Use when deploying a frontend (React, Next.js, or static HTML) to a live URL on Butterbase, or when troubleshooting deployment issues like MIME type errors or…