Promptabide Logo

Give It The Constraint You Are Embarrassed By

The detail you leave out because it makes your codebase look bad is usually the one that decides the answer.

prompt-engineering
context
architecture
Keywords:
constraints prompt
context engineering
legacy systems
better prompts
A pattern I noticed in my own prompts, and then in everyone else's once I knew to look for it.

We describe the system we would like to have. The legacy table nobody will let us touch, the deploy that takes forty minutes, the one endpoint that has to stay synchronous because a partner integration polls it - those get left out. Partly it is brevity. Mostly it is that writing them down feels like admitting something.

So you get advice for a codebase you do not have.

Now I write a CONSTRAINTS block and put the embarrassing things in it first:

`
CONSTRAINTS - all of these are fixed. Do not propose changing them.
  • • Postgres 12. Upgrading is not on the roadmap this year.

  • • The orders table has no created_at index and is 40M rows.

  • • Deploys are manual and take 40 minutes. No blue/green.

  • • One team of four. Nobody has run Kafka in production.

  • • The /invoice endpoint must stay synchronous - a partner polls it.


  • Given only the above, ...
    `

    "Do not propose changing them" is not optional. Without that line you get an answer that opens with "first, upgrade Postgres", which is not advice, it is a description of a different problem.

    The answers change completely. Not tone - substance. The "obviously use a queue" recommendation becomes a two-phase approach with a synchronous escape hatch, because the constraint that the invoice path cannot move is now visible instead of implied.

    The side effect I did not expect: writing the block is a useful exercise on its own. Half the time I get partway through listing constraints and realise which one is actually the problem. That has happened often enough that I now write it before I have decided whether I am even going to send the prompt.

    The rule: if you would be slightly reluctant to say it out loud in an interview, it belongs in the prompt.
    22.7k10

    Generated Outputs (1)

    1 weeks ago
    Claude
    claude-opus-4
    Generated Output
    Given those constraints, do not introduce a broker. Four people, none with production experience on one, and a 40-minute manual deploy is the wrong place to add a system that fails in ways you cannot roll back quickly.

    Phase one, inside Postgres. Add a jobs table and use SELECT ... FOR UPDATE SKIP LOCKED as the queue. It is not fashionable and it will carry considerably more load than you currently have. You already know how to debug Postgres at 3am, which is the property that matters here.

    The invoice path stays synchronous. Do not queue it. The partner polls it, so making it async converts a slow endpoint into a broken contract.

    The 40M-row scan. Before any of the above, add the created_at index concurrently. On Postgres 12 that is available, and it is the cheapest win on this list - most of what reads like a queueing problem here is one missing index.

    Revisit the broker when either the jobs table exceeds a few thousand pending rows in steady state, or you hire someone who has operated one. Not before.
    Comments (10)
    No comments yet. Be the first to share your thoughts!
    Top Contributors
    Loading...
    Follow PromptAbide

    New bides, prompt breakdowns and community picks, on whichever feed you already read.

    Trending Tags
    Loading...
    Give It The Constraint You Are Embarrassed By | PromptAbide