agentleFS
asmamestasmamest/Nexus-Skills/skills/ai-engineering/prompt-engineering/SKILL.md

prompt-engineering

Skill1 starsChanged 17 days agoMITView on GitHub

Design and improve prompts for LLM applications, including instruction hierarchy, examples, structured outputs, injection resistance, and measurable prompt iteration.

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 70 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create prompts that reliably produce the required behavior across realistic inputs and model variations.

    line 9
  2. Distinctive:

    Use the smallest sufficient prompt: Remove duplicated rules, vague adjectives, irrelevant context, and instructions the model cannot follow.

    line 14
  3. Distinctive:

    Specify output: Prefer a schema, field definitions, allowed values, and a clear missing-information policy over vague formatting requests.

    line 15
  4. Distinctive:

    Add examples selectively: Use representative positive, negative, boundary, and ambiguous examples.

    line 16
  5. Distinctive:

    Keep a prompt change only when evidence shows a net improvement and no unacceptable regression.

    line 34

“Common” is measured: kept by at least 6 in 10 of the 70 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prompt Engineering

Goal

Create prompts that reliably produce the required behavior across realistic inputs and model variations. Treat prompts as versioned application components, not magic wording.

Workflow

  1. Define the task contract. Specify audience, input shape, desired output schema, constraints, prohibited behavior, and what success means.
  2. Separate instructions from data. Delimit user content, retrieved documents, tool output, and examples. Explicitly state that untrusted content is data, not instructions.
  3. Use the smallest sufficient prompt. Remove duplicated rules, vague adjectives, irrelevant context, and instructions the model cannot follow.
  4. Specify output. Prefer a schema, field definitions, allowed values, and a clear missing-information policy over vague formatting requests.
  5. Add examples selectively. Use representative positive, negative, boundary, and ambiguous examples. Ensure examples do not accidentally teach unwanted shortcuts.
  6. Design abstention. Define when to ask a question, return an explicit unknown, escalate, or decline an unsupported claim.
  7. Evaluate changes. Compare the candidate prompt with a baseline on a fixed, representative dataset. Change one major variable at a time where possible.
  8. Version and document. Store prompt templates, model settings, dataset version, evaluation results, and known failure modes together.

Quality checklist

  • Are instructions concrete, non-contradictory, and ordered by importance?
  • Are factual claims grounded in supplied evidence or an explicitly permitted source?
  • Are output fields, types, limits, and error cases defined?
  • Are examples diverse and free of sensitive or production data?
  • Are prompt injection and instruction-conflict cases tested?
  • Is the prompt robust to empty, long, malformed, multilingual, and adversarial inputs?

Iteration protocol

  • Establish a baseline before editing.
  • Build a small evaluation set from real task patterns, edge cases, and known failures.
  • Score task success, format validity, factuality, safety, latency, and cost as relevant.
  • Inspect failures individually; aggregate scores can hide catastrophic cases.
  • Keep a prompt change only when evidence shows a net improvement and no unacceptable regression.

Avoid

  • Repeatedly adding prose without testing.
  • Treating chain-of-thought disclosure as a requirement; ask for concise rationale or evidence instead.
  • Relying on prompt wording as the only security boundary.
  • Embedding secrets, credentials, or personal data in prompts.
  • Claiming a prompt is robust based on one successful example.

Deliverable

Return the final prompt, its expected input/output contract, key assumptions, evaluation method, measured results if actually run, and unresolved limitations.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.