Langchain Middleware
langchain-ai/langchain-skills
INVOKE THIS SKILL when you need human-in-the-loop approval, custom middleware, or structured output.
Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.
$ npx skills add wshobson/agents --skill prompt-engineering-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install wshobson/agents prompt-engineering-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/llm-application-dev/skills/prompt-engineering-patterns .claude/skills/prompt-engineering-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "prompt-engineering-patterns" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-application-dev/skills/prompt-engineering-patterns into .claude/skills/prompt-engineering-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/wshobson/agents/tree/main/plugins/llm-application-dev/skills/prompt-engineering-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add wshobson/agents --skill prompt-engineering-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install wshobson/agents prompt-engineering-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/llm-application-dev/skills/prompt-engineering-patterns .agents/skills/prompt-engineering-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "prompt-engineering-patterns" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-application-dev/skills/prompt-engineering-patterns into .agents/skills/prompt-engineering-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wshobson/agents --skill prompt-engineering-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install wshobson/agents prompt-engineering-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/llm-application-dev/skills/prompt-engineering-patterns .cursor/skills/prompt-engineering-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "prompt-engineering-patterns" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-application-dev/skills/prompt-engineering-patterns into .cursor/skills/prompt-engineering-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/wshobson/agents.git --path plugins/llm-application-dev/skills/prompt-engineering-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add wshobson/agents --skill prompt-engineering-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install wshobson/agents prompt-engineering-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/llm-application-dev/skills/prompt-engineering-patterns .gemini/skills/prompt-engineering-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "prompt-engineering-patterns" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-application-dev/skills/prompt-engineering-patterns into .gemini/skills/prompt-engineering-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install wshobson/agents prompt-engineering-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add wshobson/agents --skill prompt-engineering-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/llm-application-dev/skills/prompt-engineering-patterns .github/skills/prompt-engineering-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "prompt-engineering-patterns" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-application-dev/skills/prompt-engineering-patterns into .github/skills/prompt-engineering-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wshobson/agents --skill prompt-engineering-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install wshobson/agents prompt-engineering-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/llm-application-dev/skills/prompt-engineering-patterns .opencode/skills/prompt-engineering-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "prompt-engineering-patterns" agent skill from https://github.com/wshobson/agents/tree/main/plugins/llm-application-dev/skills/prompt-engineering-patterns into .opencode/skills/prompt-engineering-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
prompt-engineering-patternsReference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.
The skill covers six areas: few-shot learning with example selection by similarity or diversity, chain-of-thought prompting including zero-shot, few-shot and self-consistency variants, structured outputs with JSON mode and Pydantic schema enforcement, prompt optimization through iterative refinement and A/B tests, template systems with variable interpolation and modular parts, and system prompt design for role, format and safety.
A quick start shows a LangChain prompt template with Anthropic and Pydantic. The folder ships reference files for each topic, a prompt template library, a few-shot examples file and `scripts/optimize-prompt.py`, and deeper material lives in `references/details.md`. Use cases include debugging prompts with inconsistent output, cutting token use and building reusable templates for production applications.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 46891e7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Prompt Engineering Patterns loads about 1.3k tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 439 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from wshobson/agents at commit 46891e7, republished under its MIT licence (© wshobson). 439 words, ~1,304 tokens.
.claude/skills/prompt-engineering-patterns/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability.
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate
from pydantic import BaseModel, Field
# Define structured output schema
class SQLQuery(BaseModel):
query: str = Field(description="The SQL query")
explanation: str = Field(description="Brief explanation of what the query does")
tables_used: list[str] = Field(description="List of tables referenced")
# Initialize model with structured output
llm = ChatAnthropic(model="claude-sonnet-5")
structured_llm = llm.with_structured_output(SQLQuery)
# Create prompt template
prompt = ChatPromptTemplate.from_messages([
("system", """You are an expert SQL developer. Generate efficient, secure SQL queries.
Always use parameterized queries to prevent SQL injection.
Explain your reasoning briefly."""),
("user", "Convert this to SQL: {query}")
])
# Create chain
chain = prompt | structured_llm
# Use
result = await chain.ainvoke({
"query": "Find all users who registered in the last 30 days"
})
print(result.query)
print(result.explanation)Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Track these KPIs for your prompts:
© wshobson, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 9 other files (scripts, references, assets) in plugins/llm-application-dev/skills/prompt-engineering-patterns of wshobson/agents.
Open the folder on GitHubat commit 46891e7
Prompt Engineering Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Prompt Engineering Patterns this skillwshobson/agents | 40k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Langchain Middlewarelangchain-ai/langchain-skills | 1.3k | — | ~2.7k | Automated safety check: Pass | MIT | |
| Building Pydantic AI Agentsdocling-project/docling | 69k | — | ~2.8k | Automated safety check: Pass | MIT | |
| Claude Cookbooks Reference2025Emma/vibe-coding-cn | 23k | 1 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Kayba Stage 2 Domain Contextkayba-ai/agentic-context-engine | 2.6k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Outlines Structured GenerationOrchestra-Research/AI-Research-SKILLs | 13k | 9 repos | ~4k | Automated safety check: Pass | MIT |
langchain-ai/langchain-skills
INVOKE THIS SKILL when you need human-in-the-loop approval, custom middleware, or structured output.
docling-project/docling
Patterns and tested examples for building agents with Pydantic AI: tools, capabilities, structured output, dependency injection, hooks, YAML specs, streaming and testing.
2025Emma/vibe-coding-cn
Reference of Claude API examples and guides covering tool use, vision, RAG, classification, summarization, text-to-SQL, prompt caching and agent patterns.
kayba-ai/agentic-context-engine
Gather domain context about the repository and agent — system prompt, tool definitions, domain docs, and behavior patterns from traces.
Orchestra-Research/AI-Research-SKILLs
Uses the Outlines library to constrain model output to a JSON schema, Pydantic model, regex or fixed set of choices when running local models.
hermes-labs-ai/lintlang
A skill your agent uses when writing or reviewing AI agent configs, system prompts, or tool definitions (JSON/YAML/Python) and you need to catch ambiguous tool descriptions, missing stop conditions…
wshobson/agents
Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.
wshobson/agents
Covers building subscription billing: billing cycles, subscription states, invoice generation, proration, tax handling and dunning for failed payments.
wshobson/agents
Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.
wshobson/agents
Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.
wshobson/agents
Implement distributed tracing with Jaeger and Tempo to track requests across microservices and identify performance bottlenecks.
wshobson/agents
Sets up GitOps continuous delivery for Kubernetes with ArgoCD or Flux, covering installation, repository layout, sync policies, progressive delivery and secrets.
Categories
Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts. The skill covers six areas: few-shot learning with example selection by similarity or diversity, chain-of-thought prompting including zero-shot, few-shot and self-consistency variants, structured outputs with JSON mode and Pydantic schema enforcement, prompt optimization through iterative refinement and A/B tests, template systems with variable interpolation and modular parts, and system prompt design for role, format and safety.
Prompt Engineering Patterns fits situations like: rewriting a prompt that gives inconsistent output; designing few-shot examples with dynamic selection; adding chain-of-thought or structured JSON output to a prompt; building reusable prompt templates for an LLM application.
Run `npx skills add wshobson/agents --skill prompt-engineering-patterns -a claude-code`. Or copy the skill folder (plugins/llm-application-dev/skills/prompt-engineering-patterns in wshobson/agents) into .claude/skills/prompt-engineering-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add wshobson/agents --skill prompt-engineering-patterns -a codex`. Or copy the skill folder (plugins/llm-application-dev/skills/prompt-engineering-patterns in wshobson/agents) into .agents/skills/prompt-engineering-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wshobson/agents --skill prompt-engineering-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompt-engineering-patterns, .gemini/skills/prompt-engineering-patterns, .github/skills/prompt-engineering-patterns and .opencode/skills/prompt-engineering-patterns in your project.
Going by SKILL.md and its folder, Prompt Engineering Patterns needs Python for the scripts in its folder.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Prompt Engineering Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 15k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Prompt Engineering Patterns: Langchain Middleware (langchain-ai/langchain-skills, 1.3k stars), Building Pydantic AI Agents (docling-project/docling, 69k stars), Claude Cookbooks Reference (2025Emma/vibe-coding-cn, 23k stars) and Kayba Stage 2 Domain Context (kayba-ai/agentic-context-engine, 2.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
wshobson (a GitHub user) maintains it in wshobson/agents, which has 40,305 GitHub stars. The repository holds 142 skills in this directory. The repository was last updated on October 5, 2026.
Source: wshobson/agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.