prompt-engineering-patterns

prompt-engineering-patterns is a skill for Claude Code, Codex from davila7/claude-code-templates. It costs 23 tokens per session (1,508 once invoked), scanned A, original, MIT.

A guide to advanced techniques for designing and improving prompts for AI models. It covers reusable templates, example-based prompting, structured reasoning, and system instructions.

In plain words
What is it for?
Use it to create production prompts, select useful examples, build reusable instructions, debug poor responses, and design specialised AI assistants.
Why use it?
It gives a repeatable way to make AI behaviour more reliable when prompts produce inconsistent results or need to handle complex tasks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

Claude Code Templates is a command-line tool and catalogue for configuring Anthropic’s Claude Code with agents, commands, settings, hooks, integrations, skills, and project templates. Developers use it to browse and install reusable components for their coding workflows. The catalogue includes many of these Claude Code components.

davila7/claude-code-templates · 30,542 stars · on GitHub · aitmpl.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/davila7/claude-code-templates/prompt-engineering-patterns
Any agent
npx skills add davila7/claude-code-templates --skill prompt-engineering-patterns
Clone the repo
git clone --depth 1 https://github.com/davila7/claude-code-templates

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prompt-engineering-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/davila7/claude-code-templates/prompt-engineering-patterns.svg)](https://agentmods.dev/skills/davila7/claude-code-templates/prompt-engineering-patterns)
Your own site
<a href="https://agentmods.dev/skills/davila7/claude-code-templates/prompt-engineering-patterns"><img src="https://agentmods.dev/badge/skills/davila7/claude-code-templates/prompt-engineering-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,508 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01508
Opus 5 $0.00012 $0.00754
Sonnet 5 $0.00005 $0.00302
Haiku 4.5 $0.00002 $0.00151

Measured 2d ago against content hash 5c9655b550a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

prompt-engineering-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/optimize-prompt.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cli-tool/components/skills/ai-research/prompt-engineering-patterns/SKILL.md · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt Engineering Patterns

Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability.

Do not use this skill when

  • The task is unrelated to prompt engineering patterns
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open resources/implementation-playbook.md.

Use this skill when

  • Designing complex prompts for production LLM applications
  • Optimizing prompt performance and consistency
  • Implementing structured reasoning patterns (chain-of-thought, tree-of-thought)
  • Building few-shot learning systems with dynamic example selection
  • Creating reusable prompt templates with variable interpolation
  • Debugging and refining prompts that produce inconsistent outputs
  • Implementing system prompts for specialized AI assistants

Core Capabilities

1. Few-Shot Learning

  • Example selection strategies (semantic similarity, diversity sampling)
  • Balancing example count with context window constraints
  • Constructing effective demonstrations with input-output pairs
  • Dynamic example retrieval from knowledge bases
  • Handling edge cases through strategic example selection

2. Chain-of-Thought Prompting

  • Step-by-step reasoning elicitation
  • Zero-shot CoT with "Let's think step by step"
  • Few-shot CoT with reasoning traces
  • Self-consistency techniques (sampling multiple reasoning paths)
  • Verification and validation steps

3. Prompt Optimization

  • Iterative refinement workflows
  • A/B testing prompt variations
  • Measuring prompt performance metrics (accuracy, consistency, latency)
  • Reducing token usage while maintaining quality
  • Handling edge cases and failure modes

4. Template Systems

  • Variable interpolation and formatting
  • Conditional prompt sections
  • Multi-turn conversation templates
  • Role-based prompt composition
  • Modular prompt components

Read the full file on GitHub · 217 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 217 lines · 23 tokens per session scan A 5c9655b550a3

Subscribe to this mod's changes

prompt-engineering-patterns is a skill published in the GitHub repository davila7/claude-code-templates (30,542 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 1,508 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

prompt-architect

Designs clear, testable prompts for agent workflows. Use when creating new prompts, refining weak prompts, or establishing reusable prompting patterns.

repowise-dev/claude-code-prompts · 31 tokens

ccc-prompt-fix

Fix and sharpen a prompt. Diagnoses it against the 6 prompt-quality patterns, returns a tightened rewrite with the reasoning, and suggests the right library prompt for your task.

KevinZai/commander · 41 tokens

fabric-semantic-model-ai-instructions

Use when configuring AI instructions on a Power BI semantic model — the 10,000-character blob attached via Prep data for AI → Add AI instructions in Desktop or the service. Applies everywhere Copilot uses the model (reports, Q&A, Copilot pane). Covers what belongs in the blob (business context, terminology, date…

wardawgmalvicious/agent-config · 154 tokens

ai-workflow

Set up LLM workflow discipline for projects that use AI / LLM calls in production or eval suites. Authors an eval-cost-watcher agent that projects token cost BEFORE regression evals run, plus an AI-workflow-discipline rule covering mock-mode placement, fixture freshness, and multi-stage cost accumulation. Optionally a…

vindm/dotclaude · 88 tokens

brain-prompt

Metaprompting assistant — "/brain-prompt " turns a rough ask into "the right prompt": a complete, tuned master prompt with SPARC phases, per-phase rubrics, standing rules, and cost guardrails, ready to paste or run. Use when the user says "/brain-prompt", "brain prompt", "write me the right prompt for this", "turn…

stuinfla/ruvnet-brain · 0 tokens

midjourney-prompter

Engineer Midjourney prompts — style references, aspect ratios, negative prompts, and v6 parameter tuning.

inbharatai/claude-skills · 28 tokens