How To Define Business Rules For Your Agents

A practical tutorial for making coding agents useful in real repositories. We build a small agent harness around one realistic billing bug: repo instructions, task-specific skills, markdown memory, MCP tools, and verification commands. The point is to move repeated project knowledge into files and tools the agent can actually follow. In the walkthrough: Write concrete repo rules in AGENTS.md Create task skills with SKILL.md Store project decisions in markdown memory Use MCP for current docs, GitHub issues, Figma context, and safe app actions Define exact tests, typechecks, and final reporting rules Fix a billing bug where the code uses user_id instead of account_id If your agent keeps making the same mistake, do not keep re-explaining it in chat. Turn the repeated instruction into a repo rule, a skill, a memory note, or a safe tool boundary.