Best for
- designing or refactoring prompts for production LLM systems
- structured outputs, extraction schemas, or response contracts
- prompt debugging, prompt hardening, or prompt review
vasilyu1983/AI-Agents-public/frameworks/shared-skills/skills/ai-prompt-engineering/SKILL.md
Prompt engineering for production LLMs — structured outputs, evals, RAG, tool workflows, multimodal prompting, and safety. Use when designing, debugging, or shipping prompts.
Decision brief
Use this skill for production prompt design: schema-first outputs, tool and RAG prompts, prompt hardening, evals, and release workflows. Keep it operational. If the main problem is architecture, retrieval quality, deployment, or inference cost, route to the deeper adjacent skill.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Declared | Source record | Install path and trigger |
| Claude Code | Declared | Source record | Install path and trigger |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/ai-prompt-engineering"Inspect the Agent Skill "ai-prompt-engineering" from https://github.com/vasilyu1983/AI-Agents-public/blob/53f6cb73ea53a2646e3e7d4665062ad66f3683ac/frameworks/shared-skills/skills/ai-prompt-engineering/SKILL.md at commit 53f6cb73ea53a2646e3e7d4665062ad66f3683ac. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Classify the prompt job: structured output, extraction, RAG, tool use, rewrite, classification, or release workflow. 2. Start from a template or provider-native prompt feature rather than writing from scratch. 3. Add explicit output and refusal rules. 4. Add validation: schem…
1. Pick the closest pattern. 2. Load the smallest useful template or reference. 3. Write the prompt contract: - task - allowed inputs and tools - output schema or format - refusal or missing-data behavior 4. Add validators and adversarial tests. 5. Verify current provider behavi…
Review the “ASCII Flow” section in the pinned source before continuing.
designing or refactoring prompts for production LLM systems
agent architecture and orchestration - ai-agents
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 93/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 82 | Source | Repository attention, not individual Skill quality |
| Compatibility | 2 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill for production prompt design: schema-first outputs, tool and RAG prompts, prompt hardening, evals, and release workflows. Keep it operational. If the main problem is architecture, retrieval quality, deployment, or inference cost, route to the deeper adjacent skill.
prompt job
|
v
pattern choice
structured output | extraction | RAG | tool use | rewrite | classify | release
|
v
prompt contract
inputs + role/task + context rules + output schema + refusal/failure behavior
|
v
validation
schema checks + citation/tool checks + eval cases + regression gate
|
v
released prompt
versioned artifact + rollout notes + rollback path
## Pattern Chooser## Minimal Prompt Skeletons## Production Checklist## Navigation| Need | Pattern | Core Controls |
|---|---|---|
| Machine-parseable output | Structured output | schema, JSON-only response, validation |
| Deterministic field extraction | Extractor | missing -> null, no transformation, exact schema |
| Retrieved factual answering | RAG workflow | relevance check, citation requirement, explicit missing-info behavior |
| Hidden reasoning | Private reasoning / native thinking | final answer only, no exposed chain-of-thought |
| Tool use | Tool or agent planner | plan, tool gating, validation after each call |
| Text transformation | Rewrite and constrain | meaning preservation, style and format rules |
| Classification or routing | Decision tree | mutually exclusive branches, stable output format |
| Prompt release | Prompt ops | versioning, eval gates, rollback path |
| Choosing prompt vs RAG vs fine-tune vs distill | Escalation decision | Prompt → RAG (knowledge gap) → Fine-tune (volume + stable task) → Distill (cost at scale). See references/prompt-vs-finetune.md. |
TASK:
{{one_sentence_task}}
INPUT:
{{input_data}}
RULES:
- Use only INPUT and approved tool outputs.
- Do not invent facts.
- Missing required information -> say what is missing.
- Keep reasoning hidden.
- Follow OUTPUT FORMAT exactly.
OUTPUT FORMAT:
{{schema_or_format_spec}}
AVAILABLE TOOLS:
{{tool_names_or_signatures}}
WORKFLOW:
- Make a short plan.
- Call tools only when needed.
- Validate each tool result before using it.
- Run independent reads in parallel only if the environment supports it.
RETRIEVED CONTEXT:
{{chunks_with_ids}}
RULES:
- Use only retrieved context for factual claims.
- Cite chunk ids for each claim.
- If evidence is missing, say what is missing.
Prompt quality depends on the whole input pipeline, not just instruction wording.
Route deep retrieval or memory design work to ai-rag or ai-context-layer.
Do
Avoid
| Script | Purpose |
|---|---|
scripts/prompt_regression_runner.py | Run a JSONL prompt regression suite (variant_id, prompt, golden_substrings, schema). Groups results by variant. Validates pre-collected outputs only. |
Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
Frequently asked questions
Use this skill for production prompt design: schema-first outputs, tool and RAG prompts, prompt hardening, evals, and release workflows. Keep it operational. If the main problem is architecture, retrieval quality, deployment, or inference cost, route to the deeper adjacent skill.
The source record exposes this install command: npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/ai-prompt-engineering". Inspect the command and pinned source before running it.
The pinned source record declares support for: codex, claude code.
Alternatives
vasilyu1983/AI-Agents-public
Configures Claude Code hooks and Codex hooks.json/notify callbacks. Use when adding guardrails, preflight, audit trails, worktree automation, or budget enforcement.
vasilyu1983/AI-Agents-public
Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.
vasilyu1983/AI-Agents-public
Guides multi-GPU pre-training: DDP, FSDP2, ZeRO, tensor/pipeline/expert parallelism, fp8/Muon. Use when scaling a run, training MoE, or reproducing GPT-2 on rented GPUs.
vasilyu1983/AI-Agents-public
Scans public GitHub repos for agent skills, dev practices, and code patterns. Use when enriching skills, setting team policy, or researching a build domain.