anthropics / anthropics/claude-agent-sdk-typescript

Feature request: pre-built Agent Skill for @anthropic-ai/claude-agent-sdk (parallel to anthropics/claude-api skill)

未关闭
#290 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Shell
星标
1.8k
派生
226
PR 合并指标
30 天内没有已合并 PR

描述

## Problem

When coding agents (Claude Code, Cursor, Copilot, etc.) build or maintain apps on `@anthropic-ai/claude-agent-sdk`, they have no Anthropic-published Agent Skill to lean on. Two gaps this causes:

1. **Stale SDK knowledge** — agents fall back to training-cutoff mental models of `query()` options, `SDKMessage` variants, MCP registration, session APIs, etc. Recent breaking changes (e.g. the `options.env` overlay-vs-replace shift in 0.2.113) ship silently into agent-written code.
2. **Manual docs hand-off** — developers end up pasting CHANGELOG diffs or README links into the agent's context window for every non-trivial task, which doesn't scale and isn't auditable.

## Proposed solution

A first-party Agent Skill published to `anthropics/skills`, alongside the existing [`claude-api`](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/claude-api-skill) skill, that covers the `@anthropic-ai/claude-agent-sdk` surface specifically. Auto-activates on `@anthropic-ai/claude-agent-sdk` imports; ships progressive disclosure per-task (MCP, streaming, sessions, permission modes, hooks).

Prior art:

- Anthropic's own [`claude-api` skill](https://github.com/anthropics/skills/tree/main/skills/claude-api) — Messages API + Managed Agents, auto-activates on `@anthropic-ai/sdk`. **Does not currently cover the Agent SDK.**
- Tiptap's [agent skill](https://tiptap.dev/docs/resources/agent-skill) — same progressive-disclosure pattern, clones local reference repos for offline use.

## Why it should live in this repo (or be cross-linked)

The skill's authoritative source is the SDK's own `CHANGELOG.md`, `README.md`, `docs/`, and `examples/` — all already in this repo. Publishing the skill here (or at least cross-linking to an `anthropics/skills/skills/claude-agent-sdk/` subfolder that reads from here) keeps the two in lockstep on every release.

## Acceptance criteria

- [ ] Skill installable via `npx skills add` / `/plugin install` — same flow as `claude-api`
- [ ] Auto-activates on TypeScript files importing `@anthropic-ai/claude-agent-sdk`
- [ ] Surfaces the three things agents get wrong most:
- `query()` input as async generator (required when MCP servers are attached)
- `createSdkMcpServer` + `tool()` Zod schema contract
- Permission modes + `allowDangerouslySkipPermissions` semantics
- [ ] Ships a `/claude-agent-sdk migrate` subcommand for breaking-change bumps, mirroring `/claude-api migrate`
- [ ] Works standalone *and* composes with the existing `claude-api` skill (many agent apps use both)

## Workaround until then

Teams are cloning this repo locally and pointing their agents at `CHANGELOG.md` + `examples/` for semantic review on every bump — brittle and high-friction.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。