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.

referencesresearch.md

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

Research Notes

Use this as a technique map, not a checklist. Pick methods that match the observed failure mode and validate them against evals.

Sources:

Technique Selection

The Prompt Report surveys many prompting techniques, but the practical rule is simple: diagnose the failure before choosing a technique.

  • Format or tone drift: add examples and output contracts.
  • Reasoning errors: add task decomposition, verification, or model-side self-checks.
  • Retrieval hallucination: add grounding, citation rules, and missing-evidence behavior.
  • Tool errors: define action/observation loops, tool preconditions, and stop rules.
  • Long-context misses: restructure context and keep critical instructions or questions away from the middle.

Chain Of Thought

Chain-of-thought demonstrations improved complex reasoning in earlier large models, especially arithmetic, commonsense, and symbolic tasks. For current frontier and reasoning models, do not reflexively ask for hidden chain of thought.

Use instead:

  • Few-shot examples that show input-output structure.
  • A concise visible rationale when the user needs explanation.
  • A private self-check instruction such as "Before finalizing, verify the answer against the success criteria."
  • Structured intermediate artifacts only when the product actually needs them, such as calculations, citations, or a plan.

Self-Consistency

Self-consistency samples multiple reasoning paths and selects the most consistent answer. It is useful when accuracy matters more than latency and the task has a checkable final answer.

Prompt/application pattern:

  • Generate multiple candidate answers or approaches.
  • Judge them against the same rubric or test oracle.
  • Return the best-supported result and note uncertainty.

Do not use this for cheap conversational tasks where latency and cost dominate.

ReAct And Tool Loops

ReAct-style prompting interleaves reasoning and actions so the model can update its plan from observations. This is most useful in search, coding, browsing, and tool-heavy agents.

Modern prompt version:

  • Define when to act with tools.
  • Require observation-based updates after tool results.
  • Add stop rules so the agent does not keep searching after it has enough evidence.
  • Keep user-visible reasoning concise; do not expose raw hidden chain of thought.

Long Context

Lost in the Middle shows models can underuse information buried in the middle of long contexts.

Mitigations:

  • Put critical instructions, task, or stop rules at the beginning or end.
  • Split long documents with source metadata.
  • Ask for relevant quote extraction before synthesis in high-accuracy tasks.
  • Avoid relying on one buried sentence to carry an invariant.
  • Use retrieval or chunking when the prompt becomes mostly archival data.

Automatic Prompt Optimization

Automatic Prompt Engineer frames prompts as candidate programs selected by a score function.

Practical version:

  • Generate several prompt variants.
  • Score them against eval fixtures, not taste.
  • Keep the simplest variant that passes.
  • Preserve the winning prompt and eval cases together so future edits can be measured.

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