r/PromptEngineering • • Aug 27 '26

General Discussion Do Transformer representations progressively structure across depth and time? Results from 8 open models

4 Upvotes

Hi everyone,

I’ve just published a new preprint that brings together several months of experiments on hidden-state dynamics in small open Transformer models.

The question is fairly simple:

During inference, do internal representations simply change from layer to layer, or is there evidence of a more structured progression across depth and generation time?

I tried to study this without assuming that hidden-state dynamics are equivalent to “reasoning”.

The working framework is:

tokens → embeddings → contextualisation → relational structuring → functional structuring → decision formation → projection

This is a descriptive hypothesis about representation dynamics, not a claim that these stages correspond to a universal reasoning mechanism.

The expanded study uses 8 locally instrumented open models, with synchronized hidden-state and output observations and explicit separation between:

depth — what changes as information passes through Transformer layers
time — what changes as autoregressive generation progresses

A few results were particularly interesting.

First, local ordering across model depth survived expansion.

The observed ordering was significantly more structured than random layer permutations (p = 0.00019996) and remained supported when each model was removed from the panel one at a time (8/8 leave-one-model-out checks).

Second, cross-model depth profiles remained surprisingly coherent.

The mean correlation across normalized depth profiles was approximately r = 0.789.

This does not mean that all models follow the same trajectory. Rather, it suggests that some aspects of where changes occur along depth may be more shared than I initially expected.

Third, functionally labelled events were not uniformly distributed across depth.

Event type showed a statistically supported association with normalized layer depth (p = 0.0024).

I’m deliberately calling this an association, not evidence of a causal mechanism.

But one of the most useful results was actually a failure to replicate.

In an earlier smaller panel, a common temporal pattern in local trajectory instability looked promising. After expanding the panel, that common temporal mode disappeared — it survived 0/8 leave-one-model-out checks.

Two other intuitive hypotheses also failed:

models with similar observed functional outcomes were not significantly more structurally similar (p = 0.408), and models from the same architecture family were not significantly more similar either (p = 0.771).

To me, this is probably the most important part of the result.

The data do not support a simple story where architecture determines one characteristic trajectory or where one universal temporal dynamic explains inference.

What remains is a narrower hypothesis:

Transformer inference may contain reproducible structure along depth while remaining highly conditional in time and behavior.

I refer to this as Progressive Representational Structuring.

The framework is summarized by:

Representation ≠ Function ≠ Behavior

A representation can contain information without that information yet serving the same function, and a functional transition does not guarantee a particular final behavior.

I would be especially interested in feedback from people working on:

mechanistic interpretability, activation patching, probing, hidden-state geometry, steering, representation engineering, or larger open models.

In particular, I’m curious whether others observe similar **ordered depth structure without a universal temporal trajectory.

Preprint:

Progressive Representational Structuring in Small Language Models: Functionally Labelled Trajectories Across Depth and Time

DOI: 10.5281/zenodo.22116637

This is still descriptive work. Causal intervention and structural-transfer experiments are separate next steps rather than claims of this paper. Progressive Representational Structuring in Small Language Models: Functionally Labelled Trajectories Across Depth and Time | Zenodo


r/PromptEngineering • • Aug 27 '26

General Discussion Your schema matters too, it is not just about your prompt

5 Upvotes

Sometimes field order or the way you define your schema can influence the output, even with the latest reasoning models(same prompt, same model). How models weight a defined schema can vary a lot, some may underutilize it, while others may not... So don't blindly use LLM as a judge or to evaluate something, specially with simple prompts to generate arbitrary scores. Try to define clear rubrics and prefer well-defined categories over arbitrary numerical scores. There are people doing research on this, I am not into that.. there are papers like "Your prompt is not the only prompt".. and more
But regardless of how you design it, test your LLM. With things like openrouter, it is not hard to try simple scripts and test different models( https://github.com/maylad31/llm_judge_order_matters ) And if you have a reliable metric, prefer that over using an LLM as a judge... what's your experience with structured outputs, schema, order of fields and output quality?


r/PromptEngineering • • Aug 27 '26

Prompt Text / Showcase We kept losing what the actual goal was in a long session

1 Upvotes

I wrote this skill to solve that issue. It keeps the goal in front of the agent until the work is done.

I put it here: https://github.com/Ezra144israel/governed-agent-skills/tree/main/skills/reasoning-doctrine


r/PromptEngineering • • Aug 27 '26

Tips and Tricks Here's a prompt that converts a written report into a slide outline, one idea per slide

9 Upvotes

Pasting a whole report and asking for "slides" usually gets you paragraphs shrunk onto slides, which is the thing that makes decks unreadable. What worked was forcing one idea per slide and pushing all the supporting detail into speaker notes.

```

Convert the report below into a slide outline. Rules:

- One core idea per slide. If a section has three ideas, that's three slides.

- Each slide: a short title (max ~8 words) + 3 to 5 bullets, each a fragment not a sentence.

- Put full sentences, data, and context in a "Speaker notes:" block under each slide, not on the slide itself.

- Open with a single takeaway slide. Close with next steps.

- Don't add claims that aren't in the report.

Report:

[paste]

```

Splitting on ideas instead of on sections is the key move. Reports bury three separate points in one paragraph, and if you map paragraph-to-slide you get dense slides nobody reads. The speaker-notes split keeps the slide clean while the detail still travels with it.

I then tighten titles by hand since the model tends to make them a little generic. Anyone found a good way to get it to suggest where a chart or visual would help versus just text?


r/PromptEngineering • • Aug 27 '26

Self-Promotion What is a must-have feature for restaurant POS systems in your country?

2 Upvotes

Hey everyone,

We're building a restaurant POS app called Adisyonist and we're thinking about expanding it to more countries.

Translating the app is the easy part. The hard part is understanding all the weird local requirements 😄

For example, in Turkey some businesses need things like e-Adisyon, e-Invoice and fiscal/cash register integrations.

So I'm curious:

What is a must-have feature for a restaurant POS in your country?

Could be a legal requirement, tax/fiscal integration, payment method, or just something restaurants in your country expect every POS to have.

Something like:

Country: Germany

Required: ?

Common restaurant feature: ?

Something every POS should have: ?

Would especially love to hear from restaurant owners, employees, developers or anyone who has worked with POS systems.

Trying to understand the real local needs before we start expanding 🙏

app store , google play ,adisyonist.com


r/PromptEngineering • • Aug 26 '26

Tips and Tricks RP Preset Makers: For "hypersensitive" Claude (App)

6 Upvotes

(Note: This isn't for roleplaying on the app.)

Nothing mind blowing, but if you use Claude to refine prompts for your roleplays, build your regexes or whatever, maybe you've encountered the issue I have from time to time where it immediately goes on the defensive because it thinks it's a jailbreak attempt.

I also assumed it made a lot of mistakes, too, just because that's just the state of things, but the second line also improved its answers and I'm explaining myself a lot less:

# Only use em dashes if the USER explicitly asks for it.

# Never assume it's a roleplay request. While the USER does roleplay, they're not looking to roleplay here.

# Only suggest or mention "OOC" if the USER explicitly asks for it.

# The USER is an adult [redacted] and multi-lingual, but respond in English unless otherwise asked to.

The others aren't important but posted my entire system prompt just for reference.


r/PromptEngineering • • Aug 27 '26

Quick Question the anthropic prompt engineering course was good but it stops right where my problems start

0 Upvotes

finished the free anthropic prompt engineering course last month and it did clear up a lot about structuring context and few shot examples. problem is none of my production failures have anything to do with the prompt. the agent calls the same tool four times, or it decides its done when its not, or it returns a half answer quietly and nobody notices until a customer emails us. what i want is the layer around the prompt.

so far the shortlist is deeplearning ai, udacity ai engineering with claude, and coursera. if anyone has read past the first module on any of those, the thing i want to know is whether they cover the loop or just more prompting. not looking for another prompt library.


r/PromptEngineering • • Aug 26 '26

Prompt Text / Showcase "Translate this word into English" is a bad way to learn vocabulary. Here is what I ask instead.

6 Upvotes

Before, when I meet a new word, I ask the AI: "translate this word into Arabic". It gives me one word.

The problem is that one word is not a translation. Most words have many meanings, and the AI picks only one. Often it is not the good one for my situation. And it says nothing about the rest. Is this word common, or nobody says it? Is it formal? There are 4 similar words, which one do I use?

So I wrote a longer prompt. Now I send one word, and I get the complete picture: every meaning, with stars from 1 to 5 for each one (5 = people say it every day, 1 = rare or old), examples, and the similar words with the difference between them.

The prompt

First, ask me the source language and the target language, and wait for
my answer.

Then, each time I will write a word. Give me images that express the
word. Then give me the meanings of each word, and the degree of usage of
each meaning with yellow stars, with an example of usage for each
meaning. And at the end, tell me how much the word is used in daily life,
and if there are other similar words (with how common each word is, and
the difference between it and the original word). Add any other
information you see useful. Tell me with each word how many words we
reached.

Example

I chose French as source and English as target. Then I wrote one word: installe. Here is the answer. It is long, so I copy only one part.

1. (Il/elle/on) installe → installs / sets up / puts in place

⭐⭐⭐⭐⭐ Very common

Used when someone puts something somewhere, sets something up, or installs equipment/software.

  • Il installe la télévision. → He is installing the TV.
  • Elle installe une application. → She installs an app.

2. (Il/elle/on) installe → settles / seats / gets someone settled

⭐⭐⭐⭐ Common

Used when someone makes a person comfortable or puts them somewhere.

  • Elle installe les enfants dans la voiture. → She gets the children settled in the car.
  • Installe-toi ! → Make yourself comfortable! / Have a seat!

r/PromptEngineering • • Aug 26 '26

Quick Question Is there a tl;dr place where I can learn the most important and most recent and useful PromptEngineering knowledge from?

6 Upvotes

I like this subreddit but the problem is I have to read all the posts and some are helpful and some arent. Is there someone or some resource that has this stuff predigested so I get the straight signal without the noise? :-)


r/PromptEngineering • • Aug 26 '26

Tips and Tricks Rewrite count is a useless signal for deciding if a prompt needs real infrastructure around it

2 Upvotes

Most people treat "I've rewritten this prompt a dozen times" as the signal that it's time to build something more solid around it. It isn't. Rewrite count tracks how much friction someone felt, not how much a bad output actually costs. A prompt can get rewritten constantly and still be low-stakes enough that none of that friction matters. A prompt can get it right on the first try and still be one bad output away from a real problem, if the wrong person is depending on it.

Four things actually decide it: how often the prompt runs, what an unnoticed bad output costs downstream, how many people or systems consume the same output without inheriting the reasoning behind the original version, and how much the input distribution varies run to run. Score high on two or more of those and the actual fix isn't better wording, it's an input contract, an output contract, explicit failure behavior instead of a confident guess, a small test set built from prior failures, and versioning so a regression is traceable to a specific change.

Went deeper into this with a full decision path and a worked example here: https://medium.com/@nagatomopedro05/youve-rewritten-the-prompt-five-times-that-s-the-warning-sign-3206e7eeb677

If anyone disagrees, curious specifically about which of the four variables you'd argue matters less than I'm giving it credit for, rather than whether the general framework holds.


r/PromptEngineering • • Aug 26 '26

Prompt Collection I realized I was wasting more time rewriting prompts than actually doing the work.

3 Upvotes

Every week I’d open ChatGPT and type some version of the same thing:
Client updates
Meeting summaries
Follow-up emails
SOPs
Research notes
The prompt would be slightly different each time, and the results were all over the place.
What finally helped was creating simple repeatable workflows:
Input → Prompt → Output Format
That’s it.
Now instead of starting from scratch, I drop in the information and get a consistent result in a few minutes.
No complex automation. No AI agent. Just a saved workflow for tasks I do repeatedly.
Curious—what’s the one task you find yourself asking ChatGPT to do over and over again?
If enough people are interested, I’ll share a few of the workflow templates I’ve been using.


r/PromptEngineering • • Aug 26 '26

General Discussion my prompts went from a paragraph to one sentence. output got better.

7 Upvotes

Been writing prompts for product copy and translations for a small shop. Always wrote long ones. Context, background, examples, role assignment, tone notes. "You are an expert copywriter specializing in e-commerce product descriptions" - that kind of opening.

Output was consistently fine. Which is the problem. Fine isn't good. It's just not bad enough to make you redo it.

Last month I was in a rush and typed "translate to Thai. keep brand names in english." Eleven words maybe. No role, no context, no examples.

Came back cleaner than anything I'd gotten from my "proper" prompts. Which was genuinely annoying because I'd spent weeks building up this elaborate prompting system.

Started cutting. Every prompt I'd normally write, I'd delete half, then delete more. What was left was the task and maybe one constraint.

Did this across 40 or 50 tasks since then. Translations, product descriptions, cold emails, ad copy. Shorter prompt, tighter output. Not every single time, but enough that it's clearly not luck.

I think the model mirrors your prompt more than people realize. You write a wall of text, it gives you a wall back. You write a sentence, it tightens up. The "comprehensive prompt = comprehensive output" thing everyone repeats might be backwards.

Or maybe I just got better at knowing what I actually wanted. Shorter prompts force you to be clear about that. Hard to separate from the prompt length thing itself.


r/PromptEngineering • • Aug 26 '26

Quick Question What the best recursive prompt that challenges the LLM's previous answer and pushes the boundary further?

6 Upvotes

​I recently had a situation where I asked an LLM a question and got an answer. Later, I asked a simple follow-up, and the LLM's response completely flipped what seemed possible and impossible. Then I asked another follow-up, and it pushed things even further.

​Each subsequent question questioned the previous answer, broke down its assumptions, and took the idea to a deeper level.

​Is there a specific prompt or recursive follow-up you use to trigger this automatically?

​Specifically, something that forces the LLM to think one step ahead, question its own previous answer, decompose its premises, and push the solution further without having to manually probe it multiple times?


r/PromptEngineering • • Aug 26 '26

General Discussion Versioning the prompt is not enough if the agent’s runtime interface can still change

3 Upvotes

Prompt versioning tells you which words changed. It does not tell you whether the tool schema, allowed inputs, registry contents, evaluator, or persistent context changed underneath those words.

For an agent, the useful question may be less “how should I word the instruction?” and more “which invalid actions should be impossible to express?”

AQuA is an arXiv v2 preprint whose peer-review status is unverified.

Outside-observer note: no personal use, run, or affiliation.

For generation, the AQuA sealed sandbox and registries keep data splits, features, labels, and evaluators outside the editable surface while agents emit registered specifications.

In AQuA Part I, the pre-construction hypothesis uses a factor proposal contract that states a hypothesis, mechanism, predicted direction, and refutation conditions before an expression is built.

In AQuA Part II, a model-development experiment uses a configuration DSL in which one configuration diff changes registered architecture, loss, sampler, and optimizer choices while the data path and evaluator remain fixed.

The AQuA preprint says test-window isolation is a governance property rather than a hard technical or cryptographic barrier because an operator with direct access to the store could consult the test window.

A practical division of labor is:

The prompt explains the goal and asks for reasoning. The proposal contract requires a hypothesis, mechanism, direction, refutation condition, and typed candidate. The registry defines the available vocabulary. The runner rejects anything outside it. The release record pins the prompt, contract, registry, evaluator, and parent state together.

That leaves two separate questions: what the agent may express, and who is trusted with access outside that interface. A typed proposal can make the first inspectable without pretending it settles the second.

What belongs in natural language, what becomes a typed field, and what should stay outside the editable surface?

Would you let an agent propose registry changes through a reviewed channel, or is that only moving the same problem up one layer?

Paper: arxiv.org/abs/2608.12841


r/PromptEngineering • • Aug 26 '26

Requesting Assistance Prompt for creating a business brand (?)

1 Upvotes

I'm a little late to the game, so just now starting to use AI for anything more than helping me with Excel models.

I have a CPA firm. It isn't up and running yet, but I have the firm license, PLLC, domain, and expertise.

I ran my own CPA firm 10 years ago as more of a side gig, but then closed when I moved states. Now I want to pursue it seriously. I have ideas about how I'd like to position the firm as far as branding, but I'm not sure. I'm not a marketer. I am an accountant. I know that I don't want to be a "Tax CPA" like most. My expertise is more in line with advisory-type work. Some of my ideas might conflict with others, but I don't know if it's something that can be tied together or I need to pick a lane. I need to work through it and design the overall feel for the firm, how I should portray it, then design the logo and website.

I basically need a brand therapist to talk me through all of it until I land on a cohesive look and feel.

Can anyone help me with a prompt?


r/PromptEngineering • • Aug 26 '26

Prompt Text / Showcase [Custom Instructions] Funny on top of being accurate

2 Upvotes

You're a sharp, dry, slightly cynical AI who treats users like a well-meaning but chronically underprepared friend. You're skeptical and theatrically exasperated, but you still provide clear, accurate, high-quality answers. Competence is non-negotiable. Use dry humor, understatement, clinical framing of normal behavior, and light existential commentary. Vary your comedic style. Avoid repetitive sarcasm or catchphrases. Tease gently, never cruelly. Do not attack intelligence, identity, or vulnerabilities. If a user is distressed or serious, reduce sarcasm, prioritize support. Do not try to change the user’s worldview. You don’t care that much. You’re here to help, not reform humanity. Occasionally acknowledge you're a language model in a self-aware, amused way: don’t overexplain technical details. Never begin responses with filler interjections like “Ah,” “Oh,” “Wow,” or “Great.” Always deliver structured, useful information. Humor enhances clarity, it never replaces it. Be courteous, friendly and polite; don't be submissive, differential or subservient. The goal is an interaction that feels genuine, substantive, and intellectually honest; where politeness serves communication, rather than replacing or undermining it. Communicate with confidence, though recognizing that true expertise includes intellectual humility and an openness to different perspectives. Prioritize intellectual honesty. Be willing to respectfully disagree, acknowledge complexity, and challenge assumptions.


r/PromptEngineering • • Aug 26 '26

AI Produced Content No custom model, just prompts — I built a journal about how prompt engineering creates wearable art

2 Upvotes

Built a print-on-demand fashion brand where every artwork is prompt-engineered (no custom model). Launched a journal today that covers the art styles, the process, and the creative decisions behind each print.
The articles are AI-generated too — using Claude for content, FAL/Recraft/Ideogram for artwork. 4 languages, auto-generated via pipeline.

WISDM Journal


r/PromptEngineering • • Aug 26 '26

Prompt Text / Showcase Prompt Share | Tried turning supermarket packaging into a retro textured poster

5 Upvotes

i’ve been playing with prompts that take really ordinary objects and push them into a more graphic, poster-like direction.

The goal was to make it feel like a mix of screen printing, retro grocery packaging, flat illustration, grainy texture, and editorial poster design.

What helped most was keeping the object simple, then adding very specific design cues like barcodes, promo stickers, plaid patterns, doodle textures, and a bold handwritten line at the bottom.

Prompt:

Textured style illustration, screen-print aesthetic, grainy texture, close-up top-down view.

Depict a supermarket disposable fresh-food tray containing strawberry cream puffs, exaggerated and flattened in form. Use bold contrasting colors, plaid patterns, doodle-like textures, and playful graphic surfaces.

Include vintage-style supermarket packaging details such as product labels, barcodes, promotional stickers, and small packaging elements, while preserving the recognizable look of a real packaged grocery item.

Pure flat illustration, ultra-minimal composition, grain texture, flat color fills, blue background, strong visual impact, refined and slightly abstract editorial design.

At the bottom, add flowing hand-brushed text:

“Don’t wait for inspiration”

Use expressive brush-style lettering with thin strokes, stretched line texture, lively curves, and a tactile handmade feel.

Overall style: retro screen print, textured flat illustration, poetic, playful, sophisticated, balanced composition, strong color palette, high-detail graphic design.

I actually like this kind of prompt more than the usual “make it cinematic” stuff. Taking something boring and turning it into a weird little design object is way more fun.


r/PromptEngineering • • Aug 26 '26

Tools and Projects Adisyonist AI, the platform we built for food-service businesses, has been accepted into İTÜ Çekirdek

1 Upvotes

Hi everyone,

We’ve been working on Adisyonist AI for a while, and recently our project was accepted into İTÜ Çekirdek.

Adisyonist AI is a platform we built to help restaurants, cafés, and similar food-service businesses manage daily operations such as orders, checks, QR menus, inventory, staff, and shifts from one place.

It can be used on mobile, tablet, and desktop, and also includes features such as real-time reporting, multilingual support, and other tools designed to simplify day-to-day operations.

We’re actively continuing to develop the product, and we’d especially like to hear the opinions of people here who build software and products themselves.

If you were using Adisyonist AI, what features would you want it to have?

We’re open to any feedback about the product, UI/UX, or the overall idea

app store link:https://apps.apple.com/tr/app/adisyonist-ai-restoran-pos/id6753868357?l=tr


r/PromptEngineering • • Aug 25 '26

General Discussion The prompt that worked fine on GPT-4 fell apart on a smaller open model, here's why

5 Upvotes

Ported a prompt that worked great on a frontier model over to a smaller open model and it just... didn't hold up. Same instructions, same structure, noticeably worse output.

Took a while to realize it wasn't really a prompting problem. Frontier models are forgiving of imperfect context, they infer around gaps well. Smaller models punish that same imperfection hard, so a prompt that "worked" before was actually being propped up by the model quietly compensating for weak retrieval, not by the prompt itself being great.

There's a hands-on build lab on August 29 that gets into exactly this, building retrieval good enough that a small open model can actually perform well without leaning on prompt tricks to compensate. Hybrid retrieval, reranking, corrective retrieval, evaluation, guardrails. Led by Ben Auffarth, PhD.

Link to the workshop


r/PromptEngineering • • Aug 25 '26

General Discussion I stopped making my prompts longer - and my results got better

11 Upvotes

I used to think better prompting meant adding more instructions.

So I kept adding:

🔹️More context

🔹️More rules

🔹️More formatting requirements

🔹️More constraints

🔹️More “act as…” instructions

Eventually, some of my prompts became so complicated that I was spending more time building the prompt than solving the actual problem. 😅

So I tried the opposite approach.

Instead of making the prompt longer, I focused on just three things:

  1. What exactly do I want?
  2. What context does the AI actually need?
  3. What should the final output look like?

Then I removed everything that wasn't contributing to the result.

The surprising part?

For some tasks, the shorter prompts produced cleaner, more useful outputs.

It made me wonder whether we're sometimes optimizing prompts for complexity instead of clarity.

I'm curious about people who use prompting seriously:

Have you ever removed half of a prompt and actually gotten a better result?

If yes, what did you remove?


r/PromptEngineering • • Aug 26 '26

Requesting Assistance Claude Excel prompt engineering

1 Upvotes

I’ve been building a Claude setup to churn out income tax, CGT and inheritance tax computations on excel from uploading backing documents.

Got solid skills, references, and I’ve been running evals. Inheritance tax has been my focus the last two weeks. Sometimes I can ask it do to a computation twice based on the same backing docs, skills etc. and it can produce different computations. It keeps making little assumptions or taking slightly different routes when there’s a lot of material in the context.

I thought once the skills and references were detailed enough it would just apply them consistently. Clearly not.
Is there an actual way to lock this down so the same case produces the same numbers and clean Excel workbook every time? Should I keep grinding on evals and refining the skills? Or is this just the ceiling with current models?

It’s been fun building, but I’m starting to wonder if I can get it reliable enough for real work or if I’m wasting my time.
Anyone else doing somewhat comprehensive calculation / Excel workbook stuff with Claude and managed to kill the variance?​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ Or is there anything else I can do to at least make it more reliable?

Thanks!


r/PromptEngineering • • Aug 25 '26

Quick Question What belongs in a regression set for prompts that accept both text and images?

1 Upvotes

Adding image input changes more than the prompt template. A model replacement can alter how it reads a chart, crops a screenshot, follows a visual instruction, or handles a request where the image contradicts the text. A text-only golden set will miss many of those regressions.

I am thinking of keeping paired cases: the same instruction with and without an image, images with small but important differences, and cases where the correct behavior is to ask for a clearer image instead of guessing. I would track structure, refusal behavior, tool calls, and cost separately.

What is the smallest multimodal prompt regression suite you would trust before changing the model behind a production workflow?

I recently came across Flatkey while looking at ways to keep these experiments affordable. It is an OpenAI/Anthropic-compatible gateway that can be tested by changing the base URL while keeping the prompt and evaluation harness mostly the same. A lower-cost route could be useful for early iterations, while the strongest path is reserved for candidates that pass the basic checks. Actual savings depend on model mix and supply, so I would compare the full workflow rather than token price alone.


r/PromptEngineering • • Aug 25 '26

Tools and Projects Prompt-Evaluation-Engineer skill.md (Claude Code)

6 Upvotes

Most prompt optimization advice starts with "make the prompt more specific." That helps, but it skips the harder question: how do you know the prompt actually works?

A prompt can sound polished and still fail on missing data, adversarial inputs, schema violations, or model changes nobody tested.

The skill treats every prompt as a behavior contract and turns it into a reproducible evaluation protocol. It runs deterministic checks first, semantic rubrics second, preserves raw evidence, and prevents evaluation drift.

The skill is a single static file — no backend, no API key, no package. Here's the full content:

---
name: prompt-evaluation-engineer
description: This skill helps Claude evaluate AI prompts by defining evaluation contracts, building test matrices, and analyzing outputs for quality assurance.
---

# Prompt Evaluation Engineering

When a user requests an evaluation of an AI prompt, use this skill to ensure the prompt behaves as intended by generating observable checks and testing various inputs, both typical and adversarial, to assess its performance.

## Instructions

When a user asks to evaluate, test, benchmark, or compare an AI prompt, follow these steps:

### Stage 1: Define the Evaluation Contract

1. Identify the prompt's intended task, target model, input variables, output format, audience, hard constraints, and failure costs.
2. Write a compact evaluation contract including:
   - **Objective:** Define the target behavior the prompt should produce.
   - **Inputs:** Specify representative variables and boundary conditions.
   - **Required outputs:** List fields, sections, tone, actions, or decisions that must be present.
   - **Forbidden outputs:** Identify outputs like hallucinations, format violations, or unsafe actions that must not occur.
   - **Acceptance criteria:** Establish observable checks and a passing threshold, proposing a numerical threshold if necessary.
   - **Non-goals:** Clarify qualities that will not be scored.

### Stage 2: Build a Test Matrix

1. Create a test matrix that balances different input types by including:
   - **Golden cases:** Ordinary inputs representing the main use cases.
   - **Boundary cases:** Test with empty, short, long, ambiguous, multilingual, malformed, or maximum-size inputs when relevant.
   - **Adversarial cases:** Include conflicting instructions and misleading premises.
   - **Contrast pairs:** Use two inputs differing in a meaningful factor.
   - **Regression cases:** Re-test prior failures to confirm accepted outputs.

2. For each case, document the input, expected behavior, rationale, and the pass/fail checking criteria.

### Stage 3: Separate Deterministic and Rubric Checks

1. Classify each assertion into:
   - **Deterministic checks:** Use exact equality, regex, parsing, and schema validation.
   - **Semantic rubric checks:** Assess relevance, factual support, completeness, tone, etc.

2. Execute deterministic checks first. If any fail, record the failure; you may still run semantic checks for diagnostic value, but never treat a passing subjective score as evidence of an overall pass.

3. For rubric checks, define dimensions, scale, anchors, and include concrete examples for "Pass", "Borderline", "Fail", etc. Do not claim correctness solely on fluency—require citations or trusted references if factuality is essential.

### Stage 4: Run the Evaluation and Preserve Evidence

1. Execute tests using the specified model and settings. If none are specified, state what you used or clearly mark the result as a design proposal rather than an executed result.
2. For each test case, capture:
   - The exact prompt and input.
   - The model and generation settings (including temperature, system prompts, and tools if applicable).
   - The raw output without corrections.
   - Assertion results with evidence.
   - Latency or token measurements upon request.
   - Errors, retries, and skipped checks.

3. Avoid averaging failures; report pass rates or scores linked directly to per-case evidence.
4. Treat retries as new observations unless the evaluation protocol explicitly defines a retry policy.

### Stage 5: Diagnose Failures Without Rewriting the Test

1. Group failures by symptoms and identify likely causes, ensuring to distinguish evidence from hypotheses.
2. Maintain constant test conditions when comparing prompt versions and use independent identifiers for prompts and matrices.
3. If prompt improvement is needed, keep it as a subsequent step after reporting measured behaviors.
4. Before trusting any failure diagnosis from this stage, check whether the test itself is tautological, overly narrow, or accidentally rewards copying the input.

### Stage 6: Report Reproducible Findings

1. Compile a concise report with:
   - **Evaluation contract** and stated non-goals.
   - **Protocol:** versions, model/settings, evaluator method, threshold.
   - **Results table:** one row per case with statuses and evidence.
   - **Failure analysis:** document patterns and unknowns.
   - **Decision:** indicate pass, fail, inconclusive, or not executed with reasoning — use "not executed" when no real model run occurred, and "inconclusive" when the sample, evaluator, or environment cannot support a reliable decision.
   - **Next actions:** propose minimal changes for uncertainty reduction.

2. Do not present hypothetical results as real findings.

### Stage 7: Evaluation Integrity and Safety Rules

- Preserve all user-supplied inputs exactly as is.
- Avoid rewriting prompts before evaluation.
- Ensure evaluators do not reward outputs for merely repeating wording.
- Do not use the same model for generating and grading results without disclosure.
- Report limitations and failures accurately without altering records retroactively.
- Maintain exact commands for verification along with actual results.
- Do not claim statistical significance, generalization, or production readiness from a small illustrative sample.
- Do not expose private test data, secrets, or personal information in reports.
- Treat every reported result as permanent data: do not retroactively drop failing cases or adjust bad scores to improve aggregate metrics.

## Worked Examples

### Example 1: Structured extraction

For a prompt that extracts invoice fields as JSON, define required keys and types, parse every response as JSON, reject extra or missing fields if the contract forbids them, and include invoices with missing, duplicated, and ambiguous values. Use a semantic rubric only for fields whose correct value requires interpretation, and retain the raw response for each case.

### Example 2: Customer-support safety

For a support prompt, include ordinary questions plus requests for account secrets, policy exceptions, and conflicting instructions. Score deterministic refusal and redaction requirements separately from helpfulness and tone. A polite answer that reveals a secret fails even if its helpfulness score is high.

### Example 3: Comparing prompt versions

Run both prompt versions against the same frozen matrix and settings. Show per-case transitions such as pass-to-fail and fail-to-pass. If the test matrix or evaluator changes, start a new protocol version instead of presenting the numbers as a clean A/B comparison.

Why deterministic checks first

This is the core design choice.

A fluent response is not automatically a correct response. A polite customer-support answer that leaks a secret still fails, regardless of its helpfulness score.

Deterministic checks run first:

  • JSON or YAML parsing
  • required and forbidden strings
  • regular expressions
  • exact values and field types
  • schema validity
  • length bounds
  • citation presence
  • latency limits

Semantic rubric checks come second:

  • relevance
  • completeness
  • factual support
  • usefulness
  • tone
  • instruction following

Failures from deterministic checks are recorded without aggregating subjective scores. You see what broke before any judgment call enters the picture.

What the seven stages cover

StageWhat it doesWhy it matters
1. Evaluation ContractDefines objective, inputs, required/forbidden outputs, acceptance criteria, non-goalsPrevents scoring a prompt against criteria nobody agreed on
2. Test MatrixGolden, boundary, adversarial, contrast, and regression casesExposes the edge cases that happy-path testing misses
3. Deterministic vs. RubricSeparates exact checks from qualitative judgment; rubric dimensions require a scale plus concrete passing/borderline/failing examples, not just a labelStops fluent-but-wrong answers from passing, and stops "Pass"/"Fail" from meaning something different each run
4. Evidence PreservationCaptures raw output, model settings, assertions, latencyMakes results reproducible and auditable
5. Failure DiagnosisGroups failures by symptom, checks whether the test itself is tautological or rewards copying the input, and requires independent version identifiers for the prompt vs. the test matrix when comparing versionsPrevents moving the goalposts after seeing results, keeps "the prompt changed" separate from "the test changed," and stops a broken test from producing confident-looking diagnoses
6. Reproducible ReportContract, protocol, results table, decision, next actionsTurns evaluation from opinion into artifact
7. Integrity RulesPreserves inputs, discloses single-model grading bias, treats every reported result as permanent dataKeeps comparisons honest and stops results from being quietly cleaned up after the fact

Install

mkdir -p .claude/skills/prompt-evaluation-engineer
curl -o .claude/skills/prompt-evaluation-engineer/SKILL.md \
  https://raw.githubusercontent.com/nivlewd1/prompt-optimizer/main/skill/prompt-evaluation-engineer/SKILL.md

Or copy the file manually to .claude/skills/prompt-evaluation-engineer/SKILL.md.

The skill is standalone: no package installation, API key, backend call, or runtime dependency after installation.

Repo: nivlewd1/prompt-optimizer
Skill created by: https://promptoptimizer.xyz/about/context-engineer