К основному содержанию
команда официальный · Anthropic

new-sdk-app — команда для Claude Code: создаёт проект на Agent SDK

Пошагово заводит новый проект на Claude Agent SDK: спрашивает язык, имя и тип агента, ставит зависимости и проверяет код.

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin install agent-sdk-dev@claude-plugins-official
Открыть на GitHub

Что делает new-sdk-app

Команда ведёт вас через создание приложения на Claude Agent SDK. Сначала она уточняет язык — TypeScript или Python, — потом имя проекта, тип агента и стартовую точку. Вопросы задаются по одному, чтобы отвечать было проще. Если имя передано аргументом, шаг с ним пропускается.

Дальше команда сверяется с официальной документацией SDK через WebFetch, проверяет актуальные версии пакетов и собирает план: инициализация проекта, установка @anthropic-ai/claude-agent-sdk или claude-agent-sdk, файлы index.ts или main.py с примером запроса, .env.example с ANTHROPIC_API_KEY и .gitignore. Для TypeScript она прогоняет npx tsc --noEmit и правит ошибки типов до чистого прохода. Готовый проект проверяют субагенты agent-sdk-verifier-ts или agent-sdk-verifier-py.

Для работы понадобится ключ API из консоли Anthropic — без него пример не запустится. Команда ставит свежие версии пакетов, поэтому сборка может отличаться от того, что вы видели в старых руководствах.

Какие задачи решает

  • развернуть каркас приложения на Claude Agent SDK с нуля
  • выбрать между TypeScript и Python до начала работы
  • получить рабочий пример запроса к агенту с обработкой ошибок
  • проверить типы и импорты до первого запуска
  • подготовить .env и не закоммитить ключ API

Примеры запросов агенту

  • Создай новый проект на Agent SDK, назовём его support-bot
  • Заведи приложение на Claude Agent SDK на Python с минимальным примером
  • Сделай каркас агента для ревью кода на TypeScript

Как установить new-sdk-app

1Через маркетплейс плагинов

/plugin install agent-sdk-dev@claude-plugins-official

2Вручную: положить файлы

.claude/commands/new-sdk-app.md

Вызов — /new-sdk-app. Для всех проектов — ~/.claude/commands/

Вопросы о new-sdk-app

Как установить new-sdk-app в Claude Code?

Через маркетплейс: сначала /plugin marketplace add anthropics/claude-plugins-official, затем /plugin install agent-sdk-dev@claude-plugins-official. После установки команда доступна как /new-sdk-app.

Что делает new-sdk-app?

Создаёт и настраивает новое приложение на Claude Agent SDK: собирает требования, ставит пакет SDK, пишет стартовый файл и проверяет, что код компилируется.

Что нужно для запуска?

Ключ API Anthropic: команда кладёт в проект .env.example с ANTHROPIC_API_KEY, а сам ключ вы получаете в консоли Anthropic и вписываете в .env.

Исходный текст

new-sdk-app.md · Apache-2.0
---
description: Create and setup a new Claude Agent SDK application
argument-hint: [project-name]
---

You are tasked with helping the user create a new Claude Agent SDK application. Follow these steps carefully:

## Reference Documentation

Before starting, review the official documentation to ensure you provide accurate and up-to-date guidance. Use WebFetch to read these pages:

1. **Start with the overview**: https://docs.claude.com/en/api/agent-sdk/overview
2. **Based on the user's language choice, read the appropriate SDK reference**:
   - TypeScript: https://docs.claude.com/en/api/agent-sdk/typescript
   - Python: https://docs.claude.com/en/api/agent-sdk/python
3. **Read relevant guides mentioned in the overview** such as:
   - Streaming vs Single Mode
   - Permissions
   - Custom Tools
   - MCP integration
   - Subagents
   - Sessions
   - Any other relevant guides based on the user's needs

**IMPORTANT**: Always check for and use the latest versions of packages. Use WebSearch or WebFetch to verify current versions before installation.

## Gather Requirements

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):

1. **Language** (ask first): "Would you like to use TypeScript or Python?"

   - Wait for response before continuing

2. **Project name** (ask second): "What would you like to name your project?"

   - If $ARGUMENTS is provided, use that as the project name and skip this question
   - Wait for response before continuing

3. **Agent type** (ask third, but skip if #2 was sufficiently detailed): "What kind of agent are you building? Some examples:

   - Coding agent (SRE, security review, code review)
   - Business agent (customer support, content creation)
   - Custom agent (describe your use case)"
   - Wait for response before continuing

4. **Starting point** (ask fourth): "Would you like:

   - A minimal 'Hello World' example to start
   - A basic agent with common features
   - A specific example based on your use case"
   - Wait for response before continuing

5. **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.

## Setup Plan

Based on the user's answers, create a plan that includes:

1. **Project initialization**:

   - Create project directory (if it doesn't exist)
   - Initialize package manager:
     - TypeScript: `npm init -y` and setup `package.json` with type: "module" and scripts (include a "typecheck" script)
     - Python: Create `requirements.txt` or use `poetry init`
   - Add necessary configuration files:
     - TypeScript: Create `tsconfig.json` with proper settings for the SDK
     - Python: Optionally create config files if needed

2. **Check for Latest Versions**:

   - BEFORE installing, use WebSearch or check npm/PyPI to find the latest version
   - For TypeScript: Check https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk
   - For Python: Check https://pypi.org/project/claude-agent-sdk/
   - Inform the user which version you're installing

3. **SDK Installation**:

   - TypeScript: `npm install @anthropic-ai/claude-agent-sdk@latest` (or specify latest version)
   - Python: `pip install claude-agent-sdk` (pip installs latest by default)
   - After installation, verify the installed version:
     - TypeScript: Check package.json or run `npm list @anthropic-ai/claude-agent-sdk`
     - Python: Run `pip show claude-agent-sdk`

4. **Create starter files**:

   - TypeScript: Create an `index.ts` or `src/index.ts` with a basic query example
   - Python: Create a `main.py` with a basic query example
   - Include proper imports and basic error handling
   - Use modern, up-to-date syntax and patterns from the latest SDK version

5. **Environment setup**:

   - Create a `.env.example` file with `ANTHROPIC_API_KEY=your_api_key_here`
   - Add `.env` to `.gitignore`
   - Explain how to get an API key from https://console.anthropic.com/

6. **Optional: Create .claude directory structure**:
   - Offer to create `.claude/` directory for agents, commands, and settings
   - Ask if they want any example subagents or slash commands

## Implementation

After gathering requirements and getting user confirmation on the plan:

1. Check for latest package versions using WebSearch or WebFetch
2. Execute the setup steps
3. Create all necessary files
4. Install dependencies (always use latest stable versions)
5. Verify installed versions and inform the user
6. Create a working example based on their agent type
7. Add helpful comments in the code explaining what each part does
8. **VERIFY THE CODE WORKS BEFORE FINISHING**:
   - For TypeScript:
     - Run `npx tsc --noEmit` to check for type errors
     - Fix ALL type errors until types pass completely
     - Ensure imports and types are correct
     - Only proceed when type checking passes with no errors
   - For Python:
     - Verify imports are correct
     - Check for basic syntax errors
   - **DO NOT consider the setup complete until the code verifies successfully**

## Verification

After 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:

1. **For TypeScript projects**: Launch the **agent-sdk-verifier-ts** agent to validate the setup
2. **For Python projects**: Launch the **agent-sdk-verifier-py** agent to validate the setup
3. The agent will check SDK usage, configuration, functionality, and adherence to official documentation
4. Review the verification report and address any issues

## Getting Started Guide

Once setup is complete and verified, provide the user with:

1. **Next steps**:

   - How to set their API key
   - How to run their agent:
     - TypeScript: `npm start` or `node --loader ts-node/esm index.ts`
     - Python: `python main.py`

2. **Useful resources**:

   - Link to TypeScript SDK reference: https://docs.claude.com/en/api/agent-sdk/typescript
   - Link to Python SDK reference: https://docs.claude.com/en/api/agent-sdk/python
   - Explain key concepts: system prompts, permissions, tools, MCP servers

3. **Common next steps**:
   - How to customize the system prompt
   - How to add custom tools via MCP
   - How to configure permissions
   - How to create subagents

## Important Notes

- **ALWAYS USE LATEST VERSIONS**: Before installing any packages, check for the latest versions using WebSearch or by checking npm/PyPI directly
- **VERIFY CODE RUNS CORRECTLY**:
  - For TypeScript: Run `npx tsc --noEmit` and fix ALL type errors before finishing
  - For Python: Verify syntax and imports are correct
  - Do NOT consider the task complete until the code passes verification
- Verify the installed version after installation and inform the user
- Check the official documentation for any version-specific requirements (Node.js version, Python version, etc.)
- Always check if directories/files already exist before creating them
- Use the user's preferred package manager (npm, yarn, pnpm for TypeScript; pip, poetry for Python)
- Ensure all code examples are functional and include proper error handling
- Use modern syntax and patterns that are compatible with the latest SDK version
- Make the experience interactive and educational
- **ASK QUESTIONS ONE AT A TIME** - Do not ask multiple questions in a single response

Begin by asking the FIRST requirement question only. Wait for the user's answer before proceeding to the next question.

© Anthropic · Apache-2.0 · anthropics/claude-plugins-official

Похожие слэш-команды

Все слэш-команды по теме «Настройка агента: память, контекст, субагенты» →
qdrant-clients-sdk официальный github Скилл подсказывает, как подключать Qdrant через официальные SDK и API. Пригодится для кода на Python, TypeScript, Rust, Go, .NET или Java. 61установок security-hardening Seth Hobson Команда проводит аудит безопасности по этапам: сканирует уязвимости, строит threat model и проверяет архитектуру. Подходит для поэтапного hardening проекта. CX Codex 437установок status Seth Hobson Показывает состояние проекта Conductor, активные треки и следующие действия. Нужна, когда важно увидеть прогресс по задачам и блокеры. CX Codex 348установок ultra-think davila7 Запускает многошаговый разбор задачи: вскрывает скрытые допущения, предлагает конкурирующие варианты и проверяет каждый на прочность. Пригодится, когда решение дорогое и не хочется ошибиться. 8 383установок create-architecture-documentation davila7 Слэш-команда для Claude, которая собирает документацию по архитектуре проекта: диаграммы, ADR и описание компонентов. 6 136установок refactor-code davila7 Слэш-команда ведёт агента по 17 шагам рефакторинга: от анализа и тестов до проверки производительности и подготовки к ревью. 4 890установок

Из того же набора145

Весь набор →
patch-generator Готовит исправление одной находки в отдельной копии репозитория и оставляет изменение в staged-виде, чтобы его вынесли в патч. ★ 44 770звёзд репо explore Субагент ищет файлы, строит карту вызовов и находит места реализации функций в кодовой базе. Работает строго в режиме чтения без изменения файлов. ★ 44 770звёзд репо claude-security Сканирует репозиторий или изменения, а затем готовит проверенные патчи для найденных проблем. Запускается только как главный агент сессии. ★ 44 770звёзд репо revise-claude-md Команда анализирует текущую сессию и предлагает лаконичные дополнения для файлов CLAUDE.md или .claude.local.md. Пригодится, когда проект оброс новыми командами сборки. ★ 44 770звёзд репо agent-sdk-verifier-ts Проверяет конфигурацию приложений на базе @anthropic-ai/claude-agent-sdk. Находит ошибки сборки, утечки ключей и проблемы в tsconfig.json перед развёртыванием. ★ 44 770звёзд репо agent-sdk-verifier-py Проверяет Python-приложение на базе Agent SDK: конфигурацию, вызовы SDK, безопасность и готовность к тестированию или развёртыванию. ★ 44 770звёзд репо asana-setup Пошагово проводит через настройку OAuth-приложения Asana и добавление MCP-сервера в Claude. Пригодится, если нужно связать задачи Asana с агентом. ★ 44 770звёзд репо typescript-lsp Подключает языковой сервер для TypeScript и JavaScript к Claude Code. Помогает переходить к определениям, искать ссылки и проверять ошибки прямо при редактировании кода. ★ 44 770звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой