Skip to content

Unpacking the Layers of AI

An e-book for developers who want to become AI-native — not just use the chat, but understand and build the agentic systems underneath it.

Download the full PDF

You already code. You can read a stack trace, design a schema, argue an architecture trade-off. But the new vocabulary arrives too fast: LLM, harness, agent, subagent, context, skill, plugin, MCP, CLI. Everyone uses these terms as if they were obvious, and rarely does anyone show where each one fits and how they connect.

This e-book solves that in a specific way: instead of defining each word in isolation, it builds one layer at a time on top of a single concrete example, and every chapter ties back to the central layer — the agent.

  • Developers who already code and want to master agentic system architecture.
  • Anyone who uses Claude Code (or similar tools) daily but treats it as a black box.
  • Teams who want to standardize how they build, package, and share agents.

This isn’t a “how to use the chat” tutorial. It’s about how the stack works underneath and how you design on top of it.

Every chapter uses the same concrete task:

Build a universal Orders CRUD system.

A real software engineering task, one every developer recognizes, with just the right complexity to demonstrate nearly every agentic layer. We’ll see:

  • why the LLM alone can describe an orders API but can’t write the files or run the database;
  • how the harness gives the model eyes and hands to create and change files;
  • how an agent (agent-order-orchestrator) turns the generic model into a domain specialist;
  • how a squad of subagents splits the task across product, architecture, backend, frontend, QA, and infra fronts;
  • and how context, skill, plugin, MCP, and CLI come in to make that operation robust, reusable, safe, and efficient.

The layers aren’t a rigid top-to-bottom stack — they compose. But there’s a dependency order that helps you think about it:

mermaid
graph TD
    LLM["LLM — the brain: predicts the next token"]
    HARNESS["Harness — the body: loop, tools, permissions"]
    AGENT["Agent — the specialist: prompt + model + tools"]
    SUB["Subagent — the squad: delegation in its own context"]
    CTX["Context — what the agent sees"]
    SKILL["Skill — knowledge on demand"]
    MCP["MCP — connection to the outside world"]
    PLUGIN["Plugin — distributable packaging"]
    CLI["CLI — where you operate everything"]

    LLM --> HARNESS
    HARNESS --> AGENT
    AGENT --> SUB
    CTX -.feeds.-> AGENT
    SKILL -.extends.-> AGENT
    MCP -.connects.-> AGENT
    PLUGIN -.packages.-> AGENT
    CLI -.operates.-> HARNESS
Código do diagrama
graph TD
    LLM["LLM — the brain: predicts the next token"]
    HARNESS["Harness — the body: loop, tools, permissions"]
    AGENT["Agent — the specialist: prompt + model + tools"]
    SUB["Subagent — the squad: delegation in its own context"]
    CTX["Context — what the agent sees"]
    SKILL["Skill — knowledge on demand"]
    MCP["MCP — connection to the outside world"]
    PLUGIN["Plugin — distributable packaging"]
    CLI["CLI — where you operate everything"]

    LLM --> HARNESS
    HARNESS --> AGENT
    AGENT --> SUB
    CTX -.feeds.-> AGENT
    SKILL -.extends.-> AGENT
    MCP -.connects.-> AGENT
    PLUGIN -.packages.-> AGENT
    CLI -.operates.-> HARNESS

Read it like this: the LLM is the brain. The harness is the body that gives it eyes, hands, and an action loop. The agent is a configuration of that set for a specific job. Everything else — subagent, context, skill, plugin, MCP, CLI — exists to make the agent more capable, more reliable, or easier to operate.

#ChapterWhat you’ll walk away knowing
01The LLMWhat the model does and, crucially, what it doesn’t do alone.
02The HarnessHow the LLM gains a loop, tools (TypeScript), and deterministic security hooks.
03The AgentThe anchor chapter. How to structure and version the Orders specialist.
04The SubagentDelegation into squads with isolated context. Case study: the full order squad.
05The ContextContext management, signal over noise, and working-memory control.
06The SkillProgressive disclosure, self-improving skills, and the anti-token-explosion rule.
07The PluginDistributable packaging with slash commands, hooks, and integrated MCP.
08The MCPMCP vs CLI: the unified protocol for external data and actions.
09The CLIThe terminal as a command cabin, custom commands, and Git Worktrees.
10SynthesisThe complete agentic stack in action end to end, with best practices.

Real-world case study: IgnitionStack, a multi-tenant SaaS platform. From explaining the stack to building AI products that run, scale, and pay for themselves.

#ChapterWhat you’ll walk away knowing
11Embeddings & Semantic SearchHow text becomes a vector and search shifts from words to meaning.
12RAGRetrieving external knowledge to answer with current, citable facts.
13MemoryWhat the agent remembers across sessions — and what it must forget (GDPR included).
14Structured Outputs & Tool CallingTurning language into validated, deterministic actions in the system.
15EvalsThe agents’ CI: measuring quality and blocking regressions before deploy.
16ObservabilitySeeing what the agent did, why it decided that, what it cost, and where it failed.
17Cost EngineeringMaking the AI product profitable without sacrificing quality.

The autonomous cycle of experimentation and improvement: metric, scope, verification, and rollback. We stop focusing only on the prompt and start designing robust iterative processes.

#ChapterWhat you’ll walk away knowing
18Loop EngineeringCycles with metric, scope, and rollback: Autoresearch, bundle, spec-loop, Chrome QA, and loop maturity.
19Graph EngineeringFrom isolated loops to agent graphs with shared state and durable memory.
20Workflows with SubagentsDynamic workflows orchestrating hundreds of subagents via JavaScript scripts.

Reading linearly, 01 through 20, is the recommended first pass. Part I (01-10) builds the agentic stack, Part II (11-17) puts that stack into production, and Part III explores the frontiers of Loop Engineering. But chapter 03 (agent) is the center of gravity: if you only have 20 minutes, read 01, 02, and 03 in that order and you’ll already have the mental model that supports the rest.

Every chapter follows the same pedagogical discipline:

  1. Example first. You see the concept in use before any definition.
  2. Definition second. Only then do we formalize the term.
  3. Tie-back to the agent. Every layer closes by showing how it connects to the anchor chapter.
  4. Real trade-offs. What it costs, where it fails, when not to use it.
  5. Primary sources. Official docs and papers, not third-party blogs.
  • Language: Brazilian Portuguese is the source of truth for these .md files. Versions in other languages are generated afterward from the source — the source content is never duplicated per language.
  • Models cited: the Claude 4.X family is used as a concrete reference — Opus 4.8 (claude-opus-4-8), Sonnet 4.6 (claude-sonnet-4-6), Haiku 4.5 (claude-haiku-4-5). The concepts apply to any modern LLM.
  • Voice: the inspiration drawn from educators like Andrej Karpathy (code first) and engineering authors like Robert C. Martin and Martin Fowler (clarity of principles) is tone, not quotation. No sentence is put in the mouth of real people.

Start with Chapter 01 — The LLM.