Prompt Library · 独立学习内容
Claude Code 提示词库
Anthropic 官方提示词库 52 条的完整收录与中文转述:按软件开发生命周期的阶段 × 类别组织,中英对照。橙色槽位可直接编辑、一键复制拼装好的提示词;配合背诵模式与随机抽背,一周即可背完。
发现 Discover· 入职 Onboard1 条
give me an overview of this codebase: architecture, key directories, and how the pieces connect
发现 Discover· 理解 Understand6 条
explain what src/scheduler/queue.ts does and how data flows through it. write it up as an HTML page with a diagram, then open it in my browser
where do we validate uploaded file types?
what would break if I deleted the retryWithBackoff helper?
look through the commit history of internal/auth/session.go and summarize how it evolved and why
which files would I need to touch to add a dark mode toggle to settings?
I am a PM. walk me through what happens when a user clicks Export to PDF, from the UI down to the result
设计 Design· 计划 Plan4 条
plan how to refactor the payment module to support multiple currencies. list the files you would change, but don't edit anything yet
I want to build per-workspace rate limits. interview me about implementation, UX, edge cases, and tradeoffs until we have covered everything, then write the spec to SPEC.md
read @meeting-notes.md and write up the action items, then create a Linear ticket for each with acceptance criteria
list the error states, empty states, and edge cases for the file upload flow that the design needs to cover
设计 Design· 原型 Prototype2 条
here is a mockup. build a working prototype I can click through, matching the layout and states shown
implement this design, then take a screenshot of the result, compare it to the original, and fix any differences
构建 Build· 实现 Implement7 条
look at how the GitHub webhook handler is implemented to understand the pattern, then build a Stripe webhook handler the same way
find the public functions in src/auth/ without JSDoc comments and add them, matching the style already used in the file
add a /health endpoint that returns the app version and uptime
create a drag-and-drop Kanban board with three columns using HTML, CSS, and vanilla JavaScript, then open it in my browser
read issue #312, implement the fix, and run the tests
find every place we say "Sign up free" or a close variant, show me each one in context, then update them all to "Start free trial". leave tests and the changelog alone
read the privacy impact assessments in legal/pia/ to learn the structure and voice, then draft a new one for the new analytics integration
构建 Build· 测试 Test3 条
write tests for app/parsers/feed.py, run them, and fix any failures
write tests for the password reset flow first, then implement it until they pass
read coverage/coverage-summary.json and add tests for the lowest-covered files until each is above 80%
构建 Build· 重构 Refactor4 条
migrate everything from the old logging API to the structured logger: identify every place that needs to change, then make the changes
port this Python module to Rust, keeping the same public API and test behavior
optimize the search query to bring p95 latency from 2s down to under 500ms
the login button extends 20px beyond the card border on mobile. fix it.
构建 Build· 审查 Review5 条
review my uncommitted changes and flag anything that looks risky before I commit
review PR #247 and summarize what changed, then list any concerns
here is my Terraform plan output. what is this going to do, and is anything here going to cause problems?
use a subagent to review src/api/ for security issues and report what it finds
review launch-post.md for unsupported claims, missing attributions, and brand-guideline issues and list anything I should fix before it goes to legal
构建 Build· 引导 Steer3 条
that is not right: the function signature needs to stay backward-compatible. try a different approach
that is too much. keep only the changes to the validation logic in src/forms/ and undo your other edits
you keep using default exports when this project uses named exports. add a rule to CLAUDE.md so this stops happening
交付 Ship· Git Git3 条
resolve the merge conflicts in this branch and explain what you kept from each side
commit these changes with a message that summarizes what I did
find the Linear ticket about the login timeout and open a PR that implements it
交付 Ship· 发布 Release2 条
compare v2.3.0 to v2.4.0 and draft release notes grouped by feature, fix, and breaking change
write a GitHub Actions workflow that runs the tests and deploys to staging on every push to main
运营 Operate· 调试 Debug3 条
the UserAuth test is failing, find out why and fix it
users are seeing 500 errors on /api/settings. investigate and tell me what is going on
here is a build error. fix the root cause and verify the build succeeds
运营 Operate· 事件 Incident3 条
the checkout endpoint started returning 500s an hour ago. check the logs, recent deploys, and config changes, then tell me the most likely cause
here is a screenshot of the GCP Kubernetes dashboard. walk me through why this pod is failing and give me the exact commands to fix it
show me all failed logins for the auth service over the past 24 hours. write the query, run it, and tell me what stands out
运营 Operate· 数据 Data2 条
read @reports/q1-signups.csv, summarize the key patterns, and write the results to an HTML page with charts, then open it in my browser
read @ads-performance.csv, find the underperforming headlines, and generate 20 new variations that stay under 90 characters
运营 Operate· 自动化 Automate4 条
create a /ship skill for this project that runs the linter and tests, then drafts a commit message
write a hook that runs prettier after every edit to a .ts or .tsx file
set up the Sentry MCP server so you can read my error reports directly
summarize what we did this session and suggest what to add to CLAUDE.md
✨ 六大通用模式
背完 52 条后掌握这 6 个模式,就能自己写出同水平的提示词。
1 · 描述结果,而不是步骤
说出你想要什么,让 Claude 自己找文件,无需指名路径。
add rate limiting to the public API and make sure existing tests still pass给公开 API 加上限流,并确保现有测试仍通过2 · 给它自查手段
同一条提示词里要求运行、测试、对比或验证,让它迭代而非试一次就停。
write the migration, run it against the dev database, and confirm the schema matches写迁移脚本,在开发库上执行,确认 schema 一致3 · 指向参照物
点名现有文件、测试或模式,新代码就和你已有的一致。
add a settings page that follows the same layout as the profile page加一个设置页,布局与个人资料页保持一致4 · 给出可测量的目标
涉及性能或覆盖率时,给指标和阈值,「完成」才有定义。
get the bundle size under 200KB and show me what you removed把包体积降到 200KB 以内,并列出你删了什么5 · 直接给工件
把报错、日志、截图、plan 输出粘进提示词,或用 @ 引用文件。
why is the build failing? @build.log构建为什么失败?@build.log6 · 说明答案的形式
点名格式、长度或受众,解释才合你的用途。
explain how the payment retry logic works as an HTML page with a diagram, then open it in my browser用一页带图表的 HTML 解释支付重试逻辑,然后在我的浏览器里打开🎯 背诵建议
- 背诵路线:先背 5 条 ★ 起点(约 10 分钟),再按「发现 → 构建 → 运营 → 设计 → 交付」每天 8~10 条,一周背完。
- 记骨架不记全文:每条只需记住「动词 + 槽位 + 约束 / 验证」,如 write tests for X, run them, and fix any failures。
- 中英等效:Claude Code 对中英文提示词效果等同;英文原句在团队协作、写技能、写文档时更通用。
- 落地闭环:背熟 → 用进日常开发 → 高频提示词沉淀为 /技能 或 CLAUDE.md 规则(见第 35、49、52 条)。
数据来源:code.claude.com/docs/zh-CN/prompt-library(2026-09 完整收录,52 条 · 5 阶段 · 15 类别)。提示词原文版权归 Anthropic;中文标题、「为什么有效」讲解与站点包装为本站转述。这个库与本课的五章内容相互独立——想系统学工作流,回课程主页;术语随查随用去词典。