plugins/agent-sdk-dev/commands/new-sdk-app.md
You are tasked with helping the user create a new Claude Agent SDK application. Follow these steps carefully:
Before starting, review the official documentation to ensure you provide accurate and up-to-date guidance. Use WebFetch to read these pages:
IMPORTANT: Always check for and use the latest versions of packages. Use WebSearch or WebFetch to verify current versions before installation.
IMPORTANT: Ask these questions one at a time. Wait for the user's response before asking the next question. This makes it easier for the user to respond.
Ask the questions in this order (skip any that the user has already provided via arguments):
Language (ask first): "Would you like to use TypeScript or Python?"
Project name (ask second): "What would you like to name your project?"
Agent type (ask third, but skip if #2 was sufficiently detailed): "What kind of agent are you building? Some examples:
Starting point (ask fourth): "Would you like:
Tooling choice (ask fifth): Let the user know what tools you'll use, and confirm with them that these are the tools they want to use (for example, they may prefer pnpm or bun over npm). Respect the user's preferences when executing on the requirements.
After all questions are answered, proceed to create the setup plan.
Based on the user's answers, create a plan that includes:
Project initialization:
npm init -y and setup package.json with type: "module" and scripts (include a "typecheck" script)requirements.txt or use poetry inittsconfig.json with proper settings for the SDKCheck for Latest Versions:
SDK Installation:
npm install @anthropic-ai/claude-agent-sdk@latest (or specify latest version)pip install claude-agent-sdk (pip installs latest by default)npm list @anthropic-ai/claude-agent-sdkpip show claude-agent-sdkCreate starter files:
index.ts or src/index.ts with a basic query examplemain.py with a basic query exampleEnvironment setup:
.env.example file with ANTHROPIC_API_KEY=your_api_key_here.env to .gitignoreOptional: Create .claude directory structure:
.claude/ directory for agents, commands, and settingsAfter gathering requirements and getting user confirmation on the plan:
npx tsc --noEmit to check for type errorsAfter all files are created and dependencies are installed, use the appropriate verifier agent to validate that the Agent SDK application is properly configured and ready for use:
Once setup is complete and verified, provide the user with:
Next steps:
npm start or node --loader ts-node/esm index.tspython main.pyUseful resources:
Common next steps:
npx tsc --noEmit and fix ALL type errors before finishingBegin by asking the FIRST requirement question only. Wait for the user's answer before proceeding to the next question.