Instead of optimizing prompts, design the system.
AI workflows improve when fixed rules move from prompts into code and checks, making listings and summaries more reliable.
Key Takeaways
- Large AI prompts become unreliable when asked to handle both creative language tasks and fixed mechanical rules.
- A better design separates the workflow: let the language model handle wording, while code enforces character limits, required fields, formats, and calculations.
- Automated checks are essential for catching errors before AI-generated outputs reach users, especially in data summaries and product listings.
- When AI results vary, the main question should not be how to improve the prompt, but how to redesign the system.
Meta description: Learn why a giant AI prompt for product listings failed, and how separating rules into code plus checks makes AI workflows consistent and easier to maintain.
Tags: AI workflow, prompt engineering, product listings, data summaries, automated checks
Featured image: An abstract friendly illustration of a language model passing numbers to a small script for checks, with no real people, no logos, and no text.
A product listing AI workflow that was meant to write titles, descriptions, keywords, formatting, and character-limit-compliant copy for an online shop kept changing from run to run, so its author redesigned the process by moving fixed rules out of the prompt and into code and automatic checks. The change came after the prompt, the instruction block sent to the model, grew longer while token use, the length measure for text, increased, and the results still were not reliable. The shift was away from one giant prompt and toward a small system.
Why the Large Prompt Kept Failing
The author built a small tool that handled the whole listing task inside one giant prompt. The model, a text-based AI tool, was asked to create the copy and also enforce all mechanical constraints. One run looked good, another exceeded the character limit, and a third missed a required field. Each failure led to another instruction, not a more stable system. At first, the author treated it as a prompt problem: add a sentence, run it again, and hope. That did not work.
At that point the author changed the question from what rule was forgotten to why a language model should do something a ten-line script can do. The real problem was not prompt wording. It was system design.
Creative Language Work and Fixed Rules Should Be Separate
The redesign came down to three principles. The first was to split the task into language work and rule work. A language model can choose a tone, suggest a title that sounds human, and write a product description. It is a poor ruler. Keeping text under 80 characters is a counting rule, not a creative judgment, and asking the model to satisfy it inside the same prompt mixed two different kinds of work.
The second principle made the split practical: use code for anything with a fixed right answer. Character limits, required fields, date formats, rounding, and formatting can be handled by a simple script. The script costs less than an AI call, runs in milliseconds, and returns the same result each time.
For the listing tool, that meant the model focused on the words, while code checked length, required fields, and formatting after every run.
The Same Pattern Appears in Data Summaries
The author extended the lesson to a common data science task: turning last week’s raw numbers into a stakeholder summary. A single prompt might ask the AI to clean the data, calculate week-over-week change, flag unusual values, format a table, and write two paragraphs of commentary.
That approach can produce confident writing around a wrong number. A percentage may be slightly off, or a column may be dropped, while the commentary sounds polished. The writing was not the weak point. The arithmetic was.
In a better setup, pandas, a data processing library, calculates the metrics, a function builds the table, and the model receives the finished numbers only to explain them in plain English. The model’s job becomes smaller, which reduces prompt length, token use, and places where things can go wrong.
Checks Catch Problems Before They Reach Users
The third change was to stop treating a model output as safe just because it followed the instructions. The author added checks that test the output automatically and flag anything that breaks a rule before it is used.
For a weekly summary, useful checks include whether every number in the commentary appears in the table, whether missing values or row counts no longer match the input, and whether the story’s direction, up or down, matches the sign of the actual change. These are ordinary unit tests and data quality checks, but they are often skipped when an AI-written paragraph reads well.
When a check failed, the author did not automatically rewrite the prompt. Instead, the question became which part of the system let the output pass.
What Improved, What Did Not, and What to Ask Next
The listing tool became more consistent. Retries wasted fewer tokens, and maintenance became easier because the author could identify which piece to open. Before the redesign, the only option was to touch the one giant prompt and hope nothing else moved.
The redesign did not make the model perfect. It can still produce a weak title. But that failure is now just a bad title, not a bad title plus a broken character limit plus a missing field.
The author used Claude, described as a writing buddy, to draw the before-and-after pipeline, the weekly summary pipeline, and the division of labor. The original account was first published in Towards AI on Medium, where readers continued the discussion.
For readers building AI tools, the practical takeaway is that prompt quality alone does not define reliability. When results vary, ask which part needs language or judgment, which part is a fixed rule, whether code can handle that rule, and what would catch the output if it were wrong. Most of the time, the answer is not a better prompt. It is a better system. The author invited readers whose AI workflows keep producing different results to share what they changed.
Comments (0)