/iblai-vibe:iblai-vibe-agent-createfrom ibl.ai vibe
Creates ibl.ai agents via SDK forms (CreateAgentForm/CreateAgentModal) or server routes, handling field permissions, org authority, and default agent setup.
Ships in ibl.ai vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
First time here? If
iblai.envhas noARCHITECTURE=, run/iblai-vibe-startfirst (four questions; two minutes) — it decides single-org / multi-org / headless and who signs in, and every skill reads the answer.
An agent is created with one platform call and returns a unique_id — the
UUID every other agent skill needs. Two ways to put creation in an app:
CreateAgentForm, or CreateAgentModal
around it) — Settings and Prompts tabs, run as the signed-in person, and
showing only the fields that person may set. For anyone who creates agents
from the app./setup, which picks
or creates the app's default agent with the organization's authority.
Admin-only.


Common setup (brand, conventions, env files, verification): see docs/skill-setup.md.
/iblai-vibe-auth).@iblai/iblai-js@^3.6.0. The field permissions below are not in releases
before 2.65.0, which show every field to everyone.MENTOR_CREATORS (/iblai-vibe-rbac; the org toggle
rbac/student-agent-creation/status/ decides whether plain members may).IBLAI_API_KEY in .env.local (server-only)
and lib/iblai/platform.ts from /iblai-vibe-api (requireAdmin,
platformFetch).// app/(app)/agents/new/page.tsx
"use client";
import { useState } from "react";
import { useRouter } from "next/navigation";
import { toast } from "sonner";
import { CreateAgentForm } from "@iblai/iblai-js/web-containers";
import { useUsername } from "@iblai/iblai-js/web-utils";
import { resolveAppTenant } from "@/lib/iblai/tenant";
export default function NewAgentPage() {
const router = useRouter();
const [tenantKey] = useState(resolveAppTenant);
const username = useUsername();
if (!username) return null;
return (
<div className="mx-auto w-full flex-1 overflow-auto px-4 py-8 md:w-[75vw] md:px-0">
<div className="rounded-lg border border-[var(--border-color)] bg-white p-6">
<CreateAgentForm
org={tenantKey}
username={username}
onCreated={(agent) => {
if (agent.unique_id) router.push(`/?agent=${agent.unique_id}`);
}}
onError={() => toast.error("Couldn't create the agent.")}
/>
</div>
</div>
);
}
CreateAgentModal takes the same props plus isOpen and onClose, for a
"Create Agent" button. The form owns its state, the categories query and
the create call (useCreateMentorMutation, as the signed-in person); toasts
and navigation are yours, through the callbacks.
| Prop | Type | Required | Description |
|---|---|---|---|
org | string | Yes | Organization key the agent is created in |
username | string | Yes | The person creating it |
onCreated | (agent: CreatedAgent) => void | No | With the new agent (unique_id) |
onError | (error: unknown) => void | No | When the create call fails |
onBeforeCreate | () => boolean | Promise<boolean> | No | Gate before the request (a paywall, a trial check); false stops it |
initialValues | Partial<CreateAgentFormValues> | No | Prefill any field |
showBaseModel | boolean | No | Show the Base select (template: Default, OpenAI, Gemini); off by default |
modelOptions | CreateAgentOption[] | No | Replace the Base select's options (visibilityOptions is @deprecated and ignored: a new agent is visible to administrators only) |
defaultPrompts | Partial<AgentPromptDefaults> | No | The prompts the form starts with |
labels | DeepPartial<CreateAgentLabels> | No | Any UI string |
What it renders. Settings: Name, Description, Category and an image
upload, then Next. A new agent is visible to administrators only; open
it to users or the public afterwards in /iblai-vibe-agent-setting. Prompts:
System, Proactive and Guided prompts, each with Edit, then Save.
Before showing the form it asks the platform which fields this person may
write: GET ${dmUrl}/v1/agents/settings/field-permissions with the header
iblai-org: <org>, answered as { "<field>": { "write": true|false } }.
The organization's RBAC policies decide the answer (/iblai-vibe-rbac).
new_mentor_name, display_name): always asked for and
always sent, so the call is refused (403);template_name): the create call requires it, so the form
always sends it (the default template when Base is hidden, showBaseModel
off), and a policy that bars it refuses the request (403).The create call refuses the whole request (403) when it carries a field the person may not write, so a form of your own must leave those out too:
| Form field | Sent as |
|---|---|
| Name | new_mentor_name (required), display_name |
| Description | description |
| Category | categories (and metadata.category, permitted as metadata) |
| Image | uploaded_profile_image |
| Base | template_name (required, always sent) |
| System / Proactive / Guided prompt | system_prompt, proactive_prompt, guided_prompt_instructions |
| Moderation prompt (not shown) | moderation_system_prompt |
For a custom form, the SDK's own pieces do that work:
// lib/iblai/create-agent-body.ts
"use client";
import { useCreateAgentFieldPermissions } from "@iblai/iblai-js/web-containers";
import { buildCreateAgentPayload, type CreateAgentFieldValues } from "@iblai/iblai-js/web-utils";
export function useCreateAgentBody(org: string) {
// visibility.description, .category, .systemPrompt, … and .anyPrompt say what to show.
const { permissions, visibility, isLoading } = useCreateAgentFieldPermissions({ org });
const toBody = (values: CreateAgentFieldValues) => buildCreateAgentPayload(values, permissions);
return { visibility, isLoading, toBody };
}
canWriteAgentField(permissions, field), getCreateAgentFieldVisibility
and CREATE_AGENT_FIELD_MAP come from the same web-utils entry; the raw
query is useGetAgentSettingsFieldPermissionsQuery({ org }) from
@iblai/iblai-js/data-layer, already in mentorReducer / mentorMiddleware.
/setup (admin-only)Copy the assets:
| Asset | Destination | Does |
|---|---|---|
admin-agents-route.ts | app/api/admin/agents/route.ts | GET lists the org's agents; POST creates one |
admin-client.ts | lib/iblai/admin-client.ts | browser adminFetch() that forwards the session token |
setup-screen.tsx | components/setup/setup-screen.tsx | name the app → pick or create the agent → save to org metadata |
setup-page.tsx | app/setup/page.tsx | admin-only page, outside the navbar |
The setup screen saves through useOrgSettings (/iblai-vibe-org-metadata)
and uses the SDK's OnboardingShell / StepHeader. Needs shadcn input, label.
// server, after requireAdmin(req)
const agent = await platformFetch<{ unique_id: string; name: string }>(
`/dm/api/ai-mentor/orgs/${org}/users/${caller.username}/mentor-with-settings/`,
{
method: "POST",
body: {
template_name: "ai-mentor", // the default template on most orgs
new_mentor_name: name,
display_name: name,
description,
system_prompt, // optional; refine later in the Prompts tab
// llm_provider: "openai", // optional; set later in the LLM tab
},
},
);
Listing existing agents (for a picker):
GET /dm/api/search/orgs/{org}/users/{username}/mentors/.
From the browser:
import { adminFetch } from "@/lib/iblai/admin-client";
const { unique_id } = await adminFetch<{ unique_id: string }>("/api/admin/agents", {
method: "POST",
json: { name: "Support Assistant", description: "Answers order questions." },
});
The route runs with the organization's Platform API Token, not as the person
on the page, so keep it admin-only; members create through the SDK form,
which honours their own field permissions. To copy an existing agent instead, use fork in
/iblai-vibe-agent-setting.
NEXT_PUBLIC_DEFAULT_AGENT_ID (env,
wins) or the org setting defaultAgentId (what /setup writes)./iblai-vibe-agent-setting (identity, visibility), then
Prompts, LLM, Datasets, Memory — all via /iblai-vibe-agent; turn
capabilities (web search, image generation, code interpreter, MCP, …) on
in the tabs /iblai-vibe-agent-tool maps them to./iblai-vibe-agent-chat.Run /iblai-vibe-ops-test before telling the user the work is ready, and give
every page, control and state this skill added its own checkpoint — one Playwright
test titled <ID> · … in e2e/journeys/, listed in e2e/coverage.json;
pnpm e2e:coverage must pass. Then:
pnpm typecheck && pnpm build./ chatting with the new agent; it appears on os.ibl.ai →
Explore → Custom./setup, create an agent there too; as a member,
POST /api/admin/agents answers 403.| Call | Purpose |
|---|---|
GET /dm/v1/agents/settings/field-permissions (header iblai-org) | which create fields this person may write |
POST …/orgs/{org}/users/{username}/mentor-with-settings/ | create from template → unique_id |
GET …/search/orgs/{org}/users/{username}/mentors/ | list agents |
GET …/orgs/{org}/users/{username}/mentor/categories/ | categories to assign afterwards |
POST …/users/{username}/mentors/{mentor}/fork/ | copy an agent |
REST references: agent-create, agent-setting.
/iblai-vibe-agent — the tabs to configure it/iblai-vibe-agent-setting — identity, visibility, fork, delete/iblai-vibe-agent-search — the browser members pick from/iblai-vibe-api — the server-route patternassets/admin-agents-route.ts (opens in a new tab)assets/admin-client.ts (opens in a new tab)assets/setup-page.tsx (opens in a new tab)assets/setup-screen.tsx (opens in a new tab)iblai-vibe-agent-create-1-dialog.png (opens in a new tab)iblai-vibe-agent-create-2-form.png (opens in a new tab)iblai-vibe-agent-create-3-prompts.png (opens in a new tab)test.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
iblai-agent, agent-creation, sdk-form, field-permissions, vibe-starter
npx claudepluginhub iblai/base --plugin iblai-vibe166 skills in this plugin
/iblai-api-agent-accessManage role-based access to an ibl.ai agent via the platform API — list role policies, search users/groups, and grant/revoke editor, chat, or analytics_viewer roles for users, groups, and emails. Use when controlling who can edit, chat with, or view analytics for an agent./iblai-api-agent-auditRead an ibl.ai agent's audit log via the platform API — a who-changed-what trail filterable by action, actor email, and date range. Read-only. Use when investigating configuration changes to an agent./iblai-api-agent-chatSet up live chat with a deployed ibl.ai agent by wiring the hosted iblai-api-agent-chat MCP server into the project (.mcp.json / claude mcp add) using the .env Api-Token and a chosen agent's unique id, or by signing in from claude.ai, ChatGPT or Claude Desktop with only the URL. Use to enable runtime conversations with an agent, and to list or disconnect the apps a user has connected. The actual chatting then happens through the MCP server's tools.Other plugins' skills for the same job