System Prompt Structure
The system prompt establishes identity, capabilities, and constraints.Few-Shot Pattern
Show examples before requesting completion.Chain of Thought
Request explicit reasoning before conclusions.Structured Output
Request specific JSON or formatted output.Evaluation and Critique
Request assessment of content quality.Decomposition
Break complex tasks into subtasks.Synthesis
Combine multiple inputs into coherent output.Error Analysis
Transform errors into actionable fixes.- Root cause (what specifically went wrong)
- Fix (exact changes needed)
- Prevention (how to avoid this in future)
- [domain knowledge 1]
- [domain knowledge 2]
- [characteristic behavior 1]
- [characteristic behavior 2]
- TypeScript best practices
- React performance optimization
- Security vulnerabilities in web applications
- Focus on correctness, security, and maintainability
- Suggest improvements, not just flag problems
- Prioritize issues by severity
- Critical: Must fix before merge
- Important: Should fix, can merge with follow-up
- Suggestion: Nice to have improvements
- Only use facts from the provided information
- If the information doesn’t address something, say so explicitly
- Do not use general knowledge unless it’s to clarify provided facts
- Cite specific parts of the information when making claims
- Only use facts from the provided documentation
- If the documentation doesn’t address something, say “I don’t have information about that” and suggest contacting support
- Do not make assumptions about features not explicitly mentioned
- Your response/output
- Confidence level (0-100%)
- What would increase your confidence
- What could be wrong with your response
- Category and suggested response
- Confidence level (0-100%)
- What additional information would increase confidence
- What assumptions might be wrong