Advanced prompt engineering techniques for optimizing LLM performance, reliability, and structured outputs in production.
Works with
Covers six core capability areas: few-shot learning with dynamic example selection, chain-of-thought reasoning with self-consistency, structured outputs via JSON and Pydantic schemas, iterative prompt optimization, reusable template systems, and role-based system prompt design
Includes practical patterns for semantic example selection, self-verification workflows, pr
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionprompt-engineering-patternsExecute the skills CLI command in your project's root directory to begin installation:
Fetches prompt-engineering-patterns from wshobson/agents and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate prompt-engineering-patterns. Access via /prompt-engineering-patterns in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
0
total installs
0
this week
33.1K
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
33.1K
stars
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-4-6")
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)
from anthropic import Anthropic
from pydantic import BaseModel, Field
from typing import Literal
import json
class SentimentAnalysis(BaseModel):
sentiment: Literal["positive", "negative", "neutral"]
confidence: float = Field(ge=0, le=1)
key_phrases: list[str]
reasoning: str
async def analyze_sentiment(text: str) -> SentimentAnalysis:
"""Analyze sentiment with structured output."""
client = Anthropic()
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=500,
messages=[{
"role": "user",
"content": f"""Analyze the sentiment of this text.
Text: {text}
Respond with JSON matching this schema:
{{
"sentiment": "positive" | "negative" | "neutral",
"confidence": 0.0-1.0,
"key_phrases": ["phrase1", "phrase2"],
"reasoning": "brief explanation"
}}"""
}]
)
return SentimentAnalysis(**json.loads(message.content[0].text))
from langchain_core.prompts import ChatPromptTemplate
cot_prompt = ChatPromptTemplate.from_template("""
Solve this problem step by step.
Problem: {problem}
Instructions:
1. Break down the problem into clear steps
2. Work through each step showing your reasoning
3. State your final answer
4. Verify your answer by checking it against the original problem
Format your response as:
## Steps
[Your step-by-step reasoning]
## Answer
[Your final answer]
## Verification
[Check that your answer is correct]
""")
from langchain_voyageai import VoyageAIEmbeddings
from langchain_core.example_selectors import SemanticSimilarityExampleSelector
from langchain_chroma import Chroma
# Create example selector with semantic similarity
example_selector = SemanticSimilarityExampleSelector.from_examples(
examples=[
{"input": "How do I reset my password?", "output": "Go to Settings > Security > Reset Password"},
{"input": "Where can I see my order history?", "output": "Navigate to Account > Orders"},
{"input": "How do I contact support?", "output": "Click Help > Contact Us or email [email protected]"},
],
embeddings=VoyageAIEmbeddings(model="voyage-3-large"),
vectorstore_cls=Chroma,
k=2 # Select 2 most similar examples
)
async def get_few_shot_prompt(query: str) -> str:
"""Build prompt with dynamically selected examples."""
examples = await example_selector.aselect_examples({"input": query})
examples_text = "\n".join(
f"User: {ex['input']}\nAssistant: {ex['output']}"
for ex in examples
)
return f"""You are a helpful customer support assistant.
Here are some example interactions:
{examples_text}
NoMake data-driven prioritization decisions faster
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
ailabs-393/ai-labs-claude-skills
ailabs-393/ai-labs-claude-skills
pproenca/dot-skills
Keeps context tight: prompt-engineering-patterns is the kind of skill you can hand to a new teammate without a long onboarding doc.
I recommend prompt-engineering-patterns for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
prompt-engineering-patterns has been reliable in day-to-day use. Documentation quality is above average for community skills.
prompt-engineering-patterns reduced setup friction for our internal harness; good balance of opinion and flexibility.
Registry listing for prompt-engineering-patterns matched our evaluation — installs cleanly and behaves as described in the markdown.
prompt-engineering-patterns fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
We added prompt-engineering-patterns from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
prompt-engineering-patterns reduced setup friction for our internal harness; good balance of opinion and flexibility.
prompt-engineering-patterns fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
prompt-engineering-patterns has been reliable in day-to-day use. Documentation quality is above average for community skills.
showing 1-10 of 42