claude-agent-ts-sdk
Build Claude agents using TypeScript with the @anthropic-ai/claude-agent-sdk. Use this skill when implementing conversational agents, building tools for agents, setting up streaming responses, or debugging agent implementations. Covers the tool wrapping pattern, SDK initialization, agent architecture, and best practices.
npx skills add majiayu000/claude-skill-registry --skill claude-agent-ts-sdk --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Claude Agent TypeScript SDK Build production-ready Claude agents using TypeScript and the `@anthropic-ai/claude-agent-sdk`. This skill provides battle-tested patterns for creating modular, composable agent tools. ## Quick Start ```typescript import { query, createSdkMcpServer, tool } from '@anthropic-ai/claude-agent-sdk'; import { z } from 'zod'; // 1. Define tools const greetTool = tool( 'greet', 'Greet a user by name', z.object({ name: z.string().describe('User name'), }).shape, async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }], }) ); // 2. Create MCP server const server = createSdkMcpServer({ name: 'my-agent', version: '1.0.0', tools: [greetTool], }); // 3. Query with streaming const messages = query({ prompt: 'Greet Alice', options: { systemPrompt: 'You are a helpful agent.', permissionMode: 'bypassPermissions', mcpServers: { 'my-agent': server }, }, }); // 4. Process stream for await (const event of messages) { if (event.type === 'assistant') { for (const content of event.message.content) { if (content.type === 'text') { console.log(content.text); } } } } ``` ## When to Use This Skill Use when: - **Implementing agents**: Building CLI tools, web serv
- Quick Start
- When to Use This Skill
- Core Concepts
- 1. Tools
- 2. MCP Servers
- 3. Query and Streaming
- 4. System Prompts
- Architecture Patterns
- Pattern 1: CLI/Specialized Agent
- Pattern 2: Web Server Agent
- Pattern 3: Plugin/Framework
- Project Setup
- Minimal package.json
- Directory Structure
What does the claude-agent-ts-sdk skill do?
Build Claude agents using TypeScript with the @anthropic-ai/claude-agent-sdk. Use this skill when implementing conversational agents, building tools for agents, setting up streaming responses, or debugging agent implementations. Covers the tool wrapping pattern, SDK initialization, agent architecture, and best practices.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill claude-agent-ts-sdk --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
