agentleFS
sohaibdevvsohaibdevv/AI-AGENT-SKILLS/skills/prompt-engineering/SKILL.md

prompt-engineering

Skill2 starsChanged 6 months agoMITView on GitHub

Write prompts that are reliable, testable, versioned, and safe

63 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-checklist, nextjs-app-router and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • atuljha23Skill

    security-checklist

    OWASP-style quick reference — authn/authz, injection, secrets, sessions, crypto, dependencies. Use during code review and before committing security-sensitive changes.

    Also in 3 projects that use this

  • desilokesh1Skill

    nextjs-app-router

    Next.js App Router best practices, Server Components, Server Actions, routing patterns, and data fetching strategies. Use when building Next.js applications with the App Router.

    Also in 3 projects that use this

  • rohitg00Skill

    data-engineering

    Data engineering patterns for ETL pipelines, data warehousing, Apache Spark, and data quality validation

    Also in 3 projects that use this

  • qodex-aiSkill

    multi-agent-orchestration

    Design and coordinate multi-agent systems where specialized agents work together to solve complex problems. Covers agent communication, task delegation, workflow orchestration, and result aggregation. Use when building coordinated agent teams, complex workflows, or systems requiring specialized expertise across domains.

    Also in 3 projects that use this

  • AnthropicSkill

    architecture

    Create or evaluate an architecture decision record (ADR). Use when choosing between technologies (e.g., Kafka vs SQS), documenting a design decision with trade-offs and consequences, reviewing a system design proposal, or designing a new component from requirements and constraints.

    Also in 4 projects that use this

  • ArogyaReddySkill

    changelog-generator

    Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 56 edited versions we read keep these.

  • 10

    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:

    Before integrating any LLM into a product feature

    line 14
  2. Distinctive:

    When a prompt is behaving inconsistently

    line 15
  3. Distinctive:

    Before shipping a prompt to production

    line 16
  4. Distinctive:

    When iterating on prompt quality

    line 17
  5. Distinctive:

    Write the exact input → output contract for the prompt.

    line 22
  6. Distinctive:

    Start with the simplest possible prompt.

    line 28
  7. Distinctive:

    Run your prompt against all test cases.

    line 37
  8. Distinctive:

    Every change to a prompt is a code change.

    line 40
  9. Distinctive:

    Add a system prompt safety layer.

    line 49
  10. Distinctive:

    No versioning for prompts

    line 71

“Common” is measured: kept by at least 6 in 10 of the 56 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

Overview

Prompts are code. They have bugs, regressions, and security vulnerabilities. This skill applies software engineering discipline to prompt development: version control, testing, structured output validation, and safety evaluation.

When to Use

  • Before integrating any LLM into a product feature
  • When a prompt is behaving inconsistently
  • Before shipping a prompt to production
  • When iterating on prompt quality

Process

Step 1: Define the task precisely

Write the exact input → output contract for the prompt. What is the input format? What is the output format? What constitutes a correct output? What constitutes a failure?

Step 2: Collect a golden dataset

Gather 20–50 representative inputs with verified correct outputs. This is your test suite. Without it, you are guessing.

Step 3: Write the initial prompt

Start with the simplest possible prompt. State: role, task, constraints, output format. Be explicit about what the model should NOT do.

Step 4: Add examples (few-shot)

Provide 3–5 representative examples that demonstrate the correct behavior. Examples are more reliable than instructions for complex formatting tasks.

Step 5: Specify the output format

For structured outputs: require JSON or XML with a schema. Validate all outputs against the schema. Reject non-conforming outputs rather than guessing.

Step 6: Evaluate on the golden dataset

Run your prompt against all test cases. Score: accuracy, format compliance, latency, cost. Document the baseline.

Step 7: Iterate and track changes

Every change to a prompt is a code change. Version it. Track which version produced which score. Never overwrite a working prompt without knowing the delta.

Step 8: Safety and guardrails

Test for:

  • Prompt injection (user input that overwrites your instructions)
  • Jailbreaks (attempts to bypass role restrictions)
  • Harmful outputs (toxicity, bias, PII)
  • Hallucination (false factual claims)

Add a system prompt safety layer. Add output filtering. Document what is out of scope.

Step 9: Regression testing in CI

Prompts in production must have regression tests that run in CI. A prompt change that reduces golden-dataset score is a regression.

Anti-Rationalizations

"Prompt engineering is just natural language - I don't need to test it" Natural language is the interface. The behavior is a system. All systems need tests.

"LLM outputs are non-deterministic - tests don't work" Deterministic evaluation of non-deterministic outputs: use temperature=0 for tests, use majority-vote scoring, use LLM-as-judge with a stable judge model. Non-determinism is not an excuse.

"We'll monitor it in production" Production monitoring catches failures after users see them. Testing catches failures before users do.

Red Flags

  • Prompts edited directly in production
  • No golden dataset
  • Output format not validated
  • Prompt injection not tested
  • No versioning for prompts

Verification Requirements

  • Input/output contract defined
  • Golden dataset with 20+ examples exists
  • Output format specified and validated
  • Safety evaluation completed (injection, jailbreak, harmful output)
  • Regression tests run in CI
  • Prompt versioned in source control
  • Latency and cost documented

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.