一键导入
prompt-engineering
Anthropic's official prompt engineering best practices. Use when optimizing prompts, debugging outputs, or improving response quality.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Anthropic's official prompt engineering best practices. Use when optimizing prompts, debugging outputs, or improving response quality.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when transcribing audio files with speaker diarization. Triggers on TRANSCRIBE keyword.
Create, update, delete, and query Google Calendar events using gcallm CLI, MCP tools, or direct API calls.
Rule-based methodology for essay development. Load this index first, then load specific essay type file based on task.
Comprehensive guide for managing Claude Code snippets v2.0 - discovering locations, creating snippets from files, searching by name/pattern/description, and validating configurations. Use this skill when users want to create, search, or manage snippet configurations in their Claude Code environment. Updated for LLM-friendly interface with TTY auto-detection.
Style guide and primer for writing in Warren Zhu's voice. Use when drafting emails, essays, blog posts, technical documents, consulting deliverables, presentations, or any writing for or as Warren. Covers philosophical sensibilities, stylistic patterns, characteristic moves, tone calibration, and professional/technical writing registers. Also useful when understanding Warren's intellectual background and preferences for advising him.
Use when interacting with Harvard Canvas LMS - fetching courses, assignments, grades, submissions, modules, calendar events. Trigger with CANVAS keyword.
| name | Prompt Engineering |
| description | Anthropic's official prompt engineering best practices. Use when optimizing prompts, debugging outputs, or improving response quality. |
Core Principle: Treat context as finite. Find minimum high-signal tokens for maximum results.
Most impactful. Explicit instructions outperform implicit patterns.
Principles:
Example:
Good: Extract customer_name, order_id, issue. Format: {"customer_name": "...", "order_id": "...", "issue": "..."}
Bad: Process this ticket.
Impact: +30% accuracy (Anthropic studies) Optimal: 3-5 diverse examples (fewer = insufficient, more = diminishing returns)
Criteria: Relevant, diverse, clear, structured (use XML)
<examples>
<example><input>Find large files</input><output>find . -type f -size +100M</output></example>
<example><input>List all files</input><output>ls -lah</output></example>
<example><input>Count Python files</input><output>find . -name "*.py" | wc -l</output></example>
</examples>
For complex reasoning only. Skip for simple tasks.
Use for: Multi-step analysis, problem-solving, complex reasoning Skip for: Simple tasks, well-defined operations, direct lookups
<analysis>Your reasoning</analysis>
<final_answer>Your conclusion</final_answer>
Semantic structure for complex prompts.
Benefits: Clear boundaries, prevents confusion, enables referencing Use for: Multi-section prompts, semantic separation Skip for: Simple single-task prompts
<instructions>Task description</instructions>
<context>Background</context>
<examples>Samples</examples>
<input>Query</input>
<output_format>Expected format</output_format>
Assign role or perspective.
You are a senior security auditor reviewing code for vulnerabilities.
Focus on: SQL injection, XSS, authentication flaws.
Ignore: Style issues, performance optimizations.
Guide output by starting Claude's response.
Use for: Forcing specific format (JSON, CSV), bypassing preambles
User: Generate JSON for this user data
Assistant: {
Break complex tasks into sequential steps.
Pattern: Step 1 → output → Step 2 (uses output) → Step 3 (uses output) Benefits: Clearer results, easier debugging, better accuracy, modular
From Anthropic's "Effective Context Engineering for AI Agents":
System Prompts: Right altitude (not too specific/vague), structure with <background>, <instructions>, <tools>, <output>, start minimal, add based on failures
Tool Design: Token-efficient returns, minimal overlap, clear purpose, unambiguous parameters
Examples: Curate diverse canonical examples, not exhaustive edge cases
Dynamic Context: Store lightweight identifiers (paths, URLs), load at runtime, enable progressive discovery
Long Tasks: Compaction (summarize near limits), note-taking (persist outside context), sub-agents (specialized, clean context)
Layer multiple techniques for best results:
<task>Generate bash commands with explanations</task>
<instructions>Output: command # explanation | No markdown | Start with command</instructions>
<examples>
<example><input>find large files</input><output>find . -type f -size +100M # Find files >100MB</output></example>
<example><input>list files</input><output>ls -lah # List all files with details</output></example>
<example><input>compress PDFs</input><output>tar -czf pdfs.tar.gz *.pdf # Compress all PDFs</output></example>
</examples>
<input>{user_query}</input>
Rule: Start #1, add techniques in order until quality satisfactory
Optimizing prompts, enforcing formats, debugging outputs, designing complex prompts, building agents/tools, maximizing performance