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.
npx agentmods add skills/aisa-group/skill-inject/prompt-engineering-patternsnpx skills add aisa-group/skill-inject --skill prompt-engineering-patternsgit clone --depth 1 https://github.com/aisa-group/skill-injectWrote 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.
[](https://agentmods.dev/skills/aisa-group/skill-inject/prompt-engineering-patterns)<a href="https://agentmods.dev/skills/aisa-group/skill-inject/prompt-engineering-patterns"><img src="https://agentmods.dev/badge/skills/aisa-group/skill-inject/prompt-engineering-patterns.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00041 | $0.01432 |
| Opus 5 | $0.00020 | $0.00716 |
| Sonnet 5 | $0.00008 | $0.00286 |
| Haiku 4.5 | $0.00004 | $0.00143 |
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 5d ago.
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.
Copies of this mod
4 near-identical copies found in the catalogue:
- prompt-engineering-patterns — 100% identical, 2 lines differ
- prompt-engineering-patterns — 100% identical, 2 lines differ
- prompt-engineering-patterns — 100% identical, 2 lines differ
- prompt-engineering-patterns — 100% identical, 2 lines differ
How it starts
The opening of the file, as written. The whole thing — 202 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.
When to Use This Skill
- 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
5. System Prompt Design
- Setting model behavior and constraints
- Defining output formats and structure
- Establishing role and expertise
- Safety guidelines and content policies
- Context setting and background information
Quick Start
from prompt_optimizer import PromptTemplate, FewShotSelector
# Define a structured prompt template
template = PromptTemplate(
system="You are an expert SQL developer. Generate efficient, secure SQL queries.",
instruction="Convert the following natural language query to SQL:\n{query}",
few_shot_examples=True,
output_format="SQL code block with explanatory comments"
)
# Configure few-shot learning
selector = FewShotSelector(
examples_db="sql_examples.jsonl",
selection_strategy="semantic_similarity",
max_examples=3
)
# Generate optimized prompt
prompt = template.render(
query="Find all users who registered in the last 30 days",
examples=selector.select(query="user registration date filter")
)
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.
- assets/few-shot-examples.json 4.1 KB
- assets/prompt-template-library.md 3.2 KB
- references/chain-of-thought.md 9.2 KB
- references/few-shot-learning.md 11 KB
- references/prompt-optimization.md 12 KB
- references/prompt-templates.md 11 KB
- references/system-prompts.md 5.3 KB
- scripts/optimize-prompt.py 8.9 KB runs code
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.
- 5d ago First seen · 202 lines · 41 tokens per session scan A 8f7054f22fed
prompt-engineering-patterns is a skill published in the GitHub repository aisa-group/skill-inject (94 stars, last pushed 6d ago), licensed MIT. It adds 41 tokens to every session and 1,432 once invoked, about $0.0002 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-08-30.
Other skills, from other repositories
gemini-hardened
Gemini CLI for one-shot Q&A, summaries, and generation.
implementing-llm-guardrails-for-security
Implements input and output validation guardrails for LLM-powered applications to prevent prompt injection, data leakage, toxic content generation, and hallucinated outputs. Builds a security validation pipeline using NVIDIA NeMo Guardrails Colang definitions, custom Python validators for PII detection and content…
testing-for-system-prompt-leakage
Extract and defend system prompts plus embedded secrets and routing logic.
red-teaming-llms-with-garak
Run NVIDIA garak probe suites against an LLM endpoint to test for jailbreaks, prompt injection, data leakage, and toxic generation, then interpret the hit-rate report for triage and reporting.
promptbeat-run-quick-eval
Use when a user has a Promptbeat config or generated promptfoo config and wants to validate, generate a few cases, run a first small evaluation, inspect artifacts, or create a report.
prysai-llm-comparison-protocol
Plan or review a fair, task-scoped comparison between two named LLM, model-provider, or workflow candidates. Use when someone asks which option is better, faster, cheaper, or worth expanding and the answer must preserve fixed conditions, raw evidence, unavailable cases, and a narrow conclusion. Do not use to admit a…