[FULL WORKSHOP] AI Coding For Real Engineers - Matt Pocock, AI Hero (@mattpocockuk )
A workshop on building a complete AI-assisted development workflow, covering how to translate ambiguous requirements into agent-ready plans and run autonomous coding agents to ship production-ready features.
The core thesis of AI-assisted development is that fundamental software engineering principles, crucial for collaborating with humans, are equally effective when working with AI. The key is to adapt our workflows to the unique constraints of Large Language Models (LLMs).
Understanding LLM Constraints
LLMs operate within two distinct zones, a concept introduced by Dex Hy of Human Layer:
- The Smart Zone: When an LLM context window is relatively empty (e.g., under 100k tokens), it performs at its peak. The attention mechanism isn’t strained, leading to high-quality, intelligent work.
- The Dumb Zone: As the context window fills up, the model’s performance degrades quadratically. It becomes “dumber,” making simple mistakes and losing track of the overall goal.
This necessitates sizing tasks to fit within the smart zone.
Furthermore, LLMs are like the protagonist from Memento; they have no long-term memory. Each time you clear the context, the session resets to the initial system prompt. While “compacting” a conversation into a summary is an option, it’s often better to embrace this statelessness. A workflow optimized for clearing context and starting fresh for each discrete task is more reliable and predictable.
The Workflow: From Ambiguous Idea to Implemented Feature
A structured, human-led planning phase is essential before handing off implementation to an autonomous agent. This process can be thought of as a “day shift” for humans and a “night shift” for the AI.
1. The “Grill Me” Skill: Achieving Shared Understanding
Instead of jumping directly into a plan, the first step is to align with the AI on the core requirements. This is done using a simple but powerful skill called “grill me”.
- Process: You provide the AI with a vague initial brief (e.g., a Slack message asking for “gamification”). The AI’s goal is not to produce a plan, but to “interview you relentlessly” about every aspect of the feature. It asks clarifying questions one by one, providing its own recommended answers.
- Goal: The objective is to establish a shared design concept. This back-and-forth conversation resolves ambiguities and uncovers edge cases (e.g., “Should points be awarded retroactively?”) that were not in the original brief. The resulting conversation history is a valuable asset that captures the aligned understanding between the human and the AI.
2. The PRD: Documenting the Destination
Once alignment is reached, the conversation is summarized into a Product Requirements Document (PRD).
- Function: The PRD serves as the “destination document.” It outlines the problem statement, the proposed solution, user stories, and key implementation and testing decisions.
- Human Review: It’s not necessary to meticulously review the PRD for summarization accuracy. Since you and the AI have already achieved a shared understanding during the grilling session, you can trust the LLM’s ability to summarize that shared concept. The primary purpose is to create a formal asset for the AI to work from.
3. The Kanban Board: Slicing the Journey with “Tracer Bullets”
With a clear destination, the next step is to plan the journey. Instead of a linear, multi-phase plan, the PRD is broken down into a Kanban board of independently grabbable issues. This is where the concept of vertical slices, or “tracer bullets,” becomes critical.
AI loves to code horizontally—building all the database models first, then all the API endpoints, then the UI. This is inefficient because you don’t get feedback on the integrated system until the very end.
- Vertical Slices: A tracer bullet is a thin slice of functionality that cuts across all layers of the stack (database, service layer, UI). The first task should deliver a minimal but complete end-to-end feature.
- Benefits: This approach provides immediate feedback, ensuring all layers of the system work together. It creates a visible, testable foundation that the AI can then iteratively add to in subsequent tasks. This structure also allows for parallelization, where multiple agents can pick up non-dependent tasks simultaneously.
4. Autonomous Implementation: The AFK Agent
With a well-defined Kanban board of vertical slices, the human can step back. The implementation phase is an Away-From-Keyboard (AFK) task for an autonomous agent.
- The Loop: An agent (often called a “Ralph” loop) is initiated. It analyzes the backlog of issues, selects the next available task based on priority, and begins implementation.
- Test-Driven Development (TDD): TDD is essential for agent success. By forcing the agent to follow a “red-green-refactor” cycle (write a failing test, write the code to make it pass, then refactor), you get several benefits:
- It adds valuable tests to the codebase.
- It makes it much harder for the AI to “cheat” by writing tests that trivially pass.
- It provides a tight, reliable feedback loop for the agent to validate its own work.
5. The Human’s Role: QA and Codebase Architecture
The human’s role shifts from writing code to architecting the system and performing high-level quality assurance.
- QA as Taste: The QA process is not just about finding bugs. It’s where the developer imposes their taste and opinions onto the codebase. Without this human touch, you risk producing functional but soulless “slop.” Findings from the QA session feed back into the Kanban board as new issues or bugs.
- Designing Agent-Friendly Codebases: The quality of an agent’s output is capped by the quality of the codebase it works in. A poorly structured codebase will produce poor results. The goal is to build a system with deep modules.
- Shallow Modules: Many small files with complex interdependencies. They are hard for an AI to navigate and difficult to test effectively.
- Deep Modules: Modules with a simple, well-defined public interface that encapsulates a large amount of internal complexity. These are easy to test from the outside and provide clear boundaries for the AI to work within.
- The Gray Box Abstraction: By focusing on designing the interfaces of these deep modules, developers can delegate the internal implementation details to the AI. This allows you to maintain a high-level understanding and architectural control of the codebase without needing to know every line of code, thus preserving sanity while moving quickly. You can use a skill like
improve codebase architectureto help identify areas in your code that can be refactored into deeper modules.