Learning HubApplied PracticeAI Coding Workflow 101

Module 12 · Applied Practice

AI Coding Workflow 101

AI makes code faster only for teams with a disciplined workflow. Everyone else ends up debugging confident mistakes.

Overview

AI makes code faster only for teams with a disciplined workflow. Everyone else ends up debugging confident mistakes. This module describes the workflow that produces reliable AI-assisted code, and it is a loop, not a single prompt. Context comes first. A plan comes before code. Code arrives in small, reviewable steps. Review uses both human judgment and AI-assisted tools. Tests are written alongside the change, and debugging produces an explanation before it produces a fix. The tools change every quarter; the method is what survives.

Each stage has a concrete practice. Context rules go first: a README plus an AGENTS.md or CLAUDE.md file brief the model on scope, style, and constraints, curated and short. Asking for a plan and approving it before implementation is cheaper than fixing a pile of generated code. Four lightweight roles help structure the work: Planner, Implementer, Tester, and Explainer, with split prompts and summaries between steps to keep context clean. AI-assisted pull request review catches issues a tired reviewer misses, provided comments are triaged into must-fix, worth-considering, and noise. Asking for tests at the same time as the code has a diagnostic side effect: if the test does not make sense, the code is probably unclear.

After this module you will also know the recovery moves. Debugging needs the error, the function, the surrounding code, and expected versus actual behavior. Two failed attempts is the signal to start a fresh chat with better context rather than continuing a degraded session.

The failure modes are cultural as much as technical: accepting plausible-looking code without reading it, letting a long chat drift, treating the AI as a search engine rather than a collaborator, and over-reliance that dulls your own instincts. Require AI-generated code to pass the same review, test, and security gates as human code, and reserve architectural decisions, cryptographic logic, and data migrations for human authorship.

In one paragraph

The workflow that produces reliable AI-assisted code is a loop, not a single prompt. Context comes first: project background, rules, relevant files. A plan comes before code. Code is generated in small, reviewable steps. Review happens with both human and AI-assisted tools. Tests are written alongside the change, not later. Debugging produces an explanation before it produces a fix. The loop repeats until the change is solid. The tools change every quarter. The method is what survives.

Key ideas

  • 01

    Context rules go first. A README and an AGENTS.md or CLAUDE.md file brief the model on scope, style, and constraints. More context than you think you need, curated and short.

  • 02

    Plan before code. Ask for a plan, approve it, then ask for implementation one step at a time. Fixing a plan is cheaper than fixing a pile of code.

  • 03

    Four lightweight roles help: Planner, Implementer, Tester, Explainer. Split prompts rather than asking for everything at once. Summarize between steps to keep context clean.

  • 04

    AI-assisted pull request review tools catch issues that a tired reviewer misses. Treat comments as must-fix, worth-considering, or noise.

  • 05

    Ask for tests at the same time as the code. If the test does not make sense, the code is probably unclear. Regression tests prove the bug is fixed.

  • 06

    Debugging requires the error, the function, surrounding code, expected versus actual behavior. Two failed attempts is a signal to start a fresh chat with better context.

  • 07

    Common failure modes are context drift in long chats, wrong library version, off-rails debugging loops, code quality drift, and over-reliance that dulls your own instincts.

How a senior leader uses this

  • Ask engineering managers for the team's AI coding policy. If there isn't one, the velocity gains will not last.

  • Require AI-generated code to pass the same review, test, and security gates as human-written code.

  • Reserve architectural decisions, cryptographic logic, and data migrations for human authorship.

Common failure modes

  • Accepting plausible-looking code without reading it.

  • Letting a long chat session degrade and ignoring the signal to reset.

  • Treating the AI as a search engine rather than a collaborator.

Further reading

Original source: AI Coding Workflow 101 on The System Design Newsletter by Neo Kim and collaborators
Shahzad Asghar

Why I wrote this track

Shahzad Asghar, CISSP, CISM · Written in a personal capacity

This is the workflow I use when AI writes code with me: context first, a plan before code, small steps, review and tests together. It is the only way I have found to ship AI-assisted work that survives an audit.

I have spent more than twenty years building data and AI systems in international development and humanitarian organisations, including over a decade in United Nations agencies: leading a data analysis group whose systems served more than 700,000 refugees, then heading data and digital solutions for a regional commission, with earlier work at UNICEF, UNOCHA and CIDA. I hold the CISSP and CISM security certifications. What I publish here is what I wish someone had handed me before my first AI project. If you work through it and want to compare notes on your own situation, I am happy to connect and discuss.