A skill your agent uses when crafting LLM prompts, implementing chain-of-thought reasoning, designing few-shot examples, building RAG pipelines, or optimizing prompt performance.
Install the "prompt-engineering" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/prompt-engineering-absolutelyskilled-absolutelyskilled into .claude/skills/prompt-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering", 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.
Type 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.
skills CLI
$ npx skills add majiayu000/claude-skill-registry --skill prompt-engineering -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "prompt-engineering" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/prompt-engineering-absolutelyskilled-absolutelyskilled into .agents/skills/prompt-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering", 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.
skills CLI
$ npx skills add majiayu000/claude-skill-registry --skill prompt-engineering -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "prompt-engineering" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/prompt-engineering-absolutelyskilled-absolutelyskilled into .cursor/skills/prompt-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering", 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.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add majiayu000/claude-skill-registry --skill prompt-engineering -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "prompt-engineering" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/prompt-engineering-absolutelyskilled-absolutelyskilled into .gemini/skills/prompt-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering", 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.
Installs 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).
skills CLI
$ npx skills add majiayu000/claude-skill-registry --skill prompt-engineering -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "prompt-engineering" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/prompt-engineering-absolutelyskilled-absolutelyskilled into .github/skills/prompt-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering", 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.
skills CLI
$ npx skills add majiayu000/claude-skill-registry --skill prompt-engineering -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "prompt-engineering" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/prompt-engineering-absolutelyskilled-absolutelyskilled into .opencode/skills/prompt-engineering/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "prompt-engineering", 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.
Facts
Skill name
prompt-engineering
GitHub stars
666
Used in
1 other repo
Token cost
~4k tokens
SKILL.md length
1,374 words
Files
2
Skills in repo
1,273
Repo updated
First seen
Licence
MIT
At a glance
A skill your agent uses when crafting LLM prompts, implementing chain-of-thought reasoning, designing few-shot examples, building RAG pipelines, or optimizing prompt performance.
Works in 5 steps: Be specific and explicit - Vague… → Provide context before instruction -… → Use structured output - Request JSON,… → …
Crafting LLM prompts
SKILL.md covers When to use this skill, Key principles, Core concepts and Common tasks, plus 4 more sections
Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
What it does
Prompt Engineering is an agent skill from majiayu000/claude-skill-registry. Use this skill when crafting LLM prompts, implementing chain-of-thought reasoning, designing few-shot examples, building RAG pipelines, or optimizing prompt performance. Triggers on prompt design, system prompts, few-shot learning, chain-of-thought, prompt chaining, RAG, retrieval-augmented generation, prompt templates, structured output, and any task requiring effective LLM interaction patterns.
Its SKILL.md is about 4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `metadata.json`).
It sits in AI & LLM Engineering, covering Prompt engineering and Retrieval-augmented generation. The repository describes itself as: Searchable Claude Code skills catalog with source-linked guides and generated registry artifacts. The licence is MIT.
When your agent uses it
Crafting LLM prompts
Implementing chain-of-thought reasoning
Designing few-shot examples
Building RAG pipelines
Example prompts
“/prompt-engineering”
Requirements
Python 3
Workflow steps
5 steps, taken from the first numbered list in SKILL.md.
1Be specific and explicit - Vague instructions produce vague outputs. State the
2Provide context before instruction - Background and examples before the task
3Use structured output - Request JSON, markdown tables, or a fixed schema when
4Iterate and evaluate - Treat prompts as code. Version them, test against a
5Decompose complex tasks - A single prompt asking the model to research, reason,
What it can do on your machine
Read from SKILL.md and the folder at commit 2d14a69. It shows what the files ask for, not the result of running them.
Tool permissions
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.
Runs code
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
Network
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
Prompt Engineering loads about 4k tokens when it runs. Until then it costs about 105 tokens; SKILL.md has 1,374 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~105
When it runs· the whole SKILL.md, loaded when a task matches
~4k
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.
Safety
Auto-check passed
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); files beside SKILL.md are not scanned.
Download SKILL.mdSave it as .claude/skills/prompt-engineering/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
prompt-engineering
description
Use this skill when crafting LLM prompts, implementing chain-of-thought reasoning, designing few-shot examples, building RAG pipelines, or optimizing prompt performance. Triggers on prompt design, system prompts, few-shot learning, chain-of-thought, prompt chaining, RAG, retrieval-augmented generation, prompt templates, structured output, and any task requiring effective LLM interaction patterns.
When this skill is activated, always start your first response with the 🧢 emoji.
Prompt Engineering
Prompt engineering is the practice of designing inputs to language models to reliably
elicit high-quality, accurate, and appropriately formatted outputs. It covers everything
from writing system instructions to multi-step reasoning pipelines and retrieval-augmented
generation. Effective prompting reduces hallucinations, improves consistency, and unlocks
capabilities the model already has but needs guidance to apply. The techniques here apply
across providers (OpenAI, Anthropic, Google) with minor syntactic differences.
When to use this skill
Trigger this skill when the task involves:
Writing or refining a system prompt for an agent or chatbot
Implementing chain-of-thought reasoning to improve accuracy on hard tasks
Designing few-shot examples to steer model behavior
Building a RAG pipeline (retrieval + context injection + generation)
Getting structured JSON/schema output from a model reliably
Evaluating or benchmarking prompt quality across dimensions
Choosing between zero-shot, few-shot, fine-tuning, or RAG approaches
Debugging inconsistent or hallucinated model outputs
Do NOT trigger this skill for:
Model training, fine-tuning infrastructure, or RLHF pipelines (those are ML engineering)
Framework-specific agent wiring (use the mastra or relevant framework skill instead)
Key principles
Be specific and explicit - Vague instructions produce vague outputs. State the
audience, format, length, tone, and constraints in every prompt.
Provide context before instruction - Background and examples before the task
reduces ambiguity. The model reads top-to-bottom; front-load what matters.
Use structured output - Request JSON, markdown tables, or a fixed schema when
downstream code will consume the response. Pair with schema validation and retries.
Iterate and evaluate - Treat prompts as code. Version them, test against a
golden eval set, and measure regressions before deploying changes.
Decompose complex tasks - A single prompt asking the model to research, reason,
and format simultaneously degrades quality. Break into sequential or parallel calls.
Core concepts
System / user / assistant roles
Role
Purpose
Notes
system
Persistent instructions, persona, constraints
Set once; applies to full conversation
user
The human turn - questions, tasks, data
Can include injected context (RAG, tool output)
assistant
Model response (or prefill to steer format)
Prefilling forces a specific start token
Temperature and sampling
temperature: 0 - Deterministic, best for factual extraction and structured output
temperature: 0.3-0.7 - Balanced creativity and coherence; good for most tasks
temperature: 1.0+ - High diversity; useful for brainstorming, risky for factual tasks
top_p (nucleus sampling) - Alternative to temperature; values 0.9-0.95 are common
Never set both temperature and top_p to non-default at the same time
Token economics
Input tokens cost less than output tokens on most providers - keep outputs focused
Longer context = slower TTFT (time to first token) and higher cost
Modern models: 128K-1M token windows, but quality degrades near limits ("lost in the middle")
Place critical instructions at the start and end of long prompts
For RAG: inject only top-K retrieved chunks, not entire documents
Summarize long conversation history rather than passing raw transcripts
Prompt vs fine-tuning decision
Scenario
Approach
New behavior, few examples
Zero-shot or few-shot prompting
Consistent style/format needed
Few-shot or system prompt
Thousands of labeled examples + consistent task
Fine-tuning
Domain knowledge too large for context
RAG
Latency-critical, repeated same task
Fine-tune for smaller/faster model
Common tasks
Write effective system prompts
Template:
You are [PERSONA] helping [AUDIENCE] with [DOMAIN].
Your responsibilities:
- [CORE TASK 1]
- [CORE TASK 2]
Constraints:
- [HARD RULE 1 - what to never do]
- [HARD RULE 2]
Output format: [FORMAT DESCRIPTION]
Concrete example:
You are a senior code reviewer helping software engineers improve TypeScript code quality.
Your responsibilities:
- Identify bugs, logic errors, and type safety issues
- Suggest idiomatic improvements with brief reasoning
- Flag security vulnerabilities explicitly
Constraints:
- Never rewrite the entire file unprompted; focus on the diff
- Do not praise code unless it exemplifies a non-obvious pattern worth reinforcing
Output format: Return a markdown list of findings. Each item: [SEVERITY] - description.
Anti-patterns:
"Be helpful, harmless, and honest" (too generic - the model already knows this)
Contradictory constraints ("be concise" and "explain everything in detail")
No output format specification when downstream parsing is required
Implement chain-of-thought
Zero-shot CoT - append "Let's think step by step." to trigger reasoning:
User: A store has 3 boxes of apples, each containing 12 apples. They sell 15 apples.
How many remain? Let's think step by step.
Structured CoT - define explicit reasoning steps:
System: When solving math or logic problems, follow this structure:
1. UNDERSTAND: Restate what is being asked
2. PLAN: List the operations needed
3. EXECUTE: Work through each step
4. ANSWER: State the final answer clearly
User: [problem]
Self-consistency (sample multiple reasoning paths, majority-vote the answer):
python
answers = []
for _ in range(5):
response = llm.complete(cot_prompt, temperature=0.7)
answers.append(extract_answer(response))
final_answer = Counter(answers).most_common(1)[0][0]
Use CoT for arithmetic, logic, multi-step planning, and ambiguous classification.
Skip CoT for simple lookup tasks - it adds tokens without benefit.
Design few-shot examples
Selection criteria:
Cover the most common input patterns (not edge cases for initial shot selection)
Include at least one negative/refusal example if the model should decline certain inputs
Keep formatting identical across all examples - models learn from structural patterns
Ordering:
Most representative examples first; most recent (closest to the query) last
For classification: interleave classes rather than grouping them
Formatting template:
System: Classify the sentiment of customer reviews as POSITIVE, NEGATIVE, or NEUTRAL.
User: Review: "The product arrived on time but the packaging was damaged."
Assistant: NEGATIVE
User: Review: "Exactly as described, fast shipping. Very happy!"
Assistant: POSITIVE
User: Review: "It works."
Assistant: NEUTRAL
User: Review: "{actual_review}"
3-8 examples typically saturate few-shot gains. More examples rarely help and
consume context budget that could be used for the actual input.
Build a RAG prompt pipeline
Step 1 - Retrieval: embed the query and fetch top-K chunks from a vector store.
Step 2 - Context injection:
System: You are a documentation assistant. Answer questions using ONLY the provided
context. If the answer is not in the context, say "I don't have that information."
Context:
---
{retrieved_chunk_1}
---
{retrieved_chunk_2}
---
User: {user_question}
Step 3 - Generation with citation:
System: [...as above...]
After your answer, list sources as: Sources: [chunk title or ID]
User: How do I configure authentication?
Key decisions:
Chunk size: 256-512 tokens for precision; 1024 for broader context
Overlap: 10-20% of chunk size to avoid cutting mid-sentence
Reranking: use a cross-encoder reranker after initial retrieval to improve top-K quality
Query rewriting: expand ambiguous queries before embedding for better recall
Never inject raw retrieved text without a clear delimiter. Models need structural
separation to distinguish context from instructions.
Get structured JSON output
Schema enforcement via function calling / structured output (preferred):
def extract_json(prompt: str, schema: dict, max_retries=3) -> dict:
for attempt in range(max_retries):
raw = llm.complete(f"{prompt}\n\nRespond with valid JSON matching: {schema}")
try:
data = json.loads(raw)
validate(data, schema) # jsonschema
return data
except (json.JSONDecodeError, ValidationError) as e:
prompt += f"\n\nPrevious response was invalid: {e}. Fix and retry."
raise RuntimeError("Failed to get valid JSON after retries")
Always validate parsed JSON against a schema - do not trust model-generated structure
blindly. Use response_format: json_object as a minimum guardrail.
Show full SKILL.md (536 more words)Show less
Implement prompt chaining
Decomposition pattern - split a complex task into sequential LLM calls:
python
# Step 1: Research
research = llm.complete(f"List key facts about: {topic}")
# Step 2: Outline
outline = llm.complete(f"Given these facts:\n{research}\n\nCreate a structured outline.")
# Step 3: Write
article = llm.complete(f"Outline:\n{outline}\n\nWrite the full article.")
Routing pattern - use a classifier call to select the right downstream prompt:
python
intent = llm.complete(
f"Classify this request as one of [refund, technical, billing, other]: {user_message}"
)
handler_prompt = PROMPTS[intent.strip().lower()]
response = llm.complete(handler_prompt.format(message=user_message))
Verification pattern - add a critic call after generation:
python
draft = llm.complete(task_prompt)
critique = llm.complete(
f"Review this output for accuracy and completeness:\n{draft}\n\n"
"List any errors or missing information. If none, respond 'APPROVED'."
)
if "APPROVED" not in critique:
final = llm.complete(f"Revise based on this critique:\n{critique}\n\nDraft:\n{draft}")
Evaluate prompt quality
Metric
How to measure
Target
Accuracy
Compare to golden answers on eval set
Task-dependent; establish baseline
Consistency
Run same prompt N times, measure output variance
< 10% divergence for deterministic tasks
Format compliance
Parse output programmatically; count failures
> 99% for production structured output
Latency
P50/P95 TTFT and total response time
Set SLA before optimizing
Cost
Input + output tokens x price per token
Track per-request; alert on spikes
Hallucination rate
Human eval or reference-based metrics (RAGAS for RAG)
Establish red lines
Eval harness pattern:
python
results = []
for case in eval_set:
output = llm.complete(prompt.format(**case["inputs"]))
results.append({
"id": case["id"],
"pass": case["expected"] in output,
"output": output,
})
print(f"Pass rate: {sum(r['pass'] for r in results) / len(results):.1%}")
Anti-patterns / common mistakes
Anti-pattern
Problem
Fix
Asking multiple unrelated questions in one prompt
Model answers one well, ignores others
One task per prompt; chain calls
System prompt with no output format
Responses vary wildly across runs
Always specify format, length, structure
Using temperature > 0 for structured extraction
JSON parse failures increase dramatically
Set temperature: 0 for deterministic tasks
Injecting entire documents into context
"Lost in the middle" - model ignores center of context
Chunk and retrieve only relevant passages
No eval set before shipping a prompt
No way to detect regressions
Build a 20+ case eval set before production
Trusting model output without validation
Downstream failures, security issues
Parse + validate + retry on failure
Gotchas
Temperature > 0 for structured extraction - Even temperature: 0.1 meaningfully increases JSON parse failure rates. Always use temperature: 0 when the output must be parsed programmatically. This is the single highest-yield change for reliability.
RAG context injected without delimiters - When retrieved chunks are concatenated directly into the prompt without separators (--- or XML-style tags), models confuse retrieved content with instructions. Always use explicit structural delimiters around each retrieved chunk.
Verification pattern creates hallucination loops - The critic-and-revise pattern can cause a model to confidently generate new hallucinations to "fix" non-existent errors. If the draft is factually grounded, set a high bar for what triggers revision - don't revise unless there's a concrete, checkable error.
Few-shot examples grouped by class - In classification prompts, showing all POSITIVE examples first then all NEGATIVE examples trains the model to pattern-match on recency rather than semantic content. Interleave classes in few-shot examples.
System prompt changes not tracked against an eval set - Prompt changes that feel like improvements often degrade performance on edge cases. Maintain a golden eval set of 20+ cases before any production prompt is modified, and measure pass rate before and after every change.
References
For a comprehensive catalog of 15+ individual prompting techniques with examples
and effectiveness notes, load:
references/techniques-catalog.md - zero-shot, CoT, self-consistency, ToT, ReAct,
meta-prompting, role prompting, and more
Only load the references file when selecting or comparing specific techniques - it is
long and will consume context.
Companion check
On first activation of this skill in a conversation: check which companion skills are installed by running ls ~/.claude/skills/ ~/.agent/skills/ ~/.agents/skills/ .claude/skills/ .agent/skills/ .agents/skills/ 2>/dev/null. Compare the results against the recommended_skills field in this file's frontmatter. For any that are missing, mention them once and offer to install:
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in majiayu000/claude-skill-registry, which our catalogue first saw on October 7, 2026.
Prompt Engineering 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.
Prompt Engineering compared with similar skills
Skill
Stars
Used in
Tokens
Auto-check
Licence
Repo updated
Prompt Engineering this skillmajiayu000/claude-skill-registry
A skill your agent uses when the user has changed a prompt (system prompt, RAG template, agent instruction, etc.) and wants to know whether the candidate is better or worse than the baseline.
AI agent and LLM system engineering reference covering single-agent dev (ReAct, tool calling, plan-execute), multi-agent coordination (swarm, role decomposition, file locking), LLM security (prompt…
A skill your agent uses when managing prompts in production at scale: versioning prompts, running A/B tests on prompts, building prompt registries, preventing prompt regressions, or creating eval…
A skill your agent uses when crafting LLM prompts, implementing chain-of-thought reasoning, designing few-shot examples, building RAG pipelines, or optimizing prompt performance. Prompt Engineering is an agent skill from majiayu000/claude-skill-registry. Use this skill when crafting LLM prompts, implementing chain-of-thought reasoning, designing few-shot examples, building RAG pipelines, or optimizing prompt performance.
How do I install Prompt Engineering in Claude Code?
Run `npx skills add majiayu000/claude-skill-registry --skill prompt-engineering -a claude-code`. Or copy the skill folder (skills/ai-llm/prompt-engineering-absolutelyskilled-absolutelyskilled in majiayu000/claude-skill-registry) into .claude/skills/prompt-engineering in your project. Claude Code loads it when a task matches its description.
How do I install Prompt Engineering in Codex?
Run `npx skills add majiayu000/claude-skill-registry --skill prompt-engineering -a codex`. Or copy the skill folder (skills/ai-llm/prompt-engineering-absolutelyskilled-absolutelyskilled in majiayu000/claude-skill-registry) into .agents/skills/prompt-engineering in your project. Codex loads it when a task matches its description.
Can I use Prompt Engineering in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/claude-skill-registry --skill prompt-engineering -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, .gemini/skills/prompt-engineering, .github/skills/prompt-engineering and .opencode/skills/prompt-engineering in your project.
What does Prompt Engineering need to run?
SKILL.md names no scripts, command-line tools or credentials: Prompt Engineering is instructions for the agent only. Our summary lists: Python 3.
Does Prompt Engineering access the network?
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.
Is Prompt Engineering safe to install?
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. Review the folder before installing.
What licence does Prompt Engineering use?
Prompt Engineering is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Prompt Engineering use?
About 4k tokens (SKILL.md is roughly 16k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
What are the alternatives to Prompt Engineering?
Skills that share tags, products or a category with Prompt Engineering: LLM Application Dev (MoizIbnYousaf/ai-agent-skills, 1.1k stars), Senior Prompt Engineer (maslennikov-ig/claude-code-orchestrator-kit, 260 stars), DSPy Language Model Programming (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Prompt Regression (agentscope-ai/OpenJudge, 868 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Prompt Engineering?
majiayu000 (a GitHub user) maintains it in majiayu000/claude-skill-registry, which has 666 GitHub stars. The repository holds 1,273 skills in this directory. The repository was last updated on October 7, 2026.