bot/ folder holds instructions, typed tools, MCP connections, subagents, channels, and cron schedules, with evals beside it. It deploys to Cursor’s hosting with agent-sdk deploy, or runs on your own Node host with agent-sdk serve. The npm package is @grok/agent-sdk; older projects use @cursor/bdk.
A Cursor agent is close to a Guild TypeScript agent in shape: instructions become the systemPrompt, typed tools become integration operations or functions in logic.ts, and channels and schedules become triggers.
This guide covers the Agent SDK. The Cursor SDK (
@cursor/sdk) is a client library that drives Cursor’s own coding agent; it has no bot/ folder to port.Who this is for
Teams with agents built on Cursor’s Agent SDK, on Cursor’s hosting or their own Node hosts, who want credentials the agent code never sees, ALLOW/DENY policies set by admins, and agents others can install and fork from the Hub.Concept map
Before you start
Inventory
List these from thebot/ folder before writing any Guild code. Older projects keep the same layout under agent/. Record names only, never secret values.
bot/instructions.md(orinstructions.ts) and the model inbot/agent.ts.- Every file in
bot/tools/, what it calls (Octokit,fetch, a vendor SDK), and the secrets it reads fromprocess.env. - Tools with
needsApproval, and write tools that skip side effects whenctx.session.purpose === "eval". - Every file in
bot/mcp-connections/andbot/host-connections/, with its URL,toolsordisallowedTools, and auth. bot/subagents/, agent connections, andbot/skills/.- Channels in
bot/channels/(Slack, GitHub, GitLab, Bitbucket, PagerDuty, HTTP routes) and schedules inbot/schedules/. - Harness tools turned on in
defineAgent({ tools }), such asshelloredit, and anybot/sandbox/workspace/files. - Hooks, reminders, the memory journal, and
evals/.
Steps
1
Scaffold a TypeScript agent
--category and --owner stop the CLI from prompting, which a script or coding agent can’t answer. List categories with guild agent categories.If the agent turns on Cursor’s file and shell tools, or works in bot/sandbox/workspace/, scaffold an OpenClaw agent (--agent-type OPENCLAW) instead.2
Move instructions and tools
bot/instructions.md becomes the systemPrompt. Each tool that calls an API becomes an integration operation, because the Guild runtime has no general network egress. Tools that only compute move to logic.ts.inspect_pr. Check the real names with guild integration operation list guildai~github --json.3
Replace connections with integrations
Each MCP or host connection becomes the catalog integration for the same service. Register only the operations in the connection’s For an MCP server with no catalog integration, create one from the server’s URL in the web app by choosing the MCP protocol in Create an integration. MCP-backed integrations export their tools in PascalCase, such as
tools list, and leave out anything in disallowedTools.ExaMcpTools for an exa-mcp integration.4
Turn subagents into Guild agents
Each
bot/subagents/<id>/ and each agent connection becomes its own Guild agent. Call it with guildAgentTool({ calls: "owner~agent", inputSchema, outputSchema }).5
Test
test script, so pnpm test passes without running anything. Add a test script to package.json before you rely on it, such as "test": "tsc --build && node --test logic.test.mjs". If pnpm install fails with ERR_PNPM_IGNORED_BUILDS, newer pnpm is blocking esbuild’s install script. Run pnpm approve-builds, approve esbuild, and install again.guild agent test collects files by walking your local directory and honoring .gitignore, the same way guild agent save does, so new files such as logic.ts are uploaded even without git add.Write tools that skipped side effects when ctx.session.purpose === "eval" have no such flag on Guild. Test them against a sandbox account.6
Publish and add triggers
A You can also publish with the Publish Agent to Guild GitHub Action instead of
githubChannel becomes an event trigger on the GitHub integration, and a schedule file becomes a schedule trigger. Cursor schedules run in UTC, so keep the cron expression as it is.The first
guild agent save --wait --publish after guild agent init fails with “No saved state… use —force” because of the .gitignore the scaffold writes. Add --force to that first save for now.guild agent save --publish. The Action needs an account API key with the agents:write scope:Credentials and policies
Cursor tools read secrets fromprocess.env inside execute, and connections use ${NAME} templates. Recreate each one as a Guild credential on the matching integration; the credential proxy adds it to each call, so agent code never sees it. Connections that used cursorAccount: true stored their OAuth on Cursor’s side, so connect those services again in Guild. Non-secret settings become workspace variables.
Guild splits a tool approval into two controls:
- Who can call it. Add a credential policy rule scoped to the agent and workspace that allows or denies the operation. DENY wins over ALLOW.
- Sign-off on each call. Add the
ui_promptbuilt-in and have the agent confirm with the user before it calls the tool. The run pauses until someone answers.
What doesn’t map 1:1
Models
Models
Cursor model IDs, such as
grok-4.5 and composer-2.5, have no Guild equivalent, and all Cursor inference is billed through Cursor. Pick a model from a provider Guild supports.Self-hosting
Self-hosting
agent-sdk serve runs an agent on your own Node host. Guild is a hosted platform, so self-hosted agents move to Guild’s runtime.Per-agent HTTP and MCP endpoints
Per-agent HTTP and MCP endpoints
Every served Cursor agent has its own HTTP API and MCP endpoint. Guild agents are reached through workspace chat, triggers, and the Guild API.
Hooks, reminders, and dry runs
Hooks, reminders, and dry runs
defineHook observers, runtime reminders, tool effect and dryRunResult, and harness extensions have no equivalent. The Guild session event log records each run’s model calls, tool calls, and errors.Memory journal
Memory journal
The memory hook appends every turn to
memory/journal.jsonl, shared by all users. Guild has no equivalent across runs. Keep durable state in an outside store reached through an integration.Channels without a Guild integration
Channels without a Guild integration
Cursor ships GitLab, Bitbucket, and PagerDuty channels. Check
guild integration list for the service; if there’s no integration, start the agent from an API trigger instead.Evals
Evals
Cursor evals don’t run on Guild. Rebuild the important cases as Guild Evaluations or
guild agent test sessions.Three ways to migrate
guild-migrate skill
Ask your coding agent: “Migrate the Cursor agent in
./bot to Guild.” It follows these steps and writes MIGRATION.md.Publish Agent to Guild Action
Commit the port to your repository, then publish it from GitHub Actions with an account API key.
Migration agent
Point Migrate to Guild at your repository; it opens a draft pull request. The guild-migrate skill ships in the same package.
Related pages
LLM agents
llmAgent, systemPrompt, and modes.Triggers
Event, schedule, and API triggers.