prompt-engineering

A set of methods for writing, improving, and reviewing instructions for language models. It covers organizing context, instructions, examples, and the required output format.

In plain words
What is it for?
Use it to draft system prompts, optimize existing prompts, review instructions, define structured outputs, or design agent tasks.
Why use it?
It helps make prompts clearer and reduces ambiguity about what the model should do and return. This is useful when building repeatable AI or agent workflows.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/codealive-ai/ai-driven-development/prompt-engineering
Any agent
npx skills add CodeAlive-AI/ai-driven-development --skill prompt-engineering
Clone the repo
git clone --depth 1 https://github.com/CodeAlive-AI/ai-driven-development

Made for: Claude Code, Codex.

Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00076 $0.03639
Opus 5 $0.00038 $0.01819
Sonnet 5 $0.00015 $0.00728
Haiku 4.5 $0.00008 $0.00364

Measured 2d ago against content hash 93d15d76f772, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

prompt-engineering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/prompt-engineering/SKILL.md · 319 lines

How it starts

The opening of the file, as written. The whole thing — 319 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt Engineering

Universal techniques for crafting effective prompts across any LLM.

Core Principles

1. Structure with XML Tags

Use XML tags to create clear, parseable prompts:

<context>Background information here</context>
<instructions>
1. First step
2. Second step
</instructions>
<examples>Sample inputs/outputs</examples>
<output_format>Expected structure</output_format>

Benefits:

  • Clarity: Separates context, instructions, and examples
  • Accuracy: Prevents model from mixing up sections
  • Flexibility: Easy to modify individual parts
  • Parseability: Enables structured output extraction

Best practices:

  • Use consistent tag names throughout (<instructions>, not sometimes <steps>)
  • Reference tags explicitly: "Using the data in <context> tags..."
  • Nest tags for hierarchy: <examples><example id="1">...</example></examples>
  • Combine with other techniques: <thinking> for chain-of-thought, <answer> for final output

2. Control Output Shape

Specify explicit constraints on length, format, and structure:

<output_spec>
- Default: 3-6 sentences or ≤5 bullets
- Simple yes/no questions: ≤2 sentences
- Complex multi-step tasks:
  - 1 short overview paragraph
  - ≤5 bullets: What changed, Where, Risks, Next steps, Open questions
- Use Markdown with headers, bullets, tables when helpful
- Avoid long narrative paragraphs; prefer compact structure
</output_spec>

3. Prevent Scope Drift

Explicitly constrain what the model should NOT do:

<constraints>
- Implement EXACTLY and ONLY what is requested
- No extra features, components, or embellishments
- If ambiguous, choose the simplest valid interpretation
- Do NOT invent values, make assumptions, or add unrequested elements
</constraints>

4. Handle Ambiguity Explicitly

Prevent hallucinations and overconfidence:

<uncertainty_handling>
- If the question is ambiguous:
  - Ask 1-3 precise clarifying questions, OR
  - Present 2-3 plausible interpretations with labeled assumptions
- When facts may have changed: answer in general terms, state uncertainty
- Never fabricate exact figures or references when uncertain
- Prefer "Based on the provided context..." over absolute claims
</uncertainty_handling>

Read the full file on GitHub · 319 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 319 lines · 76 tokens per session scan A 93d15d76f772

Subscribe to this mod's changes

prompt-engineering is a skill published in the GitHub repository CodeAlive-AI/ai-driven-development (131 stars, last pushed 4d ago), licensed MIT. It adds 76 tokens to every session and 3,639 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

token-saver

Minimize token consumption & maximize prompt cache hit rate. Use when user asks to save tokens, reduce cost, improve cache hit rate, or be more concise.

lokikill123/codex-token-skills · 36 tokens

agent-platform-prompt-management

Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.

hamzabellouch/agent-skills · 55 tokens

map-plan

ARCHITECT phase - decompose complex tasks into atomic subtasks with research, spec, and branch-scoped plan artifacts under .map.

azalio/map-framework · 31 tokens

map-learn

Capture reusable lessons after a completed MAP workflow. Use when a MAP run has finished and you want rules written to .claude/rules/learned/ from a workflow summary or handoff. Do NOT use during active implementation.

azalio/map-framework · 51 tokens

map-efficient

State-machine MAP execution workflow for Codex. Use when implementing an approved MAP plan end to end, resuming from branch MAP taskplan or stepstate.json artifacts, or running non-trivial multi-subtask work. Use map-fast for tiny one-shot edits.

azalio/map-framework · 55 tokens

map-task

Execute a single subtask from an existing MAP plan via Actor and Monitor. Use when map-plan has decomposed work and you want fine-grained control over one subtask. Do NOT use without an existing plan; run map-plan first.

azalio/map-framework · 51 tokens