Software Engineering with Agentic AI

Build software without drowning in prompts!

Sonny Bhatia

Sunday, August 23, 2026

The Problem

  • Syntax is now a commodity
    • AI can write and analyze and explain programs
    • Software Architecture requires deliberate thought
  • The “Black Box” Trap
    • Unstructured prompting (“vibe coding”) bypasses systems thinking and domain expertise
    • Students lack architectural understanding
  • Brittle Outcomes
    • Trial-and-error prompting does not scale to complex, reliable software

How do we transition from unstructured prompting to disciplined, agentic systems engineering?

What is Success?

Measure of Performance

Measure of Effectiveness

  • Resources spent
    • GPU
    • Electricity
    • Time
  • Model availability - frontier vs open weights
  • Scrum team velocity per dollar spent?
  • Token cost per line of code?
  • Understanding of your work…?
  • Model maxxing: Efficient Model Routing

The Big Idea: Agentic AI

  • Agent = specific role with a focused set of instructions
  • Artifacts = agent output at each step
  • Humans validate intermediate artifacts

Architect

Analyst

Architect

Planner

Planner

Tech Lead

Tech Lead

Tech Lead

Proposal

Design

Specifications

Tasks

Developer

Tester

Reviewer

Simple software engineering pipeline inspired by OpenSpec

Core Concepts

Harness

  • Software that orchestrates agents
  • Manages the control flow and context
  • Exposes tools to language models
  • Makes your AI agents agentic
  • e.g. Claude Code, Codex, OpenCode, pi.dev

Tools

  • Deterministic functions for agents (~API)
  • Interact with local or remote systems
  • Harnesses provide local tools
    • e.g. read_file, run_command, fetch_url
  • MCP servers provide remote tools

AGENTS.md

  • README file for agents
  • Per-directory context; grab the closest
  • Given to every agent, always!
  • Keep it really short and focused

Skills

  • Agents load skills as needed
    • Unlock new capabilities!
  • Reusable instructions loaded into context
  • Loads ~5k-20k tokens \(\rightarrow\) bloats context

Challenges with current systems

  • Proprietary harnesses are black boxes
  • Context grows quickly
    • Difficulty reasoning and following instructions
    • Performance degrades on smaller models
    • Larger context = higher costs; who profits?
  • Agents often orchestrated manually
    • Limited control over spawning sub-agents
    • Difficult to scale processes and parallelize tasks
  • Models, configuration, and pricing can change without notice

Guiding Principles

  1. Markdown everywhere
  2. Own your agent roles / system prompts
  3. Context window: keep it compact
  4. Control flow: manage agent interactions and artifacts
  5. Agents: small, simple, and focused

Inspiration: 12 Factor Agents: Principles for building reliable LLM applications

Markdown: The Lingua Franca

- Beautiful, simple, and human-readable
    - `#` and `##` for headings
    - `-` for lists
    - `1.` and `1.` and `1.` for numbered lists
    - __bold__ and _italic_ for emphasis
    - single backtick for inline code and three backticks for code block
    - `>` for blockquotes
    - `---` for horizontal rules
    - [Link](https://example.com) for hyperlinks
    - ![description](image.png) for images

- Human-readable + machine-parsable = ✨

- [Markdown Syntax Cheatsheet](https://www.markdownguide.org/cheat-sheet/)

- Text-based Diagrams
    - [Mermaid](https://mermaid.js.org/intro/)
    - [Graphviz](https://graphviz.org/gallery/)
    - [...and many more](https://kroki.io/)

Own Your Agent Roles / System Prompts

  • Agent prompts define roles, processes, and expectations
  • Focused instructions; no data or product artifacts
  • Modular: Keep prompts scoped to a single, focused objective
  • Chain various agents to orchestrate a complex process
    • Agents can spawn sub-agents!
    • Calling agent checks sub-agent’s output and continues the thread as needed
  • Treat prompts as code; use version control
  • Instead of loading skills, develop simple agents!!

Context Window

  • Context is precious; don’t dump extensive amounts of texts into it
  • Models (and people) perform better on focused tasks with smaller contexts
    • Shorter context = faster responses, cheaper calls, and fewer hallucinations
  • Start new conversations often!
    • Artifacts provide continuity
  • Skills often bloat context windows; use them judiciously
    • Pulled on-demand by agents probablistically; cost a lot of tokens
  • Use custom agents that will do one thing well
    • The “Need to Know” Basis: Feed agents only the specific files or functions they need
    • Sub-agents start with fresh context and a small set of instructions

Control Flow

  • Ideally: deterministic processes manage agent interactions
  • Realistically: a more powerful model manages the long-running goal-driven task
    • Tasks sub-agents sequentially or in parallel as needed
    • Frontier models excel at this
  • Use intermediate artifacts
    • pause execution, allow human review, ensure reliable outcomes
  • Open-ended prompting enables discussion around artifacts
    • Start new conversations often!
  • LLM-as-a-judge: Use models to review and approve artifacts
  • Implementation is driven by artifacts, not prompts

Agents: Small, Simple, and Focused

Architect

Analyst

Architect

Planner

Planner

Tech Lead

Tech Lead

Tech Lead

Proposal

Design

Specifications

Tasks

Developer

Tester

Reviewer

  • Analyst: Develop a proposal. Produce specifications.
  • Architect: Write the design / architecture document.
  • Planner: Develop and refine the plan. Identify dependencies and opportunities to parallelize tasks.
  • Tech Lead: Review and execute the plan. Delegate extensively.
    • Developer: Implement the plan.
    • Tester: Test the implementation. Write unit tests.
    • Reviewer: Ensure each task is complete to standard.

Agents task sub-agents as needed.

Why OpenCode?

  • Harness of choice: good balance between features and configurability
  • Overall loop remains non-deterministic - driven by a model capable of long-horizon reasoning
    • For complex tasks, expect this loop to run for hours at a time without human interaction
  • Run in terminal or web browser; supports multiple projects and sessions

Pros

  • Open source; no vendor lock-in
    • Use any provider, model, skills
  • Highly customizable
    • Fully control your system prompts / agent roles
  • Powerful permission model; containerize for added security
  • Agents can spawn multiple sub-agents
    • n-level recursion and parallelization
  • Multi-modal inputs: text, code, images!

Cons

  • Non-deterministic loop
    • Controlling model might not always make the best decisions
  • Configuration: must edit opencode.json for certain features
  • Many features still in development
  • Defining specific agent roles takes additional effort
    • Result of wanting to control your own agent roles
    • Can be automated with proper tooling

OpenCode Agentic Development Workshop

  1. Install Git, WSL, Docker; on Linux or MacOS, just ensure you have docker compose
  2. Grab the code: git clone https://github.com/aadityabhatia/opencode-docker
    • Inspect contents: opencode.jsonc, agents/, workspace/
    • workspace is the shared folder accessible from both the host and the container
  3. Run docker compose up to start OpenCode web service; docker compose run for CLI
  4. Open http://localhost:4096 in your browser
  5. Configure OpenCode
    • Add your model providers and API keys
  6. Add project /workspace and start a new session
    • README.md and spec/proposal.md contain a sample project description
  7. Start interacting with the agents!
    • Analyst: “write the specifications
    • Architect: “create the design document
    • Planner: “generate a detailed plan and identify opportunities for concurrent execution
    • Tech Lead: “execute the plan

See detailed instructions and code here

Future Work

  • Deterministic harness, e.g. OpenHands
    • Predictable control flow; agents orchestrated by a state machine
    • Precise control over intermediate artifacts: human-in-the-loop, agents-as-a-judge
  • Visualize agents and artifacts with a unified dashboard
  • Agent composition
    • Dynamically define agent roles and permissions
    • Organize agents into a hierarchy for any given task
    • Generalize beyond software engineering!

Resources

Open Source Harnesses

Open Weight Models

Use your local GPU

  • Do this if you have a GPU with 24GB+ VRAM
  • LM Studio - easiest setup
  • Ollama - easy setup, models just work
  • vLLM - complex, high performance

Hosted Models