Skip to content
AI

Working with AI agents: specs, constraints and checks

How to get dependable work from AI coding and design agents: write the spec first, limit the options, keep changes small and verify everything.

Cover for the article: Working with AI agents: specs, constraints and checks

AI agents can now research, write, design and code at remarkable speed. The output is only as good as the brief. Give an agent a vague request and it will fill every gap with its own assumptions; give it a clear spec and firm limits and it becomes a dependable member of the team.

Write the spec before the prompt

The usual pattern is prompt, code, fix, prompt again, fix again. Spec-driven development reverses it. GitHub’s open-source Spec Kit popularised a simple sequence: specify what you want, clarify open questions, plan the technical approach, break the plan into tasks, implement one task at a time and verify each against the spec. It feels slower for the first hour and saves days afterwards.

Four working rules

Andrej Karpathy has described how coding models make wrong assumptions on a user’s behalf and keep going without checking. Developers turned those observations into a short, widely shared rules file for coding agents. The four rules are worth adopting for any agent:

  1. Think before acting. State assumptions and ask when something is unclear.
  2. Keep it simple. Do what was asked, no more.
  3. Make surgical changes. Touch only the lines that need to change.
  4. Do not stop until the goal is verified. Test the result, not just the code.

Constraints create style

Ask an AI to design a website with no limits and you get every effect at once: the same purple gradient, the same glowing shapes, the same three cards in a row that thousands of other AI-made sites use. The fix is restraint. Decide the system first: two typefaces, three colours, one kind of motion, one hero moment per page. Give the agent references and design rules, then let it work inside them. Freedom produces noise; constraints produce a recognisable style.

This site follows that approach. The palette is a midnight navy base, teal for anything you can press, violet for depth and gold for highlights; the type is one display face and one text face; every animation has a job.

Write prompts like a technical manual

Aerospace manuals use a controlled language called Simplified Technical English (ASD-STE100): short sentences, one meaning per word, active voice, one instruction per sentence. Writing prompts the same way removes ambiguity. ‘Make it better’ becomes ‘Reduce the heading size to 32 pixels. Keep the colours. Do not change the layout.’

Keep context lean

Agents re-read a lot of material in each session, which costs time and tokens. Tools that build a map of a codebase or knowledge base once, then let the agent query the map, can cut that dramatically. Even without tools, a short rules file and a clear folder structure help an agent find what it needs.

A person still owns quality

AI can be a brilliant pair of hands and still have poor taste. Review the output, test it on real devices and with real data, and decide what ships. Speed is the agent’s contribution; judgement and accountability stay with the person whose name is on the work.

Framework

Spec-driven building

  1. SpecifyWhat it should do, for whom, and what done looks like
  2. ClarifyQuestions the agent must ask before building
  3. PlanThe technical approach and the files it will touch
  4. TasksSmall steps that can be checked one at a time
  5. ImplementBuild one task, then stop
  6. VerifyTest against the spec before moving on

Checklist

Put it to work

0 of 7

Quick quiz

Check what stuck

  1. In spec-driven development, coding starts…

  2. Why limit fonts and colours for an AI designer?

  3. Who should own the final quality check?

Recap cards

Tap a card to check yourself.

Sources and credits

Sarang

Business analyst and co-founder with e-commerce, marketing and operations experience since 2021. I co-founded three e-commerce businesses, including Earra, and I design and build products and websites end to end.

Read my story

Cookie settings

Choose which optional cookies this site may use. Essential ones stay on because the site cannot work without them.

Under UK GDPR you can ask what personal data is held about you, and have it corrected or deleted. Make a privacy request