news 2026/7/25 2:49:28

笔记本质量审计_cookbook-audit

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
笔记本质量审计_cookbook-audit

以下为本文档的中文说明

Cookbook 审计技能是一个专门用于审查 Anthropic Cookbook 笔记本的质量评估工具,基于预定义的评分标准进行系统性评审。它的核心功能包括对照风格指南评估笔记本质量、提供详细评分和改进建议、确保内容符合教学标准。使用场景是在需要对 Cookbook 笔记本进行审阅或审计时触发。该技能要求首先读取 style_guide.md 文件来了解权威模板和标准,然后按照系统化的审计流程操作。风格指南提供了详细的模板和示例,涵盖问题导向的引言(包含终端学习目标和使能学习目标)、前置条件和环境设置模式、核心内容结构以及映射回学习目标的结论。审计工作流程包括阅读风格指南了解标准、按评分指南逐项打分、提供改进建议、生成综合审计报告。核心特点在于教育导向和标准化评审。它不仅仅是一个内容检查工具,更是一个教学质量保证系统,通过结构化的学习目标和系统的内容评估,确保每个 Cookbook 笔记本都能有效地传递知识和技能。该技能的价值不仅体现在直接的功能实现上,还在于它与现有技术生态系统的良好兼容性和集成能力。无论是作为独立工具使用,还是嵌入到更大的工作流中,它都能发挥出应有的作用。通过遵循标准化的接口规范和协议,它减少了系统集成过程中的摩擦点,让用


Cookbook Audit

Instructions

Review the requested Cookbook notebook using the guidelines and rubrics instyle_guide.md. Provide a score based on scoring guidelines and recommendations on improving the cookbook.

The style guide provides detailed templates and examples for:

  • Problem-focused introductions with Terminal Learning Objectives (TLOs) and Enabling Learning Objectives (ELOs)
  • Prerequisites and setup patterns
  • Core content structure
  • Conclusions that map back to learning objectives

IMPORTANT: Always readstyle_guide.mdfirst before conducting an audit. The style guide contains the canonical templates and good/bad examples to reference.

Workflow

Follow these steps for a comprehensive audit:

  1. Read the style guide: First reviewstyle_guide.mdto understand current best practices
  2. Identify the notebook: Ask user for path if not provided
  3. Run automated checks: Usepython3 validate_notebook.py <path>to catch technical issues and generate markdown
    • The script automatically runs detect-secrets to scan for hardcoded API keys and credentials
    • Uses custom patterns defined inscripts/detect-secrets/plugins.py
    • Checks against baseline atscripts/detect-secrets/.secrets.baseline
  4. Review markdown output: The script generates a markdown file in thetmp/folder for easier review (saves context vs raw .ipynb)
    • The tmp/ folder is gitignored to avoid committing review artifacts
    • Markdown includes code cells but excludes outputs for cleaner review
  5. Manual review: Read through the markdown version evaluating against style guide and rubric
  6. Score each dimension: Apply scoring guidelines objectively
  7. Generate report: Follow the audit report format below
  8. Provide specific examples: Show concrete improvements with line references using the style guide templates

Audit Report Format

Present your audit using this structure:

Executive Summary

  • Overall Score: X/20
  • Key Strengths(2-3 bullet points)
  • Critical Issues(2-3 bullet points)

Detailed Scoring

1. Narrative Quality: X/5

[Brief justification with specific examples]

2. Code Quality: X/5

[Brief justification with specific examples]

3. Technical Accuracy: X/5

[Brief justification with specific examples]

4. Actionability & Understanding: X/5

[Brief justification with specific examples]

Specific Recommendations

[Prioritized, actionable list of improvements with references to specific sections]

Examples & Suggestions

[Show specific excerpts from the notebook with concrete suggestions for improvement]

Quick Reference Checklist

Use this to ensure comprehensive coverage:

Introduction(See style_guide.md Section 1)

  • Hooks with the problem being solved (1-2 sentences)
  • Explains why it matters (1-2 sentences)
  • Lists learning objectives as bullet points (2-4 TLOs/ELOs)
  • Focuses on value delivered, not machinery built
  • Optional: mentions broader applications (1 sentence)

Prerequisites & Setup(See style_guide.md Section 2)

  • Lists required knowledge clearly
  • Lists required tools (Python version, API keys)
  • Mentions recommended background if applicable
  • Uses %%capture for pip install to suppress output
  • Uses dotenv.load_dotenv() not os.environ
  • Defines MODEL constant at top
  • Groups related installs in single command

Structure & Organization

  • Has logical section progression
  • Each section teaches through demonstration
  • Code blocks have explanatory text before them
  • Includes what we learned after code blocks
  • Uses headers to break up sections

Conclusion(See style_guide.md Section 4)

  • Maps back to learning objectives
  • Summarizes what was accomplished
  • Suggests ways to apply lessons to user’s context
  • Points to next steps or related resources

Code Quality

  • All code blocks have explanatory text before them
  • No hardcoded API keys (automatically checked by detect-secrets)
  • Meaningful variable nam
    es
  • Comments explain “why” not “what”
  • Follows language best practices
  • Model name defined as constant at top of notebook

Output Management

  • pip install logs suppressed with %%capture
  • No verbose debug output
  • Shows relevant API responses
  • Stack traces only when demonstrating error handling

Content Quality

  • Explains why approaches work
  • Discusses when to use this approach
  • Mentions limitations/considerations
  • Provides transferable knowledge
  • Appropriate model selection

Technical Requirements

  • Executable without modification (except API keys)
  • Uses non-deprecated API patterns
  • Uses valid model names (claude-sonnet-4-6, claude-haiku-4-5, claude-opus-4-6)
  • Uses non-dated model aliases (never dated IDs like claude-sonnet-4-6-20250514)
  • Model name defined as constant at top of notebook
  • Includes dependency specifications
  • Assigned to primary category
  • Has relevant tags

Content Philosophy: Action + Understanding

Cookbooks are primarily action-oriented but strategically incorporate understanding and informed by Diataxis framework.

Core Principles:

  • Practical focus: Show users how to accomplish specific tasks with working code
  • Problem-first framing: Lead with the problem being solved and value delivered, not the machinery
  • Builder’s perspective: Written from the user’s point of view, solving real problems
  • Agency-building: Help users understand why approaches work, not just how
  • Transferable knowledge: Teach patterns and principles that apply beyond the specific example
  • Critical thinking: Encourage users to question outputs, recognize limitations, make informed choices
  • Learning contracts: State learning objectives upfront, then map back to them in conclusions

What Makes a Good Cookbook

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.

What Cookbooks Are NOT

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.

Style Guidelines

Voice & Tone
  • Educational and agency-building
  • Professional but approachable
  • Respectful of user intelligence and time
  • Either second person (“you”) or first person plural (“we”) - be consistent within a notebook
Writing Quality
  • Clear, concise explanations
  • Active voice preferred
  • Short paragraphs (3-5 sentences)
  • Avoid jargon without definition
  • Use headers to break up sections
Code Presentation
  • Always explain before showing: Every code block should be preceded by explanatory text
  • Explain after running: Include what we learned after code blocks execute
  • Comments explain why, not what: Use meaningful variable names
  • Use constants: Define MODEL as a constant at the top
  • Good habits: Usedotenv.load_dotenv()instead ofos.environ

Output Handling

Remove extraneous outputwith %%capture:

  • pip install logs (always suppress these)
  • Verbose debug statements
  • Lengthy stack traces (unless demonstrating error handling)

Show relevant output:

  • API responses that demonstrate functionality
  • Examples of successful execution

Structural Requirements

See style_guide.md for detailed templates and examples

1. Introduction (Required)

Must include:

  • Problem hook(1-2 sentences): What problem are we solving?
  • Why it matters(1-2 sentences): Why is this important?
  • Learning objectives(2-4 bullet points): “By the end of this cookbook, you’ll be able to…”
    • Use action verbs (Build, Implement, Deploy, etc.)
    • Be specific about capabilities
    • Include context/constraints
  • Optional: Broader applications (1 sentence)

Avoid: Leading with machinery (“We will build a research agent…”)
Do: Lead with problem/value (“Your team spends hours triaging CI failures…”)

2. Prerequisites & Setup (Required)

Must include:

  • Required Knowledge: Technical skills needed
  • Required Tools: Python version, API keys with links
  • Recommended: Optional background that helps
  • Setup: Step-by-step with explanations
    • Use%%capturefor pip installs
    • Usedotenv.load_dotenv()notos.environ
    • DefineMODELconstant at top
3. Main Content (Required)

Organized by logical steps or phases, each with:

  • Clear section headers
  • Explanatory text before code blocks(what we’re about to do)
  • Code examples
  • Explanatory text after code blocks(what we learned)
  • Expected outputs (where relevant)
  • Optional: Understanding callouts (why it works, when to use, limitations)
4. Conclusion (Recommended)

Must include:

  • Recap: Map back to learning objectives
  • What was accomplished: Summary of key points
  • Application guidance: How to apply lessons to user’s context
  • Next steps: Related resources or ideas to pursue

Avoid: Generic summaries (“We’ve demonstrated how the SDK enables…”)
Do: Actionable guidance (“Consider applying this to X… Next, try Y…”)

Optional Sections
  • How It Works: Brief explanation of underlying mechanism
  • When to Use This: Appropriate use cases and contexts
  • Limitations & Considerations: Caveats, failure modes, constraints
  • Troubleshooting: Common issues and solutions
  • Variations: Alternative approaches or extensions
  • Performance Notes: Optimization considerations
  • Further Reading: Links to relevant docs, papers, or deeper explanations

Common Anti-Patterns to Flag

Refer to style_guide.md for detailed good/bad examples. Watch for these issues:

Introduction Anti-Patterns

❌ 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

Setup Anti-Patterns

❌ Noisy pip install output without%%capture
❌ Multiple separate pip install commands
❌ Usingos.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 Presentation Anti-Patterns

❌ 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”

Conclusion Anti-Patterns

❌ 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 context3e:[“" , " ","","L41”,null,{“content”:“$42”,“frontMatter”:{“name”:“cookbook-audit”,“description”:“Audit an Anthro
pic Cookbook notebook based on a rubric. Use whenever a notebook review or audit is requested.”}}]

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/7/25 2:46:53

基于深度学习的农业水果成熟度识别技术实践

1. 项目背景与核心价值水果成熟度识别一直是农业生产和食品加工领域的重要课题。传统的人工判断方法存在主观性强、效率低下等问题&#xff0c;而基于深度学习的自动化识别技术正在改变这一现状。这个毕设项目选择用AI解决水果成熟度识别问题&#xff0c;不仅具有学术研究价值&…

作者头像 李华
网站建设 2026/7/25 2:44:25

Analysis of AdvFusion: Adapter-based Multilingual Learning for Code Large Language Models

文章核心总结与创新点 主要内容 本文是对AdvFusion(一种基于适配器的参数高效微调方法)的扩展研究,聚焦代码大型语言模型(Code-LLMs)在多语言知识迁移中的表现。在原有代码摘要和方法名预测任务基础上,新增代码生成、代码翻译、提交消息生成三大任务,通过CodeLlama、D…

作者头像 李华
网站建设 2026/7/25 2:44:16

AI智能体技能手册:模块化设计提升效率与性能

1. 项目概述&#xff1a;当AI智能体遇上"技能手册"在AI智能体开发领域&#xff0c;强化学习&#xff08;RL&#xff09;长期占据着行为决策的核心地位。但最近半年&#xff0c;我和团队在多个实际项目中发现一个有趣现象&#xff1a;当我们将传统RL方案替换为结构化&…

作者头像 李华
网站建设 2026/7/25 2:43:23

终极字体库指南:如何一次性获取所有设计师都在用的专业字体

终极字体库指南&#xff1a;如何一次性获取所有设计师都在用的专业字体 【免费下载链接】fonts My favorite fonts: SF Pro Text, Pingfang SC, Avenir Next, Roboto, Uber and more. 项目地址: https://gitcode.com/gh_mirrors/font/fonts 还在为设计项目找不到合适的字…

作者头像 李华
网站建设 2026/7/25 2:43:16

LLM幻觉问题深度解析:实现99%无幻觉输出的实用方案

LLM幻觉问题深度解析&#xff1a;实现99%无幻觉输出的实用方案在大语言模型&#xff08;LLM&#xff09;应用日益普及的今天&#xff0c;幻觉&#xff08;hallucination&#xff09;问题已成为开发者面临的最大挑战之一。无论是企业级应用还是个人项目&#xff0c;模型生成不准…

作者头像 李华