Use Claude's XML tag preference to structure complex analysis tasks with clearly separated sections for input, reasoning, and output.
By The Prompt Black Magic Team
How to Use
This prompt leverages Claude's native XML parsing strength. Replace the tags and content with your specific analysis task. Works best with Claude Opus or Sonnet.
The Prompt
<task>
Analyze the following [CODE/DOCUMENT/DATA] and provide a structured assessment.
</task>
<input>
[PASTE YOUR CODE, DOCUMENT, OR DATA HERE]
</input>
<context>
- Purpose: [WHAT THIS CODE/DOCUMENT IS FOR]
- Audience: [WHO WILL READ YOUR ANALYSIS]
- Priority: [WHAT MATTERS MOST - SECURITY, PERFORMANCE, CLARITY, CORRECTNESS]
</context>
<instructions>
1. Read the input thoroughly before starting your analysis
2. Organize your response using these sections:
<summary>
Provide a 2-3 sentence overview of what you found
</summary>
<strengths>
List what is done well, with specific line references
</strengths>
<issues>
List problems ranked by severity (critical, major, minor), with specific locations and fixes
</issues>
<recommendations>
Provide actionable next steps in priority order
</recommendations>
3. Be specific - reference exact locations, not vague descriptions
4. For each issue, provide both the problem and the solution
</instructions>
Pro Tips for Coding
Include your existing code patterns and conventions in the prompt so generated code integrates seamlessly with your codebase.
Ask for unit tests alongside the implementation. Writing tests after the fact is harder than generating them together.
Always specify the programming language, framework version, and runtime environment - "write a function" without context produces unusable code.
When to Use This Prompt
Your pull request needs comprehensive unit tests and you want to generate test cases that cover edge conditions.
You are integrating a third-party API and need boilerplate code with proper error handling and retry logic.
You want to optimize a slow database query and need to understand the execution plan and indexing strategy.
Expected Results
Performance optimization recommendations backed by profiling strategies and complexity analysis.
API integration boilerplate with authentication, retry logic, rate limiting, and error response handling.
Clean, commented code following language-specific conventions with error handling for edge cases.
How to Customize This Prompt
Swap the sample API endpoint with your real endpoint URL, authentication method, and expected payload format.
Replace the language placeholder with your exact tech stack including framework version and runtime environment.
Add your existing code conventions (naming patterns, file structure, style guide) for consistent output.