Leanpub Header

Skip to main content

Agentic Software Engineering

The Definitive Governance Framework

Stop treating AI like a deterministic compiler and wondering why your codebase is degrading into hallucinated spaghetti code. Agentic Software Engineering provides the architecture, constraints, and rigorous governance needed to safely transition your team from manual typists to AI Orchestrators.

Minimum price

$24.99

$34.99

You pay

$34.99

Author earns

$27.99
$

...Or Buy With Credits!

You can get credits with a paid monthly or annual Reader Membership, or you can buy them here.
PDF
EPUB
WEB
About

About

About the Book

Agentic Software Engineering: The Handbook for Governing AI

Stop fighting AI hallucinations. Start engineering with them.

We were promised a future where we could simply type a natural language prompt and perfect, production-ready software would emerge. But for anyone who has tried to use Large Language Models (LLMs) to build complex enterprise applications, the reality is starkly different: AI hallucinates architectures, forgets security protocols, ignores existing utility functions, and spins into infinite loops of technical debt.

This is the AI Coding Crisis. The cause isn't bad models; the cause is a lack of engineering governance.

Agentic Software Engineering is your blueprint for regaining control. Drawing on thirty years of industry experience across every major technological paradigm shift, Hugo L. Villalobos reveals why treating an AI like a compiler is a fundamental mistake. Instead, this handbook teaches you how to treat AI like the non-deterministic, probabilistic engine it truly is.

In this concise, no-nonsense guide, you will learn how to:

  • Stop the Hallucination Spiral: Understand the physics of Code Entropy and why unconstrained LLMs inevitably degrade complex codebases.
  • Implement Zero-Trust AI: Enforce strict OWASP Top 10 security standards and Non-Functional Requirements (NFRs) before the AI generates a single line of code.
  • Master the Orchestrator/Worker Pattern: Transition from manually prompting chat windows to building automated, multi-agent pipelines that scale to massive, legacy microservice architectures.
  • Tropicalize the Framework: Adapt the Agentic Software Engineering (ASE) principles to fit the unique cultural and technical realities of your specific enterprise.

The narrative that AI is here to "replace" developers fundamentally misunderstands the nature of software creation. Writing syntax has always been the easiest part of our job; engineering systems is the true challenge.

This is not a book about writing better prompts. This is a book about building better systems. Elevate yourself from a manual typist to a true Orchestrator of information, and harness the speed of AI without sacrificing the security, maintainability, and structural integrity of your enterprise software.

The age of the "God Agent" magic trick is over. The era of the Governed AI has begun.

Author

About the Author

Hugo L. Villalobos

Hugo L. Villalobos has been at the forefront of the software engineering industry for over thirty years, navigating and driving teams through every major technological paradigm shift—from Mainframes and Client-Server architectures to the Web, the Cloud, and now, Agentic Software.

His journey began in college, working for a large state corporation powered by IBM mainframes and COBOL. Even before writing his first line of code, he had the invaluable opportunity to study massive codebases and witness the complete software engineering lifecycle in action.

In his twenties, during the rise of the client-server paradigm, Hugo left college to become an entrepreneur. His venture secured major contracts from the outset, including building the budget management system for the Mexican state oil company. Starting as a solo developer using Gupta Corporation's SQLWindows, he quickly identified a pattern that would define his career: the need to structure and automate software generation.

By leveraging the TeamWindows feature, he built a custom framework that standardized the codebase. When his company hired new programmers, they didn't need to master the entire language upfront; they only needed to learn the framework to become immediately productive. The resulting code was remarkably homogeneous. A decade later—long after SQLWindows had been replaced by platforms like Oracle, Progress, and .NET—he observed that the exact same patterns his framework had enforced had evolved into a permanent "Operations Culture" within his teams.

As his company took on more projects, the bottleneck shifted to project management. Unmanaged scopes led to late and over-budget deliveries. Recognizing the gap, Hugo rigorously studied the discipline, earning his PMP and Scrum Master certifications. He instituted strict practices to control project scope, effort, time, and budget, ensuring that his projects never derailed again.

Shifting his focus to strategic action and market expansion, he led his organization to successfully achieve a CMMI Level 2 appraisal. At its peak, his enterprise employed 600 engineers. Its core strength remained that foundational Operations Culture, enabling the company to scale, spin off, and execute with perfectly controlled software engineering processes.

Today, as the industry faces the crisis of AI hallucination and unmanaged code generation, Hugo applies those same principles of structure, governance, and architectural rigor to the world of Large Language Models. Agentic Software Engineering is the culmination of three decades of hard-won lessons in how to govern the entropy of software creation, regardless of whether the code is written by a human or a machine.

Contents

Table of Contents

Agentic Software Engineering

  1. The Handbook for Governing AI

Copyright

Introduction: The Entropy of the Broken Telephone

Part 1: The AI Coding Crisis & The Universal Truth

  1. Chapter 1: The Infrastructure Illusion & Scope Creep at Lightspeed
  2. Chapter 2: The Equivalency Map
  3. Chapter 3: The Illusion of “Just Write Code”
  4. Chapter 4: The Micro-Waterfall Renaissance

Part 2: The Framework: Governing the AI

  1. Chapter 5: The Agent-Based Workflow
  2. Chapter 6: Prompting for Predictability
  3. Chapter 7: Governing the Emotional Connection (UI/UX)
  4. Chapter 8: Requirements as Guardrails
  5. Chapter 9: The Registers (Declaring the Boundaries)
  6. Chapter 10: Breaking the Task (The Implementation Plan)

Part 3: Advanced AI Patterns & Entropy Management

  1. Chapter 11: Prompt Architecting & Agent Types
  2. Chapter 12: Controlling Code Entropy (Architectural Paradigms)
  3. Chapter 13: Zero-Trust AI & The OWASP Top 10
  4. Chapter 14: The NFR Safety Net (Periodic Attention Refresh)

Part 4: Implementation & Automation

  1. Chapter 15: Human-in-the-Loop (HITL) Execution
  2. Chapter 16: Attractora Core and the Worker Fabric
  3. Chapter 17: Scaling Attractora with State, RAG, and Sovereign Infrastructure

Part 5: The Capstone Test Proof

  1. Chapter 18: Requirements Extraction
  2. Chapter 19: Sizing & Planning the App
  3. Chapter 20: Forcing the Architecture
  4. Chapter 21: The Final Code Walkthrough

Part 6: Continuous Evolution & Adaptation

  1. Chapter 22: Tuning and “Tropicalizing” the Framework
  2. Chapter 23: The Roadmap for ASE and Attractora

Appendix A: The Scribe Method and AI Agents

Appendix B: The Illusion of “Easy” AI Graphics

  1. The Mermaid Trap
  2. The AI Graphic Treatment
  3. The Domain Expertise Parallels

Appendix C: ASE Framework Repository and System Implementations

Recommended Reading & Bibliography

  1. Academic Research
  2. Books & Handbooks

Appendix E: The Agentic Corporate Software Lifecycle

  1. 1. Requirements Engineering (The Uniquely Human Endeavor)
  2. 2. Software Architecture and High-Level Design (Human-Directed Orchestration)
  3. 3. Implementation and Coding (Agent-Driven, Human-Maintained)
  4. 4. Quality Assurance and Testing (Agent-Executed, Human-Validated)
  5. 5. DevOps, CI/CD, and Operations (Agent-Automated, Human-Governed)
  6. 6. Project Management and Agile Execution (Agent-Assisted)
  7. 7. Framework Governance and “Tropicalization” (The Meta-Human Role)

Appendix F: Related Efforts and the Emerging Synthesis

  1. 1. Agentsway (Academic Methodology)
  2. 2. OpenCastle and Multi-Agent Orchestration
  3. 3. Repository-Structured and Instruction-File Approaches
  4. 4. Production-Grade and Cognitive-Blueprint Frameworks
  5. 5. Why This Matters for You

Appendix G: Culture as Infrastructure for Agentic Software Development

  1. 1. Why Culture Matters Just as Much in the Agentic Era
  2. 2. What “Software Engineering Culture” Means in Practice
  3. 3. Reuse Is a Force Multiplier, Not a Compromise
  4. 4. The Cultural Layer of ASE
  5. 5. Human Teams and Agentic Teams Share the Same Law
  6. 6. A Practical Adoption Path
  7. Final Reflection

Appendix H: Heuristic Management

About the Author

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub