- Home
- Skills
- Ancoleman
- Ai Design Components
- Prompt Engineering
prompt-engineering_skill
- Python
291
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill ancoleman/ai-design-components --skill prompt-engineering- outputs.yaml8.3 KB
- SKILL.md20.2 KB
Overview
This skill teaches practical prompt engineering to produce reliable, cost-effective outputs from modern LLMs. It covers zero-shot, few-shot, chain-of-thought, structured output, tool calling, and prompt chaining across OpenAI, Anthropic, and open-source models. Examples are provided in Python and TypeScript for production-ready workflows.
How this skill works
I present repeatable patterns and decision frameworks that match task goals to prompting techniques (e.g., zero-shot for simple tasks, CoT for complex reasoning, JSON mode for structured data). The skill includes system prompt design, function/tool definitions, prompt chaining, caching strategies, and validation patterns to enforce schema and reduce hallucination. Practical code snippets show integration with SDKs and validation libraries like Zod.
When to use it
- Building LLM-powered apps that need consistent, production-grade outputs
- When model responses are hallucinating, inconsistent, or fail format constraints
- Extracting structured data (JSON) from free text or enforcing schemas
- Implementing multi-step reasoning, agents, or workflows that call external tools
- Optimizing token cost, latency, or migrating prompts across providers
Best practices
- Start with a decision tree: pick zero-shot, few-shot, CoT, JSON mode, RAG, or tool use based on the task
- Design a concise system prompt (role, behavior, constraints, output format) and version it like code
- Prefer native JSON modes or function calling over text parsing; validate outputs with schema checks
- Use few high-quality examples (2–5) for few-shot; randomize order to avoid position bias
- Cache large static context (prompt caching) and monitor token usage to control cost
Example use cases
- RAG-based document QA that returns structured citations and confidence scores
- An AI agent that decides when to call external APIs and synthesizes results back to users
- Automated extraction of user profile data into validated JSON for downstream systems
- Complex multi-step pipelines: summarize → extract entities → generate metadata
- Migration plan for moving prompts between OpenAI and Anthropic with minimal behavior drift
FAQ
Use native JSON mode or function/tool calling, specify a strict schema, and validate responses with a parser (Zod or JSON Schema); add a recovery step that asks the model to correct invalid output.
When should I use chain-of-thought?
Use CoT for tasks requiring multi-step reasoning (math, multi-hop QA). It improves accuracy but increases token cost, so combine with self-consistency or few-shot CoT when needed.
How many examples for few-shot prompting?
Typically 2–5 high-quality, diverse examples. Quality matters more than quantity; cover edge cases explicitly and keep formatting consistent.