cookbook-audit by anthropics/claude-cookbooks
npx skills add https://github.com/anthropics/claude-cookbooks --skill cookbook-audit使用 style_guide.md 中的指南和评分标准审查请求的 Cookbook notebook。根据评分指南提供分数,并就如何改进 cookbook 提出建议。
风格指南提供了详细的模板和示例,涵盖:
重要提示:在进行审计之前,请务必先阅读 style_guide.md。风格指南包含可供参考的规范模板以及好/坏示例。
遵循以下步骤进行全面审计:
style_guide.md 以了解当前最佳实践python3 validate_notebook.py <路径> 来捕获技术问题并生成 markdown
* 该脚本会自动运行 detect-secrets 来扫描硬编码的 API 密钥和凭据
* 使用 scripts/detect-secrets/plugins.py 中定义的自定义模式
* 对照 处的基线进行检查广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
scripts/detect-secrets/.secrets.baselinetmp/ 文件夹中生成一个 markdown 文件以便于审查(与原始 .ipynb 文件相比,可以保存上下文)
* tmp/ 文件夹被 gitignore 以避免提交审查工件
* Markdown 包含代码单元格,但为了更清晰的审查而排除了输出使用以下结构呈现您的审计结果:
[简要说明理由,并提供具体示例]
[简要说明理由,并提供具体示例]
[简要说明理由,并提供具体示例]
[简要说明理由,并提供具体示例]
[按优先级排序、可操作的改进列表,并引用具体章节]
[展示 notebook 中的具体摘录,并提供具体的改进建议]
使用此清单确保全面覆盖:
引言(参见 style_guide.md 第 1 节)
先决条件与设置(参见 style_guide.md 第 2 节)
%%capture 来抑制 pip install 的输出dotenv.load_dotenv() 而非 os.environ结构与组织
结论(参见 style_guide.md 第 4 节)
代码质量
输出管理
%%capture 抑制 pip install 日志内容质量
技术要求
Cookbooks 主要面向行动,但也战略性地融入了理解,并受到 Diataxis 框架的启发。
核心原则:
一个好的 cookbook 不仅帮助用户解决当前的问题,还帮助他们理解解决方案背后的基本原理,鼓励他们识别何时以及如何调整方法。用户将能够就 AI 系统设计做出更明智的决策,培养对模型输出的判断力,并构建可迁移到未来 AI 系统的技能。
Cookbooks 不是纯教程:我们假设用户具备基本的技术技能和 API 熟悉度。我们在 cookbook 中明确说明先决条件,并引导用户前往 Academy 学习更多相关知识。它们不是全面的解释:我们不教授 Transformer 架构或概率论。我们需要理解,用户遵循我们的 cookbook 是为了解决他们当前面临的问题。他们很忙,正在学习或构建过程中,希望能够利用所学知识解决他们的即时需求。Cookbooks 不是参考文档:我们不会详尽记录每个参数,而是根据需要链接到文档中的适当资源。Cookbooks 不是简单的技巧和窍门:我们不教授仅适用于当前模型世代的“技巧”。我们不夸大其词,也不敷衍了事。Cookbooks 不是生产就绪的代码:它们展示用例和功能,而非生产模式。不需要过多的错误处理。
dotenv.load_dotenv() 而非 os.environ使用 %%capture 移除无关输出:
显示相关输出:
有关详细模板和示例,请参见 style_guide.md
必须包括:
❌ 避免:以机制为引领(“我们将使用 Claude SDK 构建一个研究代理……”) ✅ 应做:以问题/价值为引领(“你的团队花费数小时处理 CI 故障……”)
必须包括:
%%capture 处理 pip installdotenv.load_dotenv() 而非 os.environMODEL 常量按逻辑步骤或阶段组织,每个部分包含:
必须包括:
❌ 避免:通用性总结(“我们演示了 SDK 如何实现……”) ✅ 应做:可操作的指导(“考虑将此应用到 X……接下来,尝试 Y……”)
有关详细的好/坏示例,请参考 style_guide.md。注意以下问题:
❌ 以机制为引领:“我们将使用 Claude SDK 构建一个研究代理……” ❌ 功能堆砌:列出 SDK 方法或工具功能 ❌ 模糊的学习目标:“了解代理”或“理解 API” ✅ 以问题为先的框架,具有具体、可操作的学习目标
❌ 未使用 %%capture 导致 pip install 输出嘈杂
❌ 多个独立的 pip install 命令
❌ 使用 os.environ["API_KEY"] = "your_key" 而非 dotenv
❌ 在整个 notebook 中硬编码模型名称,而非使用 MODEL 常量
✅ 干净的设置,包含分组安装、dotenv 和常量
❌ 代码块之前没有解释性文字 ❌ 运行代码后没有解释所学内容 ❌ 注释解释代码“做什么”(代码应具有自解释性) ❌ 过度解释显而易见的代码 ✅ 代码之前提供上下文,代码之后提供见解,注释解释“为什么”
❌ 通用性总结:“我们演示了 SDK 如何实现……” ❌ 仅仅重述 notebook 做了什么,而没有提供指导 ❌ 没有映射回声明的学习目标 ✅ 关于如何将经验教训应用到用户特定上下文的可操作指导
每周安装次数
165
代码仓库
GitHub 星标数
34.6K
首次出现
2026年1月21日
安全审计
安装于
opencode130
claude-code128
gemini-cli113
cursor106
codex103
github-copilot83
Review the requested Cookbook notebook using the guidelines and rubrics in style_guide.md. Provide a score based on scoring guidelines and recommendations on improving the cookbook.
The style guide provides detailed templates and examples for:
IMPORTANT : Always read style_guide.md first before conducting an audit. The style guide contains the canonical templates and good/bad examples to reference.
Follow these steps for a comprehensive audit:
style_guide.md to understand current best practicespython3 validate_notebook.py <path> to catch technical issues and generate markdown
scripts/detect-secrets/plugins.pyscripts/detect-secrets/.secrets.baselinetmp/ folder for easier review (saves context vs raw .ipynb)
Present your audit using this structure:
[Brief justification with specific examples]
[Brief justification with specific examples]
[Brief justification with specific examples]
[Brief justification with specific examples]
[Prioritized, actionable list of improvements with references to specific sections]
[Show specific excerpts from the notebook with concrete suggestions for improvement]
Use this to ensure comprehensive coverage:
Introduction (See style_guide.md Section 1)
Prerequisites & Setup (See style_guide.md Section 2)
Structure & Organization
Conclusion (See style_guide.md Section 4)
Code Quality
Output Management
Content Quality
Technical Requirements
Cookbooks are primarily action-oriented but strategically incorporate understanding and informed by Diataxis framework.
Core Principles:
A good cookbook doesn't just help users solve today's problem, it also helps them understand the underlying principles behind the solutions, encouraging them to recognize when and how to adapt approaches. Users will be able to make more informed decisions about AI system design, develop judgement about model outputs, and build skills that transfer to future AI systems.
Cookbooks are not pure tutorials: We assume users have basic technical skills and API familiarity. We clearly state prerequisites in our cookbooks, and direct users to the Academy to learn more on topics. They are not comprehensive explanations: We don't teach transformer architecture or probability theory. We need to understand that our users are following our cookbooks to solve problems they are facing today. They are busy, in the midst of learning or building, and want to be able to use what they learn to solve their immediate needs. Cookbooks are not reference docs: We don't exhaustively document every parameter, we link to appropriate resources in our documentation as needed. Cookbooks are not simple tips and tricks: We don't teach "hacks" that only work for the current model generation. We don't over-promise and under-deliver. Cookbooks are not production-ready code: They showcase use cases and capabilities, not production patterns. Excessive error handling is not required.
dotenv.load_dotenv() instead of os.environRemove extraneous output with %%capture:
Show relevant output :
See style_guide.md for detailed templates and examples
Must include:
❌ Avoid : Leading with machinery ("We will build a research agent...") ✅ Do : Lead with problem/value ("Your team spends hours triaging CI failures...")
Must include:
%%capture for pip installsdotenv.load_dotenv() not os.environMODEL constant at topOrganized by logical steps or phases, each with:
Must include:
❌ Avoid : Generic summaries ("We've demonstrated how the SDK enables...") ✅ Do : Actionable guidance ("Consider applying this to X... Next, try Y...")
Refer to style_guide.md for detailed good/bad examples. Watch for these issues:
❌ Leading with machinery: "We will build a research agent using the Claude SDK..." ❌ Feature dumps: Listing SDK methods or tool capabilities ❌ Vague learning objectives: "Learn about agents" or "Understand the API" ✅ Problem-first framing with specific, actionable learning objectives
❌ Noisy pip install output without %%capture ❌ Multiple separate pip install commands ❌ Using os.environ["API_KEY"] = "your_key" instead of dotenv ❌ Hardcoding model names throughout instead of using a MODEL constant ✅ Clean setup with grouped installs, dotenv, and constants
❌ Code blocks without explanatory text before them ❌ No explanation of what we learned after running code ❌ Comments that explain "what" the code does (code should be self-documenting) ❌ Over-explaining obvious code ✅ Context before code, insights after code, comments explain "why"
❌ Generic summaries: "We've demonstrated how the SDK enables..." ❌ Simply restating what the notebook did without guidance ❌ Not mapping back to the stated learning objectives ✅ Actionable guidance on applying lessons to user's specific context
Weekly Installs
165
Repository
GitHub Stars
34.6K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode130
claude-code128
gemini-cli113
cursor106
codex103
github-copilot83
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装