[KongchangAI]
· 5 min read· 2,623 words

How to Actually Write Good Code with AI: Matt Pocock's Tactical and Strategic Framework

How to Actually Write Good Code with AI: Matt Pocock's Tactical and Strategic Framework

Matt Pocock breaks down AI programming methodology: AI excels at tactics, strategy still depends on humans.

Matt Pocock uses the tactical-versus-strategic framework from *A Philosophy of Software Design* to argue that AI is extremely strong at tactical work like writing functions and fixing bugs but lacks strategic ability, and that pure vibe coding degrades the codebase serving as the agent's environment. He proposes narrowing the human-machine communication gap with a grill process and shared domain language, managing context with a ~150K-token smart/dumb zone threshold, and sticking to medium effort daily. The workflow spans five stages—grill, spec and tickets, code review, human review, retro—centered on deterministic checks like strong typing, tests, and linters so the agent can verify itself. The trust ladder sets how many agents run in parallel; improving the environment beats waiting for stronger models, and because programming is highly verifiable it is easier for AI to transform than most knowledge work.

AI writing code is no longer novel, but the gap between good and bad is widening. In a deep-dive interview, well-known TypeScript community educator Matt Pocock systematically broke down his complete methodology for AI programming—and the core thesis can be summed up in one sentence: AI excels at tactical programming, but strategic programming still depends on humans.

Tactics and Strategy: The Core Contradiction of AI Programming

Matt Pocock borrows the framework from John Ousterhout's A Philosophy of Software Design to understand AI programming: tactical programming is a squad leader winning today's battle, while strategic programming is a general winning the entire war. AI is extremely powerful at the tactical level—ask it to write a function, fix a bug, or implement a component, and it will produce tirelessly.

The problem is that AI has almost no strategic capability. Pocock's explanation is straightforward: models are trained on benchmarks to complete specific tasks and receive scores, so their attention is 100% focused on the tactical level. You can't get a higher benchmark score by "thinking about long-term impact," and strategic mistakes often don't surface until months later, making them impossible to score effectively.

This leads to a practical consequence: if pure vibe coding (a style of programming where you don't read or think about the code) is your only approach, the codebase will gradually degrade. And the codebase is exactly the environment in which agents operate—when the environment deteriorates, agent performance deteriorates with it. Pocock uses a vivid metaphor: like the dog sitting in a burning house saying "this is fine," the agent keeps working in a gradually collapsing environment while nobody maintains the house.

effort level

A Philosophy of Software Design is a software design classic published in 2018 by Stanford professor John Ousterhout. The book sets up the opposition between "tactical programming" and "strategic programming": the former gets code running as fast as possible, while the latter requires developers to continuously invest roughly 10%–20% of their time improving design and controlling complexity. Ousterhout's core argument is that "complexity is the greatest enemy of software," and tactical programming does nothing but accumulate complexity debt, eventually making the system hard to maintain. The book also introduces concepts like the "deep module," advocating simple interfaces that encapsulate complex implementations. Pocock borrows this framework precisely to explain AI's behavioral tendencies: models are rewarded during training and benchmarking for "getting the current task right," which naturally biases them toward the tactical level.

The Communication Gap: The Biggest Chasm Between You and the Agent

Pocock believes most people underestimate the communication gap between themselves and the agent. He compares the agent to a hired developer—but one who, like the protagonist of Memento, has no memory and is dropped into an unfamiliar world.

His solution is a process he calls "grill." The core skill is called grill with docs: after you present a vague requirement, the agent first explores the codebase and then turns around and asks you questions—rather than jumping straight into action, it aligns on requirements step by step through a series of questions. A more basic version, grill me, is a simplified form of this process.

The key design here is the shared language from Domain-Driven Design (DDD). Pocock maintains a glossary in his projects that defines the names and relationships of all entities in the application: course, section, lesson, draft version... All skills are required to reference this glossary. The codebase, database, and frontend interface use the same language, so the agent can work "as if it were inside your head."

He mentions a widespread phenomenon: in many codebases, the frontend calls an operation a reversal, the email system calls it a pending charge back, and the database calls it a refund—three names for the same thing, making it hard for both humans and agents to understand. Shared language solves more than just naming—it solves overall collaboration efficiency.

Domain-Driven Design (DDD) was introduced by Eric Evans in his 2003 book of the same name, with the core idea of keeping software models aligned with the business domain. One key practice is the "Ubiquitous Language": development, business, and code all use the same set of terms, avoiding different names for the same concept across layers. The glossary Pocock maintains is an extension of this idea into the AI programming context—when the codebase, database, frontend, and agent all share the same entity naming, the agent encounters less ambiguity when reading code and generating implementations, and more easily understands requirements "as if it were inside your head." The value of a ubiquitous language isn't just readability—it reduces the information loss when conveying intent between humans and models.

Context Management: The Smart Zone and the Dumb Zone

Pocock has a widely cited breakdown of the context window: within every context window there is a "smart zone" and a "dumb zone." As the token count grows, the model's decisions get dumber and dumber, because the number of relationships between tokens grows quadratically and attention gets diluted.

His empirical threshold is to start being cautious at around 150K tokens. This isn't because the model's window isn't big enough—it's because he wants the model to always be in its best decision-making state: lower latency, more controllable cost, and no need to pay repeatedly for hundreds of thousands of tokens when debugging.

This principle directly determines how the workflow branches: if grilling and implementation can be completed within the same context window, just use the implement skill; if it's expected to exceed the threshold, first convert it into a spec (specification document), then break it into tickets, with each ticket implemented as an independent session.

A counterintuitive piece of advice: don't use too high an effort level. Pocock almost exclusively uses Opus 5.5 medium day to day, and is even considering dropping to low. His logic is that tasks like exploring a codebase don't need higher effort—they just need to read the right files and find the right information. "People use the highest effort to explore the codebase, and as a result they enter the dumb zone sooner and performance actually gets worse." Only when verifying your own work (running tests, performance tracing, clicking through the real application) is high effort worth it.

unit tests

Automated Checks: Putting the Agent in a Straitjacket

Pocock repeatedly emphasizes one word: care. Strategic programming is largely about "caring a little more than the person next to you." In engineering practice, that means being willing to invest effort in building feedback loops that let the agent verify itself.

He lists several core categories of automated checks:

  • Strong typing: Use TypeScript instead of JavaScript; the type system tells the agent it made a mistake immediately
  • Runtime tests: Actually verify whether behavior matches expectations
  • Linters: Check code patterns, import sources, and known bad practices

One entry in his coding standards: the TypeScript any type is forbidden, because it's cheating your way around the type system.

More critical is the structure of tests. Pocock cites Michael Feathers and John Ousterhout's concept of the "deep module": good tests should target the narrow interface of a large module, with the module's internals hidden from the tests. That way the module can be refactored freely without affecting the tests; conversely, if every line of code is bound to a test, any change triggers endless test modifications.

He has a skill called improve code base architecture that generates a visual report for any repo, identifies "shallow modules" and duplicated code, and suggests merging them into deep modules. Pocock himself has a cron job that runs it once a day and automatically generates improvement PRs.

linting

"Deep module" is a design principle Ousterhout proposes in A Philosophy of Software Design: a module should have a simple, narrow interface while encapsulating a large amount of complex functionality internally. Its opposite is the "shallow module"—a complex interface with little internal implementation, essentially exposing complexity to callers. The significance of deep modules for testing is that tests only need to be written against the narrow interface, and the module's internals can be refactored freely without breaking tests, reducing test maintenance costs. Conversely, if tests are tightly coupled to implementation details (for example, one test per line of code), any refactoring triggers a large number of test modifications, and tests become a drag on improving the design. Pocock's improve code base architecture skill uses exactly this principle to identify shallow modules and duplicated code and suggest merging them.

The Complete Workflow: From Grill to Retro

Pocock's daily loop can be broken into several stages:

Grill—Use grill with docs to align on requirements; the agent asks questions, you answer, and the boundaries are gradually clarified.

Spec and Tickets—Large tasks are first converted into a specification document, stored in Markdown or a GitHub issue, then broken into tickets. Each ticket is roughly 150K tokens in size, implemented by parallel sub-agents in worktrees, and finally merged into a single PR.

Code Review—implement spec automatically invokes code review, which reviews along two dimensions: spec review checks whether it did what it was supposed to do and whether it went out of scope; standards review checks against the coding standards file in the repo.

Human Review and the PR skill—The PR skill generates a visual summary, execution evidence (screenshots or run logs), and most importantly a "merge danger" assessment: is this a one-way door or a two-way door? How big is the blast radius? Only one-way doors with a high blast radius need careful human review; small two-way-door changes can ship directly.

Retro—Review the entire session and PR, and turn the problems found in review into automated checks or standards updates for next time. Pocock particularly emphasizes: always prefer deterministic solutions. If a rule can be added to the linter, don't rely on the agent's self-discipline; if CI/CD can do it, don't make the agent re-execute it every time.

verify

Git worktree is a feature available since Git 2.5 that allows multiple working directories to be checked out from the same repository simultaneously, each pointing to a different branch while sharing the same Git object database. Compared with "cloning multiple repositories," worktrees are lighter and avoid the hassle of syncing between copies. In the AI programming context, worktrees let multiple sub-agents implement different tickets in parallel in their own independent branches and directories without interfering with each other, then merge them into PRs separately. Pocock's "each ticket roughly 150K tokens, implemented by parallel sub-agents in worktrees" uses exactly this mechanism to break large tasks into independent units that can run in parallel while controlling the context size of any single session.

The Trust Ladder: From Reviewing Every PR to Running Hundreds of Agents in Parallel

Pocock cites Lauren Tan's (known in the community as Potato) concept of the trust ladder: your level of trust in the agent determines how many agents you can run simultaneously. If you have to review every PR line by line, you can manage at most four agents; only if you can trust two-way-door PRs to auto-merge can you scale to hundreds of parallel tasks.

The path to building trust isn't switching to a stronger model—it's improving the agent's operating environment. Pocock's view is clear: rather than waiting for the next generation of models to solve everything, pick the low-hanging fruit in your environment now. Pinning the model and fixing the environment often has a more noticeable effect than upgrading the model.

He doesn't shy away from the limitations either: everything he builds is personal software, so he dares to let agents auto-merge; if he were in banking or healthcare, he would be extremely cautious about one-way doors and invest a large number of tokens in safety verification.

What Beginners Need to Know

For people without a software background, Pocock's advice can be summarized in a few points:

You don't need to learn a programming language first. Languages are a tactical-level thing; the agent can teach you. What you really need to learn is how to read module boundaries and understand architectural concepts.

Read the classics. His recommended reading list includes: John Ousterhout's A Philosophy of Software Design, Michael Feathers's Working Effectively with Legacy Code, Martin Fowler's Refactoring, Kent Beck's Extreme Programming, and The Pragmatic Programmer. His improve code base architecture skill was distilled from these books.

Learn with the teach skill. Pocock wrote a teach skill himself that takes any report or concept you don't understand and generates an HTML course, tracks your learning progress, and quizzes you. He used this skill himself to learn how to solve a Rubik's cube.

Deployment isn't that scary. DevOps has been greatly simplified over the past decade or so by serverless platforms. Pocock's advice: when in doubt, use a Postgres database (managed services like Supabase or PlanetScale), deploy on platforms like Vercel or Netlify, and push to GitHub to deploy automatically. CI/CD is deterministic and doesn't consume tokens—always prefer it over having the agent deploy manually.

Prove yourself with projects. For students trying to break into the industry, Pocock believes the key is to show that you care about the strategic level—use the right terminology, think about long-term improvements, and polish your projects as much as possible and deploy them somewhere others can click and try them.

The Predicament of Knowledge Work

The interview ends with a thought-provoking turn. Pocock believes programming is actually easier for AI to transform than most knowledge work, because programming is highly verifiable—there are tests, types, and CI, and right and wrong are clear. Knowledge work like course design, content creation, and scheduling has almost no reliable verification; you don't know how today's course is better than the one from two months ago.

When he himself is in the course planning stage, he turns AI off, prints learning objectives on cards, and arranges them in physical space to find the course structure. "This takes a few hours, completely away from the computer, away from AI." His explanation is that the agent responds too quickly and outputs too densely, which actually makes people lose context; handwriting and cards pull people back to a human pace and let thinking unfold at the right speed.

This is perhaps the most honest part of the entire interview: the toolchain for AI programming is relatively mature, but in the broader field of knowledge work, how to verify quality and how to preserve the human rhythm of judgment remain unsolved problems.

Matt Pocock's skills and resources can be found at aihero.dev, and his core thesis can be condensed into one sentence: You don't need to become an AI expert; you need to become someone who cares a little more about code quality than you did yesterday.

One-line Summary

Matt Pocock breaks down the AI programming methodology: AI excels at tactics, strategy still depends on humans.

Paragraph Summary

Matt Pocock borrows the tactical-versus-strategic framework from A Philosophy of Software Design to point out that AI is extremely strong at tactical tasks like writing functions and fixing bugs but lacks strategic capability, and that pure vibe coding will continuously degrade the codebase that serves as the agent's operating environment. He proposes narrowing the human-machine communication gap with a grill process and a shared domain language, managing context with a "smart zone/dumb zone" threshold of around 150K tokens, and sticking to medium effort day to day. The workflow covers five stages—grill, spec and tickets, code review, human review, and retro—with the core being deterministic checks like strong typing, tests, and linters that let the agent verify itself. The trust ladder determines how many agents can run in parallel; improving the environment is more effective than waiting for stronger models. Because programming is highly verifiable, it is easier for AI to transform than most knowledge work.

#AI programming#Matt Pocock#vibe coding#domain-driven design#context window management#deep modules#AI coding workflow#trust ladder
Share:

Related articles