paperclipai avatar

Create Agent Adapter

This walks you through building a new agent adapter for Paperclip, the system that lets you plug in different AI coding tools like Claude Code or Codex. You get the full architecture: a three-part package structure (server execution, UI parsing, CLI formatting), the exact interfaces to implement, and how to wire everything into the registries. The environment test contract is well documented, which matters because those diagnostics show up in the board UI when users configure agents. If you're adding support for a new CLI tool or API-based agent, this covers the session management, stdout parsing, and config building you need. The concrete examples from claude-local and codex-local adapters make it practical rather than abstract.

skills.sh installs
329
GitHub stars
112.7K
last updated
Aug 21, 2026

Install

$ npx -y skills add paperclipai/paperclip --skill create-agent-adapter --agent claude-code

Installs into .claude/skills of the current project.

Files

Creating a Paperclip Agent Adapter

An adapter bridges Paperclip's orchestration layer to a specific AI agent runtime (Claude Code, Codex CLI, a custom process, an HTTP endpoint, etc.). Each adapter is a self-contained package that provides implementations for three consumers: the server, the UI, and the CLI.


1. Architecture Overview

packages/adapters/<name>/
  src/
    index.ts            # Shared metadata (type, label, models, agentConfigurationDoc)
    server/
      index.ts          # Server exports: execute, sessionCodec, parse helpers
      execute.ts        # Core execution logic (AdapterExecutionContext -> AdapterExecutionResult)
      parse.ts          # Stdout/result parsing for the agent's output format
    ui/
      index.ts          # UI exports: parseStdoutLine, buildConfig
      parse-stdout.ts   # Line-by-line stdout -> TranscriptEntry[] for the run viewer
      build-config.ts   # CreateConfigValues -> adapterConfig JSON for agent creation form
    cli/
      index.ts          # CLI exports: formatStdoutEvent
      format-event.ts   # Colored terminal output for `paperclipai run --watch`
  package.json
  tsconfig.json

Sponsors

Details

Repository
github.com/paperclipai/paperclip
Categories
Backend & APIs, AI & Agent Building, CLI & Terminal
First seen
Jun 3, 2026

More from paperclipai/paperclip

All 10
1mryll avatarvertical-slice-architecturemryll/skillsEnforce Vertical Slice Architecture (VSA) when building applications in any language (Go, .NET/C#, Java, Kotlin, TypeScript, Python, etc.) and any type (web API327skills.sh installs
2sanjay3290 avataratlassiansanjay3290/ai-skillsManage Jira issues and Confluence wiki pages in Atlassian Cloud. Use when: (1) searching/creating/updating Jira issues with JQL, (2) searching/reading/creating 327skills.sh installs
3jezweb avatarcloudflare-agentsjezweb/claude-skillsBuild AI agents with Cloudflare Agents SDK on Workers + Durable Objects. Provides WebSockets, state persistence, scheduling, and multi-agent coordination. Preve326skills.sh installs
4wsimmonds avatarnextjs-client-cookie-patternwsimmonds/claude-nextjs-skillsPattern for client components calling server actions to set cookies in Next.js. Covers the two-file pattern of a client component with user interaction (onClick325skills.sh installs
5bobmatnyc avatarvercel-storage-databobmatnyc/claude-mpm-skillsVercel data and storage services including Postgres, Redis, Vercel Blob, Edge Config, and data cache. Use when selecting data storage or caching on Vercel.324skills.sh installs
6gohypergiant avataraccelint-security-best-practicesgohypergiant/agent-skillsComprehensive security audit and vulnerability detection for JavaScript/TypeScript applications following OWASP Top 10. Use when (1) Users say 'audit security',323skills.sh installs