Golden Rules for Agentic Engineering

Indrajeet Patil

Boost productivity without compromising quality

Source code for these slides can be found on GitHub. All illustrations in this presentation are AI-generated.

Before we start

Audience

You ship production software

Tests, deployment, security, and maintenance matter.

Exception

Throwaway code

Relax engineering rigour for disposable code; retain safeguards for real data and real actions.

Caveat

No panacea

These are principles that sharpen judgement, not a magic recipe.

On the risks of real actions, see The lethal trifecta for AI agents (Willison) and Excessive agency (OWASP).

Golden rules

01

Measure the whole job

02

DevEx = AgentEx

03

Define done before delegating

04

Scope control

05

Bound the blast radius

06

Guardrails

07

Session hygiene

08

Know thy tools

09

Meta-automation

10

Be curious. Be humble. Be kind.

01 Measure the whole job

Choose the simplest approach that improves time to an accepted result.

Two-panel illustration: choose among a direct human edit, a script or existing tool, and an agent, starting with a real pain point. Preparation, generation, verification, and review all contribute to time to an accepted result. Also track review effort, defects, and maintenance burden, and keep the approach that improves the whole job.

Simplest-solution principle: Building effective agents (Anthropic). The whole-job measures are practical recommendations for coding work.

02 DevEx = AgentEx

If humans hunt for context, agents burn tokens too.

Editorial infographic: a human and a coding agent connect to the same well-designed codebase. Five panels identify clear structure (folders, names, boundaries), one-command workflows (setup, format, lint, test), deterministic QA (formatters, linters, types, tests), living documentation (README, conventions, examples), and modular design (small units, clear interfaces). Shared outcomes are speed, quality, and trust.

DevEx = AgentEx: in practice

One setup command. The same starting point for humans and agents.

Two-panel illustration: on the left, a detailed ten-step project setup checklist leaves both a human developer and a coding agent confused. On the right, AGENTS.md contains a single instruction, run make setup, and the same human and agent are happy. The command encapsulates the setup procedure behind one shared entry point.

See the AGENTS.md convention.

03 Define done before delegating

State the outcome, what must stay unchanged, and the evidence that will show it works.

Three-panel illustration: a human gives a robot a brief containing the goal, constraints, and what stays unchanged; evidence is chosen to fit the task, reproducing and fixing a bug, inspecting a UI interaction, or measuring performance; a human and robot compare tests with requirements because both can share the same mistake. Agree the criteria, verify against them, and review the evidence.

On specifying success and grading outcomes rather than paths, see Demystifying evals for AI agents (Anthropic).

Define done before delegating: in practice

Bug fix

Reproduce the failure. Show the same case succeeding after the fix, and check relevant unchanged behaviour.

UI change

Inspect the rendered interaction, including relevant keyboard and responsive states. A build alone cannot show this.

Performance

Measure before and after under comparable conditions. State the workload and trade-offs.

Check the meaning of the tests. Implementation and assertions can agree with each other while missing the requirement.

Bug and UI checks adapted from Claude Code best practices (Anthropic).

04 Scope control

Small diffs beat heroic prompts.

Two-panel illustration: an enormous prompt covering onboarding, billing, analytics, search, SSO, and migrations produces a large diff that is hard to review and reverse. Five small steps, API change, UI update, tests, docs, and deployment configuration, each have a small diff and commit. One concern at a time makes changes reviewable and reversible, with fast feedback. Small diffs beat heroic prompts.

Scope control: in practice

Why

Agents can produce changes faster than reviewers can assess them. Keep each change within review capacity.

How

Prefer narrow tasks: one bug, one refactor, one test gap, one migration step. Each chunk should be reviewable, testable, and revertible on its own.

When the agent discovers broader issues, capture them as follow-up tasks instead of expanding the current change indefinitely.

See Small CLs (Google Engineering Practices).

05 Bound the blast radius

Limit what the agent can read, change, and execute; agree which actions need approval.

Three-panel illustration: an agent works within enforced read, change, and execute permissions while credentials are protected; retrieved content stays separate from authorised instructions; a human approval checkpoint precedes deploying, sending, and deleting. Worktrees isolate edits, while sandboxes restrict actions.

Bound the blast radius: in practice

Access

Allow only the files, tools, network access, and credentials needed for the task. Enforce the limits outside the prompt.

Authority

Treat retrieved content as data. It cannot grant permissions or override authorised instructions.

Approval

Agree the actions that need approval, and place the checkpoint before their real effects.

Worktrees isolate edits; they do not contain actions. Use a sandbox with enforced access limits.

06 Guardrails

Fast feedback beats orchestration.

Two-panel illustration contrasting a confused robot amid inconsistent style, flaky tests, broken assumptions, hallucinated APIs, and failed builds with a calm robot in a safety harness labelled Formatter, Linter, Type checker, Pre-commit, CI, Sanitisers, and Valgrind. Output cards show consistent style and configured gates passing for tests, types, and builds. Human review is still needed to assess requirements, behaviour, and user experience. A change flows through checks to human review; passing gates is evidence for review.

Guardrails: in practice

Guardrails workflow: the agent proposes a change, then deterministic checks run. On failure, precise error output returns to the agent for another attempt. On success, the change proceeds to human review, then merge.

The harness

Formatters, linters, type checkers, behaviour-focused tests, Git hooks, and security scans

One command

make qa checks the agreed gates, and CI runs the same gates. Review checks whether we solved the right problem.

Agents optimise for green

Never weaken a check merely to get there. Repairing a wrong gate is deliberate, reviewed work.

See also Harness engineering for coding agent users (Böckeler, martinfowler.com).

07 Session hygiene

Coherent context beats haunted context.

Three-panel illustration: a robot keeps useful context for task A and a related follow-up in the same coherent session, with one task as the default and a reset when confused; parallel tasks A and B run in separate Git worktrees from the same repository; durable conventions, decisions, and lessons move from chat history into AGENTS.md, which a new session consults. A compact handoff contains the goal, constraints, relevant files, ruled-out approaches, and acceptance checks.

08 Know thy tools

Sometimes the unlock is a hidden tool affordance.

Example affordances that users miss: Claude Code voice dictation turns a spoken prompt into terminal input with /voice; Codex generates and edits visual assets; GitHub Copilot CLI computer use operates GUI-only desktop apps with /computer on. An ellipsis indicates more examples, and the footer encourages reading the changelog to discover what the tools can do.

09 Meta-automation

Automate repeated agent choreography.

Meta-automation infographic: repeated work is captured once, run many times, and reviewed. Four mechanisms are compared: a prompt for changing instructions, a skill for domain know-how, a slash command for a stable shortcut, and a workflow for steps and branches. A loop processes an input list, runs automation for each item, collects results, and ends with human review.

Meta-automation: in practice

Prompts, skills, shortcuts, and workflows turn repeated work into reusable automation.

Four concrete automation examples. Prompt: update-deps.md instructs an agent to refresh dependencies, fix compatibility breaks, run QA, and prepare a draft PR. Skill: frontend-pr-screenshot packages how to preview the app, capture a screenshot, and attach it to a PR. Slash command: an illustrative /address-review shortcut invokes a saved prompt to read review threads, make warranted fixes, and reply. Workflow: vulnerability management goes from scan to triage, then asks whether a finding is worth fixing. Yes leads to fix, verify, and draft PR; no leads to recording the reason. Humans review evidence and decide what ships.

Examples adapted from chatbot-template prompts and its PR screenshot skill.

10 Be curious. Be humble. Be kind.

AI is not an excuse to become incompetent or disagreeable.

Four-panel editorial illustration: be curious, with a developer experimenting alongside a robot; avoid deskilling, with a disengaged developer leaving the robot unattended; be humble and kind, with a team listening and discussing shared notes; avoid grandiosity, with an engineer, product manager, and designer dismissing one another while pointing to their own assistants.

Be curious. Be humble. Be kind: in practice

Curious

Experiment, prototype, and keep learning the fundamentals the agent is standing on.

Humble

Agents are confidently wrong. So are we. Verify before you trust, including your own prompt.

Kind

Review agent-generated work as carefully as human work, and review humans as kindly as ever.

AI does not remove responsibility. You still own the design, the code, the tests, the security implications, and the communication with your team.

Making it stick

Code generation is the easy part

Everything around it needs planning, especially in teams.

Share

Pool your team’s tips and tricks for agentic coding. Someone has already solved your annoyance.

Fix pain points

Pick a real pain point (slow tests, unclear setup, flaky workflows). Use the simplest effective approach, and measure the whole job.

Frontload planning

Task division, coordination, and reviewability matter more when everyone has an agent.

Challenge your habits

Revisit your workflow as tools change. Keep changes that improve the outcome.

Simplest-solution principle: Building effective agents (Anthropic).

Further reading

Thank You

Go forth and delegate responsibly.


Check out my other slide decks on software development best practices