Anthropic's official prompt library provides a collection of validated prompting patterns. Its core principles are "describe the outcome, not the steps" and "give Claude a way to check its own work"; these patterns can be used directly for everyday development tasks with Claude Opus 4.7.
Suitable tasks: API development, database migrations, performance optimization, error debugging, documentation generation, and feature implementation
Unsuitable tasks: Low-level systems programming that requires extremely precise control; the official patterns are better suited to mid- and high-level abstraction tasks
Applicable model version: Claude Opus 4.7
Applicable client, Agent, or API: Claude API, Claude Code
Recommended reasoning levels and parameters: Use xhigh for complex tasks and high for general tasks
❌ Wrong approach:
"Open src/api/routes.ts and add rate limiting middleware on line 42,
then modify config.ts to add the configuration option..."
✅ Right approach:
"Add rate limiting to the public API and make sure existing tests still pass"Principle: Let Claude find the right files and locations on its own instead of manually specifying every step.
❌ Wrong approach:
"Implement user authentication"
✅ Right approach:
"Implement user authentication, run tests to verify that all cases pass,
then try calling the API with an invalid token to confirm it is rejected"Principle: Ask Claude to run, test, compare, or verify within the same prompt so that it iterates instead of stopping after a single attempt.
API development:
add rate limiting to the public API and make sure existing tests still passDatabase migration:
write the migration, run it against the dev database,
and confirm the schema matchesFeature implementation:
add a settings page that follows the same layout as the profile pagePerformance optimization:
get the bundle size under 200KB and show me what you removedError debugging:
why is the build failing? @build.logDocumentation generation:
explain how the payment retry logic works as an HTML page with a diagram,
then open it in my browser# 1. Create the skill directory
mkdir -p .claude/skills/api-rate-limit
# 2. Create SKILL.md
cat > .claude/skills/api-rate-limit/SKILL.md << 'EOF'
---
name: api-rate-limit
description: Add rate limiting to API endpoints, including configuration and tests
---
# API rate limiting
## Steps
1. Check the current API route structure
2. Add rate limiting middleware
3. Configure the limit parameters (requests/time window)
4. Make sure existing tests pass
5. Add new test cases to verify that the limit takes effect
## Verification
- Run `npm test` to ensure all tests pass
- Manually test that requests exceeding the limit are rejected
EOF# CLAUDE.md
## Project conventions
- All API endpoints must have rate limiting
- Use the express-rate-limit package
- Limit: 100 requests/15 minutes/IP
- Tests must cover normal requests and rate-limited requests
## Common patterns
- When adding new features, always check existing tests first
- After performance optimization, compare metrics before and after optimization
- When debugging errors, reproduce the problem before fixing itSelect a pattern from the official prompt library that matches your task
Adjust the prompt to your project context (replace specific feature names, file paths, and so on)
Include verification steps in the prompt (run tests, inspect output, and compare it with expectations)
If it works well, save the prompt as a Skill for the team to reuse
Record effective patterns and conventions in CLAUDE.md
For recurring tasks, use a validated Skill instead of rewriting the prompt from scratch
The official documentation explicitly states that these patterns are "based on published Anthropic resources"
The prompt library includes common workflows, best practices, and examples of team use
The documentation emphasizes two core principles:
"Describe the outcome, not the steps" — let Claude find the files
"Give Claude a way to check its own work" — ask it to run, test, compare, or verify
Anthropic officially recommends saving effective prompts as Skills and recording conventions in CLAUDE.md
The documentation mentions plan mode for large or high-risk changes; it displays the file list before editing
These patterns apply to most mid- and high-level abstraction tasks
Low-level systems programming or tasks requiring extremely precise control may need more detailed steps
Prompt effectiveness depends on Claude Opus 4.7's comprehension and the project context
Not every task is suited to the "describe the outcome" pattern; some complex tasks may require step-by-step guidance
Skills and CLAUDE.md require ongoing team maintenance and updates
Official documentation: "The prompts above share a few patterns. Recognizing them helps you adapt any prompt here to your own task. Describe the outcome, not the steps. Say what you want and let Claude find the files."
"Give it a way to check its own work. Ask for run, test, compare, or verify in the same prompt so Claude iterates instead of stopping after one attempt."
Claude Opus 4.7