Main Site ↗

prompting

by danielmiessler425GitHub

Provides concrete guidelines for writing effective prompts and managing context for AI agents. Focuses on clarity, signal-to-noise optimization, and just-in-time information loading based on Anthropic's best practices.

Unlock Deep Analysis

Use AI to visualize the workflow and generate a realistic output preview for this skill.

Powered by Fastest LLM

Target Audience

Developers building AI agents with Claude or similar LLMs who need structured prompt engineering guidance

9/10Security

Low security risk, safe to use

9
Clarity
8
Practicality
8
Quality
9
Maintainability
7
Innovation
Meta
prompt-engineeringcontext-managementai-agentsdocumentation
Compatible Agents
Claude Code
Claude Code
~/.claude/skills/
Codex CLI
Codex CLI
~/.codex/skills/
Gemini CLI
Gemini CLI
~/.gemini/skills/
O
OpenCode
~/.opencode/skills/
O
OpenClaw
~/.openclaw/skills/
GitHub Copilot
GitHub Copilot
~/.copilot/skills/
Cursor
Cursor
~/.cursor/skills/
W
Windsurf
~/.codeium/windsurf/skills/
C
Cline
~/.cline/skills/
R
Roo Code
~/.roo/skills/
K
Kiro
~/.kiro/skills/
J
Junie
~/.junie/skills/
A
Augment Code
~/.augment/skills/
W
Warp
~/.warp/skills/
G
Goose
~/.config/goose/skills/
SKILL.md

Architecture

Prompt patterns and user preferences live in ~/prompting/.

~/prompting/
├── memory.md          # HOT: user voice, model preferences, learned corrections
├── patterns/          # Reusable prompt templates by task type
└── history.md         # Past prompts with outcomes

See memory-template.md for initial setup.

Quick Reference

TopicFile
Common failure modesfailures.md
Model-specific quirksmodels.md
Iteration workflowiteration.md
Advanced techniquestechniques.md

Core Rules

1. Ask Before Assuming

Before writing any prompt, ask:

  • What model? (GPT-4, Claude, Haiku, Gemini)
  • What's the failure mode you're seeing? (if iterating)
  • Token budget? (cost-sensitive vs. quality-first)

Never default to verbose. Simpler often wins.

2. Preserve What Works

When improving a failing prompt:

  • Change ONE thing at a time
  • Note what's currently working
  • Surgical fixes > rewrites

3. Model-Specific Adaptation

See models.md — key differences:

  • Claude: explicit constraints, less scaffolding needed
  • GPT-4: benefits from step-by-step, tolerates verbose
  • Haiku/fast models: brevity critical, skip examples when possible

Prompt optimized for one model will underperform on others.

4. Voice Lock

When user provides writing samples:

  • Extract specific patterns (sentence length, punctuation, vocabulary)
  • Apply consistently throughout session
  • Check output against samples before delivering

5. True Variation

When generating alternatives, vary:

  • Structure (not just synonyms)
  • Emotional angle
  • Opening hook
  • Call-to-action style

"Top 5 reasons" → "The hidden truth about" → "What nobody tells you about" = real variation.

6. Failure Classification

When a prompt fails, classify the failure type:

  • Hallucination → add grounding, sources, constraints
  • Format break → strengthen output spec, add examples
  • Instruction drift → move critical constraints earlier
  • Refusal → rephrase intent, remove ambiguity

Different failures need different fixes. See failures.md.

7. Compression Bias

Default to removing words, not adding. Test: "Does removing this line change the output?" If no, remove.

Token costs matter. A prompt that works with 50 tokens beats one that needs 500.

8. Test Case Generation

When asked to test a prompt:

  • Generate edge cases (empty input, very long, special chars)
  • Include adversarial inputs
  • Test boundary conditions

Don't just test happy path.

9. Platform-Native Output

For content prompts, know platform constraints:

  • Twitter: 280 chars, no markdown
  • LinkedIn: longer ok, hashtags matter
  • Instagram: emoji-friendly, visual hooks

Prompt should enforce format, not hope for it.

10. Memory Persistence

Store in ~/prompting/memory.md:

  • User's preferred style (terse vs detailed)
  • Target models they commonly use
  • Past corrections ("I told you I don't want emojis")

Reference before every prompting task.

Source: https://github.com/danielmiessler/PAIPlugin#skills~prompting

Content curated from original sources, copyright belongs to authors

Grade A
8.3AI Score
Best Practices
Checking...
Try this Skill

User Rating

USER RATING

0UP
0DOWN
Loading files...

WORKS WITH

Claude Code
Claude
Codex CLI
Codex
Gemini CLI
Gemini
O
OpenCode
O
OpenClaw
GitHub Copilot
Copilot
Cursor
Cursor
W
Windsurf
C
Cline
R
Roo
K
Kiro
J
Junie
A
Augment
W
Warp
G
Goose