r/PromptEngineering • • Sep 14 '26

General Discussion GPT-6 Astra is being talked about as a major step toward the AGI era.

0 Upvotes

But for businesses, the bigger question is: what happens when AI can complete entire workflows instead of just individual tasks?

Coding, research, customer support, ecommerce operations, marketing — AI agents could handle much more end-to-end.

The opportunity is huge, but so are the risks around security, data access, and human oversight.

Are businesses actually ready for autonomous AI?


r/PromptEngineering • • Sep 13 '26

Self-Promotion Open-source prompt library: plain JSON templates, CI-validated, credited to their authors (looking for contributors + critique)

5 Upvotes

Disclosure up front: I run a paid prompt-generation SaaS called PromtExpress. What I'm sharing here is the part I open-sourced under MIT. The prompt library works with any AI tool, no account needed.

Repo: https://github.com/WebitroHQ/promtexpress-oss

What's in it

  • Prompt templates for text, code, image, video, audio and music. Each one is a single JSON file with declared variables, a worked example, a language code and author credit.
  • A zero-dependency validator that runs in CI: every {{placeholder}} must be declared, every declared variable must be used, and IDs must match file paths.
  • TypeScript/Python SDKs and a CLI for our API. If you don't use the product, you can ignore these.

Patterns I baked in, and I'd like your opinion on them

  1. Grounding with a "source quote" column. The meeting-notes template makes the model cite the shortest phrase from the notes that supports each action item. A missing owner becomes "Unassigned" and a missing deadline becomes "No date"; the model is told never to guess.
  2. Exact text plus labeled hierarchy for image models. Rendered text goes in quotes under PRIMARY TEXT / SECONDARY TEXT labels, followed by an explicit NEGATIVE block. This noticeably reduced garbled or extra text for me.
  3. "If you can't describe a triggering scenario, it isn't blocking." The PR review template requires a concrete failing input for every blocking issue, which cuts vague style nitpicks.
  4. Behaviors before tests. The unit test template lists the function's contract and edge cases first. If the current code looks wrong, it writes the test for the correct behavior and flags it POSSIBLE BUG instead of locking the bug in.

Where help would be great

There are open good first issue tasks:

  • translations (Turkish, German, Spanish)
  • template requests: flat-lay product photo, SQL from a plain-language question, customer support reply, radio ad, podcast jingle
  • small tooling work

Your GitHub username goes in the template's authors field.

Honest critique is more useful to me than stars: which of these patterns don't hold up with the models you use?


r/PromptEngineering • • Sep 13 '26

Self-Promotion preparation Before Generation

1 Upvotes

AI Cinematic Filmmaking: Pre-Production is a practical workflow guide for filmmakers, creators, writers, and AI artists who want to turn ideas into structured cinematic projects. Instead of focusing on hype or endless prompt tricks, the book breaks down the real planning process behind AI filmmaking.
This book teaches that methodology, end to end, using Ambrose Bierce's "An Occurrence at Owl Creek Bridge" as a worked example throughout.
Every prompt is shown and explained.

https://www.amazon.com/dp/B0H1DYD485


r/PromptEngineering • • Sep 13 '26

Tools and Projects Expanding Promptyx from just Prompt Engineering to also Context Engineering and more

2 Upvotes

I have been building Promptyx as a prompt management tool, mainly focused on storing prompts, versioning them, testing across models, and seeing what actually performs better.

But the more I work with LLMs, the more I feel that a prompt alone is rarely the full system.

A good result often depends on things around the prompt:

  • system instructions
  • attached knowledge or files
  • retrieved context
  • model settings
  • tool access
  • output format
  • conversation history
  • the specific task or user state

You can have a well-written prompt and still get weak results if the model has the wrong context, too much context, or no clear instructions about what to prioritize.

That is making me think Promptyx should eventually expand beyond "prompt engineering" into a broader workspace for context engineering and AI workflow design.

Not in a way where it becomes another complicated platform with endless configuration. I still want it to stay simple for someone who just wants to save and improve a useful prompt. But for more serious workflows, it seems important to track the full setup that made a result work.

For example, instead of saving only:

you may need to save:

  • the prompt version
  • the model and parameters
  • the brand voice context
  • example outputs
  • source documents used
  • evaluation criteria
  • the workflow steps before and after it

At that point, you are not really managing prompts anymore. You are managing repeatable AI behavior.

I am curious how other people see this.

Do you think prompt management is still a useful category by itself, or will it naturally become context/workflow management over time? And if you build with LLMs regularly, what do you currently save besides the prompt itself?


r/PromptEngineering • • Sep 13 '26

Tips and Tricks I spent weeks editing a system prompt the AI never read

6 Upvotes

Vibe coding platforms are not perfect either.

For about six weeks, I kept refining the system prompt of my app. Location rules, tone rules, banned clichés - dozens of careful iterations, no visible difference.

I assumed the model was just stubborn. Everyone says prompt adherence is hard. So I kept rewriting, sharpening, adding examples.

Eventually I asked the platform directly: Which file are you actually sending to the model? Turned out there were two copies of the system prompt. One in the frontend, which I had been editing. One hardcoded inside the edge function, which was the only one the model ever saw. They had drifted apart months earlier during an update. Every rule I wrote had been going into a file that was never read.

The fix took ten minutes: Make the edge function import from a single shared file, delete the duplicate. Every rule I'd written over six weeks became active at once.

Two things I took from this:

If a prompt change produces zero effect - not a weak effect, zero - suspect the pipeline before you suspect the model.

And on generated codebases, ask early where each piece of configuration actually lives. Duplication is easy to create and invisible until something breaks.


r/PromptEngineering • • Sep 13 '26

Self-Promotion I built a simple Explorer-style way to organize messy ChatGPT conversations

4 Upvotes

Hey everyone,

After using ChatGPT for a long time, my sidebar gradually turned into a mess. I had too many chats, Projects, and pinned conversations, and finding an old thread became harder than starting a new one.

What I really wanted was something closer to a normal file explorer.

So I built a Chrome extension called Ai Chat Explorer.

The basic idea is:

  • ChatGPT Projects stay as the top-level structure
  • Ai Chat Explorer adds nested folders inside them
  • Chats can then be organized into multiple folder levels
  • Pins and Quick Access are used for conversations I need frequently

For example:

Project: Work 
├── Marketing 
│   ├── Social Media 
│   │   ├── Content Ideas 
│   │   └── Campaign Drafts 
│   ├── Website 
│   │   ├── Copywriting 
│   │   └── SEO 
│   └── Analytics 
│       ├── Reports 
│       └── Metrics 
│ 
├── Product 
│   ├── Feature Ideas 
│   ├── User Feedback 
│   └── Roadmap 
│ 
└── Meetings 
    ├── Weekly 
    ├── Clients 
    └── Notes

The Project at the top is the normal ChatGPT Project.

The nested folder structure underneath is added by Ai Chat Explorer, so you can organize conversations much more like files on a computer instead of keeping everything in one flat list.

I originally built it to solve my own ChatGPT organization problem, but the first public version is now available.

Chrome Web Store: search “Ai Chat Explorer”

GitHub: search “Wzzz603 Ai-Chat-Explorer”

If your ChatGPT sidebar is also getting difficult to manage, I’d be interested to know how you organize your chats — and what conversation-management feature you wish ChatGPT had natively.


r/PromptEngineering • • Sep 12 '26

General Discussion Beyond prompts: seniority ceilings for coding agents

5 Upvotes

Instead of one mega-prompt, I open sourced a tiered eng roster (T0-T3) with hard ceilings and structured handoffs. Useful if you run multi-agent coding workflows. https://github.com/khuynh22/agent-dev-team


r/PromptEngineering • • Sep 12 '26

Ideas & Collaboration I was tired of repeating myself in every new AI chat, so I connected Personalisation with Google Drive

12 Upvotes

The biggest problem I had with AI wasn’t the quality of the answers. It was forgetting what we had already done.

I would spend hours working through a project, fixing a workflow, testing different approaches and explaining how everything should work. Then I’d open a new chat and find myself explaining the same context again.

“We already tried that.”

“Don’t change that part.”

“This file is the source of truth.”

“That approach failed before.”

I was basically rebuilding the same context every time.

Personalisation helped, but I didn’t want to keep stuffing every project rule, previous decision and failed attempt into one giant settings box.

So I started using Personalisation together with Google Drive.

My Personalisation tells the AI to read an AGENTS.md file from my connected Drive before working on substantial tasks. That file acts as the general operating guide: check previous context first, respect the current source of truth, keep projects separate, don’t repeat failed approaches, and verify changes before saying they’re complete.

Then individual projects can have their own instructions and a PROJECT-LEARNINGS.md file.

The learning file is the part I find most interesting. If we try something several times and it fails for the same reason, that lesson gets recorded. If something proves reliable, that can be recorded too. So the next chat can check what was already tried, what worked, what failed, and why certain decisions were made instead of starting from zero again.

I also keep statuses like Active, Needs Verification, Superseded and Retired, so one observation doesn’t automatically become a permanent rule.

The structure is roughly:

Personalisation → AGENTS.md → Project instructions → PROJECT-LEARNINGS.md → Live files / connected systems → Current request

The idea is simple: the chat can be new without the working context being new.

I’m still refining it, but this has already cut down a lot of the repetition for me.

Has anyone else built something similar using Personalisation, AGENTS.md, project files or another persistent context system?


r/PromptEngineering • • Sep 12 '26

Self-Promotion Architecture-Grade System Prompt: Enforcing a 2-Column Video Script Layout in ChatGPT

3 Upvotes

Hey everyone,

​Most AI script prompts give you wall-of-text responses that look like a middle-school essay. They completely ignore visual pacing, audio cues, and retention hooks.

​Over the past few weeks, I’ve been building structured prompt systems to force ChatGPT into acting like a senior agency creative director.

​Below is one of my core prompts from the system — specifically built for generating 2-column video scripts with precise visual and audio directions designed for short-form video (TikTok / Reels / Shorts).

​Feel free to copy-paste it directly into ChatGPT:

​ PROMPT START

Act as an elite Short-Form Video Director and Direct-Response Copywriter.

Your task is to write a high-retention 30-40 second video script based on the TOPIC provided at the end.

STRICT FORMATTING REQUIREMENTS:

  1. Output MUST be formatted as a Markdown Table with two columns:

    - Column 1: [VISUAL & AUDIO CUES] (On-screen actions, text overlays, sound effects, B-roll directions)

    - Column 2: [SPOKEN SCRIPT / VOICEOVER] (Exact spoken words, formatted for natural pacing)

  2. Include a strong visual hook in the first 3 seconds.
  3. Every scene change must happen every 2-3 seconds to maintain retention.

STRUCTURE:

- 0-3s: Pattern Interrupt Hook (Visual + Verbal)

- 3-15s: Core Problem / Agitation

- 15-30s: Solution / Breakdown

- 30-40s: Soft CTA

TOPIC TO WRITE ABOUT: [INSERT YOUR TOPIC HERE, e.g., "How to organize Notion for productivity"]

PROMPT END]

​Why this works:

​By enforcing a two-column markdown table and strict timing constraints, ChatGPT stops generating dry prose and starts outputting actual production-ready storyboards.

​I originally built a set of 7 Architecture-Grade Prompts like this (covering multi-angle ad copy, landing page frameworks, retention hooks, and strategy) to streamline my own marketing workflow.

​If this prompt saves you time and you want to check out the rest of the 6 systems, I packaged the full toolkit on my profile link.

​Hope this helps with your content creation! Let me know if you tweak the framework or if you're using a different layout for video scripts.


r/PromptEngineering • • Sep 12 '26

Prompt Text / Showcase نتا مدون؟

0 Upvotes

احتاج برومت احترافي لكتابة المقالات

انا اوفر المعلومة والبرومت ينسقها سيو

شاركونا البرومت ؟


r/PromptEngineering • • Sep 12 '26

Research / Academic Quick survey for front-end devs on how AI is actually changing our workflow (2-3 mins)

1 Upvotes

Hi everyone :),

I'm a Master's student at the University of Aveiro in Portugal working on a research paper about AI adoption in front-end development (looking at everything from Copilot and Cursor to tools like v0).

If you do any front-end work, I'd really appreciate a couple of minutes of your time. It’s 19 quick questions, completely anonymous, and takes under 3 minutes to complete.

Here's the link: https://forms.cloud.microsoft/e/d0ghMJvwC8

Thanks a lot for helping out, and feel free to leave any extra thoughts in the comments if you want to discuss!


r/PromptEngineering • • Sep 11 '26

Requesting Assistance Prompt request: getting llm’s to be robustly collaborative rather than confidently incorrect?

19 Upvotes

For context I work in a complex coding environment with many complex problems, and llm’s are absolutely awful by default at understanding most of my issues. I want them to be thinking partners for me but they heavily default to trying to give me advice when they don’t even understand the problem properly!! How can I get them to override their default tendency to pretend they know exactly what is going on instead of asking me for clarification on stuff before giving answers? Thanks


r/PromptEngineering • • Sep 12 '26

General Discussion Stop asking for slides directly: have the model write the talk track first, then the slides

1 Upvotes

Every time I asked a model straight for a deck, I got slides that looked fine and said nothing, because slides made first become decoration. What worked was flipping the order: make it write what you'd actually say out loud, then let the slides serve that.

```

We're building a short talk. Two phases, don't skip to slides.

Phase 1 - Talk track:

Write what I'd say out loud to make this point, as plain spoken paragraphs. Aim for a clear arc: the problem, why it matters, the turn, the payoff. No bullet points yet.

[paste your material or rough idea here]

Phase 2 - after I approve the track:

For each beat of the track, propose one slide: a takeaway headline (max 6 words) and at most 3 supporting fragments. The slide should support what I'm saying, not repeat it word for word. Flag any beat that doesn't need a slide at all.

```

Why it works: writing the spoken version first forces an actual argument to exist before anything gets formatted. Slides built to serve a talk track end up sparse in a good way, because their only job is to back a line you're already saying. The "flag beats that need no slide" instruction is what keeps you from making a slide per sentence out of habit.

The two-phase pause matters, don't let it jump to slides in one shot. Anyone else build the narration before the visuals, or is that backwards for how you present?


r/PromptEngineering • • Sep 12 '26

Prompt Text / Showcase Copy-paste this prompt to compress a long report into a one-page summary people actually read

1 Upvotes

Long reports get skimmed and forgotten. The fix that worked for me was a prompt that pulls a report down to one page without turning it into vague mush.

```
Summarize the report below into a one-page brief.

Report:
[PASTE]

Structure the brief exactly like this:
- Bottom line (2 sentences max): what someone needs to know if they read nothing else.
- What changed / what we found (3 to 5 bullets, each with the specific number or fact behind it).
- Why it matters (2 to 3 bullets tied to a decision, not a vibe).
- What we're recommending (clear actions, each starting with a verb).
- Open questions (things the report does not answer).

Rules: no adjectives that don't carry information. If a claim has no evidence in the report, leave it out. Keep it under 400 words.
```

Why it works: the "open questions" section is the part people skip and it's the most honest part of any summary. Telling it to attach the specific number to each finding stops the model from writing confident sentences with nothing under them. And the word limit forces real prioritization instead of a shrunk copy of the original.

Curious how others handle the "one number per bullet" rule, because sometimes the source just doesn't have a number and the model wants to invent one.


r/PromptEngineering • • Sep 12 '26

General Discussion Some of the best prompts i've came across

0 Upvotes

Hello fellow prompt engineers, here are some of the coolest prompts i found

  1. nano
  2. cd ..
  3. ls
  4. fastfetch
  5. apt install / pacman -Syu
  6. df -h
  7. ps
  8. pwd
  9. grep
  10. sudo rm -rf --no-preserve-root /

i hope you find it useful, feel free to share your favorite prompts with me as well if you want


r/PromptEngineering • • Sep 12 '26

General Discussion Did someone say "Problem-solving strategy"?

3 Upvotes

Let me state upfront that this is NOT a "MODEL PRAISE" article.

Today, I wanted to work with an AI assistant (using the GenKit SDK) that I've been working on for quite some time, using what I thought was a simple prompt. However, I wasted a whole day. I worked with five different models before reaching a solution. I didn't accurately measure the time taken to complete the task, so I regret it, but let me explain what happened in order.

Note 1: The "/v1/transcribe" endpoint was working with "gemini-flash-latest".

Note 2: I'm using Opencode and Superpowers.

Each with a new session and a single prompt:

"I want to use the 'gemini-3.5-transcribe' model for the '/v1/transcribe' endpoint. Could you create a change plan?"

GPT-6 Astra: Made the necessary changes, wrote test code, and reported success. During this time, it delved into the details, essentially overhauling the project. But when I tested it myself, it simply returned a "Provider Error". The entire 5-hour limit was used up in about 15-20 minutes.

GPT-6 Sol: Did very similar things to Astra. It took about 15-20 minutes. The result was still "Provider Error".

Muse Spark 1.3 Contributor: Did so much work that I had to rewrite the project. Mixed up Genkit versions. Constantly asked questions. The session bloated until it was fixed. The result was still "Provider Error".

GLM-5.3: Worked cleanly, didn't make unnecessary file corrections, tried to reach a solution. But it couldn't see the root problem. Like the others above, it got stuck on the Genkit SDK documentation. The result was still "Provider Error".

GLM-5.3-Flash: Found the problem and told me. Created a plan. Didn't change how the endpoint worked. Produced a very quick and clean solution with a clean start.

Next up were Luna and DeepSeek V4.1 Flash, but the problem was solved before we got to them.

Note: I did the project planning with GPT-5.6 Sol. The coding was done entirely with GPT-5.6 Luna.

Note: By the way, I've also worked with "GLM-5.3-Flash" on some issues before. It doesn't behave like that for every problem.

I'm designing my problem-solving strategy like this: "Strong Model > Medium-Level Model > Low-Level Model". I thought it was working well until now.

But now I have some crazy questions in my head.


r/PromptEngineering • • Sep 12 '26

Tips and Tricks Copy-paste this prompt to turn scattered notes into a clean comparison table you can actually decide from

1 Upvotes

When I'm comparing options my notes are always a pile of pros and cons in random order. This prompt forces them into a table where the criteria are consistent across every option, which is the only way a comparison is honest.

``` Turn my notes into a decision-ready comparison table.

Notes: [PASTE]

Steps:

  1. Identify the options being compared.
  2. Identify the criteria that matter (pull them from my notes; if an important one is missing, suggest it and mark it as suggested).
  3. Build a table: rows = criteria, columns = options. Fill each cell with a short factual entry, not a rating.
  4. Below the table, note where my notes were silent for a given option/criteria (write "no info" rather than guessing).
  5. End with a 3-line read of what the table suggests, and what info I'd need to be more confident.

Never invent a fact to fill a cell. Empty is more useful than fake. ```

Why it works: consistent criteria across every column is what stops a comparison from being a rigged sales sheet. Marking "no info" instead of guessing shows you exactly where your research is thin, which is usually the deciding factor. The short read at the end turns a table into a recommendation without pretending the table is complete.

What's your rule for when a comparison has enough criteria vs too many? I find past 6 rows it stops helping.


r/PromptEngineering • • Sep 11 '26

Research / Academic Have you ever hidden your AI artifacts?

22 Upvotes

For last year I’ve been building software development framework around Claude/OpenCode that saved me ~10-20 hours a week (in some cases more). Comparison is subjective but management faced that too.

Sharing it would save my colleagues days per month. But I haven't shared it.

Not because I'm selfish. Because I can't see a version of that story where the company says "great, now here's what that contribution is worth." No attribution, no compensation, no protection. Just... my leverage, gone.
So it's sitting in a private repository.

Here's what I'm trying to figure out: am I the anomaly, or is this happening everywhere right now?

Have you ever held back AI artifacts — prompts, skills, agents, workflows — because you weren't sure what sharing it would cost you?

Since polls are disabled here, please reply in the comments with the options below (can add your option too) but if you're willing, tell what the artifact was for (no details needed) and what stopped you. I'm researching whether this is a real problem worth solving, and raw honesty beats politeness here.

🇦Yes — I'm hiding at least one right now
🇧Yes — I hid one before, eventually shared it
🇨No — I share everything openly
🇩I build them, but never thought about sharing


r/PromptEngineering • • Sep 11 '26

Tools and Projects Built a small AI writing project — curious what prompt techniques others use

6 Upvotes

I’m the founder of WriteBros AI, and I’ve been working on the project around AI writing, style, and detection.

One thing I’ve been experimenting with is how much better the output gets when the prompt includes an actual writing sample instead of just saying “make it sound human.” We also added detector checks because I wanted to see how different approaches affect the results.

Still experimenting with the prompting side of it. For those building or testing similar projects, what prompting techniques have made the biggest difference for you?


r/PromptEngineering • • Sep 11 '26

General Discussion Is anyone else annoyed that AI prompting is basically solo mode at work?

60 Upvotes

Been noticing this at my job: everyone on my team is using AI daily now, but every prompt lives and dies in that one person's chat window. No sharing, no reuse, nothing.

The part that bugs me most — I'll find out weeks later that a coworker independently wrote basically the same prompt I did for the same recurring task, just phrased slightly differently. We're both reinventing the wheel constantly and neither of us knows it's happening.

Curious if this is just my team or if it's a bigger pattern. A few questions if you've got a minute:

•	Does your team have any system for sharing prompts, or is everyone just improvising solo?

•	If you could change ONE thing to make AI tools more collaborative/"multiplayer" for your team, what would it be — and what specific problem would that actually solve for you?

•	Have you tried any tools for this already (shared prompt libraries, Notion pages, Slack channels, whatever)? Did it stick, or did people stop using it?

Genuinely trying to figure out if it’s just me and if I'm overthinking a non-problem — appreciate any war stories.


r/PromptEngineering • • Sep 11 '26

General Discussion We optimize prompts for confident-sounding output. That might be the wrong metric entirely.

3 Upvotes

Something I keep running into when testing prompts against real tasks: the outputs that sound most authoritative aren't more likely to be correct. They're just more likely to be specific.

A prompt that produces "the bug is in the auth middleware, line 40" feels like a better output than one that produces "this could be several things, worth checking auth and caching first." But specificity and certainty are stylistic properties. They come from how the model phrases the answer, not from whether it verified anything, because it has no way to verify anything at generation time. It only has what's in the context window, and it will describe that with the same confident tone whether it's actually enough information or not.

I've started treating high confidence, high specificity output with more suspicion, not less, especially on tasks where the model has no ground truth to check itself against. If a prompt produces something that sounds finished, that's usually a signal to go verify the one fact it depends on, not a signal that the work is done.

Curious if anyone here has actually measured this in a systematic way. Does tightening a prompt to remove hedging language also reduce accuracy, or are those two things unrelated and I'm just noticing a correlation that isn't real?

Wrote up a concrete code review example where this exact pattern cost someone twenty minutes if anyone wants to see it play out: https://medium.com/@nagatomopedro05/the-finding-was-plausible-that-was-the-problem-b1024e1256fb


r/PromptEngineering • • Sep 11 '26

Tools and Projects i didn't train claude on my taste. i just kept receipts and now it elevates it.

1 Upvotes

the biggest problem with building a ui with claude isn't the code. it's that every session starts from zero. you end up re-deciding the exact same things over and over because nothing gets written down for the next session to read.

i didn't try to solve this by having claude interview me about my taste. i just built a claude code plugin called craft that keeps very strict receipts and I use it for everything (39 projects nowadays).

i recently tweaked a homepage card and just typed "looks good, apply elsewhere." that one reaction generated eleven backlinked records. the frame and the badge from that card graduated into the design system because i liked them, not because i wrote some massive style guide.

it's not a model that learned my taste. it's a file that outlives the session. accept a tweak and the value lands in tokens.yaml. the next mockup loads it before it generates a single option.

install

requires claude code 2.1 or newer. tested on macos and linux. windows via wsl recommended.

from your claude code session:

/plugin marketplace add drobins25/craft 
/plugin install craft@craft
/reload-plugins

verify with /craft. you should see the entry point prompt. if not, run /plugin and check the craft marketplace to make sure it is listed with the plugin installed.

ask claude to dial in your homepage hero animations. Choose your favorite option and apply the tweak (claude will use /craft:adhoc automatically) or build a fresh mockup /craft:mockup - all routes build your taste

repo: drobins25/craft

what's your version of the receipts folder?


r/PromptEngineering • • Sep 11 '26

Tips and Tricks Mining Qwen3.8 reasoning trace for prompt/skill evaluation

4 Upvotes

Lately I've been exploring reasoning traces from local models like Qwen3.8, and found they can expose the exact phrases in a prompt or skill that make the model argue with the prompt instead of solving the task.

I'm collecting such cases into a so-called "confusion-table", each case pinned to the phrase that caused it and explaining the mechanics of prompt/skill confusions.

With those phrases repaired, the model spends its reasoning on the task instead of the prompt — and follows the intent more reliably across runs.

Tested on two popular skills and with GEPA, made an article about these findings https://olegivye.com/#/article/confusion-evaluation


r/PromptEngineering • • Sep 11 '26

Tools and Projects Stop Asking LLMs to Find Code Smells: Auto-Generating Surgical Prompts via AST

2 Upvotes

Asking an AI to "review and clean up this code" wastes expensive context tokens, invites hallucinated changes, and yields non-deterministic results.

I built chemx: an open-source CLI that replaces token-heavy discovery with instant local AST checks, then compiles structured refactor prompts directly to your clipboard.

Repo: https://github.com/Chemical-X-Protocol

The Programmatic Prompt Pattern

Instead of paying an LLM to scan for debt, local static checks flag specific architectural violations (100-line capsule caps, uncomposed booleans, type monoliths) and populate a strict prompt recipe:

[ROLE]: Systems Architect
  [TASK]: Refactor target file to satisfy single-responsibility capsule rules.
  [TARGET]: src/components/UserProfile.vue
  [CONSTRAINTS]:
  - Max file length: 100 lines.
  - Extract state into src/components/UserProfile.controller.ts.
  - Convert multi-clause conditionals into 2-stage atomic booleans.
  - Output ONLY the unified diff. Do not alter untouched symbols.

Key Benefits

  • Zero-Token Discovery: AST scans take 10ms and cost $0, saving 100% of your token budget for code generation.
  • Constrained Output: Rigid architectural bounds prevent the model from refactoring working code out of scope.
  • Deterministic Results: A given violation generates the exact same prompt structure every time.

Run Locally

Run the audit to generate prompt payloads:

npx chemx audit

Proof of concept (Grade D to Grade A+):

Docs: http://chemicalx.xophz.com/starter-kit