主题
Prompt 库
按任务和角色分类、可复制粘贴进 Claude Code 的官方 prompt 合集。
是什么
Prompt 库是一组可直接复制到 Claude Code 使用的 prompt,用于探索没尝试过的工作方式,或在不知从何下手时作为起点。这些 prompt 收集自 Anthropic 的多份指南,包括 Common workflows、Best practices 以及 How Anthropic teams use Claude Code。
它们是起点而非脚本。每条 prompt 下展开 Why this works(为何有效)可看到背后的模式,从而学会自己写 prompt。页面带搜索框、按标签(角色/阶段)筛选,并提供 Start here 五条入门 prompt。
怎么工作
- 每条 prompt 按 SDLC 阶段(Discover/Design/Build/Ship/Operate)和类别(Onboard、Understand、Plan、Prototype、Implement、Test、Refactor、Review、Steer、Git、Release、Debug、Incident、Data、Automate)组织。
- 部分 prompt 带可填空的槽位(如 {path}、{feature}),在高亮字段填入自己的内容后再复制。
- 部分 prompt 标注 Needs(前置条件),如 gh CLI、issue tracker(MCP/connector)、浏览器渲染能力、数据库/日志连接。
- 部分 prompt 需先粘贴或 @-mention 素材(mockup、design 图、screenshot、Terraform plan 输出、错误输出、CSV 文件)。
- 每条 prompt 标注来源,并给出 Make it stick 后续建议(如存成 skill、写入 CLAUDE.md)。
- 顶部提供搜索、按角色标签(Product/Design/Docs/Marketing/Security/On-call 等)筛选,以及 Start here 五条入门 prompt。
怎么配置 / 用法
Start here 入门 prompt 示例:
text
give me an overview of this codebase: architecture, key directories, and how the pieces connect带槽位的示例(填入高亮字段后复制):
text
write tests for {path}, run them, and fix any failures什么时候用
- 想探索还没尝试过的 Claude Code 工作方式时
- 不确定从哪开始、需要现成起点时
- 按具体任务(理解代码、计划、测试、审查、调试、发布等)或角色(PM、设计、运维、安全等)查找对应 prompt 时
- 想通过 Why this works 学习 prompt 背后的模式以便自己改写时
限制 / 坑
- 这些 prompt 是起点而非脚本,需按自己的项目改写。
- 部分 prompt 有前置条件(gh CLI、MCP/connector、浏览器渲染、数据库连接)才能正常工作。
硬事实速查(15 条)
- Get oriented in a new repository:give me an overview of this codebase: architecture, key directories, and how the pieces connect
- Explain unfamiliar code:explain what {path} does and how data flows through it. write it up as
- Find where something happens:where do we {behavior}?
- Check what breaks before you delete:what would break if I deleted {target}?
- Plan a multi-file change before touching code:plan how to refactor the {target} to {goal}. list the files you would change, but don't edit anything yet
- Draft a spec by interview:I want to build {feature}. interview me about implementation, UX, edge cases, and tradeoffs until we have covered everything, then write the spec to SPEC.md
- Implement from a screenshot and self-check:implement this design, then take a screenshot of the result, compare it to the original, and fix any differences
- Work an issue end to end:read issue #{issue}, implement the fix, and run the tests(需 gh)
- Write tests, run them, fix failures:write tests for {path}, run them, and fix any failures
- Run a security review with a subagent:use a subagent to review {path} for security issues and report what it finds
- Review a pull request:review PR #{pr} and summarize what changed, then list any concerns(需 gh)
- Turn a correction into a rule:you keep {mistake}. add a rule to CLAUDE.md so this stops happening
- Find and fix a failing test:the {test} test is failing, find out why and fix it
- Turn a recurring task into a skill:create a /{name} skill for this project that
- Connect a tool with MCP:set up the {server} MCP server so you can read my {data} directly