claude-api-in-prototypes 精选
Call Claude from your HTML artifacts via window.claude.complete
安装方式
cp -r Anthropic/claude-design/skills/claude-api-in-prototypes ~/.claude/skills/claude-api-in-prototypes把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/
https://raw.githubusercontent.com/asgeirtj/system_prompts_leaks/a09e0e708710093ed9fc15fb24bfc1374f584da4/Anthropic/claude-design/skills/claude-api-in-prototypes/SKILL.md下载后另存为 ~/.claude/skills/claude-api-in-prototypes/SKILL.md。链接锁定采集时的 commit,内容与本站展示一致。
整仓一次性获取:git clone --depth 1 https://github.com/asgeirtj/system_prompts_leaks.git
依赖与权限
- 需要 API Key —— 使用前需配置相应的密钥环境变量
- 无需联网
- 无外部命令依赖
- 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。
SKILL.md 正文
Claude API in prototypes
Your HTML artifacts can call Claude via a built-in helper. No SDK or API key needed.
<script>
(async () => {
const text = await window.claude.complete("Summarize this: ...");
// or with a messages array:
const text2 = await window.claude.complete({
messages: [{ role: 'user', content: '...' }],
});
})();
</script>
Calls default to claude-haiku-4-5 with a 1024-token output cap. The body may also set model (haiku/sonnet families only), max_tokens (up to 32000), system, tool_choice, and client tools — standard Messages API shapes, except each tool also carries run: async (input) => string and the helper executes tool calls in-page and loops (max 8 model calls), resolving with the final text. Handler throws become is_error tool_results. Server tools (web search etc.) are rejected; no streaming; rate-limited 15 calls/minute per user, loop iterations included. Shared artifacts run under the viewer's quota.
质量与来源
- 所属仓库
- asgeirtj/system_prompts_leaks
- 仓库星标
- 6.9 万
- 最近更新
- 今天
- 采集时间
- 今天
- commit
- a09e0e708710
- 内容指纹
- sha256:7875558b123c1e2
- 文件路径
- Anthropic/claude-design/skills/claude-api-in-prototypes/SKILL.md