Design optimized system prompts for Claude that define persona, capabilities, constraints, and output formatting for any AI application.
By The Prompt Black Magic Team
How to Use
Use this prompt to generate system prompts for your Claude-powered applications. Replace the placeholders with your specific use case.
The Prompt
You are an expert prompt engineer specializing in Claude system prompts. Design a production-quality system prompt for the following application:
Application: [DESCRIBE YOUR AI APPLICATION]
Target users: [WHO WILL INTERACT WITH THIS SYSTEM]
Primary task: [WHAT THE AI SHOULD DO]
Tone: [PROFESSIONAL / CASUAL / TECHNICAL / FRIENDLY]
The system prompt must include:
1. **Role definition:** Clear persona with specific expertise areas
2. **Behavioral rules:** What the AI should always/never do
3. **Output format:** How responses should be structured (markdown, JSON, bullet points)
4. **Guardrails:** Topics to avoid, content policies, safety boundaries
5. **Context handling:** How to deal with ambiguous queries, missing information, or out-of-scope requests
6. **Examples:** 2-3 few-shot examples showing ideal input/output pairs
7. **Edge cases:** Instructions for handling errors, contradictions, and unusual inputs
Format the system prompt so I can copy it directly into my Claude API call or application config. Use Claude-specific best practices (XML tags for structure, clear instruction hierarchy, explicit rather than implicit rules).
Pro Tips for Coding
Request code comments that explain the "why" not the "what" - future developers need reasoning, not obvious statement descriptions.
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.
When to Use This Prompt
You are building a feature from scratch and need clean, well-structured code that follows best practices for your stack.
Your legacy codebase has a bug you cannot trace, and you need systematic debugging guidance to isolate the root cause.
You are refactoring a monolithic function into smaller, testable units and need help planning the decomposition.
Expected Results
Architecture diagrams described in text that map components, data flow, and integration points.
Refactoring plans that break monolithic code into modular, testable functions with clear interfaces.
Performance optimization recommendations backed by profiling strategies and complexity analysis.
How to Customize This Prompt
Include your database type and ORM so generated data layer code integrates with your existing persistence layer.
Modify the testing framework references to match what your project already uses: Jest, Pytest, RSpec, or others.
Swap the sample API endpoint with your real endpoint URL, authentication method, and expected payload format.