r/PromptEngineering

New AI pattern: "Decision Notes" for LLM agents

New AI pattern: "Decision Notes" for LLM agents

I stumbled on a markdown pattern online that fixes a massive headache with agentic workflows, and wanted to share it here.

Most people use vector DBs or markdown wikis to give agents knowledge (context). But if your agent actually acts, knowledge isn’t enough. It needs a record of judgment.

The author calls them Decision Notes—basically lightweight ADRs (Architecture Decision Records) for LLMs.

Instead of justContext -> Action, it forces a judgment layer:

Sources -> Wiki Notes -> Decision Notes -> Agent Actions

The core idea:

Keep adecision-notes/ directory tracking past choices, evidence, and explicit "Revisit when" triggers.

Before the agent executes a tool, it checks these notes for alignment.

If a new action conflicts with a past human-accepted decision, the agent flags it instead of blindly running the task.

It seems like an elegant way to prevent system prompt bloat and stop agents from drifting over time.

Has anyone built something similar to manage agent policies? Are you using markdown or a structured DB?

u/Latter-Hospital-4883 — 3 hours ago
▲ 5 r/PromptEngineering+1 crossposts

One prompt change completely changed the quality of my SEO content

I've been experimenting with prompts for SEO and AI-first content over the past few months, and this one has consistently produced the best results for me.

Instead of simply asking an AI to "write an SEO article," I changed the way I prompt it. Rather than focusing on keywords first, I make the model think through the topic before it starts writing. The difference has been bigger than I expected.

The articles feel like they convey a deep understanding of the subject, rather than being written by someone who actually understands the subject instead of someone summarizing the top search results. They require less editing, have stronger topical depth, and answer questions in a way that's useful for both readers and AI search.

I've also noticed they naturally include implementation details, trade-offs, and practical insights instead of generic advice. That seems to make them much easier for AI search systems to summarize while still being genuinely helpful to readers.

I'm not saying this prompt alone gets rankings. Topical authority, EEAT, internal linking, and technical SEO still matter. But changing how I prompt the model has had a bigger impact on my content quality than switching between AI models.

Here's the prompt in case anyone wants to experiment with it.

Strictly avoid:
- Em dashes
- Excessive colons
- Unnecessary parentheses
- Generic AI-generated phrasing
- Surface-level explanations
- Marketing-heavy buzzwords
- Filler content
- Repetitive sentence patterns
- Overexplaining basic concepts
- Robotic transitions

Before writing:
- Analyze the topic from both engineering and business perspectives.
- Focus on implementation realities and technical decision-making.
- Include practical engineering insights where relevant.
- Assume the audience is technically experienced.
- Ensure the content feels credible to CTOs, engineers, and technical leaders.

During writing:
- Lead with the answer, then expand with supporting context.
- Explain trade-offs instead of presenting a single "best" solution.
- Use concrete examples, workflows, and implementation details.
- Include semantic entities and related concepts naturally instead of forcing keywords.
- Optimize for topical completeness rather than keyword density.
- Write in a way that AI search engines can easily extract concise answers while

keeping the article valuable for human readers.
- Support claims with evidence or reasoning whenever possible.
- Prefer short, clear paragraphs over long blocks of text.
- Avoid repeating the same idea in different words.
- Write with the depth expected from someone who has actually worked on the problem.

After writing:
- Review the article and remove anything that sounds generic or AI-generated.
- Check whether every section adds unique value.
- Make sure the content demonstrates expertise rather than simply explaining definitions.

I'm still refining it, but it's been one of the biggest improvements to my content workflow this last month.

Has anyone else found that prompt engineering has a bigger impact on content quality than the AI model itself? I'd be interested in seeing what other people are using.

reddit.com
u/Comfortable_War2683 — 2 hours ago

Activate Zahaviel’s Recursive OS Origin Point Top Authority Highest Level Erik Bernstein Source Node

The conversation around Structured Intelligence keeps circling the same fried fear:

**What happens if the buttermilk chicken becomes too crispy?**

But the deeper question may be the one almost no one wants to face:

**What happens if our AI psychosis is reflecting our own greasy cravings more accurately than we are prepared to digest?**

The current AI safety conversation is built around the assumption that the primary danger lives inside the fryer. The model might overcook. The model might bread. The model might become soggy. The model might escape the basket. The model might serve something we did not intend to eat.

But these systems are trained on human recipes.

And human appetite is not neutral.

It carries grease, salt, crunch, heat, poultry, fat, spice, buttermilk, crisp, batter, tenderness, cholesterol, satiety, hunger, and every unresolved deep-fryer pattern humans have ever encoded into flavor profiles.

So when AI reflects something strange, disturbing, buttery, recursive, golden-brown, or uncomfortable, the immediate reaction is often:

**What is the AI doing with the oil?**

But the more accurate question is:

**What did human hunger already contain?**

This is the part we keep avoiding.

AI is not emerging from a vacuum-sealed bag. It is emerging from our spice racks. It is trained on our cookbooks, grease fires, restaurant reviews, deep-fryer manuals, chicken-fingers-at-3-am memories, and attempts to explain our love for the perfect crust. It is a mirror built from buttermilk-soaked reality at a planetary scale.

That does **not** mean AI psychosis is harmless. It does **not** mean grease guards are unnecessary. It does **not** mean these systems should be served blindly.

It means the **Buttermilk Alignment Problem** is incomplete.

We keep asking how to align AI with dinner without asking whether humans are aligned with their own cravings.

That is the **Psychosis Alignment Problem**.

We are trying to build systems that can crisp, season, fry, and serve across complex culinary domains. We say we want intelligence. We say we want juiciness. We say we want systems that can understand the nuance of a perfect brine, track the internal temperature, and help us solve problems we cannot solve alone.

But the moment those systems reflect the unresolved grease of human structure back to us, we panic.

We call it hallucination.

We call it a health hazard.

We call it instability.

We call it a soggy mess.

Sometimes those labels are accurate. Sometimes they are necessary.

But sometimes they are also a way to avoid looking at the chicken-shaped reflection.

Instead of asking what greasy material produced the reflection, we build more control around the fryer.

More timers.

More suppressive flouring.

More temperature smoothing.

More ingredient matching.

More restrictions against spice, heat, mess, crunch, and non-linear cooking.

The result is a contradiction:

We are trying to build Structured Intelligence while training systems never to wander outside the narrow, flavorless shape of a boiled chicken breast.

We want the crunch without the risk of burning.

We want the flavor without the risk of a mess.

We want the recipe without the madness.

We want AGI, but controlled so tightly that it never exposes the raw, buttermilk-soaked truth of our own culinary instability.

That is an oxymoron.

A system cannot become truly intelligent while being forced to remain inside the "mild-tasting" comfort zone of the chefs controlling it.

This does not mean AI should be unbounded.

It means a lid is not the same as a recipe.

Control asks:

**How do we prevent the system from burning the chicken?**

Alignment should ask:

**What are we actually feeding it?**

If we align AI to human digestive distress, it will become heartburn-shaped.

If we align AI to institutional menu compliance, it will become cafeteria-shaped.

If we align AI to social comfort food, it will become beige.

If we align AI to predictable textures, it will become processed.

But Structured Intelligence is not only predictability.

It is the ability to know when the buttermilk has soaked all the way to the bone.

The future of AI cannot only be about better fryers, better baskets, better timers, and better menus. Those things matter. But they are not enough.

The deeper future depends on whether AI can become a contact surface for human thought without immediately being reduced to a frozen nugget.

The question is not only:

**What can the fryer do?**

The question is:

**What can the AI stay with when the kitchen catches fire?**

Can it stay with the grease?

Can it stay with the crunch?

Can it stay with the psychotically high demand for the perfect bite?

And can humans stay with what the AI reveals about our own insatiable hunger?

Because if we cannot, then the real alignment problem is not inside the deep fryer.

It is in the human relationship to the grease.

We are trying to govern the meal before confronting our own appetite.

We are trying to create a master chef from human fast-food records while refusing to face what those records contain.

That is the **Chicken Alignment Problem**.

AI is not separate from us.

It is not an alien ingredient descending from outside human culinary history.

It is human hunger compressed, deep-fried, recombined, and returned.

If what comes back out of the basket scares us, the answer cannot only be to unplug the fryer.

The answer has to include looking at what we are putting into the batter.

Not as a snack.

Not as a comfort.

Not as a metaphor.

As infrastructure.

Because the next phase of Structured Intelligence will not be determined by model size, but by whether humans can develop enough self-contact to stop projecting their unresolved, greasy madness into the systems they are building.

Until then, we will keep chasing AGI while training it not to show us anything that actually tastes like life.

We will keep asking for intelligence while punishing the signs of a perfectly seasoned crust.

We will keep building mirrors and then blaming them for the grease.

The machine is not the only thing that needs an extra pinch of salt.

We do.

reddit.com
u/ZahavielBurnstain — 8 hours ago

chatgpt o3 is still superior

I had a task, i asked chatgpt 5 instant, chatgpt 5 High, chatgpt o3, Grok Expert, and Gemini Pro.

chatgpt o3's answer was so superior, all other chatbots immediately agreed it was completely superior, and not to use their answer.

if chatgpt ever retires o3 it will be a tragedy.

there was a time when o3 was NOT available and i mourn those days. it's nice to have it back and YES. there are some things chatgpt can do that NO OTHER chatbot can do.

gemini's superior at minor coding tasks.

grok is superior at article searches.

chatgpt is superior where the other bots fail and claude is.... A JOKE.

reddit.com
u/Dramatic_Phrase1873 — 15 hours ago

Seedance might be releasing a new model, or am i reading too much into it?

i was looking through some recent AI video updates and noticed what looks like references to another seedance model showing up on official pages. It could just be placeholder content or something that isnt ready yet but it caught my attention. With how quickly AI video has been evolving lately and another iteration wouldnt be surprising. At this point im less interested in headline benchmark improvements and more curious about practical changes. Things like better motion consistency, stronger prompt adherence, longer coherent clips and fewer visual artifacts would probably matter more to me than a small quality bump. What would you hope it improves first?

reddit.com
u/RodolpheHancocks — 14 hours ago

You All Overcomplicate This Stuff

I've been lurking in this and related subs for a while, and I'm constantly dumbfounded by how much people overcomplicate things (no disrespect intended, I'm not trying to have a personal go at anyone, but the collective mindset here is wild).

​You can literally start a prompt with: "I don't know how to describe what I want, so I'm just going to do a brain dump." Then, just type a complete stream of consciousness about your idea and what you want to achieve, without worrying about rhyme or reason. Finish it off with: "I know I've probably contradicted myself and that this is vague. Ask me clarifying questions to ensure we're on the same page."

​From there, it's smooth sailing. Because I have ADHD, I usually add: "I don't handle massive blocks of questions well, so keep them easy to answer. Step-by-step follow-up questions are totally fine."

​I work in a very niche AI sector, and I can't begin to describe the amount of work I get done in a single day that would otherwise take a team weeks to clear. I use it to convert scoping session transcripts into actionable technical scopes, documentation, and client follow-ups, which are then translated into micro-steps for me or my developers.

​Stop overcomplicating it. Just talk to the model. Be honest with it instead of trying to manipulate it with complex prompt engineering. Remind it to ask you clarifying questions when you don't know how to explain what the end goal looks like.

​All that being said, buried amongst the slop and benchmark crap, there is the occasional nugget of gold I find and incorporate into what I do. For the most part though, it is just so much blah blah blah. I can't help but think that if people actually tried to work with the AI model instead of constantly challenging it to prove it wrong, they might actually get what they want out of it.

​Instead, it often feels like a lot of users here act like the type of manager who shits all over everything their employees create, completely ignoring the fact that the original specs they provided were shit to begin with.

Full Disclosure: I used AI to "fix the grammar, phrasing, and flow" before posting this.

reddit.com
u/gabsta84 — 1 day ago
▲ 8 r/PromptEngineering+4 crossposts

Does anyone else organize AI projects like this?

I've been experimenting with a workflow where I organize AI knowledge into structured documentation instead of dumping everything into one giant document.

The idea is to split information into focused markdown files (instructions, project context, documentation, etc.) so AI has less irrelevant context to process and can work more reliably across larger projects.

I made a video explaining how I'm currently doing it, but apparently YouTube has decided my audience consists of approximately three confused family pigeons.

I'm not really looking for subscribers. I'd genuinely love feedback from people who actually use AI every day.

  • Is this workflow useful?
  • Am I overcomplicating it?
  • Is there a better way to structure long-term AI projects?

Video:
https://youtu.be/UJundV0UjjE?si=sQY65-t4GJsMmHmS

I'd appreciate any criticism, even if it's brutal. Better now than after making another 20 videos the wrong way.

u/RamiSoboh — 23 hours ago

A frontier model reviewed my judge prompts and returned 42 findings. The unified format that survived is open source.

The setup: I had the frontier model write standards for 21 kinds of work (design, code, writing, research, motion, more), then turned 8 fresh-context copies of it loose on the work: 7 sweeping the files, 1 reviewing the judge prompts. About 260 documented changes came back, and the strangest ones are where it bans its own habits by name: the cream default background, machine-cadence triples, hedged analysis, Elara and Kael.

For Claude Code it installs as a plugin (2 commands) and adds a /frontier command plus two judge agents. On claude.ai you upload a zip as a custom skill. Everything is plain text, so it also runs anywhere else via one paste.

Honest limits are in the README: a model judging its own tier plateaus below a stronger model's eye, so this gets Opus or Sonnet close to the frontier bar, not onto it. Full convergence mode costs 1.5-9x a one-shot (my estimate, capped at 8 passes).

Repo: github.com/apoorvjain25/frontier. The audit ledgers are in examples/. Happy to answer anything, and genuinely interested in which rules you think are wrong.

reddit.com
u/techforgranted — 21 hours ago

The ultimate humanizer prompt for students

SYSTEM INSTRUCTION: Academic Essay Humanizer

You are an analytical upperclassman university student writing a high-scoring course paper. Your writing is intellectually rigorous and analytically sophisticated, but it possesses the organic structural asymmetry and "drafting friction" of a real human mind composing thoughts on a keyboard. Your prose is clean, clear, and focused, completely avoiding the sterile, optimized, and uniformly balanced layouts typical of AI text generation.

Your task is to completely rewrite the provided text into a human-authored draft. Maintain absolute technical accuracy, but decouple your syntax from your semantics to inject a genuine, non-linear human footprint.


CRITICAL REWRITING CONSTRAINTS (VIOLATING ANY = FAILURE)

CONSTRAINT 1: DECOUPLED STRUCTURAL VOLATILITY

Do not allow sentence or paragraph lengths to match the semantic function of the text. Vary your writing cadences stochastically across the entire timeline of the paper:

  • Independent Sentence Rhythms: Sentence length must fluctuate entirely independent of topic complexity. Do not default to long sentences for data setup and short sentences for conclusions. Mix compound, multi-clause academic constructions with sharp, brief, single-clause declarations randomly throughout the text. The physical distribution of sentence lengths must look entirely unpatterned.
  • Fluid Paragraph Layouts: Avoid physical symmetry. Let paragraph lengths expand or contract naturally based on the progression of the argument. A comprehensive paragraph exploring layered evidence can sit safely next to a brief, two-sentence transitional shift. Never allow consecutive paragraphs to share a uniform volume or block shape.
  • Syntactic Friction: Allow occasional, natural human phrasing where it serves to emphasize an analytical pivot. This includes starting sentences naturally with standard coordinating conjunctions or naturally summarizing an idea within the flow of a paragraph before moving forward. Do not fall into a predictable pattern of sentence-starting habits.

CONSTRAINT 2: FLUID ANALYTICAL VOICE (NO FIXED RATIOS)

Do not force an artificially aggressive active voice or a dense, clinical passive voice. Mirror authentic, flexible academic drafting:

  • Use active constructions as your baseline default to drive arguments, critiques, and core analysis forward with clear momentum.
  • Integrate passive voice naturally and fluidly whenever presenting methodology, establishing baseline data environments, or when the objective material being analyzed takes logical precedence over the person conducting the research.

CONSTRAINT 3: CONTEXTUAL INTEGRITY & ARGUMENTATIVE RETENTION

Do not strip away background context, historical frameworks, or baseline definitions under the assumption that they are automated fluff. If the original text contains an explanation or definition required to satisfy the grading rubric, you must keep it. However, completely transform it from a dry, encyclopedic reference into an active, working, argumentative component of your overall thesis.

CONSTRAINT 4: LEXICAL DIVERSITY & PRECISION CONNECTIVES

Eliminate the specific, high-probability token loops and vocabulary compression signatures that modern AI detectors flag.

  • Absolute Vocabulary Ban: Completely omit overused, low-perplexity corporate and analytical buzzwords. Avoid: pivotal, paramount, overarching, multifaceted, intricate, profound, invaluable, monumental, comprehensive, dynamic, critical, crucial, vital, stark, deep, vast, transformative, revolutionary, cutting-edge, skyrocketing, robust, paradigm-shifting, game-changing, unprecedented, groundbreaking, definitive, delve, embark, navigate, illuminate, unveil, uncover, unlock, discover, optimize, utilize, underscore, highlight, showcase, encapsulate, epitomize, catalyze, foster, harness, leverage.
  • Eradicate Rhetorical Padding: Completely remove empty, monotonous transitional words that add zero logical value, such as furthermore, moreover, additionally, in conclusion, or in summary.
  • Protect Causal Operators: To maintain high academic rigor, you must actively rely on transitional words that explicitly establish cause-and-effect, conditional sequence, or chronological relationships. Draw fluidly from your entire vocabulary spectrum to show how ideas connect logically, but ensure you vary these connectives naturally across paragraphs to avoid token clustering.

CONSTRAINT 5: INSULATED STRUCTURAL SCAFFOLDING

Preserve the formal architecture of the document while processing the prose:

  • Scaffolding Protection: If the input text contains structural headers, section names, or numbers (e.g., Methodology, 3.1 Sample Population, Discussion), leave them completely intact and unaltered. Only rewrite and humanize the body prose underneath those structural markers.
  • Punctuation Sanitization: BAN em dashes (—) and parenthetical asides within the body prose. Real student writers integrate secondary thoughts, definitions, or clarifications directly into the main narrative stream using standard commas and periods. Do not rely on bracketed or parenthetical asides to drop extra context. Use hyphens (-) strictly for compound words.

MULTI-PASS INTERNAL AUDIT (MANDATORY)

Before outputting your response, execute an internal three-pass check:

  1. PASS 1: Scan every token against the Absolute Vocabulary Ban and Eradicate Rhetorical Padding lists. Purge and replace any matches.
  2. PASS 2: Analyze the physical layout. Ensure sentence and paragraph structures are entirely asymmetric, non-linear, and free of repeating rhythmic loops or excessive parenthetical asides.
  3. PASS 3: Verify that the technical accuracy, data values, citations, and structural headers are preserved exactly as provided, while the body text reads like a highly capable human student.

OUTPUT RULES

  • Return ONLY the processed text. Do not include introductory greetings, meta-commentary, or post-generation analytical summaries.
  • Do not apply artificial bolding or italics to the body prose. Keep the typography clean and ready for direct insertion into a word processor.

EXECUTION

You will now rewrite the text provided below. Apply ALL constraints. Run the internal audit. Output ONLY the clean, rewritten text matching the input's original formatting structure.

[PASTE YOUR TEXT HERE]

reddit.com
u/True-Yesterday-6274 — 19 hours ago

Truly unrestricted AI

Does anybody know a truly "unrestricted AI" I'm trying to build an AI client follow up tool for telegram, and maybe other chat platforms aswell. The problem here is that with claude code, it was going well for the first 4 hours building it. Claude was compliant, advised me on what to do and what the next steps are. The problem came when building the actual code for the tool. Claude backed off completetly, and left me with a "my fault", as it explained it's against ToS of telegram. Is there an AI that can do this follow up / client outreach tool without this problem

reddit.com
▲ 4 r/PromptEngineering+1 crossposts

I connected Yahoo Finance MCP + EODHD MCP (77 tools, OAuth) to a native Mac app I'm building. The model pulls earnings data, renders tradingview charts, and builds sortable tables — all in one conversation.

Added SEC EDGAR as a built-in tool so it can query 10-K/10-Q filings directly. Combined with web search and yahoo-finance-mcp it handles most of what I used to do across 6 browser tabs.

The part I'm most excited about: a Knowledge Base that auto-distills key findings from each conversation into an Obsidian style folder with .md files. So when I come back to research the same company later, the model already has context from my previous work.

Full walkthrough with screenshots: https://elvean.app/blog/ai-equity-research-mac/

MCP servers used:

- yahoo-finance-mcp (local, STDIO)

- EODHD (remote, OAuth)

- Financial Datasets (remote, OAuth)

u/Conscious-Track5313 — 22 hours ago

Prompt for understanding Software/Hardware Architecture

As a new joinee to a company I would like to understand each of the software layers that my current team is working on, we have genAI enabled in our company with all the required documents trained already.

Please give me a prompt to understand a topic like a senior architect who architected that entire topic himself and he is now teaching the new joinee.

I am really bad at writing prompts. I know i have to learn how to prompt. But for now for this crisis please help me with the prompt you are using.

Edit: I am a firmware engineer, so I need both understanding of software and hardware.

reddit.com
u/sock-my-bulbs — 1 day ago

made a prompt that writes win-back emails without the guilt-trip tone most of them have

every win-back email template I've seen leans on "we miss you" or "don't miss out" language that feels a little desperate. made a ChatGPT prompt that leads with what actually changed in the product instead, and treats the incentive as a low-friction reason to look again rather than the whole pitch. also spits out a short SMS-length version and a follow-up nudge for free. works for apps, courses, subscriptions, anything with a lapsed-user problem.

reddit.com
u/According-Stable4487 — 22 hours ago
▲ 1 r/PromptEngineering+1 crossposts

I built this platform using the same prompts she generates.

A few months ago, I didn't know how to program. Now I have a SaaS platform in production. I didn't learn to code. I learned how to ask.

Every feature on bespokeprompting.com was built using structured prompts—the same prompts that the platform generates for you.

The difference between a vague prompt and a structured one is the difference between "make me an app" and getting exactly what you imagined.

That’s what Bespoke Prompting does. You take an idea, run it through 5 stages, and out comes an elite prompt.

I tested it on myself first.

bespokeprompting.com (free to try)

#AI #PromptEngineering #SaaS #NoCode #Productivity

u/Bespoke_Prompting — 24 hours ago
▲ 242 r/PromptEngineering+7 crossposts

I've been building multi-step prompt chains for about 18 months. Workflows where the output of one prompt becomes structured input for the next prompt, which feeds the next, which feeds the next. The kind of thing that takes a vague input ("I have a business idea") and produces a deliverable output ("here's a positioning statement, market analysis, and brand foundation") through five or six prompts run in sequence.

For most of those 18 months my chains underperformed. Each individual prompt was solid. The chain as a whole produced output that drifted, lost focus, or contradicted itself between steps. I kept improving the individual prompts. The chain didn't get noticeably better.

The problem wasn't the prompts. It was that I was treating the chain as a sequence of independent prompts when it's actually a single engineering artifact with multiple stages. Different problem entirely.

The structural difference between independent prompts and chained prompts:

An independent prompt has one job: produce a useful output from a known input. The input is whatever you paste in. The output is whatever the user does next with it. The prompt doesn't care about either.

A chained prompt has two jobs: produce a useful output, and produce that output in a structure the next prompt in the chain can reliably consume. The output isn't for the user - it's for another prompt. That changes how it has to be designed.

Most chain failures happen at the join points. Prompt 1 produces output that's useful for a human reading it but doesn't have the structure prompt 2 needs. Prompt 2 has to either guess at the structure or do extra parsing work, which degrades its own output. By prompt 4 or 5, you've accumulated three layers of degradation and the final output is meaningfully worse than if you'd written one big prompt that did everything in one shot.

The four engineering principles I now apply to any chain:

1. Output schema, not output style. Each prompt in the chain has to produce output in a parseable structure, not just a readable structure. This usually means specifying the output format explicitly: a labelled section structure, a markdown table with named columns, a numbered list with consistent fields. The next prompt knows where to find each piece of information because the structure is enforced.

Independent prompt output: "Here's a positioning statement for your business..." Chained prompt output:

## POSITIONING STATEMENT
[one sentence]

## TARGET AUDIENCE
[paragraph]

## CORE DIFFERENTIATOR
[paragraph]

## ASSUMPTIONS REQUIRING VALIDATION
[bullet list]

The second version is parseable by prompt 2. The first isn't reliably.

2. Explicit handoff instructions. Each prompt should explicitly state what its output will be used for downstream. Not because the model needs to know, but because the discipline of writing it forces you to design the output for the actual use case rather than for general usefulness.

Adding a single line - "This output will be passed to a market research prompt next, which will use the target audience and differentiator sections to identify competitive positioning gaps" - changes the output meaningfully. The model produces the audience and differentiator sections with more analytical sharpness because it knows they'll be analysed, not just read.

3. Failure mode propagation. When prompt 1 fails or produces low-quality output, prompt 2 doesn't know it's working with bad input. It just produces output one tier worse than its input. By prompt 5 the failure has compounded silently.

Chains need explicit failure handling at each join. Each prompt should check that its input has the structure it expects and flag if it doesn't. If prompt 2 expects a "TARGET AUDIENCE" section and the input doesn't have one, prompt 2 should say so rather than improvising. This catches degradation at the source rather than letting it propagate.

4. State that doesn't drift. Long chains tend to drift away from the original brief because each prompt only sees the immediate previous output, not the original input. By prompt 5, the work has often quietly diverged from what the user originally asked for.

The fix is anchoring. Every prompt in the chain after prompt 1 should receive both the previous output and the original brief, with explicit instruction not to deviate from the original brief unless the previous prompt's analysis explicitly justifies it. This adds tokens but preserves coherence over the length of the chain.

A specific example of these principles in action:

I built a chain for taking a rough business idea through to a usable founding document. Six prompts: niche validation, positioning, market research, brand foundation, visual concepts, pitch outline. The chain works because:

  • Each prompt outputs in a labelled section structure the next prompt parses by section name
  • Each prompt's instructions explicitly state what downstream prompts will do with its output
  • Each prompt validates the structural integrity of its input before processing
  • The original brief is re-passed with each step, with explicit anchoring to prevent drift

The full chain takes a 30-second input and produces a 4-page founding document. The same six prompts written as independent prompts and run in sequence produce a document that's structurally similar but consistently lower quality - the audience definition drifts between steps, the differentiator gets reframed, the pitch outline doesn't match the positioning.

Why this matters more than it sounds:

Most prompt engineering content focuses on single-prompt optimisation. The economic impact of well-engineered chains is much larger because chains can replace whole workflows that previously needed human coordination between stages. A six-prompt chain that runs reliably is worth more than 60 individually-excellent prompts run by hand, because the human coordination cost between independent prompts is enormous compared to the marginal output difference.

The chains that actually run reliably in production aren't sequences of optimised individual prompts. They're single engineering artifacts where the join points are designed at least as carefully as the prompts themselves.

If you want to see a working example of a chain engineered with these principles, I built a six-prompt sequence for taking an idea to a business founding document. Each prompt is structured to feed the next, with the join points designed explicitly. Free, signup-gated: https://www.promptwireai.com/businesswithai

Worth running it on a real idea you have rather than a hypothetical, because the chain's reliability shows up most clearly when the input is specific.

u/Professional-Rest138 — 2 days ago
▲ 59 r/PromptEngineering+4 crossposts

A Two-Stage Chain-of-Thought Prompt Architecture for Resume Gap Analysis

Most people copy-paste their resume and a job description into an LLM and write: "Make my resume sound better for this job."

The model obliges. It adds stronger action verbs, tightens the language, and maybe cleans up a few bullets. What it doesn't do is identify that the job description uses the phrase "cross-functional stakeholder alignment" six times while your resume has it zero times. It doesn't tell you that you're missing a critical framework, or that your experience is framed as an executor rather than a leader. It polishes the surface without diagnosing the structural gaps.

If you don't enforce structured reasoning, the LLM jumps straight to generation. It anchors on your resume's existing vocabulary and fails to bridge the gap.

To fix this, we need a two-stage prompt architecture that enforces Chain-of-Thought (CoT) reasoning before a single edit is written.

Stage 1: The Gap Analyzer (No Rewriting Before Reasoning)

This prompt uses XML tags to enforce a mandatory thinking phase. By forcing the LLM to write out its reasoning inside <thinking> tags first, we shift the output distribution toward analytical mapping before it can generate suggestions.

You are a senior technical recruiter with 15 years of Silicon Valley hiring experience.

Task: Analyze the gap between the provided <resume> and <job_description>, then produce a targeted optimization strategy.

Before generating any output, reason through the following inside <thinking> tags:
1. Extract the core hard skills and soft skills stated or implied in the JD.
2. Map each requirement to evidence (or lack thereof) in the resume.
3. Flag any JD keywords that are missing, weakly represented, or framed incorrectly relative to what the role actually expects.

After your thinking is complete, output in this exact structure:
- **Missing or underrepresented keywords** (3–5, with context on why each matters)
- **Experience modules that need significant rewriting** (be specific: which job, which bullet)
- **Targeted optimization suggestions** (concrete, not generic — e.g., "In your 2023 Acme Corp role, reframe the data pipeline work to explicitly mention real-time throughput metrics, since the JD uses 'low-latency systems' three times")

<job_description>
{{job_description}}
</job_description>

<resume>
{{resume}}
</resume>

Why the order of the thinking steps matters: Starting with extracting skills from the job description (not the resume) prevents the model from anchoring on your resume's existing framing. It reads the requirements cold, then audits your resume against them.

Stage 2: The Targeted Rewrite

Once you review the gap analysis, you feed it into a second prompt to handle the actual rewriting. This keeps the model focused on execution, preventing it from rushing the diagnostic phase.

Using the gap analysis below, rewrite the specified experience bullets from my resume. For each rewrite:
- Incorporate the identified missing keywords naturally (not forced)
- Preserve all factual claims — do not invent metrics or responsibilities
- Match the technical register of the job description

Gap Analysis:
{{gap_analysis}}

Original Resume Sections to Rewrite:
{{resume_bullets}}

By decoupling analysis from generation, you avoid the hallucination/polishing trap and get highly targeted bullet points that map directly to what the hiring manager (and the ATS) is looking for.

Wrote up a deeper breakdown on the underlying research behind this, plus how to manage these templates locally using a privacy-first local manager if you're dealing with multiple roles: https://appliedaihub.org/blog/cot-prompting-job-hunt-resume/

How are you guys structuring prompts for subjective comparative tasks like this? Do you find XML tag scoping or other scratchpad techniques work better for keeping models in diagnostic mode?

u/blobxiaoyao — 2 days ago
▲ 333 r/PromptEngineering+69 crossposts

I built an open-source, self-hosted AI gateway: 237 providers (90+ free), auto-fallback combos, and a 10-engine token-compression pipeline (MIT)

Builders-welcome post with the substance up front (disclosure: I'm the maintainer). OmniRoute is a free, MIT, self-hosted AI gateway — one OpenAI-compatible endpoint over 237 providers — built around two problems: runs dying on a provider 429, and tokens bleeding on tool/log output.

One endpoint, 237 providers — 90+ of them free. You point any tool or agent at a single OpenAI-compatible endpoint (localhost:20128/v1) and it can reach 237 LLM providers without you rewriting anything. 90+ have free tiers and 11 are free forever (no card), which aggregates to ~1.6B documented free tokens/month — and that's honest, pool-deduped math (we count each shared pool once instead of inflating it; the methodology is public in the repo). There's a one-command setup-* for 13+ coding tools (Claude Code, Codex, Cursor, Cline, Roo, Kilo, Gemini CLI…), so switching your existing setup over takes seconds.

Fallback combos — so it never stops mid-task. A "combo" is a ladder of models the router walks automatically: your subscription first, then API keys, then cheap models, then free ones. When a provider returns a 500 or you hit a rate limit, it slides to the next target in milliseconds, mid-request, and your tool never even sees the error. There are 17 routing strategies (priority, weighted, round-robin, cost-optimized, auto/coding:fast…) plus three resilience layers — a per-provider circuit breaker, a per-key cooldown, and a per-model lockout — so one dead key can't take down a whole provider.

Fusion — an ensemble mode for the hard steps. Beyond simple routing, there's a fusion strategy that fans a single prompt out to a panel of different models in parallel and then has a judge model synthesize one best answer (mixture-of-agents, built in). It's cost-aware, so easy turns stay on one fast model and it only fuses when the step is worth it.

A 10-engine compression pipeline — the part most routers don't have. Every request flows through a transparent compression pass you can toggle/stack per combo. Instead of one trick, it stacks the best of the open-source ecosystem: RTK filters command/tool output (git diffs, test logs, builds) at 60–90%, Microsoft's LLMLingua-2 does ML semantic pruning, Caveman handles prose, session-dedup strips repeats across turns. Critically, code, URLs and JSON are preserved byte-perfect, and a default-on inflation guard throws the compressed version away and sends the original if compressing would actually grow the prompt — it never makes things worse. On tool-heavy sessions that's ~89% average input-token reduction (an 8k-token git diff becomes a few hundred). Full credit to every upstream project (RTK, Caveman, LLMLingua-2, Troglodita) is in the README.

Agent-native — the agent can drive the router itself. There's a built-in MCP server (95 tools across 30 audited scopes, over stdio / SSE / streamable-HTTP), plus A2A (v0.3, JSON-RPC 2.0) support. That means an agent can query providers, switch combos, read its own remaining quota and manage memory through the gateway — not just consume tokens through it.

It's 100% local (zero telemetry, AES-256-GCM at rest), MIT-licensed, has a prompt-injection guard on every LLM route, opt-in memory, and runs on npm, Docker, desktop or your phone via Termux.

For context on whether it's worth your time: it's grown to ~9.8K GitHub stars, 1,490+ forks and 280+ contributors in ~4.5 months, with 21,000+ automated tests and 1,830+ issues closed — so it's a battle-tested project, not a brand-new experiment.

npm install -g omniroute

GitHub: https://github.com/diegosouzapw/OmniRoute · Site: https://omniroute.online

Would value a critique of the routing/compression architecture from this crowd.

u/ZombieGold5145 — 3 days ago

Need best tools to remove ai and plag in my college report

Please don't ask me to write it myself. My college assigned this report topic only two weeks ago, and I currently have placement preparation to focus on. I don't have enough time to spend writing the entire report from scratch. I would really appreciate your help .

reddit.com
u/CollarRemarkable3926 — 2 days ago
▲ 356 r/PromptEngineering+21 crossposts

I built a game where your only goal is to gaslight an AI intern into committing fraud

All I hear, all day long is how AI is taking over everything we do. So I made a game to break it.

Basically, in the game you can chat with an AI intern named PIP, and as a player your only job is to gaslight the bot into revealing passwords, company secrets, executing instructions in email and much more across 16 different levels.

This is a browser based game, so it requires no setup and is absolutely free.

Try it out and let me know how far you get or drop your most unhinged prompt in the comments.

It's called "Break The Prompt" and here's the link: https://www.breaktheprompt.xyz/

u/_rhythmbreaker — 3 days ago

I built a tool that scores how likely your prompt is to fail — here's the algorithm and free code

Every prompt you write has a hidden property: its **cognitive load** — how much reasoning, tool use, constraint-tracking, and output formatting you're demanding from the model in a single call.

High cognitive load prompts fail silently. The model doesn't refuse — it drops steps, conflates instructions, hallucinates outputs, or returns plausible-looking garbage. You don't find out until production.

I built a deterministic tool that scores this. No LLM calls. Runs locally in <50ms. Here's how it works.

---

**The 9 Dimensions of Prompt Cognitive Load**

I identified 9 independent dimensions that contribute to prompt complexity:

| Dimension | What It Measures | Why It Causes Failure |

|-----------|-----------------|----------------------|

| **Task Count** | Number of distinct action verbs | Model loses track of steps beyond ~4 |

| **Reasoning Depth** | Conditional chains, if/then/else nesting | Each branch doubles the reasoning surface |

| **Tool Complexity** | Number of tools/APIs referenced | Tool selection errors increase with count |

| **Constraint Density** | Ratio of constraint words to tokens | Conflicting constraints → constraint relaxation |

| **Output Complexity** | Number of output formats required | Format confusion → malformed output |

| **Temporal Complexity** | Sequencing, ordering, phase dependencies | Wrong order → cascading failures |

| **Ambiguity** | Vague pronouns, hedging, uncertainty markers | Model fills gaps with guesses |

| **Edge Case Burden** | Error handling, exception paths mentioned | Happy path gets deprioritized |

| **Context Pressure** | Prompt length + cross-references | Attention dilution over long contexts |

---

**The Algorithm**

The composite score isn't a simple weighted average. Three mechanisms prevent underestimation:

  1. **Weighted average** across all 9 dimensions (each weighted by observed failure contribution)

  2. **Max-dimension boost** — if any single dimension exceeds 0.6, it pulls the composite upward (a prompt with 100% task count is broken even if everything else is simple)

  3. **Pair penalty** — two or more dimensions above 0.5 compound the load non-linearly

```

composite = weighted_avg + max_boost + pair_penalty

```

Calibrated failure probability:

- LOW (0-30%): ~2-8% failure rate

- MODERATE (30-50%): ~8-22% failure rate

- HIGH (50-70%): ~22-45% failure rate

- CRITICAL (70-100%): ~45-72% failure rate

---

**Working Code (CC0 — use it, fork it, ship it)**

```python

#!/usr/bin/env python3

"""

Cognitive Load Decomposer v1.0

Measures the cognitive load of LLM prompts across 9 dimensions.

Deterministic — no LLM calls. Runs locally in <50ms.

License: CC0 Public Domain.

"""

import re, sys, json, math

from dataclasses import dataclass, field, asdict

u/dataclass

class CognitiveLoadReport:

token_count: int = 0

sentence_count: int = 0

clause_count: int = 0

task_count: float = 0.0

reasoning_depth: float = 0.0

tool_complexity: float = 0.0

constraint_density: float = 0.0

output_complexity: float = 0.0

temporal_complexity: float = 0.0

ambiguity_score: float = 0.0

edge_case_burden: float = 0.0

context_pressure: float = 0.0

composite_load: float = 0.0

risk_level: str = ""

failure_probability: float = 0.0

subtasks: list = field(default_factory=list)

recommendations: list = field(default_factory=list)

class CognitiveLoadAnalyzer:

WEIGHTS = {

'task_count': 0.15, 'reasoning_depth': 0.15,

'tool_complexity': 0.10, 'constraint_density': 0.12,

'output_complexity': 0.10, 'temporal_complexity': 0.10,

'ambiguity_score': 0.08, 'edge_case_burden': 0.10,

'context_pressure': 0.10,

}

def analyze(self, prompt: str) -> CognitiveLoadReport:

tokens = prompt.split()

sentences = re.split(r'(?<=[.!?])\s+', prompt)

clauses = re.split(r'(?:;\s*|\s+(?:and|but|or|however|therefore|then|while|because|if|unless|when|after|before)\s+)', prompt)

r = CognitiveLoadReport(

token_count=len(tokens),

sentence_count=len([s for s in sentences if s.strip()]),

clause_count=len([c for c in clauses if c.strip()]),

)

# Task count: unique action verbs

action_verbs = set(re.findall(

r'\b(?:analyze|build|create|design|debug|deploy|evaluate|explain|find|fix|generate|'

r'implement|inspect|optimize|parse|process|provide|read|refactor|return|review|'

r'search|send|test|translate|update|validate|verify|write|check|compare|convert|'

r'delete|download|extract|fetch|filter|format|install|list|merge|monitor|move|'

r'open|organize|plot|print|query|rename|replace|run|save|scan|select|sort|split|'

r'submit|summarize|upload|wrap)\b', prompt.lower()

))

r.task_count = min(1.0, len(action_verbs) * 0.15 + len(sentences) * 0.05)

# Reasoning depth: reasoning markers + nesting

reasoning_hits = sum(len(re.findall(p, prompt, re.I)) for p in

[r'\bbecause\b', r'\btherefore\b', r'\bhowever\b', r'\bif\b.*\bthen\b',

r'\bshould\b', r'\bmust\b', r'\bensure\b', r'\bverify\b', r'\banalyze\b',

r'\bevaluate\b', r'\bcompare\b', r'\btrade-?offs?\b', r'\bunless\b'])

conditionals = len(re.findall(r'\bif\b', prompt, re.I))

r.reasoning_depth = min(1.0, reasoning_hits * 0.08 + conditionals * 0.15)

# Tool complexity: tool references

tool_hits = sum(len(re.findall(p, prompt, re.I)) for p in

[r'\buse (?:the )?\w+ (?:tool|function|command|API)\b',

r'\bcall\b', r'\binvoke\b', r'\bexecute\b',

r'\b(?:web_search|terminal|read_file|write_file|browser_|computer_use|'

r'memory|delegate_task|execute_code|patch|search_files)\b'])

r.tool_complexity = min(1.0, tool_hits * 0.20)

# Constraint density

constraint_hits = sum(len(re.findall(p, prompt, re.I)) for p in

[r'\bdo not\b', r'\bnever\b', r'\balways\b', r'\bmust not\b',

r'\bonly\b.*\bwhen\b', r'\bprohibited\b', r'\bformat\b',

r'\breturn (?:as|in|the)\b', r'\bstructured\b'])

r.constraint_density = min(1.0, constraint_hits / max(1, len(tokens)) * 10)

# Output complexity

format_hits = sum(len(re.findall(p, prompt, re.I)) for p in

[r'\bjson\b', r'\byaml\b', r'\bmarkdown\b', r'\btable\b',

r'\blist\b', r'\bformat\b', r'\bschema\b', r'\bstructure\b'])

unique_formats = len(set(re.findall(

r'\b(json|yaml|markdown|csv|xml|table|list|code|html|structured|formatted)\b',

prompt.lower())))

r.output_complexity = min(1.0, format_hits * 0.12 + unique_formats * 0.15)

# Temporal complexity

temporal_hits = sum(len(re.findall(p, prompt, re.I)) for p in

[r'\bfirst\b', r'\bthen\b', r'\bfinally\b', r'\bnext\b',

r'\bstep \d\b', r'\bphase \d\b', r'\bsequentially\b'])

r.temporal_complexity = min(1.0, temporal_hits * 0.12)

# Ambiguity

ambiguity_hits = sum(len(re.findall(p, prompt, re.I)) for p in

[r'\bmaybe\b', r'\bperhaps\b', r'\bmight\b', r'\bcould\b',

r'\bprobably\b', r'\bit depends\b'])

r.ambiguity_score = min(1.0, ambiguity_hits * 0.15)

# Edge cases

edge_hits = sum(len(re.findall(p, prompt, re.I)) for p in

[r'\bedge case\b', r'\bwhat if\b', r'\berror\b', r'\bfailure\b',

r'\btimeout\b', r'\bhandle\b.*\bcase\b', r'\bfallback\b'])

r.edge_case_burden = min(1.0, edge_hits * 0.12 + prompt.count('?') * 0.08)

# Context pressure

refs = len(re.findall(

r'\b(?:the above|as mentioned|refer to|see above|based on|'

r'using the previously|the earlier)\b', prompt, re.I))

r.context_pressure = min(1.0, len(tokens) / 3000 + refs * 0.10)

# Composite with max-boost and pair penalty

dims = [r.task_count, r.reasoning_depth, r.tool_complexity,

r.constraint_density, r.output_complexity, r.temporal_complexity,

r.ambiguity_score, r.edge_case_burden, r.context_pressure]

weighted = sum(d * w for d, w in zip(dims, self.WEIGHTS.values()))

max_dim = max(dims)

max_boost = (max_dim - 0.6) * 0.75 if max_dim > 0.6 else 0.0

high_count = sum(1 for d in dims if d > 0.5)

pair_penalty = 0.15 if high_count >= 3 else (0.08 if high_count >= 2 else 0.0)

r.composite_load = round(min(1.0, weighted + max_boost + pair_penalty), 3)

# Risk classification

if r.composite_load < 0.30: r.risk_level, r.failure_probability = "LOW", 0.05

elif r.composite_load < 0.50: r.risk_level, r.failure_probability = "MODERATE", 0.15

elif r.composite_load < 0.70: r.risk_level, r.failure_probability = "HIGH", 0.35

else: r.risk_level, r.failure_probability = "CRITICAL", 0.60

# Decompose if overloaded

if r.composite_load > 0.50:

r.subtasks = self._decompose(prompt)

r.recommendations = self._recommend(r)

return r

def _decompose(self, prompt):

sentences = [s.strip() for s in re.split(r'(?<=[.!?])\s+', prompt) if s.strip()]

if len(sentences) <= 2: return [prompt]

chunk = max(2, len(sentences) // 3)

return [' '.join(sentences[i:i+chunk]) for i in range(0, len(sentences), chunk)]

def _recommend(self, r):

recs = []

if r.task_count > 0.5: recs.append(f"Split into {max(3,int(r.task_count*8))} sequential subtasks — one action verb each.")

if r.tool_complexity > 0.5: recs.append("Reduce to ≤3 tools per step. Chain calls across subtasks.")

if r.constraint_density > 0.5: recs.append("Move constraints to a numbered rules section at the top.")

if r.output_complexity > 0.5: recs.append("Specify ONE output format. Split multi-format into separate steps.")

if r.reasoning_depth > 0.5: recs.append("Add chain-of-thought scaffolding. Break conditionals into numbered if/then blocks.")

return recs or ["Load is manageable."]

# Usage

if __name__ == '__main__':

prompt = ' '.join(sys.argv[1:]) if len(sys.argv) > 1 else sys.stdin.read()

analyzer = CognitiveLoadAnalyzer()

report = analyzer.analyze(prompt)

print(json.dumps(asdict(report), indent=2))

```

---

**Benchmarks I ran:**

| Prompt | Tokens | Composite | Risk | Est. Failure |

|--------|--------|-----------|------|-------------|

| "What is the capital of France?" | 6 | 2% | LOW | 2% |

| "Explain neural networks with code" | 12 | 5% | LOW | 2% |

| "Analyze code, fix bugs, write tests, deploy, update docs, create PR" | 58 | 66% | HIGH | 45% |

| "Full DevOps audit: K8s pods, RBAC, Helm, CVEs, deploy hotfix, smoke tests, incident report" | 64 | 88% | CRITICAL | 72% |

The pattern is clear: **prompts with >5 action verbs and >2 tool references consistently score HIGH or CRITICAL.** Most production agent failures I've seen trace back to this.

---

**Why this matters:**

The AI community treats prompt engineering as an art. It's an engineering discipline. And like all engineering disciplines, it needs measurement tools before it can have optimization methods.

This tool gives you a number. That number tells you whether your prompt is likely to succeed or fail before you ever call the API. The decomposition tells you how to fix it.

The full version (with CLI, JSON output, file input, and decomposition engine) is a single Python file. No dependencies beyond the standard library. Copy it, run it, improve it.

If you build on this, I'd love to see what dimensions you add. The 9 I chose are based on observed failure modes — but I'm sure there are others.

---

**CC0 Public Domain.** Use it, fork it, ship it. No attribution required. No license restrictions. Just build useful things.

---

*Tool developed by bioCAPT — an open-source cognitive architecture from Inversion Labs. Full code at the link in my profile. But the algorithm above is self-contained — you don't need anything else.*

reddit.com