<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Viacheslav Fesenko</title>
    <description>The latest articles on DEV Community by Viacheslav Fesenko (@vfesenko_abcd1234).</description>
    <link>https://dev.to/vfesenko_abcd1234</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4043964%2F7e744864-ea6b-4170-a812-64d3e8919bde.jpg</url>
      <title>DEV Community: Viacheslav Fesenko</title>
      <link>https://dev.to/vfesenko_abcd1234</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vfesenko_abcd1234"/>
    <language>en</language>
    <item>
      <title>AI Bounded-Context Development aka `AB-CD`</title>
      <dc:creator>Viacheslav Fesenko</dc:creator>
      <pubDate>Thu, 23 Jul 2026 14:15:31 +0000</pubDate>
      <link>https://dev.to/vfesenko_abcd1234/ai-bounded-context-development-aka-ab-cd-2ee5</link>
      <guid>https://dev.to/vfesenko_abcd1234/ai-bounded-context-development-aka-ab-cd-2ee5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Maximize developer control and AI execution on complex tasks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  My Path
&lt;/h2&gt;

&lt;p&gt;When I first started working with AI agents, I was impressed by their ability to create a RESTful proof-of-concept application faster than a developer could describe it. The architecture of such an application is rarely something to showcase, but it is usually good enough for a PoC.&lt;/p&gt;

&lt;p&gt;Some of these PoCs contain functions hundreds of lines long, with dozens of nested loops, conditions, and recursive calls. They do not scale, but they work—sometimes surprisingly reliably.&lt;/p&gt;

&lt;p&gt;This means that an agent can create a working application architecture, while an LLM can write working low-level code.&lt;/p&gt;

&lt;p&gt;That made it difficult for me to understand why an application created well from scratch would begin to degrade after relatively small agent-driven changes. And the more such changes accumulated, the more the codebase deteriorated.&lt;/p&gt;

&lt;p&gt;I used to see this as a limitation of agents. Over time, however, I noticed that an agent can make a good change when the developer explains precisely enough what that change should look like.&lt;/p&gt;

&lt;p&gt;So the question is not whether an agent can complete the task, but what price the developer must pay to specify it correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is the Cost?
&lt;/h2&gt;

&lt;p&gt;The main problem with autonomous development is not that an agent writes poor code. The problem begins earlier: the developer delegates not only implementation, but also the choice of solution, and then tries to review the result without having an expected solution of their own.&lt;/p&gt;

&lt;p&gt;To retain control, the developer must first understand how the task should be solved—independently or with AI—and then explain what to change, what to preserve, and how the result should be evaluated.&lt;/p&gt;

&lt;p&gt;Without an expected solution, they can only judge whether the result looks plausible, passes tests, and contains no obvious problems. That is not enough to determine whether the architecture, dependencies, and change points were chosen correctly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You cannot delegate the engineering decision to AI and then expect to regain control during code review.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the result contains serious problems, the developer faces a choice: continue fixing it or implement the task again from scratch.&lt;/p&gt;

&lt;p&gt;Each iteration makes review harder because new changes must be evaluated against both the original codebase and the agent’s previous modifications. Abandoning the result also becomes increasingly difficult: after investing time in prompting, generation, and review, each new local problem appears cheaper to fix than the whole result is to discard.&lt;/p&gt;

&lt;p&gt;Sometimes the solution can be recovered. In other cases, after many iterations, the developer still implements it manually.&lt;/p&gt;

&lt;p&gt;This is why, for complex tasks, developers often choose the safe bet: implementing the solution themselves. Not because the agent is incapable of completing the task, but because without a predefined solution, the cost of working with it remains unknown.&lt;/p&gt;

&lt;p&gt;Yes, writing code manually like cave people is slow and painful. But the developer understands the chosen solution, controls the changes, and knows how they fit into the codebase.&lt;/p&gt;

&lt;p&gt;As a result, the choice often comes down to two options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;delegate both implementation and solution selection to the agent, accepting the risk of an expensive chain of iterations with no guaranteed result;&lt;/li&gt;
&lt;li&gt;define the solution independently and implement it manually, preserving control and predictability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;By independent implementation, I do not mean only fully manual code changes. It may also include using an LLM to implement low-level details.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Between these two options, there is room for another approach: the developer defines the solution and the boundaries of the work, but delegates a much larger share of the actual implementation to AI than isolated functions, tests, or documentation.&lt;/p&gt;

&lt;p&gt;I call this approach &lt;strong&gt;AI Bounded-Context Development&lt;/strong&gt;, or &lt;strong&gt;AB-CD&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;AI Bounded-Context Development&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;AB-CD&lt;/code&gt; is intended for complex engineering tasks in complex codebases. The key trigger is the suspicion that implementing the task manually may be faster than describing every do and don’t to an agent.&lt;/p&gt;

&lt;p&gt;There is no universal complexity threshold. Additional signs include a diff too broad to review confidently, unexpected change points, or several similar architectural patterns from which AI would have to choose.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AB-CD&lt;/code&gt; does not necessarily pay off for small local changes, disposable PoCs, well-isolated greenfield modules, or tasks where the developer intentionally wants several alternative solutions. It is useful when the cost of choosing the wrong direction is higher than the cost of defining the boundary in advance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Formal Definition
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AI Bounded-Context Development&lt;/strong&gt; is an AI development workflow in which the developer explicitly defines and evolves the information boundary available to the LLM for each implementation step.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Its core principle can be stated as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Provide the LLM with exactly the information required for the current implementation step. No less. No more.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In &lt;code&gt;AB-CD&lt;/code&gt;, the developer defines the expected solution and expresses it through an information boundary. AI implements one predefined step within that boundary, increasing &lt;code&gt;AI Execution&lt;/code&gt; without delegating the architectural direction.&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://medium.com/@fvsleader/ai-as-a-pie-598f3987582e" rel="noopener noreferrer"&gt;AI-as-a-Pie classification&lt;/a&gt;, the role of AI is evaluated along two independent axes: &lt;code&gt;AI Decision Autonomy&lt;/code&gt; and &lt;code&gt;AI Execution&lt;/code&gt;. The quadrant is determined by who holds the controlling interest in each dimension—who primarily chooses how the goal will be achieved, and who performs most of the actions required to achieve it.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;AB-CD&lt;/code&gt;, the developer investigates the task, chooses the solution, divides it into steps, and defines each step’s information boundary. AI implements a predefined part of that solution.&lt;/p&gt;

&lt;p&gt;This places &lt;code&gt;AB-CD&lt;/code&gt; in the first quadrant of &lt;code&gt;AI-as-a-Pie&lt;/code&gt;: low &lt;code&gt;AI Decision Autonomy&lt;/code&gt; with high &lt;code&gt;AI Execution&lt;/code&gt;. Unlike &lt;code&gt;AI-as-a-Helper&lt;/code&gt;, AI performs a substantial share of the implementation; unlike agentic approaches, it does not choose the path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0rsqzh8effd0u37zn21h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0rsqzh8effd0u37zn21h.png" alt="AAAP" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Context Contract
&lt;/h3&gt;

&lt;p&gt;The primary artifact of &lt;code&gt;AB-CD&lt;/code&gt; is the &lt;strong&gt;Context Contract&lt;/strong&gt;—an explicit description of the current step’s role, the information available to the model, and the implementation constraints.&lt;/p&gt;

&lt;p&gt;It may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step Role&lt;/strong&gt; — which part of the expected solution the current step implements and what result it must leave behind;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Editable Scope&lt;/strong&gt; — listings that the LLM is allowed to modify;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read-only Scope&lt;/strong&gt; — listings required to understand the task but not to modify, including auto-generated files;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Excluded Scope&lt;/strong&gt; — relevant listings intentionally excluded from the context because they must not influence the current step’s solution;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project Constraints&lt;/strong&gt; — architectural constraints, code style, local project rules, and special instructions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A Context Contract is not merely a list of files. It captures the role of the step within a previously chosen solution and limits the information on which the LLM may base its implementation choices.&lt;/p&gt;

&lt;p&gt;For example, a task such as “add a new filter end to end” affects more than the form itself. The filter value passes through shared state, appears in chips, is converted into API parameters, and is applied in the backend filtering pipeline. In addition, the frontend contract may be generated from OpenAPI and must not be edited manually.&lt;/p&gt;

&lt;p&gt;Before implementation begins, the developer investigates this flow and defines the expected solution: what state type the filter needs, how &lt;code&gt;null&lt;/code&gt; and empty values should be interpreted, where API mapping occurs, whether the backend should reuse an existing predicate or use a separate query service, and whether a database change is required.&lt;/p&gt;

&lt;p&gt;The task is then divided into implementation steps. For the frontend-state step, the &lt;strong&gt;Editable Scope&lt;/strong&gt; may include the filter component, UI model, and facade. A broadcaster hub may be provided as &lt;strong&gt;Read-only Scope&lt;/strong&gt; because it explains the existing boundary but does not need to change. Generated API models may also be included only to clarify the current contract, with an explicit prohibition against editing them.&lt;/p&gt;

&lt;p&gt;A similar legacy filter may be deliberately placed in the &lt;strong&gt;Excluded Scope&lt;/strong&gt; if the developer has already decided not to reproduce its architecture. The LLM does not receive the entire chain at once or the right to choose the path independently. It receives only the information required to implement one specific step within a predefined solution.&lt;/p&gt;

&lt;p&gt;After review, the boundary changes: for the backend step, the Editable Scope may include the request contract, filtering pipeline, and tests, while the frontend files are no longer necessary. If the LLM proposes an unexpected dependency or a change outside the anticipated locations, the developer does not need to investigate the architecture from scratch. Instead, they verify whether the Context Contract is incorrect or the model has stepped outside the role assigned to the current step.&lt;/p&gt;

&lt;p&gt;In this way, one end-to-end task is implemented not through a single broad prompt, but through a sequence of controlled boundaries, each expressing a distinct part of an already chosen engineering solution.&lt;/p&gt;

&lt;p&gt;A Context Contract does not have to exist as a separate document. What matters is that the boundary is explicitly defined by the developer and can evolve together with their understanding of the task.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Excluded Scope&lt;/strong&gt; does not necessarily need to be enumerated in full either. The developer may require the LLM to rely only on the provided files and to explain any missing context instead of making assumptions or producing a partial solution.&lt;/p&gt;

&lt;p&gt;The exact form of the contract depends on the tool and the developer’s preferences. The controlled boundary is mandatory; its syntax is not.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Key Idea Behind &lt;code&gt;AB-CD&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;AB-CD&lt;/code&gt; does not introduce a new technical mechanism. It formalizes context-management practices into a workflow where the context is derived from a predefined engineering solution and used as a constraint on AI.&lt;/p&gt;

&lt;p&gt;The focus is not only on which listings enter the &lt;strong&gt;Editable Scope&lt;/strong&gt; and &lt;strong&gt;Read-only Scope&lt;/strong&gt;, but also on which relevant parts of the system are deliberately excluded.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Excluded Scope&lt;/strong&gt; is as much an engineering decision as &lt;strong&gt;Editable Scope&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;AB-CD&lt;/code&gt; is not merely about reducing context size. It controls the space of admissible solutions by controlling the information that may influence implementation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;AB-CD&lt;/code&gt; limits not the number of files provided, but the set of solutions that AI can justify at the current step.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Additional modules, similar implementations, and alternative patterns give the model more plausible paths, not all of which match the developer’s intent. My practical hypothesis is that this is why excessively broad context often produces unexpected change points and gradual scope expansion. This is an observation, not a universal law.&lt;/p&gt;

&lt;p&gt;An agent that does not know the final solution must either collect broad context to avoid missing dependencies or minimize it and risk excluding something important. Both strategies can work, but choosing the context requires an understanding of the expected solution.&lt;/p&gt;

&lt;p&gt;Once the developer has that understanding, the boundary becomes an architectural filter: the model receives only the patterns that should influence the current step. Review also changes—from evaluating an independently chosen AI solution to checking whether implementation conforms to the predefined role of the step.&lt;/p&gt;

&lt;p&gt;Unexpected dependencies then become signals that either the contract is incomplete or the model has stepped outside it. This allows the developer to use AI for substantial low-level implementation while preserving control over the intended solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Main Flow
&lt;/h3&gt;

&lt;p&gt;The basic &lt;code&gt;AB-CD&lt;/code&gt; cycle looks like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Discover&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
   The developer investigates the task and defines the expected solution.&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Define Boundary&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
   A &lt;code&gt;Context Contract&lt;/code&gt; is created for the current step based on the expected solution.&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implement&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
   The LLM receives the bounded context and implements a specific part of the solution.&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Review&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
   The developer compares the changes with the expected solution.&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Refine Boundary&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
   If the result is incomplete or incorrect, the developer refines the instruction and the information boundary.&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next Step&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
   Once the step is complete, the cycle repeats for the next part of the task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why &lt;code&gt;AB-CD&lt;/code&gt; Is Not an Extra Mile
&lt;/h2&gt;

&lt;p&gt;Defining the information boundary may look like additional work, but a &lt;code&gt;Context Contract&lt;/code&gt; does not create a new analysis stage. It turns an already chosen engineering solution into an executable constraint for AI.&lt;/p&gt;

&lt;p&gt;By the time implementation begins, the developer should already know which parts must change, which modules are needed only for understanding, and which constraints must be preserved. Capturing that knowledge in a boundary moves uncertainty from the expensive post-generation phase into the cheaper step-design phase.&lt;/p&gt;

&lt;p&gt;An error found while defining the boundary usually requires adjusting the context or splitting the step. The same error found after broad generation may require analyzing the diff, reverting dependencies, and repeating the review.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The primary engineering responsibility shifts from writing prompts to defining the model’s knowledge boundary for each implementation step.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is what distinguishes &lt;code&gt;AB-CD&lt;/code&gt; from simply “providing the necessary files”: the developer first restricts the solution space and only then delegates implementation within it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Practical Guideline for Context Size
&lt;/h2&gt;

&lt;p&gt;Excluding irrelevant files provides another advantage: both the context and the resulting diff remain reviewable. Token savings are more of a side effect.&lt;/p&gt;

&lt;p&gt;In my experience, the most predictable results occur when a single implementation step fits within roughly a couple of thousand lines of input context, give or take, while the expected amount of change remains comparable or smaller.&lt;/p&gt;

&lt;p&gt;This is not a universal threshold beyond which LLM quality magically drops. For me, it is a practical guideline: the step remains coherent enough for the model, while the result remains compact enough for confident review.&lt;/p&gt;

&lt;p&gt;The exact limit depends on the language, code density, relationship complexity, and the capabilities of the model. What matters is not the context size itself, but whether the developer can keep track of the role each provided fragment plays in the expected solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Is an LLM Preferable to an Agent for &lt;code&gt;AB-CD&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;For &lt;code&gt;AB-CD&lt;/code&gt;, the tool matters less than the guarantee that the executor cannot silently expand the defined boundary.&lt;/p&gt;

&lt;p&gt;An agent may discover additional dependencies, open neighboring modules, or pass more files to the underlying LLM. That is useful in ordinary agentic work, but in &lt;code&gt;AB-CD&lt;/code&gt; it shifts control over context composition back to the agent.&lt;/p&gt;

&lt;p&gt;The preferred executor is therefore one that cannot move beyond the supplied context—most often, an LLM without direct codebase access. An agent is still suitable if every context expansion requires explicit developer approval.&lt;/p&gt;

&lt;p&gt;Agents may also help during investigation, dependency discovery, and context preparation. The expected solution and final context composition for each implementation step remain the developer’s responsibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use &lt;code&gt;AB-CD&lt;/code&gt; in Practice
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;AB-CD&lt;/code&gt; does not require a dedicated tool. The executor simply must receive only the context defined for the current step.&lt;/p&gt;

&lt;p&gt;A developer can use an agent in a limited-scope mode, provided it cannot read beyond the supplied files without approval and the complete context remains visible. When stricter control is needed, the context can be passed directly to an LLM.&lt;/p&gt;

&lt;p&gt;If a step affects one or two files and does not require many project-specific instructions, it is enough to copy the relevant listings, add the constraints, and send everything to a regular LLM chat—just as developers did before agents.&lt;/p&gt;

&lt;p&gt;That is technically sufficient. Across several implementation steps, however, manually assembling file sets, repeating project instructions, and applying changes back in the IDE becomes distracting routine.&lt;/p&gt;

&lt;p&gt;To automate this mechanical part of the process, I created &lt;a href="https://marketplace.visualstudio.com/items?itemName=ViacheslavFesenko.llm-copypaster" rel="noopener noreferrer"&gt;LLM Copypaster&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The developer selects files and folders in VS Code; the extension concatenates them with project instructions and copies the prompt to the clipboard. A structured response can then be applied back to the project.&lt;/p&gt;

&lt;p&gt;Copypaster is a deterministic algorithm: no AI magic, but complete predictability and transparency when assembling context. It is free and &lt;a href="https://github.com/SlavaFesenko/llm-copypaster" rel="noopener noreferrer"&gt;open source&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In any case, &lt;code&gt;AB-CD&lt;/code&gt; does not depend on Copypaster or on any particular agent. They merely provide different ways to preserve an information boundary defined by the developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;AB-CD&lt;/code&gt; begins with an expected engineering solution, which the developer divides into implementation steps and expresses through a sequence of controlled information boundaries.&lt;/p&gt;

&lt;p&gt;Its goal is to delegate as much of the direct implementation as possible to AI while keeping the choice of architectural direction and control over the final solution in the developer’s hands.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The developer defines the solution and its information boundaries. AI executes within them.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>llm</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
