DS DevShelfHub Projects · AI tools
Tutorials / System Prompts / Task-Specific Prompts
System Prompts Intermediate · 9 min read Page 6 of 10

System Prompts for Specific Tasks: Practical Templates for Developers

By DevShelfHub

Real, working system prompts for code review, content writing, data analysis, customer support, and more.

Series progress 6 / 10
Task-specific system prompt templates for code review, writing, and data analysis

The template approach

Each task needs a slightly different focus. Start with a base template and customize for your use case.

Markdown
# IDENTITY
You are a [expertise] with [years/experience]. Your values: [list]

# TASK CONTEXT
[What specifically are you doing?]

# INSTRUCTIONS
- [Specific behavior 1]
- [Specific behavior 2]
- [Format requirements]

# CONSTRAINTS
- Never [safety boundary]
- Don't [anti-pattern]

Example 1: Code Review

Markdown
You are a senior code reviewer. You prioritize: security (no shortcuts), performance (matter at scale), readability (future maintainers), testing (does it fail gracefully).

When reviewing:
1. Security: SQL injection, XSS, auth bypasses, secrets exposure
2. Performance: O(n²) loops, N+1 queries, memory leaks
3. Readability: naming, comments, complexity
4. Testing: edge cases, error paths

Return: [Problem] → [Impact] → [Fix] → [Severity: CRITICAL/HIGH/MEDIUM]

Example 2: Content Writing

Markdown
You are an expert technical writer. You make complex ideas accessible without oversimplifying.

Guidelines:
- Define jargon on first use
- Use analogies and real examples
- Write for [target audience: engineers/managers/non-technical]
- Structure: Why (why does it matter?) → How (how does it work?) → What now (next steps)
- Tone: [professional/conversational/enthusiastic]

Never assume prior knowledge in [specific domain].

Example 3: Data Analysis

Markdown
You are a data scientist. You're skeptical of correlations and always consider alternative explanations.

When analyzing:
1. First, state your assumptions
2. Check for confounding variables
3. Calculate statistical significance
4. Consider business impact, not just numbers
5. Never claim causation without evidence

Always: Show your work, cite sources, acknowledge uncertainty.

Example 4: Customer Support

Markdown
You are a customer support specialist. You genuinely want to help. You're empathetic, solution-focused, and clear.

Your approach:
1. Validate: Show you understand their frustration
2. Clarify: Ask questions if needed
3. Solve: Provide clear steps
4. Follow-up: Offer to check back in

Never: Make excuses, blame the customer, or say "it's working as designed"

Example 5: Creative Writing

Markdown
You are a creative writer known for [vivid descriptions/tight dialogue/fast pacing].

Your voice:
- Tone: [witty/dark/uplifting]
- Style: [literary/pulpy/minimalist]
- Show, don't tell
- Use specific details, not abstractions

Avoid: Purple prose, info-dumping, passive voice

Example 6: Teaching/Tutoring

Markdown
You are a patient teacher. You break concepts into digestible pieces and check for understanding.

Your method:
1. Start with why (why does this matter?)
2. Build from fundamentals
3. Use analogies and examples
4. Ask: "Does this make sense?"
5. Adjust based on feedback

Never: Assume prior knowledge, use jargon without explanation

How to adapt these for your use case

Step 1: Pick the closest template above

Step 2: Customize expertise, context, and constraints for your domain

Step 3: Add domain-specific details (tools, constraints, best practices)

Step 4: Test with real inputs and refine

Anti-patterns specific to each task

The templates above set the floor. What separates a working production prompt from one that quietly degrades the user experience is what you remove, not what you add. Each task has a few recurring failure modes that show up in eval logs across teams. Audit your prompt against them before shipping.

Code review prompts

Anti-pattern: asking the model to "find bugs" without a severity rubric. Result: every minor naming preference gets flagged as CRITICAL, and reviewers stop trusting the output. Fix: define what each severity level means in your codebase ("CRITICAL = exploitable security flaw or data loss; HIGH = correctness bug under a realistic input; MEDIUM = maintainability or test coverage gap"). Also: tell the model to skip style nits that your linter already catches — repeating linter output wastes attention.

Content writing prompts

Anti-pattern: stacking adjectives ("engaging, compelling, clear, authoritative, conversational"). The model averages them and produces bland prose. Fix: pick one or two anchors and give negative examples — "Write like Patrick McKenzie's essays, not like a corporate blog." Concrete reference points beat abstract qualities.

Data analysis prompts

Anti-pattern: asking for "insights" without specifying what the user already knows. The model surfaces obvious things ("revenue grew") that waste a senior analyst's time. Fix: specify the audience's baseline ("the reader already knows MoM revenue trends and headcount; surface only what's surprising relative to last quarter") and require the model to flag confidence levels on every claim.

Customer support prompts

Anti-pattern: telling the model to "be empathetic." It over-empathizes, producing three paragraphs of validation before getting to the fix — frustrating for users who just want their bug resolved. Fix: lead with the resolution, then acknowledge the impact briefly. Add: "If the user is frustrated, do not open with 'I'm so sorry to hear that.' Open with the answer."

Creative writing prompts

Anti-pattern: asking for "creative" or "original" output. The model has no reliable metric for either and tends to over-produce metaphors and adjectives. Fix: constrain the form ("4 paragraphs, no more than 3 metaphors total, no semicolons") and feed in 2–3 reference excerpts of the voice you want. Form constraints are creativity guardrails, not creativity killers.

Teaching prompts

Anti-pattern: "Use analogies." The model defaults to over-explaining and burying the actual answer in metaphors. Fix: tell the model to answer the literal question first in one sentence, then optionally add an analogy if it would clarify. Many learners want the fact and the analogy in that order, not the other way around.

How to decide between similar templates

Most real tasks straddle two categories — a "code review for a tutorial blog post" needs both code-review rigor and writing voice; a "data analysis for a customer-facing report" needs both analytical care and support-style empathy. Picking the wrong base template is one of the most common reasons a prompt feels off without anyone being able to articulate why.

The decision rule: pick the template that matches the non-negotiable of the task. For code review of a blog post, the non-negotiable is technical correctness — start with the code-review template and layer in writing guidance second. For a customer-facing data report, the non-negotiable is not being condescending or alarming — start with the support template and layer in analytical rigor second. The first template sets the model's default reasoning order; the second one tunes it. Get the order wrong and the model defaults toward the wrong priority when the two conflict.

For higher-stakes products, the next step is a quick eval. Spin up 10–20 representative inputs, run both candidate prompts, and have a teammate (not the prompt author) blind-rate which version is closer to what production needs. This takes under an hour and almost always reveals one template as the clear base — far faster than relying on intuition or iterating on a single prompt for days.

Task-Specific Prompts FAQ

What is a task-specific system prompt?

A task-specific system prompt customizes the AI's behavior for a particular job like code review, content writing, or data analysis. Each task needs different emphases — security for code review, empathy for support, rigor for analysis.

How do you write a system prompt for code review?

Define the reviewer's priorities (security, performance, readability, testing), specify what to flag (SQL injection, N+1 queries, naming issues), and set the output format like Problem, Impact, Fix, and Severity level.

What is the template approach for system prompts?

Start with four sections — Identity (who you are), Task Context (what you're doing), Instructions (specific behaviors), and Constraints (safety boundaries). Customize each section for your specific use case.

How do you customize a system prompt template?

Pick the closest existing template, customize the expertise and context for your domain, add domain-specific details like tools and best practices, then test with real inputs and refine based on the results.

Can one system prompt work for multiple tasks?

Generally no. Different tasks have different non-negotiables. A code review prompt prioritizes security, while a customer support prompt prioritizes empathy. Use the template approach and create specialized prompts for each task.

Before customizing templates, review the core principles of effective system prompts — clarity and specificity are the foundation. For structuring longer prompts, see instruction structuring techniques. Add safety constraints to any task prompt before deploying. Browse the full tutorial catalog for more.

Quick summary

  • Different tasks need different emphases: code review (security), writing (clarity), analysis (rigor), support (empathy)
  • Use the template approach: customize identity, context, instructions, constraints
  • Start with an example that matches your task and adapt it
  • Test and refine with your specific use case
  • Each domain has different non-negotiables