spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / plugins / agent-sdk-dev / README.md
208 lines · 6.2 KBPreviewCodeRaw
1# Agent SDK Development Plugin
2
3A comprehensive plugin for creating and verifying Claude Agent SDK applications in Python and TypeScript.
4
5## Overview
6
7The Agent SDK Development Plugin streamlines the entire lifecycle of building Agent SDK applications, from initial scaffolding to verification against best practices. It helps you quickly start new projects with the latest SDK versions and ensures your applications follow official documentation patterns.
8
9## Features
10
11### Command: `/new-sdk-app`
12
13Interactive command that guides you through creating a new Claude Agent SDK application.
14
15**What it does:**
16- Asks clarifying questions about your project (language, name, agent type, starting point)
17- Checks for and installs the latest SDK version
18- Creates all necessary project files and configuration
19- Sets up proper environment files (.env.example, .gitignore)
20- Provides a working example tailored to your use case
21- Runs type checking (TypeScript) or syntax validation (Python)
22- Automatically verifies the setup using the appropriate verifier agent
23
24**Usage:**
25```bash
26/new-sdk-app my-project-name
27```
28
29Or simply:
30```bash
31/new-sdk-app
32```
33
34The command will interactively ask you:
351. Language choice (TypeScript or Python)
362. Project name (if not provided)
373. Agent type (coding, business, custom)
384. Starting point (minimal, basic, or specific example)
395. Tooling preferences (npm/yarn/pnpm or pip/poetry)
40
41**Example:**
42```bash
43/new-sdk-app customer-support-agent
44# → Creates a new Agent SDK project for a customer support agent
45# → Sets up TypeScript or Python environment
46# → Installs latest SDK version
47# → Verifies the setup automatically
48```
49
50### Agent: `agent-sdk-verifier-py`
51
52Thoroughly verifies Python Agent SDK applications for correct setup and best practices.
53
54**Verification checks:**
55- SDK installation and version
56- Python environment setup (requirements.txt, pyproject.toml)
57- Correct SDK usage and patterns
58- Agent initialization and configuration
59- Environment and security (.env, API keys)
60- Error handling and functionality
61- Documentation completeness
62
63**When to use:**
64- After creating a new Python SDK project
65- After modifying an existing Python SDK application
66- Before deploying a Python SDK application
67
68**Usage:**
69The agent runs automatically after `/new-sdk-app` creates a Python project, or you can trigger it by asking:
70```
71"Verify my Python Agent SDK application"
72"Check if my SDK app follows best practices"
73```
74
75**Output:**
76Provides a comprehensive report with:
77- Overall status (PASS / PASS WITH WARNINGS / FAIL)
78- Critical issues that prevent functionality
79- Warnings about suboptimal patterns
80- List of passed checks
81- Specific recommendations with SDK documentation references
82
83### Agent: `agent-sdk-verifier-ts`
84
85Thoroughly verifies TypeScript Agent SDK applications for correct setup and best practices.
86
87**Verification checks:**
88- SDK installation and version
89- TypeScript configuration (tsconfig.json)
90- Correct SDK usage and patterns
91- Type safety and imports
92- Agent initialization and configuration
93- Environment and security (.env, API keys)
94- Error handling and functionality
95- Documentation completeness
96
97**When to use:**
98- After creating a new TypeScript SDK project
99- After modifying an existing TypeScript SDK application
100- Before deploying a TypeScript SDK application
101
102**Usage:**
103The agent runs automatically after `/new-sdk-app` creates a TypeScript project, or you can trigger it by asking:
104```
105"Verify my TypeScript Agent SDK application"
106"Check if my SDK app follows best practices"
107```
108
109**Output:**
110Provides a comprehensive report with:
111- Overall status (PASS / PASS WITH WARNINGS / FAIL)
112- Critical issues that prevent functionality
113- Warnings about suboptimal patterns
114- List of passed checks
115- Specific recommendations with SDK documentation references
116
117## Workflow Example
118
119Here's a typical workflow using this plugin:
120
1211. **Create a new project:**
122```bash
123/new-sdk-app code-reviewer-agent
124```
125
1262. **Answer the interactive questions:**
127```
128Language: TypeScript
129Agent type: Coding agent (code review)
130Starting point: Basic agent with common features
131```
132
1333. **Automatic verification:**
134The command automatically runs `agent-sdk-verifier-ts` to ensure everything is correctly set up.
135
1364. **Start developing:**
137```bash
138# Set your API key
139echo "ANTHROPIC_API_KEY=your_key_here" > .env
140
141# Run your agent
142npm start
143```
144
1455. **Verify after changes:**
146```
147"Verify my SDK application"
148```
149
150## Installation
151
152This plugin is included in the Claude Code repository. To use it:
153
1541. Ensure Claude Code is installed
1552. The plugin commands and agents are automatically available
156
157## Best Practices
158
159- **Always use the latest SDK version**: `/new-sdk-app` checks for and installs the latest version
160- **Verify before deploying**: Run the verifier agent before deploying to production
161- **Keep API keys secure**: Never commit `.env` files or hardcode API keys
162- **Follow SDK documentation**: The verifier agents check against official patterns
163- **Type check TypeScript projects**: Run `npx tsc --noEmit` regularly
164- **Test your agents**: Create test cases for your agent's functionality
165
166## Resources
167
168- [Agent SDK Overview](https://docs.claude.com/en/api/agent-sdk/overview)
169- [TypeScript SDK Reference](https://docs.claude.com/en/api/agent-sdk/typescript)
170- [Python SDK Reference](https://docs.claude.com/en/api/agent-sdk/python)
171- [Agent SDK Examples](https://docs.claude.com/en/api/agent-sdk/examples)
172
173## Troubleshooting
174
175### Type errors in TypeScript project
176
177**Issue**: TypeScript project has type errors after creation
178
179**Solution**:
180- The `/new-sdk-app` command runs type checking automatically
181- If errors persist, check that you're using the latest SDK version
182- Verify your `tsconfig.json` matches SDK requirements
183
184### Python import errors
185
186**Issue**: Cannot import from `claude_agent_sdk`
187
188**Solution**:
189- Ensure you've installed dependencies: `pip install -r requirements.txt`
190- Activate your virtual environment if using one
191- Check that the SDK is installed: `pip show claude-agent-sdk`
192
193### Verification fails with warnings
194
195**Issue**: Verifier agent reports warnings
196
197**Solution**:
198- Review the specific warnings in the report
199- Check the SDK documentation references provided
200- Warnings don't prevent functionality but indicate areas for improvement
201
202## Author
203
204Ashwin Bhat (ashwin@anthropic.com)
205
206## Version
207
2081.0.0