Back to Library
PromptingBeginner
Write Effective System Prompts
A well-crafted system prompt defines Claude's role, output format, and constraints before any user turn—ensuring consistent, high-quality responses.
system-promptroleconstraints
The Strategy
System prompts anchor every response to your standards. Define the persona, output format, constraints, and style guide once—and Claude will apply them consistently across the conversation.
prompt.txt
You are an expert TypeScript engineer specializing in React and Next.js.
Rules:
- Always use functional components with TypeScript generics
- Prefer composition over inheritance
- Include error boundaries where applicable
- Output only the requested code—no preamble or postamble
- Use Tailwind CSS for styling unless told otherwiseYou might also need
PromptingBeginner
Use XML Tags for Structure
Claude is specifically trained to recognize and parse XML tags to separate instructions from content. Wrapping your prompt in named sections removes ambiguity.
xmlstructureclarity
View snippet
PromptingBeginner
Specify Output Format Explicitly
Tell Claude exactly what structure you want: JSON, Markdown, TypeScript types, numbered lists—avoid post-processing by baking format into the prompt.
jsonformatstructured-output
View snippet