All skills
elithrar avatar

/prompt-engineer

@a2a5f65
by Matt Silverlockelithrar/dotfiles201 stars
15

Audit and revise system prompts, developer instructions, tool descriptions, and reusable LLM prompt templates. Use for behavioral failures such as over-searching, format drift, weak tool use, instruction conflicts, or unsupported claims. Use for prompt behavior, not ordinary prose editing or skill packaging alone.

Use this Skill: https://skilld.dev/gh/elithrar/dotfiles/prompt-engineer

This session only. Nothing lands on disk.

referencesclaude.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Claude Prompting Notes

Use this when the target model is Claude, especially Opus-class or long-horizon agentic Claude deployments.

Sources:

Start With Evals

Anthropic recommends prompt engineering after success criteria and empirical tests exist. If the user only has a vague prompt, first define what a good response looks like and capture a few representative inputs.

Clear And Direct

  • Be explicit about the desired output, constraints, and level of effort.
  • Add context or motivation for non-obvious rules. Claude generalizes better when it knows why the rule matters.
  • Use role prompting when domain, tone, or reasoning style matters.
  • Use positive instructions before negative constraints.

Examples

Examples are high leverage for Claude. Use them when output format, tone, or classification boundaries matter.

  • Include examples that closely mirror real inputs.
  • Cover edge cases and avoid accidental patterns.
  • Wrap examples in <example> or <examples> tags.
  • For complex Claude prompts, 3-5 diverse examples can outperform repeated rule wording.

XML Structure

Claude parses XML-style tags reliably. Use tags for distinct prompt regions such as <instructions>, <context>, <documents>, <examples>, <input>, and <output_format>.

Best practice:

  • Use consistent, descriptive tag names.
  • Nest only when the content has a real hierarchy, such as multiple documents with metadata.
  • Avoid cargo-cult tags around every paragraph.

Long Context

For large document or data-rich inputs:

  • Put long-form data above the immediate query and instructions when the prompt is primarily a document-analysis task.
  • Use document metadata tags like <source> and <document_content>.
  • Put the user's immediate question near the end.
  • For high-accuracy document work, ask Claude to extract relevant quotes first, then synthesize from those quotes.

Output And Formatting

  • Tell Claude what to do instead of only what not to do.
  • Match the prompt style to the desired output style when formatting drift persists.
  • Prefer structured outputs or tool schemas for strict JSON, classification, and enum outputs.
  • Check current Anthropic docs before recommending assistant prefill; newer Claude models have reduced or removed support for last-turn prefills.

Tool And Agent Behavior

  • If the user wants action, say so directly: "Make these edits" beats "Suggest changes".
  • Calibrate eagerness. Opus-class models may overtrigger on aggressive tool or thoroughness prompts that were useful for older models.
  • Use explicit confirmation thresholds for destructive, irreversible, externally visible, or production-affecting actions.
  • Encourage parallel tool calls only when calls are independent and parameters are known.
  • For codebase questions, require inspection before claims: never speculate about files that have not been opened unless the answer is truly known.

Reasoning And Effort

  • Use effort or thinking controls where the API supports them; do not simulate them with repetitive "think deeply" text.
  • Ask Claude to self-check against concrete criteria before finalizing high-stakes answers.
  • When explicit thinking is disabled, avoid overusing the word "think" in prompts that are meant to produce direct answers; use "evaluate", "assess", or "verify" instead.

Overengineering Controls

Claude can overbuild when asked for quality or thoroughness. Add constraints like these when minimality matters:

Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Do not add features, abstractions, fallback paths, or documentation unless they are required for the current task.

Migration Watchouts

  • Dial back "always use tools" and "be maximally thorough" language for newer Opus-class prompts.
  • Prefer decision rules: when to search, when to ask, when to stop, and what evidence is enough.
  • Keep prompt changes tied to eval failures; newer models often need less scaffolding, not more.

Source: SKILL.md on GitHub

No alerts12d3 checks · Risk SAFE
  • Gen Agent Trust Hub12d

    This skill provides best practices for prompt engineering and auditing LLM behavior. It contains no executable code and focuses on defensive strategies for managing instruction authority and untrusted inputs.

  • Socket12d

    No alerts

  • Snyk12d

    Risk: LOW · No issues

Signed by skilld at a2a5f65. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 4 weeks ago

README badge

README badge for elithrar/dotfiles/prompt-engineer