I recently watched Matt Pocock's workshop, Full Walkthrough: Workflow for AI Coding.
The main takeaway: Good AI-assisted coding is not about writing better prompts. It's about applying solid software engineering practices to AI agents.
Here are the key lessons.
1. Keep AI Tasks Small and Context Fresh
LLMs tend to become less reliable as their context grows.
Matt describes two zones:
- Smart Zone: Fresh context, focused tasks, better decisions.
- Dumb Zone: Bloated context, reduced reliability, more mistakes.
He uses roughly 100K tokens as a practical warning threshold, not a universal technical limit.
His recommendations:
- Break large tasks into smaller, independent tasks.
- Keep system instructions minimal.
- Prefer clearing context and restarting with well-defined tasks rather than repeatedly compacting long conversations.
- Use subagents for isolated exploration without filling the main agent's context.
2. Align Requirements Before Writing Code
Instead of immediately asking AI to implement a feature, Matt uses a custom "Grill Me" skill.
The AI interviews the developer, asking questions one at a time and recommending possible answers.
For example, when building a gamification feature:
- Which activities earn points?
- Should existing users receive retroactive points?
- How should levels work?
- Where should the UI appear?
The goal is to reach a shared understanding before implementation.
Planning requires human involvement. Coding can be delegated much more easily.
3. Turn Requirements into a PRD and Independent Tasks
Once the requirements are clear, create a Product Requirements Document (PRD) covering:
- Problem and proposed solution
- User stories and acceptance criteria
- Implementation decisions
- Testing requirements
- Out-of-scope features
The PRD describes the destination.
Next, break it into independent issues with explicit dependencies. This creates a Kanban-style backlog that agents can work through, potentially in parallel.
4. Build Vertical Slices, Not Horizontal Layers
AI often prefers implementing features horizontally:
- Build the entire database layer.
- Build the APIs.
- Build the frontend.
The problem is that meaningful end-to-end feedback comes too late.
Matt recommends vertical slices (tracer bullets) instead.
For example, implement one small feature that includes:
- Database changes
- Backend logic
- API integration
- A minimal frontend
- Tests
Each slice delivers something functional and testable.
This makes integration problems visible much earlier.
5. Use Ralph Loops for Automated Implementation
Once the backlog is ready, implementation can become an automated loop:
- Select an unblocked issue.
- Explore the relevant code.
- Implement the feature.
- Run tests and type checks.
- Commit the changes.
- Repeat until the backlog is complete.
Matt demonstrates this with a Ralph-style loop.
For parallel execution, he also introduces Sand Castle, which uses isolated Git worktrees and Docker sandboxes for agents.
Separate agents can handle planning, implementation, review, and merging.
6. Test-Driven Development Makes AI More Reliable
Matt strongly recommends TDD (Test-Driven Development) for AI agents.
The process follows:
Red → Green → Refactor
- Write a failing test.
- Implement the minimum code needed to pass.
- Refactor while keeping the tests green.
Writing tests first makes it harder for AI to generate weak tests that merely confirm its existing implementation.
More importantly, AI needs fast feedback loops:
- Unit and integration tests
- Type checking
- Linting
- Automated code review
The quality of your feedback loops often determines the quality of your AI-generated code.
7. Design Deep Modules with Simple Interfaces
Another important lesson comes from A Philosophy of Software Design.
Matt recommends deep modules:
- Small, clear public interfaces
- Substantial functionality hidden internally
- Well-defined responsibilities
- Easy-to-test boundaries
This is preferable to many tiny, tightly coupled modules.
The developer should understand and control the overall architecture while delegating internal implementation details to AI.
This helps prevent losing architectural understanding as AI generates more code.
8. Never Skip Human QA and Code Review
Automated tests passing doesn't guarantee a good product.
Matt emphasizes that humans still need to:
- Verify actual user behavior.
- Review important architectural decisions.
- Inspect tests and critical code.
- Evaluate frontend usability.
- Identify missing requirements.
He also recommends using a fresh AI context for code review rather than asking an agent to review its own work after a long implementation session.
QA findings can become new backlog issues, creating a continuous improvement cycle.
The Complete Workflow
Idea
↓
Grill Me (Requirements Alignment)
↓
PRD (Define the Destination)
↓
Independent Issues (Vertical Slices)
↓
AI Implementation (Ralph Loop)
↓
TDD + Automated Feedback
↓
AI Code Review
↓
Human QA
↓
New Issues / Improvements
↓
Repeat
Final Thoughts
The biggest lesson from this workshop is that AI doesn't replace software engineering fundamentals. It makes them even more important.
Good architecture, small tasks, clear requirements, automated tests, and continuous feedback are what make AI coding agents effective.
The developer's role increasingly shifts from writing every line of code to defining requirements, designing systems, providing feedback, and maintaining quality.
AI can handle much of the implementation, but humans still need to own the decisions and the final product.
Source: Matt Pocock — Full Walkthrough: Workflow for AI Coding (YouTube)
Suggested DEV.to tags: #ai #programming #productivity #softwareengineering
Top comments (0)