
AI Prompting Is About Practicing Contractual (Not Conversational) Language
Author
John O'Brien
Date Published
AI Prompting Is About Practicing Contractual (Not Conversational) Language
When I was a kid I wanted to become a lawyer. Now, that’s not the most exciting thing a kid has ever wanted to be. It also wasn’t my first imagined dream profession. My very first thing I wanted to be was a paleontologist, as I had an early fascination with dinosaurs. In hindisght, that fascination probably wasn’t so unique.
Recently I remembered that, after my first nascent childhood dreams of khaki vests and desert fedoras, my next, and probably more realistic desire, was to become a lawyer. This was my first intuition about what kind of adult career would suit my natural proclivities. Instead, life took me in many different directions, and while I never became a lawyer, becoming a software developer often feels very law-adjacent.
This is true for how I feel about raw software code, but it’s also how I feel even more about AI prompting and markdown files.
The AI industry continues to put forth the narrative that their AI models are sentient, animate life. While this might be a great pitch to get more investor buy-in, it’s not true. AI models are software, software is an abstraction over machine language, machine language manipulates hardware to store state and do computations with it, and computers are inanimate objects. AI is no different.
At the beginning, though, while I was rushing to gain an understanding of how exactly the underlying inference mechanics of AI (Large Language Models) work, I didn’t know exactly what the best method to prompt them would be. The initial examples put forward by AI companies that informed people’s first instincts were to be conversational with the agents, like you would be with a person. This was at the time, and continues to be, a marketing ploy, and a strategy to get people hooked on talking with the chatbot machines (which in essence is really just giving people a transistor-based mirror to talk to themselves in). All of this done in the name of profit, I was still unsure if it wasn’t true that using conversational language—idioms, emotional appeals, personal identification—was the best way to get the best results from the models. When people didn’t get the right results from models, they would try to imbue it with a psychological profile, “You are THE BEST software developer in the whole world.” I’ll be honest, I really didn’t know if this was actually necessary to best leverage the technology. A lot of AI models, especially in the beginning, were entirely general. Only over time have they become more niche and specialized for things like software.
However, eventually, after learning enough about how probabilistic inference works, while it’s still extremely impressive and nothing I could be, it is in the same species of autocomplete. I think about it like an autocomplete for the sake of simplicity, although I’ll readily admit it does a bit more than just pure autocompletion. In the realm of coding, inference does produce interesting decision trees when you prompt it correctly, and what I mean by “correctly”, I’ll now detail.
There’s a small but important jump to make when prompting AI. To best leverage AI as a tool, your language must not be conversational, but contractual. That’s not to say that your language can’t be conversational at all, but rather to say that it’s not necessary to be conversational. It must, however, be contractual. When everything in a prompt is done in legalistic clauses and recommendations for inference preferring certain choices and outcomes over others, you will begin to see the best results from your AI sessions.
And to those who may be thinking it, no, this is not an invitation to be rude. It’s an invitation to be legally-minded.
To illustrate, let’s take try an example. Pretend you’re a software developer. You have a request to make the background of a website red, when it’s now blue. Here are two versions of that prompt:
Conversational: “You are a frontend web developer and you always like to do everything perfectly the first time. You need to update the background color of the website from red, to blue. I’ve included the two colors. Let me know if you have any questions and I’ll try to answer. You really don’t need to spend too much time on this, it should be a really simple change.”
Contractual: “Find the HTML element that’s used as the background of all webpages across the website and change it from the red color to the included blue color.”
Now, this is possibly the simplest example I can construct. All it indicates is a difference, not in prompt style in regards to literary content, but in format altogether. One is a casual conversation, the other is a dictate. To quickly cover, the reason why the second is better than the first is that, in regards to AI technology, the first prompt will certainly cause more tokens to be spent just to ascertain the exact goal of the task being described. It also has other commands that seek to influence the model like its an animate being with personal choice and a self-concept, and that this will have any significant effect on the outcome. It may seem almost brutally simple, but the second prompt is superior not only because it’s shorter and more to the point, but also because it a) describes the goal, but also b) gives instruction on exactly what to do to complete the goal. If you think about AI as a cousin of autocomplete, it has a forward motion that, once unleashed, is meant to make decisions on its own to get to some outcome that seems to coincide with any or all of the goals included in the ask. While we could call this language simply declarative, the next example might help elucidate more why it’s a little better to always use the one term “contractual” when evaluating the veracity of your prompts.
Markdown AI files can be written by people, but AI companies recommend that they be actually written by the AI after being prompted with the goals that the markdown aims to achieve. These markdown files can many times be referred to as “Skills” or “Rules”. Markdown files are, in essence, longform pre-written prompts that can be reused to influence and harness (see: direct) an AI’s behavior. When you allow AI to write your markdown files, you’ll find that the language the AI’s use to codify their own instructions and behavior is expressed in a style and format that will lead to the most reliably useful outcomes across chats and workflows, and that style and format is contractual.
This is a much longer example, but it’s best posted in its entirety to help fully illustrate the point. I asked Cursor, using Grok 4.7, to create a mock Skill (research what a Skill is if so far unfamiliar) for choosing a best Javascript array sort method. This is what it returned:
1---2name: sort-javascript-array3description: >-4 Choose the right way to sort a JavaScript array. Use when sorting arrays,5 writing a compare function, deciding between sort and toSorted, ordering6 numbers, strings, dates, or objects, or when the user asks which sort to use.7---89# Sort a JavaScript array1011Pick one method. Do not invent a custom sort algorithm unless a rule below says to.1213## Decision14151. **Must keep the original array?** Use `toSorted`. Otherwise use `sort`.162. **What are the elements?** Follow the matching row. Always pass a compare function unless the row says the default is correct.1718| Elements | Compare |19|----------|---------|20| Numbers | `(a, b) => a - b` (ascending). `NaN` sorts to the end: treat non-finite values before subtracting. |21| Strings the user will read | `(a, b) => a.localeCompare(b)` with an explicit locale when the audience is known. |22| Strings compared as codes (ids, enum keys) | `(a, b) => (a < b ? -1 : a > b ? 1 : 0)`. Default `sort()` is only correct for ASCII strings that should order by UTF-16 code units. |23| Dates | Compare `getTime()` (or numeric timestamps). Do not subtract Date objects through string coercion. |24| Objects, one key | Compare that key with the rule for its type. |25| Objects, several keys | Compare keys in priority order; return on the first non-zero result. |26| Mixed or unknown types | Normalize to one type first, then sort. Do not rely on default coercion. |27283. **Order.** Ascending is the compare above. Descending is the same function with arguments swapped, or a negated numeric result. Do not negate a `localeCompare` result that can be non-`1` magnitudes; swap arguments or pass `{ numeric: true }` options and reverse the array only when every comparison is symmetric.29304. **Already sorted, or only one insert?** Do not re-sort the whole array. Binary-search the insertion index.31325. **Huge array of small integers in a tight range?** A counting sort can beat comparison sort. Say so and still default to `sort` unless the user asked for that case.3334`Array.prototype.sort` and `toSorted` are stable. Equal elements keep their original order, so a tie-breaker is only needed when the existing order is not the one you want.3536## Output3738State the choice in one sentence (method, mutate or copy, compare rule), then the code.3940```js41const byScoreDesc = (a, b) => b.score - a.score || a.name.localeCompare(b.name)42const ranked = players.toSorted(byScoreDesc)43```4445Copy when the array is state, a prop, or reused later. Mutate only when the caller owns the array and wants it replaced in place.46
Even if you only read some of the language, notice what kind of language is being chosen by the AI here to best direct itself. It is not casual, conversational language that someone might have with another living being. It is a pure contract. What do contracts do? They do many things, but like the lawyer Alan Sapinsley in The Sopranos says to Tony Soprano when Tony tries to get his mortgage deposit refunded to him by Alan, “That’s what contracts are for, to hold parties to agreements.” If there is anything about AI that is anthropomorphic like a person, it’s that it benefits greatly from being given strict definitions for what decisions are permissible to make given a subject or situation. Life itself often feels ambiguous. The purpose of contracts is to anticipate, enter into, and then resolve those ambiguities in concrete ways. They’re also to create agreements, so that all parties involved can come to a common understanding what should and/or will happen in a given scenario. This is the way to get the best results out of your AI sessions, whether that’s prompting, or building markdown files for workflows or otherwise.
Practicing this kind of language can feel awkward at first, and that’s okay. Law is referred to as a “practice”. It’s a change of mindset, but it’s one that pays dividends when trying to coax reliably useful results from Large Language Models.