Source profileQuality 96/100

event4u-app/agent-config/src/skills/prompt-engineering-patterns/SKILL.md

prompt-engineering-patterns

Use when designing production-LLM prompts — few-shot, chain-of-thought, system prompts, templates, self-verification — distinct from prompt-optimizer and refine-prompt.

Source repository stars
7
Declared platforms
0
Static risk flags
0
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Production patterns for LLM prompts: few-shot, chain-of-thought, system-prompt design, templating, self-verification. Distinct surface from sibling skills:

Best for

  • Designing the system prompt for a new LLM-powered feature.
  • Building a few-shot template with dynamic example selection.
  • Adding chain-of-thought reasoning to a low-accuracy prompt.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/prompt-engineering-patterns"
Safe inspection promptEditorial

Inspect the Agent Skill "prompt-engineering-patterns" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/prompt-engineering-patterns/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Step 1 — Pick the prompt level (progressive disclosure)

    Escalating without evidence is over-engineering. Each level adds tokens, latency, and a maintenance surface.

    Escalating without evidence is over-engineering. Each level adds tokens, latency, and a maintenance surface.
  2. 02

    Step 2 — Structure the prompt

    Fixed instruction hierarchy — every production prompt fills these slots in order:

    Fixed instruction hierarchy — every production prompt fills these slots in order:Stable slots (system, task, format) belong in cached prompt prefixes; volatile slots (examples, input) belong in the per-call portion.
  3. 03

    Step 3 — Pick the few-shot strategy

    Bad examples are worse than no examples — the model imitates structure.

    Bad examples are worse than no examples — the model imitates structure.
  4. 04

    Step 4 — Add chain-of-thought ONLY when measured

    CoT improves accuracy on multi-step reasoning, hurts on classification and lookup. Decision rule:

    CoT improves accuracy on multi-step reasoning, hurts on classification and lookup. Decision rule:
  5. 05

    Step 5 — Build error recovery into the prompt

    Production prompts handle their own failure cases:

    Specify the explicit "I don't know" output (don't let the model invent).Require a confidence indicator when downstream code needs to gate.Define the format for "missing information" so callers can branch.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score96/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars7SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
event4u-app/agent-config
Skill path
src/skills/prompt-engineering-patterns/SKILL.md
Commit
0adf49a8ae84b0ff6e2de8759eea43257e020eff
License
MIT
Collected
2026-07-28
Default branch
main
View the original SKILL.md

prompt-engineering-patterns

Production patterns for LLM prompts: few-shot, chain-of-thought, system-prompt design, templating, self-verification. Distinct surface from sibling skills:

  • prompt-optimizer — polishes a single end-user prompt for ChatGPT / Claude / Gemini.
  • refine-prompt — refines a free-form work prompt into engine-ready acceptance criteria.
  • This skill — designs prompts that ship inside an application that calls an LLM at runtime.

When to use

  • Designing the system prompt for a new LLM-powered feature.
  • Building a few-shot template with dynamic example selection.
  • Adding chain-of-thought reasoning to a low-accuracy prompt.
  • Reviewing a prompt diff in production code.
  • Diagnosing inconsistent LLM outputs that look like prompt drift.

Do NOT use when:

  • Polishing a one-off prompt for a chat session — route to prompt-optimizer.
  • Turning a Jira ticket into engine input — route to refine-prompt.
  • Tuning a model's weights — this skill is prompt-only, not fine-tuning.

Decision framework

Step 1 — Pick the prompt level (progressive disclosure)

Start at Level 1; only escalate when measurement says you must.

Level 1  Direct instruction                    "Summarize this article."
Level 2  + constraints (length, format, focus) "...in 3 bullets, key findings only."
Level 3  + reasoning scaffold                  "Read first, identify findings, then summarize."
Level 4  + few-shot examples                   "Like these examples: ..."
Level 5  + self-verification step              "...then check answer against criteria; revise if fails."

Escalating without evidence is over-engineering. Each level adds tokens, latency, and a maintenance surface.

Step 2 — Structure the prompt

Fixed instruction hierarchy — every production prompt fills these slots in order:

[System context]   role, expertise, constraints, safety
[Task instruction] what to do, in one sentence
[Examples]         few-shot demonstrations (optional)
[Input data]       the user-supplied content
[Output format]    schema, length, citation rules

Stable slots (system, task, format) belong in cached prompt prefixes; volatile slots (examples, input) belong in the per-call portion.

Step 3 — Pick the few-shot strategy

Examples are uniform and small (< 20)         → embed all of them; deterministic.
Examples are large or diverse                 → semantic-similarity retrieval per call.
Edge cases dominate                           → diversity-sampled examples (cluster + pick one per cluster).
Token budget tight                            → fewer, higher-quality examples beats many mediocre.
Examples drift with the data                  → regenerate from a labeled corpus on a schedule, not hand-edited.

Bad examples are worse than no examples — the model imitates structure.

Step 4 — Add chain-of-thought ONLY when measured

CoT improves accuracy on multi-step reasoning, hurts on classification and lookup. Decision rule:

Task is multi-step / arithmetic / multi-hop   → add CoT (zero-shot "let's think step by step", or few-shot CoT).
Task is single-step extraction / classify     → CoT adds tokens without lift; skip.
You haven't measured                          → measure first, decide second.
Self-consistency needed (high-stakes answers) → sample N reasoning paths, majority vote.

Step 5 — Build error recovery into the prompt

Production prompts handle their own failure cases:

  • Specify the explicit "I don't know" output (don't let the model invent).
  • Require a confidence indicator when downstream code needs to gate.
  • Define the format for "missing information" so callers can branch.
  • For self-verification: specify the criteria, then the revision rule.

Step 6 — Treat prompts as code

  • Version every prompt (file + git, not a wiki page).
  • Test on a frozen evaluation set before shipping changes.
  • Track P50 / P95 latency, token usage, accuracy, success rate per version.
  • A/B test prompt variants behind a flag; never edit a live prompt without a rollback path.

Procedure: Apply to a new LLM feature

  1. Inspect the existing prompt (if any) and the eval set; verify a success metric exists (accuracy / consistency / latency / token cost) — refuse to design without it.
  2. Draft Level-1 prompt (Step 1) and measure on the eval set.
  3. Escalate one level at a time (Step 1) until metric is met or budget runs out.
  4. Lock the structure (Step 2), choose few-shot strategy (Step 3), decide CoT (Step 4).
  5. Add error-recovery clauses (Step 5).
  6. Commit prompt + eval results + chosen version (Step 6); cite this skill.

Output format

  1. Prompt-spec table: slot · content · stable-vs-volatile · cached-vs-per-call.
  2. Eval results table: prompt-version · metric · delta-vs-previous.
  3. Failure-mode list: trigger · prompt clause that handles it.

Gotcha

  • Few-shot examples leak the model's style — examples that include hedging produce hedging.
  • "Let's think step by step" works zero-shot on capable models, fails on smaller models without exemplar reasoning traces.
  • Self-consistency (N samples + vote) multiplies cost by N — only on high-stakes paths.
  • Cached prompt prefixes only cache when byte-identical — a single reformat busts the cache.
  • Prompts that drift across model versions silently regress accuracy when the provider rolls a model update; pin model version OR re-run eval per release.

Do NOT

  • Do NOT escalate to Level 4 / 5 before measuring at lower levels.
  • Do NOT mix few-shot examples from different tasks; the model averages them.
  • Do NOT add CoT to single-step classification — it hurts.
  • Do NOT hand-edit production prompts without versioning + eval.
  • Do NOT echo secrets or PII into the prompt — they end up in provider logs.

Auto-trigger keywords

  • prompt engineering
  • few-shot learning
  • chain-of-thought
  • system prompt design
  • prompt template
  • LLM prompt versioning
  • prompt evaluation

Provenance

  • Adopted from: an external reference (internal provenance, redacted) — restructured into a decision-framework shape; source-specific vendor Python snippets dropped.
  • Cross-linked: prompt-optimizer, refine-prompt, mcp-builder, async-python-patterns.
  • Provenance registry: agents/settings/contexts/skills-provenance.yml (entry: prompt-engineering-patterns).
  • Iron-Law floor: verify-before-complete, skill-quality, non-destructive-by-default.

Alternatives

Compare before choosing

Computed 8638,313

wshobson/agents

prompt-engineering-patterns

This skill should be used when the user asks to "optimize a prompt", "improve prompt performance", "design a prompt template", "write better prompts", "debug prompt issues", "use chain-of-thought", "structured prompting", "few-shot prompting", or wants to apply advanced prompt engineering patterns for production LLM applications.

Computed 10042,015

coreyhaines31/marketingskills

ab-testing

When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program

Computed 1007

event4u-app/agent-config

design-intelligence

Grounded design brief from the adopted corpus — style, WCAG-checked color tokens, typography, layout pattern, anti-patterns. Use on ui-design-brief or any which-style/palette/font/chart decision.

Computed 1007

event4u-app/agent-config

existing-ui-audit

Use BEFORE writing or editing any non-trivial UI — inventories components, design tokens, shadcn primitives, and reusable patterns into state.ui_audit. Hard gate for the ui directive set.