Skip to main content
Different AI models respond better to different prompting styles. This guide covers model-specific techniques and provides ready-to-use prompt refiner skills.
Works everywhere: These prompting techniques apply to both the Droid CLI and the Factory App.

Universal Prompting Principles

These principles work across all models:
Weak: “Fix the bug in auth”Strong: “Fix the login timeout bug where users get logged out after 5 minutes of inactivity. The session should persist for 24 hours.”
Weak: “Add error handling”Strong: “This API endpoint handles payment processing. It currently crashes silently on network errors. Add error handling that logs the error, returns a user-friendly message, and triggers an alert.”
Weak: “Make it faster”Strong: “Optimize the search query. Success criteria: query time under 100ms for 10k records, no change to result accuracy, passes existing tests.”
Weak: “Refactor this code”Strong: “Refactor this code to use the repository pattern. Constraints: don’t change the public API, maintain backward compatibility, keep the same test coverage.”

Claude Models (Opus, Sonnet, Haiku)

Claude models excel with structured, explicit instructions and respond particularly well to certain formatting patterns.

Key Techniques for Claude

1

Use XML tags for structure

Claude responds exceptionally well to XML-style tags for organizing complex prompts:
2

Put examples in dedicated sections

When you want specific output formats, show examples:
3

Use thinking prompts for complex reasoning

For complex decisions, ask Claude to think through options:
Copy the prompt refiner skills below to ~/.factory/skills/ to use them. Learn more about skills in the Skills documentation.

Claude Prompt Refiner Skill

Create ~/.factory/skills/prompt-refiner-claude/SKILL.md:

GPT Models (GPT-5, GPT-5.1, Codex)

GPT models excel with clear system-level context and benefit from explicit role framing.

Key Techniques for GPT

1

Frame the role explicitly

GPT models respond well to clear role definitions:
2

Use numbered steps for procedures

GPT follows numbered instructions reliably:
3

Be explicit about output format

Specify exactly what you want:

GPT Prompt Refiner Skill

Create ~/.factory/skills/prompt-refiner-gpt/SKILL.md:
You are a senior security engineer conducting a security audit of a Node.js payment processing service. Context: This service handles credit card transactions and communicates with Stripe’s API. It runs in AWS ECS. Task: Review the code in src/payments/ for security vulnerabilities. Steps:
  1. Check for proper input validation on all endpoints
  2. Verify secrets are not hardcoded or logged
  3. Review authentication and authorization logic
  4. Check for SQL injection and XSS vulnerabilities
  5. Verify proper error handling that doesn’t leak sensitive info
Output format: Return a security report in markdown with:
  • Critical: Issues that must be fixed before deployment
  • High: Significant risks that should be addressed soon
  • Medium: Improvements to consider
  • Recommendations: General security enhancements
For each issue, include:
  • File and line number
  • Description of the vulnerability
  • Recommended fix with code example

Gemini Models

Gemini models handle long context well and work effectively with structured reasoning.

Key Techniques for Gemini

1

Leverage long context

Gemini can handle extensive context—don’t be afraid to include more background:
2

Use reasoning levels effectively

Gemini supports Low and High reasoning. Use High for:
  • Architecture decisions
  • Complex debugging
  • Multi-step planning
Use Low for:
  • Straightforward implementations
  • Code generation from specs
  • Routine refactoring

Model Selection Strategy

Match the model to the task:

Creating Your Own Prompt Refiner

For team-specific needs, create a custom prompt refiner:
Context: [What exists, what module/layer] Task: [Specific action] Patterns to follow: [Reference existing similar code] Tests: [What tests to add/update] Done when: [Acceptance criteria]

Quick Reference Card

Claude (Opus/Sonnet/Haiku)

  • ✅ XML tags for structure
  • ✅ Context before instructions
  • ✅ Examples in dedicated sections
  • ✅ “Think through…” for reasoning

GPT (GPT-5/Codex)

  • ✅ Role framing (“You are a…”)
  • ✅ Numbered step procedures
  • ✅ Explicit output format
  • ✅ “Step by step” for reasoning

Gemini

  • ✅ Extensive context inclusion
  • ✅ Low/High reasoning levels
  • ✅ Structured output requests

Next Steps

Setup Checklist

Complete power user configuration

Token Efficiency

Reduce costs while maintaining quality