Building Agents with Claude Code
Trinity is the operating system for the AI-native company — open source, self-hosted, that you own. It deploys, orchestrates, and governs fleets of AI agents on your own hardware, and it is model-agnostic: each agent runs on Claude Code, Gemini CLI, or OpenAI Codex (see Agent Runtimes).
This guide covers the Claude Code path. The abilities plugins are Claude Code tooling: you run them in a Claude Code session to create, develop, and deploy Claude Code agents to Trinity — all from your terminal. For a Gemini CLI or Codex agent, declare the runtime in template.yaml and create it as described in Creating Agents.
Build an AI Recruiter Agent
Jun 2026
Build and Deploy Agents in Cursor
Apr 2026
From Zero to Deployed AI Agent
Apr 2026
Prerequisites
Claude Code installed — npm install -g @anthropic-ai/claude-code
Trinity instance running — Trinity is self-hosted. No instance yet? /trinity:deploy-new-instance stands one up: the DigitalOcean installer, a Marketplace image (DigitalOcean 1-Click, AWS or Vultr), any server you reach over SSH, or local Docker
An operator account or above on that instance — a user account works in the Workspace only and cannot use MCP, so ask an admin to whitelist you as operator
One-Time Setup
Add the abilities marketplace and install the core plugins:
# Add the abilities marketplace (one-time)
/plugin marketplace add abilityai/abilities
# Install the core plugins
/plugin install create-agent@abilityai
/plugin install agent-dev@abilityai
/plugin install trinity@abilityaiOr from the terminal: claude plugin marketplace add abilityai/abilities
Choose Your Starting Point
Path A: Creating a New Agent
Start from scratch with the interview-driven wizard
Run the wizard
/create-agent:create # Shows all available wizards
# Or jump directly:
/create-agent:custom # Any agent, from an interview — role, skills, schedules, credentials, Trinity wiring
/create-agent:website # A website scaffold (no agent)The custom wizard asks about your domain and scaffolds a complete agent. It covers every shape the retired domain wizards used to — describe the role and the interview builds it. It can also run inside a deployed Trinity agent with no one at the keyboard — see headless mode.
Connect to Trinity (one-time)
/trinity:connectAuthenticates and saves your MCP connection config. Only needed once per machine. If it stops with 403 workspace_only, your account has the user role; an admin raises it to operator under Settings → Access → User Management.
Add your GitHub token (one-time)
Deployment is repository-first — Trinity clones the agent from its GitHub repo. In the Trinity UI, go to Settings → MCP Keys → Personal GitHub Token and add your own fine-grained PAT with Contents: Read and write on the repos your agents live in. With your own write token on a repo your account owns, the agent gets a working branch with auto-sync, so its work lands back in git. A read-only token, or the instance-wide token an admin set, gives a pull-only agent that tracks the branch. Public repos clone pull-only without any token. See GitHub Sync.
Push, then deploy to Trinity
git push # the wizard already initialized and committed the repo
/trinity:onboardChecks compatibility, fills in anything missing in template.yaml (declared credentials, schedules, plugins), verifies the repo is pushed and readable, and deploys from it. Your agent is now running 24/7 — turn on its autonomy toggle in the UI when you want its schedules to start firing.
Path B: Onboarding an Existing Agent
Already have a Claude Code agent? Deploy it to Trinity.
Connect to Trinity (one-time)
/trinity:connectOnboard the agent
/trinity:onboardChecks your agent for Trinity compatibility, creates required files (template.yaml, .env.example, .mcp.json.template, .gitignore), and deploys — from the agent's GitHub repo by default, from local files as the fallback when there is no repo yet.
Already deployed it from a bare repo? If you created the agent in Trinity straight from a repository that had no template.yaml — someone else's agent, or one you didn't want to adapt locally — run /trinity:onboard inside that agent — send it /trinity:onboard in-place as a chat message, or run it from the agent's terminal — and it takes the Onboard in place path. It writes the Trinity files, installs and declares the plugins, pushes the result back to the repo, reconciles schedules, and verifies with the platform's compatibility report. Nothing needs installing first: Trinity's agent image ships with the trinity plugin, so a bare repo can onboard itself. See Onboarding a deployed agent in place.
Review and improve (optional)
/create-agent:review # Read-only audit — prioritized findings, no changes
/create-agent:adjust # Apply the improvementsreview audits your agent against best practices without changing anything; adjust proposes and applies improvements to CLAUDE.md, skills, and Trinity files.
Path C: Ongoing Development
Add capabilities and keep your agent in sync
Add a new skill/playbook
/agent-dev:create-playbookAdd a memory system
/agent-dev:add-memory # Choose: file-index, brain, json-state, workspaceAdd GitHub Issues task management — pick the one that fits the work
/agent-dev:add-backlog # the agent's own dev backlog: /backlog, /claim, /autoplan, /commit, /close, /groom, /roadmap, /sprint, /work-loop
/agent-dev:add-project-management # cross-actor projects: /project-init, /project-task, /project-steward, /project-reconcile, /project-intake, /project-statusPush changes to Trinity
git push
/trinity:sync # advances the deployed agent; also reconciles schedules + pluginsBoth task-management installers copy standalone agent-dev runtime skills into .claude/skills/, and the same skills ship in Trinity's bundled community skills catalog (trinity-skills v0.2.0 and later) — so an agent that is already deployed can be given them by assignment from the Library page instead, with no local install and no push. /project-init creates the project standard itself on first run if the installer never ran.
What Gets Created
Wizard-created agents include everything needed for Trinity:
CLAUDE.md— Agent identity and instructions
.claude/skills/— 2-4 starter skills
template.yaml — Trinity deployment config — resources, declared credentials, schedules:, plugins:, metrics:
.mcp.json.template — MCP server configuration with ${VAR} placeholders
dashboard.yaml— Custom metrics dashboard
onboarding.json— Setup progress tracker