Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

Coding Agent Architecture: A Practical Layered Enforcement Method

Make coding agents follow repository architecture by combining instructions their harness discovers, automated checks for critical boundaries, and targeted verification in the intended harness.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make coding agents respect a repository’s architecture, combine three things: instructions written for the harness they actually use, automated checks for rules that can be tested, and a small trial in that harness to confirm the instructions are discovered and followed. Prose explains intent and trade-offs; lint rules and structural tests catch repeatable violations.

Start with instructions the agent can discover

Before writing architectural guidance, identify the coding harness and its current instruction mechanism. A rule in a file the harness does not load cannot guide the agent. Visual Studio Code’s documentation lists AGENTS.md as an instruction option for OpenAI Codex and describes other project-wide and targeted instruction formats across supported tools. Check the current documentation for the harness you use rather than assuming filenames or discovery behavior are interchangeable: Visual Studio Code: Configure AI for your codebase.

As an Amazon Associate I earn from qualifying purchases.

Make the project-level guidance concrete enough to orient a change. Include the architecture and boundaries that matter, important directories, established conventions, build and test commands, and what a completed change must satisfy. Visual Studio Code’s guide recommends covering these areas. Prefer a short, prioritized set of repository decisions over a catalogue of preferences: explain the allowed dependency directions and the checks that demonstrate a change fits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Scope rules to the code that needs them

Keep truly universal constraints in repository-wide guidance. If a subsystem has different conventions or boundaries, attach the rule to that area using the mechanism supported by the harness. Mixing unrelated local rules into a global instruction file can obscure the constraints that matter for any given edit.

Harness or use Documented instruction mechanism Scope
GitHub Copilot in Visual Studio Code .github/instructions/**/*.instructions.md files with applyTo patterns, as described by Visual Studio Code’s codebase configuration guide Targeted to files matching the patterns
OpenAI Codex Root and nested AGENTS.md files, as described by Visual Studio Code’s codebase configuration guide and custom instructions documentation Directory-based; instructions are discovered from the repository root down to the working directory
Copilot code review .github/copilot-instructions.md for repository-wide review guidance, root AGENTS.md for project context, and .github/instructions/**/*.instructions.md for path-specific review guidance, according to GitHub’s code review documentation Repository-wide or path-specific, depending on the file

These mechanisms are not interchangeable guarantees. In particular, when testing nested Codex guidance, use the relevant subdirectory as the working folder; the discovered instruction context depends on the root-to-working-directory path described in the Visual Studio Code guide.

Turn critical boundaries into executable checks

Instructions are useful for explaining why a boundary exists and how a change should fit it. For a critical rule that can be expressed mechanically, add a custom linter or structural test so violations are caught repeatably instead of relying solely on an agent to interpret prose. OpenAI describes this approach in “Harness engineering: leveraging Codex in an agent-first world”: “In practice, we enforce these rules with custom linters and structural tests, plus a small set of ‘taste invariants.’”

  1. State the rule and rationale. Describe the boundary in the project instructions, including what belongs where and why.
  2. Encode the checkable portion. Add a lint rule or structural test for violations that can be identified from repository structure or code.
  3. Explain the repair. Make failure output tell the agent what is wrong and what an allowed fix looks like. OpenAI notes that custom lint messages can inject remediation instructions into agent context.
  4. Keep judgment where it belongs. Leave context-dependent architectural trade-offs to review; a check should enforce a repeatable constraint, not pretend every design decision is mechanical.

A check that only says “failed” is less actionable than one that names the violated boundary and points to the permitted direction of change. The goal is not to automate all architecture, but to make the important, deterministic rules hard to miss.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify discovery and behavior in the intended harness

After adding or changing instructions, verify both that the harness loads them and that the resulting guidance is useful for the targeted work. Visual Studio Code recommends reviewing the pattern, testing instructions in a new chat with the same harness, and asking for a small change to a file matched by the rule. Its guide puts it plainly: “Review the pattern and test the instructions by asking the agent to make a small change to a specific matching file.”

  1. Check the instruction filename, location, and any path pattern against the chosen harness’s current documentation.
  2. Start a fresh chat or session with that same harness so the test reflects ordinary instruction loading.
  3. Request a small, bounded change in a file the rule is meant to cover. Check whether the agent observes the relevant architectural constraint.
  4. For nested Codex instructions, open the corresponding subdirectory as the working folder when testing.
  5. Run the repository’s actual lint and structural checks on the resulting change.

If the targeted rule has no effect, investigate whether it was discovered and whether its scope matches the file before adding more prose. A failed automated check should lead to a specific repair; a missed instruction may instead indicate a loading or scope problem.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep the enforcement layers distinct

Use project guidance for architecture, rationale, conventions, and context that helps an agent choose among valid approaches. Use lint rules and structural tests for repeatable constraints with clear pass-or-fail conditions. Use the intended harness to confirm that instructions reach the agent, then use human review for choices that depend on context. This separation makes the rules understandable without treating prose as a guarantee or tests as a substitute for architectural judgment.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.