agentleFS
kzndotshkzndotsh/skills/skills/prompt-engineering/SKILL.md

prompt-engineering

Skill2 starsChanged 29 days agoMITView on GitHub

Prompt engineering knowledge base distilled and audited from the DAIR.AI Prompt Engineering Guide (promptingguide.ai). Use when writing, debugging, or improving prompts for LLMs; choosing a prompting technique (few-shot, chain-of-thought, self-consistency, ReAct, RAG, prompt chaining, PAL, ToT, Reflexion, meta-prompting); designing agents, tool/function calling, or context engineering; prompting reasoning models; defending against prompt injection, leaking, and jailbreaks; or looking up example prompts, LLM settings (temperature, top-p), and model notes.

85 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-checklist, multi-agent-orchestration and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • atuljha23Skill

    security-checklist

    OWASP-style quick reference — authn/authz, injection, secrets, sessions, crypto, dependencies. Use during code review and before committing security-sensitive changes.

    Also in 3 projects that use this

  • javalenciacaiSkill

    multi-agent-orchestration

    Design and coordinate multi-agent systems where specialized agents work together to solve complex problems. Covers agent communication, task delegation, workflow orchestration, and result aggregation. Use when building coordinated agent teams, complex workflows, or systems requiring specialized expertise across domains.

    Also in 4 projects that use this

  • xfstudioSkill

    llm-evaluation

    Implement comprehensive evaluation strategies for LLM applications using automated metrics, human feedback, and benchmarking. Use when testing LLM performance, measuring AI application quality, or establishing evaluation frameworks.

    Also in 3 projects that use this

  • GoogleSkill

    coding-principles

    Enforces engineering, architecture, public API, and code quality standards distilled from human reviewer feedback across A2UI pull requests. Use when authoring new code, refactoring, addressing review feedback, or reviewing PR diffs. Don't use for release publishing or spec blueprint generation without code or PR changes.

    Also in 3 projects that use this

  • pproencaSkill

    refactoring

    Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.

    Also in 6 projects that use this

  • mjunaidcaSkill

    tool-design

    Design tools that agents can use effectively. Use when creating new tools for agents, debugging tool-related failures, or optimizing existing tool sets.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 75 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Start with the simplest prompt that could work: clear instruction, specific context, delimiters, explicit output format.

    line 16
  2. Distinctive:

    If output is wrong, escalate one step at a time: add few-shot examples (format and label space matter more than label correctness) -> …

    line 17
  3. Distinctive:

    Test against adversarial and edge inputs, including prompt injection if the prompt handles untrusted text.

    line 19
  4. Distinctive:

    Search or planning puzzles -> Tree of Thoughts.

    line 51
  5. Distinctive:

    Treat repo example outputs as illustrations, not benchmarks.

    line 57
  6. Very specific:

    Never exec() model output outside a sandbox (the PAL notebook does).

    line 59

“Common” is measured: kept by at least 6 in 10 of the 75 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prompt Engineering

Source: dair-ai/Prompt-Engineering-Guide at commit 5767372 (2026-03-11), English pages, notebooks, and lecture slides. Everything below was read in full and audited. Reference files carry templates, examples, caveats, and per-file "Audit notes".

Read first: the guide is mostly a 2022 to early-2024 snapshot (GPT-3.5, text-davinci-003, GPT-4, Mixtral era). Technique concepts hold up. Model-specific claims, prices, benchmarks, and code samples do not. See references/audit-summary.md before trusting any date-bound claim.

Workflow for writing or fixing a prompt

  1. Define the task, the output format, and how you will judge success. Without a check, you can't tell if a rewrite helped.
  2. Start with the simplest prompt that could work: clear instruction, specific context, delimiters, explicit output format. Say what to do rather than what to avoid. Specificity beats length.
  3. If output is wrong, escalate one step at a time: add few-shot examples (format and label space matter more than label correctness) -> reasoning (CoT, or a reasoning model) -> decomposition (prompt chaining) -> tools or retrieval (PAL, ReAct, RAG) -> fine-tuning.
  4. Set parameters deliberately: low temperature/top-p for factual or extraction tasks, higher for creative tasks. Change one of temperature or top-p, not both.
  5. Test against adversarial and edge inputs, including prompt injection if the prompt handles untrusted text.
  6. Iterate on a fixed test set. A single lucky run proves nothing. The repo's own bias and exemplar-order examples are single-run, so don't copy that.

Where to look

NeedFile
Prompt elements, settings, tips, basic examplesreferences/fundamentals.md
Pick or apply a technique (decision table + templates for 18 techniques)references/techniques.md
Ready-made prompts by task (classification, QA, coding, extraction, summarization, math, reasoning, creativity, image gen)references/prompt-library.md
Agents, workflows vs agents, function calling, deep agents, context engineeringreferences/agents-and-context-engineering.md
Reasoning-model prompting, prompt optimization, deep research, 4o image genreferences/guides-modern.md
Prompt injection, leaking, jailbreaks, defenses, biases, factualityreferences/risks-and-safety.md
Real-world applications and case studies (code gen, synthetic data, fine-tuning, caching, job classification)references/applications.md
Per-model notes (Llama, Mistral, Gemini, GPT-4, Claude 3, Gemma, ...) and chat templatesreferences/models.md
Research digests (RAG surveys, faithfulness, reasoning, tokenization, long context) and paper indexreferences/research-notes.md
Runnable patterns (function calling, PAL, RAG, ReAct, LangChain, caching) with staleness notesreferences/notebooks-and-code-recipes.md
Lecture slide summaryreferences/lecture-summary.md
Tools, services, datasets, courses, readingsreferences/resources-catalog.md
Repo layout and what's in legacy guides/references/repo-map.md, references/legacy-guides-diff.md
Cross-cutting audit findings (errors, stale items, gaps)references/audit-summary.md

Load only the file the task needs. Each starts with a table of contents.

Quick technique picker

  • Simple known task -> zero-shot with an explicit format.
  • Format or labels wrong -> few-shot.
  • Multi-step reasoning on a non-reasoning model -> CoT ("Let's think step by step" or worked exemplars); unstable answers -> self-consistency (sample N, majority vote).
  • Exact arithmetic or dates -> PAL (generate code, execute in a sandbox).
  • Fresh, private, or hallucination-prone facts -> RAG, or ReAct with search.
  • Too complex for one prompt -> prompt chaining.
  • Search or planning puzzles -> Tree of Thoughts.
  • Agent repeats mistakes with a feedback signal -> Reflexion.
  • Reasoning models (o-series style): give a clear goal and constraints and skip manual CoT. The repo says so, though other pages recommend CoT generally. Treat CoT as for non-reasoning models.

Cautions

  • Treat repo example outputs as illustrations, not benchmarks. Many came from retired models at temperature 1.
  • Known bugs in repo examples: the PAL date exemplar returns today.strftime instead of later.strftime; the self-consistency bagels exemplar lacks its "The answer is" line; the function-calling notebook double-encodes tool arguments. The reference files carry corrected notes.
  • Never exec() model output outside a sandbox (the PAL notebook does).
  • Several technique pages (DSP, GraphPrompts, Active-Prompt, ART, multimodal CoT, meta-prompting) are stubs. The reference sketches for them are tagged "(not in repo)".
  • Gaps in the guide: indirect prompt injection via tool output, MCP, structured outputs, evals, least-to-most, self-refine, chain-of-verification, chunking and reranking for RAG. Use current provider documentation for these.
  • Agent and context-engineering pages are one course's opinion and carry promo callouts. Their prompt examples contradict each other (subtask counts, schema types).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.