Tidelines - the TypeGlish blogPrompt engineering, in plain English

Tidelines

Field notes for prompt engineers. Best practices that survive production, teardowns of real prompts, deep dives into why English fails and how to fix it - written by the team building TypeGlish.

◉ High tide - latestTeardownsOct 18, 20268 min read

Teardown: the promo block from the campaign brief

A promo block pasted from the campaign brief gives your agent an expiring offer, one word for two kinds of code, and a judgment call on discounts.

by TypeGlish team
tg review - the promotions block, pasted and rebuilt✓ C (78) to A (99)
  as pasted:   C (78)  2 of 9 lines read as rules
  rebuilt:     A (99)  6 of 6 rules, 6/6 covered
  upset patch: A (99)  passes; the test is the gate
Tide table - all entries189 entries
TeardownsTeardown: the promo block from the campaign briefA promo block pasted from the campaign brief gives your agent an expiring offer, one word for two kinds of code, and a judgment call on discounts. Deep divesSort your prompt by how often it changesPrompt caching reuses only the identical front of a prompt, so a customer name near the top costs every chat: sort sections by how often they change. Deep divesAbsolutely never is weaker than neverAdd EVER, ABSOLUTELY or under any circumstances to a NEVER rule and the checker stops defending it: the edit that contradicts it ships at an A. Best practicesBake-off: 5 business days vs. 7 daysRefund policies count business days, but the checker cannot compare them and the model cannot count them: write calendar-day ceilings and look up the date. Best practicesRewrite: read me the code we just texted youA chat agent that asks for the texted code breaks the promise it never will. Verify in the app instead, burn any pasted code, and the NEVER rule holds. Deep divesRemember to ask is a rule about rememberingOpeners like make sure to and remember to bury a rule's real verb, so it can sit beside its own NEVER and check clean until you write the action first. GuidesBuilding an email support agent, prompt-firstAn email agent gets one reply per thread: answer every question, cap the paragraph not the reply, gate copied threads, and keep auto-replies out of the loop. Best practicesThe chat agent is getting a phone numberMoving a chat agent onto the phone line: strip the decoration, scope every format and link rule to its channel, read the voice build, and test what both share. GuidesHow to write complaint-handling rules for an AI support agentComplaint rules for a support agent: make dissatisfaction the trigger, log before you fix, cite the tool's reference, and keep the compensation ban provable. TeardownsTeardown: the persona sheet that gave your agent a dogA marketing persona sheet gives your agent an age, a home town and a dog, and checks clean: no checker sees a lie, so cut the backstory and test the questions. Deep divesYour prompt has authors you have never metA courier note or a CRM note spliced into an agent prompt is text from someone outside your team: fence each field in a named tag the checker holds rules to. GuidesHow to shorten an agent prompt without losing a ruleCutting a support prompt by feel drops the rule that looks like filler; map every old line to the new one and let review-rewrite name what went missing. Best practicesWhy your agent tells a grieving customer to have a great dayA cheerful sign-off written for every contact reaches the customer reporting a death: scope the default with UNLESS, route the contact, and test the exception. Best practicesRewrite: back in about two weeksAn out-of-stock section tells your agent to say when an item is back and never to promise a date; a stock tool, a scoped NEVER and tests make it hold. Best practicesBake-off: tell it what to do vs. tell it what not to doPositive rules give your agent a next move, and NEVER rules give the checker a fence it can defend against later edits, so write every prohibition as a pair. Deep divesWe renamed the customer. The contradictions walked through.Give the customer another name in one rule's action, the caller or the account holder, and an edit that contradicts that rule passes the checker at an A. GuidesBuilding a missing-parcel agent, prompt-firstBuild a delivered-but-not-received agent from a six-line brief: take the replacement out of its hands, route on numbers the host passes in, test every arm. Best practicesPrices go up on the first. Your prompt has both.A price rise leaves two prices in your agent prompt: write them so the checker sees the clash, let the runtime supply each price, and test what follows. GuidesHow to mark a rule as important in an agent promptIMPORTANT and CRITICAL labels hide a rule from the checker; put importance in the modal you pick, state the rule once, and pin it with a test case. TeardownsTeardown: the IVR menu you pasted into the voice agentA phone tree pasted into a voice agent prompt is a keypad script the checker cannot read; rewrite each route as one rule, put safety first, test every route. Deep divesYour quote marks never reach the modelQuote marks in a .tg file speak to the compiler and strip on build, so a verbatim disclosure needs a literal zone the model can see and a contains test. Best practicesWhy your agent gives the balance to whoever callsWhen every rule says the customer, your agent treats whoever is on the line as the account holder; a typed caller role with one $SWITCH arm per role fixes it. Deep divesMost customers is not this customerYour agent reads most disputes are a forgotten travel pass as a fact about the customer in front of it, so move base rates out and test the exception. Best practicesRewrite: mention Premium before you goThe upsell line in a support prompt pitches Premium to customers who already pay for it; a typed plan input, an event-based guard and one $TEST fix it. Deep divesWe put the condition last. The checker stopped defending the rule.Move a rule's when, if or unless clause to the end of the line and the checker stops proving it, so a later edit that contradicts it passes clean at an A. Best practicesBake-off: one test per rule vs. one test per contactTwo test suites for one billing agent both report full coverage; only the one built from real customer contacts finds the rules that collide. GuidesHow to write read-back rules for a voice agentReading a detail back is how a voice agent catches a misheard digit: one rule per detail, a named partial for secrets, and the verbs the checker folds together. GuidesBuilding a flight-disruption agent, prompt-firstA six-line airline brief becomes a rebooking spec: consent as a pair of rules, the delay as a typed input, and a chain that finds the three-hour passenger. Best practicesYour agent works nights. Nobody else does.Eight checks for the day your chat agent goes 24/7 and your team does not: make the shift an input, give each shift its own promise, and test the night. TeardownsTeardown: the starter prompt that came with the platformThe starter prompt your CX platform ships grades a D and hides your own contradictions, because a rule the checker cannot read has nothing to argue with. Best practicesWhy your agent writes an essay in a chat bubbleA length rule with no number loses to every content rule beside it; count it in sentences and the checker can prove which rule is making replies long. Deep divesOr is two rulesA rail that guards two things with one or scores an A while hiding a contradiction; write one object per line and the conflict gets proven at check time. GuidesHow to stop your support agent replying in MarkdownAsterisks in your chat widget mean the prompt banned Markdown in a way nothing can check: name each mark, scope it to the surface, and test the reply. Best practicesRewrite: a five really helps the teamThe end-of-chat rating ask grades a C and screens unhappy customers out of your CSAT: the contradiction it hides, and why the survey leaves the prompt. Deep divesEvery WHEN is a classifierA guard in an agent prompt is a label the model assigns to a message: the checker proves what follows from it, never whether it fits. Decide it or test it. Best practicesBake-off: say escalate vs. call the escalation toolTwo handover prompts tie on every number the toolchain prints, until one edit each splits them: write the act as a rule and the mechanism as a pointer. GuidesBuilding a returns-eligibility agent, prompt-firstA returns desk from brief to spec: your agent has no calendar, so make eligibility a state the runtime computes and give every state one arm. Deep divesDelete the examples. The grade goes up.Nine cuts to the few-shot blocks of a clean support prompt: two refuse to build, three change nothing at all, and losing every demonstration raises the grade. TeardownsTeardown: the do-not-say list from the brand teamEight tone-of-voice bans pasted into an agent prompt arrive at full force, print every banned word into the artifact, and never meet the rule they contradict. Best practicesWhy your agent takes the customer's word for your policyA rule that defers to the customer's reading of your terms checks clean because their number is not in the file; write it down and the build is refused. Best practicesYour agent can now do something it cannot undoNine checks for the day your agent gets a tool that acts in the world: the reckless prompt and the railed one both score A, so only tested rails are real. Deep divesA preference is not an orderPREFER a replacement over a refund scores an A and decides nothing; give each remedy a trigger and the same stock rule becomes a refused build. GuidesHow to write agent rules for a multi-item orderA prompt cannot hold a list: FOR EACH earns no credit and a list input refuses to compile, so quantify over the items and bound them one at a time. Best practicesRewrite: delete everything you have on meA member asks you to erase their record: the two rules that cancel out, the scope phrase that hides the conflict, and the one route that resolves it. Deep divesYour prompt has no private halfFour places in a .tg file the model never reads, why a NEVER reveal rule is not one of them, and where a discount ceiling should live instead. TeardownsTeardown: the capability list from the launch deckA capability slide pasted into a prompt becomes rules nobody wrote: the verb decides which promises bind, and the deck’s limits bind nothing at all. Best practices$40 and 40 dollars are not the same ruleA dollar sign keeps the amount out of the arithmetic: the same impossible pair of credit rules is A (100) with a symbol and F (83) written in words. GuidesBuilding a billing-dispute agent, prompt-firstA billing-dispute desk from brief to spec: your policy verbs are not verbs the checker reads, and trading them for ones it does takes the file from C to A. Best practicesBake-off: name the condition once vs. write it three timesThree copies of one tier condition or a single $DEFINE: both grade A, both build the same artifact, and only one survives the day silver gets promoted. Best practicesPut it back the way it was on TuesdayNine checks for putting a prompt back the way it was last week: a revert is an edit that has to pass check, and only the artifact hash proves where you landed. Deep divesWe moved eleven lines. Six shipped a different prompt.Eleven position-only moves on a clean agent prompt: three refuse to build, two change nothing the model reads, and six ship different bytes at the same grade. ReleasesTypeGlish 0.10.0: one run, ranked by gain0.10.0 adds typeglish review, one report that names the grade, the grade if every fix lands, and each rule-shaped line the checker cannot actually read.10 min → Deep divesNothing in your prompt ends the conversationA closing section is polite about the way out and silent on when it is: an ending is a rule with an observable trigger, so enumerate them as a closed set. GuidesHow to write the rules for a support agent that gets sent photosDeclare the photo as a typed input, write down what it may prove and what must never come out of it, and keep the warranty decision out of the file. Best practicesRewrite: the duty of care nothing can checkThe IF...THEN frame switches a rule off, so the vulnerable-customer lines that matter draw nothing: keep the modal and move the trigger into the subject. Deep divesAdvice is a verbA prohibition covers only the verb it names: NEVER give advice is clean beside SHOULD suggest a policy, so pick one verb and pin it with an $EXAMPLE. Best practicesThree payment options. Two of them exist.Promise three options above a list holding two: only one spelling puts the count and the set in front of the prover, and ‘every’ has no number to go stale. TeardownsTeardown: the help centre page where you means the customerHelp centre copy says ‘you’ to the customer and a prompt reads it as the agent, so a pasted policy binds the wrong party: quote it in a literal zone. GuidesBuilding an SMS support agent, prompt-firstOn SMS the budget is the spec: write at most 160 characters as a bound, not an adjective, and mind the quoted literal where a curly apostrophe ships unseen. Best practicesBake-off: the number in the prompt vs. the number at runtimeOne refund SLA, two spellings. Both check clean today, and the December edit that breaks the policy is a refused build in one file and a silent pass in the other. Deep divesSix rows, five prompts, zero new bytesA leave-one-out ablation of glish.tgc, the project file no prompt mentions: one row decides whether all five build, and none moves an artifact byte. Best practicesTwo arms, one hypothesis, three artifactsEight checks for A/B testing a prompt: an arm is a file that $IMPORTs the control, and the diff between the two artifacts has to be your hypothesis. Deep divesNot approving is not decliningMUST NOT approve specifies no reply: emission verbs fold a prohibition onto its opposite, response verbs do not, so a refusal has to be its own rule. TeardownsTeardown: the apology rules three desks wroteTwelve lines about saying sorry: the build is refused on one rule at two strengths, and the feared admit-fault clash is three verbs no prover can compare. GuidesHow to write the AI disclosure rule your agent will actually followThree clean lines still leave ‘are you a real person?’ to the model: make the disclosure a fact, the mode a typed $SWITCH input, the wording a literal. Best practicesRewrite: the customer just pasted their card numberSeven lines about handling sensitive data check clean at D (59/100). Two of them are the same rule to the compiler, and the one thing the section cannot do is notice the digits. Best practicesThe tone is casual. Your tone is formal. Both ship.Two lines in one prompt, exact opposites, and the check is silent. The checker compares slots, not sentences, and the owner of the slot is part of its address. Deep divesYour router assumes one thing is wrongA typed routing input holds exactly one value, by construction. The prompt built on that assumption checks clean at A (99/100), and the customer who raises three things at once never appears in it. GuidesBuilding an order-tracking agent, prompt-firstWhere is my order is the highest-volume question in retail support. A seven-line brief checks clean with every real defect still in it, and typing the lines is what makes them appear. Best practicesBake-off: write the rule vs. show the exampleOne support policy, three files: rules only, examples only, and both. All three check clean, and only one of the three is a document the compiler can defend. Deep divesYour tool's URL is proven. Its purpose is a warning.Ablating a $SERVICE and two $TOOL blocks row by row: the compiler proves the plumbing the model never sees and only warns about the one field it reads. Best practicesOps wants the hours changed by FridayNine checks for handing prompt values to the teams that own them: a request is a case, a bound or a rule, and one build-twice hash test tells you which. TeardownsTeardown: the peak-season block pasted above your RoleTwo clean files taped together refuse to build, yet the line that costs money, a Christmas delivery promise, draws nothing: make the season an input. Deep divesTry again is not a numberA retry with no count is an absent rule, not a weak one: it passes clean under --strict, and only a number gives a checker or reviewer anything to argue with. GuidesHow to write the handover note your agent leaves for a humanWhen your agent gives up, a human inherits a conversation they were not in. Most prompts spend one line on that note, and the line collides with the rule two lines above it. Best practicesRewrite: nobody is on the other endA model never experiences silence, so a 'still no answer' rule assumes a faculty it lacks: hand the clock to the runtime and $SWITCH ON a typed no_input state. Deep divesYour policy remembers. Your agent does not.Half the rules in a mature CX prompt quantify over things that happened before this conversation started. Five of them check clean, and the one that cannot be followed scores highest. Best practicesWhy your agent invents a case referenceAn identifier written anywhere in your prompt is a template the model will fill. Eight spellings of one rule, and the only one that blocks the build is the honest one. GuidesBuilding a de-escalation agent, prompt-firstA warning ladder has two axes, a $SWITCH has one, and the nested $IF that looks like the fix ships as prose: flatten it to one $IF chain with a compound arm. Best practicesBake-off: the reason in the rule vs. the reason in a noteA because clause is parsed like a rule and proved like nothing: put reasons the model needs in # Context prose and reasons the reviewer needs in a @@ note. Deep divesThe typo that compiles is the one to worry aboutSixteen one-character edits to a clean prompt: ten refuse to compile, three warn, and three ship silently at the same grade, split by grammar, not danger. Best practicesBoth prompts were clean. The merge is not.Nine checks for the week two clean prompts become one: what concatenation reports, the three conflicts it never will, and why a $SWITCH beats reconciling. Deep divesGold and silver conflict. Priority and standard do not.A closed set is only closed once declared: the checker knows metals exclude each other, but your tier names are two words until one line writes the set down. TeardownsTeardown: your macro library speaks in the first personRules are indexed by subject, so a macro that says I is never compared with a rule that says you: a three-day callback sits under a two-hour rule, unflagged. Best practicesRewrite: a box costs 34 pounds, and nothing knows itOnly a copula binds, so three of five Context facts are furniture: rules get a bound, runtime facts a $REQUIRE variable, and B (82) becomes A (98). GuidesHow to write a severity scale your agent can applyA field guide to severity, priority and tier scales in an agent prompt: prompt/scale-gap catches the level nobody defined, and a typed input with a $SWITCH proves every level has an arm. Best practicesWhy your agent handles a 150-dollar refund two waysTwo tiers that share an edge give one amount two handlers, and prompt/tier-overlap proves it: make the bounds meet exactly once, or use an ordered $IF chain. Best practicesBake-off: import the old prompt vs. retype itOne legacy support prompt, two routes into a checked spec. The converter repairs form and never words, and one of its repairs changes what a sentence says. Deep divesYour prompt is a default and its exceptionsFive rule pairs in one care prompt, none of them a contradiction, and all of them a decision nobody made. What the checker says when two rules are merely coherent. GuidesBuilding a grounded help-centre agent, prompt-firstGrounding is the one rule a compiler cannot check: six phrasings of 'answer only from the docs' pass clean, so trade it for a citation rule a test can read. Deep divesWe took the scope off every rule. Three came off quietly.Strip the WHEN off nine guarded rules in turn: six break the build, three pass clean, and one of those now reads an account balance aloud to any caller. Deep divesYou retired the plan. The prompt still sells it.A retirement is provable only where the plan was a typed value: pull the word from the domain and its $SWITCH arm refuses to build; the prose rules still ship. Best practicesThe prompt is frozen. The artifact is not.Nine checks for a prompt inside a change freeze: @@ notes and a $TEST are free, a refund cap is not, and an imported file nobody froze moves the artifact. TeardownsTeardown: nobody checked the Spanish oneEvery TypeGlish operator is an English word, so a Spanish prompt where DEBES replaces MUST has no rules in it; localize the copy, not the rules. Best practicesRewrite: one conversation is not 70 percentA containment target scores exactly like a rule, and no single reply can obey it; write the per-turn rules that produce it and B (83) becomes A (98). GuidesHow to structure an agent prompt with XML tagsOne XML section sets the structure model for the whole file, bodies indent, tag names are names, and only the quoted tag keeps your line breaks. Best practicesWhy your agent never offers the credit you allowedMAY reads like spend authority but never says when, so the credit goes unused; write the case as a guarded MUST and the ceiling as an unguarded bound. Deep divesThere is only one supervisorEvery ‘the’ in a rule claims exactly one such thing exists; the checker flags the ones never introduced and proves uniqueness only where it holds. Best practicesBake-off: the rule in the prompt vs. the rule in the tool descriptionOne credit cap, two homes. Both compile. Then somebody appends a rule that breaks the cap, and one file refuses to build while the other raises its grade. Deep divesYour prompt cannot tell a missing input from a real oneDelete a $REQUIRE line and the build refuses; omit the same key from the host's bag and it builds clean, even to an artifact identical to a real answer. GuidesBuilding an agent-assist drafter, prompt-firstAn agent-assist drafter has two readers and one output, and no section scopes a rule to half of it; name what each rule bounds and the spec hits A (97). Best practicesYour coding agent writes the prompt nowNine checks for when an AI edits your prompt: hand it the compiler, not your notes, and gate on the artifact, which alone tells a fix from a deletion. Deep divesYour agent has two names‘You are Aria’ and ‘Your name is Dana’ never write to the same slot, so three names check clean; a @{you.name} pointer is the only test that answers. TeardownsTeardown: your agent has no team lead to askA new-hire handbook is perfect instruction for someone with a shift and a team lead; in an agent prompt, ‘ask your team lead’ points at a building. Best practicesRewrite: the sentence that repeals the rest of your prompt‘Use your best judgment’ is not vague, so nothing flags it repealing every rule above it; as a bounded MAY plus a guarded fallback, B (80) becomes A (94). Best practicesWhy your agent skips step oneA numbered procedure carries no order a checker can prove; only an explicit before or after link builds a timeline the next appended rule has to obey. GuidesHow to write what your agent says when the lookup failsMake the tool outcome a typed input and branch on it with $SWITCH ON, so the failure arm nobody wrote is a build error, not an invented depot delay. Deep divesOnce per what?The prompt is re-read each turn, so every rule is per turn and scope words are invisible to the prover: a cross-turn count belongs in a host-filled variable. Best practicesBake-off: tests in the prompt vs. a file beside itTwo ways to carry an agent's eval suite: inline $TEST blocks, or a sibling .test.tg. They tie on every number the toolchain prints, and then a typo, a rename and a directory build separate them. Deep divesYour bound is for the rule you have not written yetSwap a rule's number for the word it stood for and nothing you run today notices: a bound is a slot for the next edit, so write the rule you are afraid of. GuidesBuilding a proactive outage agent, prompt-firstAn outbound agent speaks first, so no $TEST compiles without a user turn: a six-sentence outage brief becomes a spec with two clocks the build refuses. Deep divesYou did not narrow that rule. You moved it.An adjective keeps a rule in the prover's reach, but a preposition, a recipient or an adverb moves it to a slot nothing can join, and the check stays green.8 min → Best practicesLegal has your prompt open in a tabNine checks to run before legal reads your agent prompt: hand over the built artifact and its hash, then fix the four rules a reviewer always finds.9 min → ReleasesTypeGlish 0.9.0: the deadline meets the duration0.9.0 makes ‘takes’ a frame: how long the work needs is typed time now, so a refund that takes 5 days collides with a rule promising it in 2 days.8 min → Best practicesRewrite: the rules that say usuallyA rule that says usually checks clean, and usually before a number takes it out of the solver: each adverb becomes a guarded rule or an honest MAY.8 min → TeardownsTeardown: your QA scorecard is not a system promptSeven rows of the quality rubric, pasted under a heading. The checker has seven things to say, none of them blocking, and the rows that read most like requirements are the ones it never saw.9 min → GuidesHow to make your agent ask one question at a timeA collection checklist dressed as a rule is why the agent interrogates: bound it to at most 1 question per reply, with a $TEST that counts question marks.7 min → Best practicesWhy your agent promises the refund instead of issuing itPolicy prose deletes the doer, so the agent narrates the refund instead of calling the tool: put a doer in every rule and D (54) becomes A (90).8 min → Best practicesBake-off: forbid the tool vs. never hand it overDeclare the refund tool and forbid it, or never declare it: the safer-looking option gives up the rule you can prove, so forbid the tool by pointer.8 min → Deep divesHalf your prompt arrives at runtimeThe platform writes half your prompt at runtime and a checker only proves the half it sees: name the seam with $REQUIRE section so citations are tracked.8 min → GuidesBuilding a cancellation-save agent, prompt-firstA retention brief compiled into a spec: the discount ceiling becomes a $SWITCH over plan, one offer becomes at most 1, and D (55) becomes A (93).9 min → Deep divesSoften a rule and it stops being gradedSoften MUST to SHOULD and the check never moves, because a soft rule is not marked down: it drops out of what gets measured, proofs and all.8 min → Best practicesNobody who wrote this prompt still works hereNine checks for day one with an inherited prompt: build before you read, because the artifact is what ships and every advisory is an unfinished decision.8 min → Deep divesYour prompt says it. The model picks one.Most agent rules name their object with a pronoun or a bare ‘the’, and the checker only advises: naming the object as a typed input is your job.7 min → Best practicesRewrite: the paragraph that lives in three promptsThree agent prompts share a house-rules paragraph by copy-paste. All three check clean, and the checker tells you exactly why that proves nothing: nothing co-checked.8 min → TeardownsTeardown: your escalation matrix is one long lineA routing table lifted out of the ops wiki and pasted under a heading. Sixteen warnings, nothing blocking, and a build artifact where the whole table is a single line.8 min → GuidesHow to get a structured wrap-up out of a support agentYour agent needs to end every contact with a parseable disposition. Write the JSON shape as ordinary prose and the build strips every quote mark out of it, then reports a clean check.7 min → Best practicesYou said only. Your agent escalated anyway.The word only reads like a closed door in a system prompt. TypeGlish can prove one narrow version of it, and a single MUST on the rule that breaks it turns two blocking errors into a clean check.8 min → Best practicesBake-off: a catch-all arm vs. one arm per memberTwo routers, same four reason codes, both clean at A (93/100). Add a fifth reason code and one of them blocks the build while the other silently routes a cancellation to a general queue.8 min → Deep divesYour prompt is a graph, not a listThree routing rules in three sections, no two of which conflict, fail together as logic/syllogism at F (72): delete any one and the file compiles.8 min → Deep divesDelete every test. The score does not move.Delete the $TEST cases one by one, then all six: check stays green, the grade holds at A (95), and the only signal is a coverage line nobody gates on.8 min → GuidesBuilding an identity-verification gate, prompt-firstAn impostor and the account holder type the same words, so verification becomes a typed input the runtime sets, with one $SWITCH arm per state.9 min → Best practicesSomebody wants the model bill smallerNine checks before a prompt moves to a cheaper model, because the swap changes nothing the model reads: you changed the reader and left the text alone.8 min → Deep divesYour agent is certain because you said soHalf a prompt's lines are claims, not rules, and the model cannot doubt them: two that clash are provable, but a lone capability claim ships as a premise.7 min → Best practicesRewrite: your bad example is a good exampleA prose counter-example ships the banned price to the model, quotes stripped, while $EXAMPLE holds the bad:: response out of the artifact, B (83) to A (92).7 min → TeardownsTeardown: Hi {first_name}, thanks for contacting usBare {braces} are prose, so a flow-builder export with five unfilled placeholders checks clean and ships them verbatim: the sigil is the declaration.8 min → Best practicesWhy your agent follows half a ruleA hard-wrapped rule is two statements: the tail ships as a stray noun phrase, its bound never enters the proof, and a real contradiction goes invisible.7 min → GuidesHow to write a procedure your agent follows in orderNumbered steps in a system prompt are not decoration. The checker binds them as a scope, gives each one an address, and refuses to compile a gap, a duplicate, or a reference to a step you deleted.8 min → Deep divesYour agent has never heard of a wallboardEvery contact centre runs on words the model has only guessed at. A prompt carries two glossaries, one for the compiler and one for the model, and only one of them reaches the artifact.7 min → Best practicesBake-off: if unsure vs. if a fact is missingGate a rule on a missing fact, never on the model's confidence: the fact-gated prompt wins A (93) to B (88) and takes deterministic asserts, not a judge.8 min → Deep divesYour headings decide which rules get checkedDelete # Role and persona prose turns into unenforceable rules, but delete # Constraints and a real finding vanishes while the grade climbs eight points.7 min → GuidesBuilding a ticket-triage agent, prompt-firstA router's contract is a closed set of queue names, so declare it with one of, mirror it as a typed $TOOL parameter, and bound the reply to one word.8 min → ReleasesTypeGlish 0.7.2: the checker takes your word for it0.7.2 adds $DEFINE word to teach the compiler your product nouns, then spends the rest of the release retiring findings that should never have fired.8 min → ReleasesTypeGlish 0.7.1: the embedded editor bootsA bare nspell import kept the typeglish/monaco worker from booting in a browser; 0.7.1 bundles it in, and nothing in the language or the checker moved.4 min → ReleasesTypeGlish 0.7.0: your prompts are one programFiles joined by $IMPORT now compose before the proofs run, so a NEVER in the policy file and a MUST in the agent importing it finally collide at edit time.8 min → Best practicesYou are about to add one more ruleEight checks before one more rule lands in a live prompt: the naive one-liner passes check and scores A (93) while promising a date the file forbids.9 min → Deep divesTwo rules, no words in commonMUST withhold and MUST display are one action at opposite poles, so two rules that share no vocabulary still block the build as logic/contradiction.7 min → TeardownsTeardown: the policy doc somebody pasted into your agentA pasted returns policy compiles clean, but the checker lists every noun the model has to guess; introduce each one and the file goes C (71) to A (95).7 min → Best practicesRewrite: two clocks on the same promiseTwo SLA promises on one rule are a logic/time-strength error: the looser bound only licenses missing the tighter, and the rewrite goes F (70) to A (99).6 min → Best practicesWhy your agent will read out your API keyA key in a prompt is published to every customer the agent talks to; security/leaked-secret blocks the build, and the value belongs in the host environment.7 min → GuidesHow to connect an agent tool to a real APIDeclare the host's tool with $IMPORT tool or define one with $TOOL bound to an HTTP request, and keep the base URL and auth header in one $SERVICE.8 min → Best practicesBake-off: deterministic asserts vs. an LLM judge for agent testsTwo test suites for the same support prompt: same cases, same intent, one written as asserts and one as prose a model grades. Both compile, both score A. Only one can fail without a model.7 min → Deep divesYour prompt has a second readerThe model reads the compiled artifact and the next engineer reads the source, so two files with the same artifact grade A (95) and B (83) on @@ notes alone.7 min → ReleasesTypeGlish 0.6.0: paste the prompt you already haveThe migration release: typeglish import writes checked .tg from the prompt you already run without changing a word, and the score card now splits by plane.8 min → GuidesBuilding a multilingual support agent, prompt-firstMake the locale a typed input, keep the few rules that vary by language in a $SWITCH, and a fourth language is a compile error, not a silent gap.8 min → Deep divesDelete a line. See who notices.Six of eleven one-line deletions from an airline prompt pass in silence, the agent's identity included: only a line something else points at fails the build.7 min → Best practicesYour agent said the wrong thing. Now what?Triage for the hour after an agent misbehaves: reproduce the transcript as a $TEST, run check --strict, confirm which prompt shipped, and edit last.8 min → Deep divesHalf your rules are about somebody elseDrift between You MUST and the agent MUST writes two rule sets no prover compares, so a contradiction hides behind an A (95); give every rule one subject.7 min → TeardownsTeardown: the system prompt an AI wrote for youA model-drafted prompt's em-dash and emoji are not cosmetic: they stop the checker short of the real bug, two length rules that cannot both hold.7 min → Best practicesRewrite: a brand voice that cancels itself outTone adjectives are claims on axes: professional beside casual is a proven contradiction, and one value per axis takes the section from F (48) to A (92).7 min → GuidesHow to turn parts of your system prompt on and offOne prompt, many channels: a when= guard on a # heading is inert and always ships, so guard a tag section and build both ways to prove the block drops.6 min → Best practicesWhy your agent approves refunds it shouldn'tA refund limit set twice at two amounts lets the model pick one per conversation: state the cap once as a fact and let logic/measure block a second.6 min → ReleasesTypeGlish 0.5.0: the language server shipsRun typeglish lsp and the squiggle in any LSP editor is the same verdict CI blocks on, with hover, completion, and rename served by one engine.4 min → Deep divesYour system prompt is an API contractEvery @{input}, @[tool], and $REQUIRE in a prompt is a clause in a contract with the runtime. Treat the system prompt like an interface and the compiler enforces it.6 min → Best practicesBake-off: typed inputs vs. free-text for tier-gated rulesTwo agent prompts gate behavior by tier. Both compile, both score B. Then someone fat-fingers a tier value, and only the typed input turns the typo into a failed build.6 min → GuidesHow to keep your AI support agent on topicAgents answer off-topic questions because a prompt with no scope has an open default. Declare what the agent covers with an allowlist, and give the off-topic case a real action.7 min → GuidesBuilding a refund agent, prompt-firstA refund agent is a set of rules about what it may settle on its own and what it must hand up. From a one-line brief to a spec the checker passes.7 min → ReleasesTypeGlish 0.3.0: the function-word floorThe small words now paint: every and each read as the universal, so 'Every refund is approved' and 'No refund is approved' provably conflict.5 min → Best practicesWhy your agent gets the time zone wrong'Open until 6pm' is half a fact: with no zone the model guesses one per run, wrong for customers elsewhere, so make the zone a variable the caller passes.6 min → Deep divesSay it once, or say it's optionalRepeating a rule more gently doesn't reinforce it, it weakens it. Why a soft restatement reads as 'not always', and how the checker proves the strength conflict.6 min → ReleasesTypeGlish 0.2.3: possessives that chainSarah's manager's email now resolves one owner at a time, inlined with @{sarah.manager.email}, and %account manager% binds as one entity that can own.5 min → TeardownsTeardown: a voice agent system prompt, line by lineA production voice-agent prompt, torn down line by line: the emoji the phone can't speak, two length rules that can't both hold, and a hedged escalation - every defect a real compiler error.7 min → Best practicesThe pre-launch checklist for a contact-center agentSeven launch gates, each a command, not an opinion: compile clean, clear score --min B, point a rule at every tool, scope escalation, and test the sad paths.8 min → Deep divesYour system prompt has a compile timeEvery system prompt has two planes: the runtime prose the model reads, and compile-time scaffolding it never sees. TypeGlish makes the boundary real and catches the line that leaks across it.6 min → Deep divesThe arithmetic in your promptEvery number in a system prompt is a constraint a solver can check. TypeGlish proves when two length or count limits can't both hold, with logic/numeric, instead of letting the model quietly pick one.6 min → Deep divesWe pulled a good prompt apart, one rule at a timePull the data-breach guard from an A-grade prompt and the score does not move: it measures checkability, not importance, so pin what matters with $TEST.7 min → GuidesHow to write escalation rules for an AI support agent'When appropriate' is not a trigger: make the handoff a tool call, scope each WHEN so rules cannot collide, tier severity with $IF, and pin it with $TEST.7 min → Best practicesRewrite: a bloated support prompt, cut to rules that checkA support prompt that reads perfectly can still score a D. The same prompt, rewritten as measurable rules the checker can hold you to, goes from D (54) to B (89). Here is the rewrite, line by line.7 min → Best practicesWhy your agent won't use the tool you gave itA $TOOL no rule points at is furniture: the checker flags it as structure/unused-tool, and one WHEN rule that calls @[lookup_order] is the whole fix.6 min → ReleasesTypeGlish 0.2.2: 'the' names an object, and the docs go live'The shop is a bakery' binds shop as an object @{shop} can point at: references stop fighting your prose, and the full docs land at typeglish.dev/docs.5 min → GuidesBuilding an appointment-booking agent, prompt-firstFrom a one-line brief to a spec the checker passes: name the rules, wire the tool, and pin the behavior with a $TEST so the next edit can't quietly break it.8 min → Best practicesBake-off: prose conditionals vs $SWITCH for multichannel agentsTwo prompts, one per-channel behavior across voice, chat, and email. Both compile today. Then someone adds SMS, and only one of them refuses to build.6 min → ReleasesTypeGlish 0.2.1: the playground ships to productionA patch about reach, not language: the browser playground gets its production deploy config, so the same checker the CLI runs is one URL away.3 min → ReleasesTypeGlish 0.1.0: the first releaseWhat 0.1.0 ships: a Z3-backed checker that refuses to compile a proven contradiction, a prompt that carries its own eval suite, typed $CONFIG, and a CLI.7 min → Best practicesSay what you mean: eight prompting rules that survive productionEight prompting best practices we keep re-learning from compiler errors - what English lets you get away with, and production doesn't.9 min → TeardownsTeardown: a support agent’s system prompt, line by lineA real 1,400-word support prompt with four silent contradictions, one buried rule, and a persona doing the work of a policy - torn down and rebuilt.7 min → Deep divesFew-shot examples are a type system you haven’t written downYour examples define a schema whether you meant to or not. Inconsistent shots are type errors the model resolves silently.6 min → GuidesWhere the rules go: a field guide to instruction placementTop, bottom, system, or user turn - placement changes compliance more than wording does. A map of what goes where.5 min → Deep divesYour prompt argues with itselfPrompts accumulate rules the way old codebases accumulate flags. The three kinds of contradiction, and how models pick a winner without telling you.6 min →