FMTechnical notes
Portfolio
Back to the blog

AI & Agents · Advanced · Agentic

Professional Agentic Engineering: From Prompts to Decoupled Harnesses

Prompt engineering as a parlor trick is dead. Building real software with artificial intelligence demands systems architecture: decoupled harnesses, specialized subagents, and contract-driven development.

After reading this
  • Understand the difference between code autocompletion and autonomous agent harnesses
  • Design a cost- and context-optimized multi-model topology
  • Implement Organic Driven Development (ODD) with a strict TDD verification cycle
01 / 04

1. The single-prompt fallacy

Asking a single model to digest an entire repository, make architectural choices, write code, and verify its own solution is a recipe for context degradation and silent hallucinations.

As the context window fills with unrelated logs and diffs, transformer attention is diluted. The solution is not a larger window; it is a modular architecture with bounded responsibilities.

  • Attention degradation: excessive tokens reduce logical precision.
  • Confirmation bias: the model that wrote the bug rarely catches it in self-review.
  • Exponential cost: resending the entire codebase on every turn burns budget without delivering value.
02 / 04

2. Role-based multi-model topology

There is no single model best suited for every task. A professional agentic architecture decouples roles based on the tradeoff between reasoning depth, per-token pricing, and syntactic specialization.

  • Orchestrator (Frontier / Reasoning): Handles high-level strategy, breaks tasks into independent units, and manages interaction (GLM-5.2, GPT-Sol, or Gemini Pro).
  • Explorer (MoE / High-Context): Reads thousands of files, maps AST symbols, and summarizes evidence without write permissions (DeepSeek-V4.1-Flash with 1M tokens at pennies).
  • Worker / Coder (Code Specialist): Writes the minimum change under deterministic tests respecting repository conventions (Qwen 3 Coder).
  • Verifier (Independent Checker): Runs test suites and linters in isolated sandboxes with zero write authority.
json
{
  "model": "openrouter/z-ai/glm-5.2",
  "agent": {
    "explore": { "model": "deepseek/deepseek-flash", "mode": "subagent" },
    "worker": { "model": "openrouter/qwen/qwen3-coder", "mode": "subagent" },
    "verify": { "model": "deepseek/deepseek-flash", "mode": "subagent" }
  }
}
03 / 04

3. Organic Driven Development (ODD) & TDD

An agent must never possess unconstrained destructive authority. In ODD, the orchestrator sets strict allowed edit surfaces and demands test execution evidence before accepting changes.

The cycle is uncompromising: RED (verify failure before code changes), GREEN (implement the minimum passing solution), and PRESERVE (prove zero regressions in existing behavior).

04 / 04

4. Infrastructure layer: Local agent harnesses

Tools such as OpenCode and Gentle-AI are not simple chat interfaces. They are execution harnesses providing cross-session persistent memory (Engram), static code graphs (CodeGraph), and bash permission sandboxes.

Coupling a local harness with open APIs (OpenRouter and direct endpoints) yields a decoupled workflow that slashes inference costs by up to 90%.

Component tree● interactive

Layout-level composition. Owns the document structure and orchestrates which features render.

Practice

Agentic topology design

Design model assignments and permission boundaries for a production database migration: which model orchestrates, which analyzes schema, and which validates?

Show a hint

Ensure the migration executor lacks permissions to drop schemas without explicit human confirmation.