$ show anthropics/prompt-eng-interactive-tutorial
This repository is an interactive educational resource (Jupyter notebooks) teaching prompt engineering for Anthropic's Claude LLM. It is not a software application or a data pipeline; it is a notebook collection, so it is classified as data_research by the notebook signal, but its 'data' is synthetic/demo content (animal names, user/product records, arithmetic operations, legal tax code excerpts) used to illustrate prompt patterns. The primary entry points are the notebooks themselves, with parallel implementations for the Anthropic direct API and AWS Bedrock (both boto3 and anthropic Bedrock clients). Lessons progress from basic prompt structure, clarity, system prompts, XML tags, few-shot examples, step-by-step thinking ('Precognition'), output formatting, avoiding hallucinations, to complex/industry use cases. The notebooks use get_completion wrappers around client.messages.create(...), %store magic to share variables, and a tool-use appendix that implements prompt-injected function calling via XML-like tags and regex parsing. Exercises include golden answers and rubric-based grading (e.g., summary quality scored 1-5). Reusable patterns include the tool-use prompt-injection function construct_successful_function_run_injection_prompt(invoke_results), system-prompt composition (general tool-use explanation + specific tool definitions), and a grader prompt pattern. However, the code is tightly coupled to notebook execution order, API details may drift, and duplicated content across anthropic/boto3 notebooks creates maintenance risk.
The LLM identified 2 files worth highlighting for reuse:
Implements prompt-injected function calling for Claude without native tool-use API. Defines construct_successful_function_run_injection_prompt(invoke_results) to format tool results back into the message chain, and composes system prompts by concatenating a general tool-use explanation with specific tool definitions. Demonstrates manual parameter parsing and result injection via XML-like tags. Reusable as a reference pattern for adding tool-use to Claude in environments where native tool calling is unavailable.
Contains a reusable grader prompt pattern: build a prompt that asks Claude to assess summary quality against a rubric and return a 1-5 score. This pattern can be extracted and applied to any LLM output evaluation task, not just the tutorial's examples.