Leanpub Header

Skip to main content

AI-Assisted Development

Working With Coding Agents

AI-Assisted Development

A working engineer's guide to building and maintaining production software with autonomous terminal coding agents (382 manuscript pages).

Minimum price

$19.99

$29.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
About

About

About the Book

Terminal coding agents can now read a codebase, plan a change, edit many files, run the tests, and hand you a diff. Used well, they compress hours of mechanical work into minutes; used carelessly, they produce confident, plausible, and wrong changes faster than any human could.

AI-Assisted Development is a practical guide to using them well, for working developers who want to move faster without giving up control of quality, security, or their git history. Its method is simple: the human designs, the agent executes, and a human-reviewed diff is the gate between the two.

Git, tests, context files, and a sandbox are the four backbones that make that safe. The book builds each one, then adds the judgment no tool supplies: what to delegate, what to keep, how to review what comes back, and when to stop a session.

Part I maps the tools and walks through a controlled first session. Part II covers daily practice, from sandboxing and prompting to refactoring, diff review, git micro-commits, and testing. Part III scales the practice to local and cloud models, custom tools, teams, and CI, and closes with the anti-patterns and maintenance habits that keep it healthy.

Because tool names and flags change quickly, the book anchors on durable patterns and treats specific commands as illustrations to adapt.

Author

About the Author

Yohan Rodriguez

Yohan is a Senior Full-Stack Software Engineer with extensive experience delivering scalable, end-to-end software solutions across web, enterprise, and cloud-based environments. He specializes in architecting robust platforms, modernizing legacy systems, driving cloud transformation efforts, and building integration-heavy applications that support critical business workflows. He is recognized for translating complex requirements into reliable, maintainable, and high-value solutions across industries such as insurance, cybersecurity, and professional services.

Known for combining strong technical execution with a practical business mindset, he has contributed to projects from concept and design through production delivery and long-term support. His experience includes collaborating with cross-functional teams, improving development workflows, solving complex technical challenges, and helping organizations deliver dependable software products that adapt to changing business needs. He brings a balanced approach to engineering that values quality, efficiency, and continuous improvement.

Contents

Table of Contents

  • Preface i
  • 1 The Landscape --- Claude Code, Aider, Cursor, and Local Tools 2
    • 1.1 The Shift From Chat Assistance to Agentic Development 3
    • 1.2 A Taxonomy of AI Development Tools 4
    • 1.3 Autocomplete Tools: Fast, Narrow, and Low-Friction 6
    • 1.4 Chat-Based Coding Assistants: Useful but Disconnected 8
    • 1.5 IDE-Integrated Agents: Convenient but Editor-Bound 9
    • 1.6 Terminal-Based Coding Agents: The New Power Tool 10
    • 1.7 Claude Code, Aider, Cursor, and Similar Tools: How to Think About Them 12
    • 1.8 Local and Open-Weight Coding Models 13
    • 1.9 Cloud Agents vs. Local Agents 15
    • 1.10 Context Windows, Repository Maps, and Why Agents Get Lost 16
    • 1.11 Terminal State, Command Execution, and Feedback Loops 18
    • 1.12 The Real Productivity Pattern: Human Designs, Agent Executes 20
    • 1.13 Choosing the Right Tool for the Job 21
    • 1.14 A Practical Starter Stack 22
    • 1.15 What This Book Will Teach You Next 24
  • 2 Setup and Your First Session 26
    • 2.1 Before You Install Anything 26
    • 2.2 The Three Layers of Setup 27
    • 2.3 Choosing a First Repository 29
    • 2.4 Installing the Agent Without Making the Book Fragile 30
    • 2.5 Credential and API Key Hygiene 31
    • 2.6 Terminal Readiness 32
    • 2.7 The Clean Git Baseline 33
    • 2.8 Starting the First Session 34
    • 2.9 Read-Only Repository Discovery 36
    • 2.10 Verifying Tool Behavior 37
    • 2.11 Running the First Safe Command 38
    • 2.12 The First Tiny Change 39
    • 2.13 Reading the Diff 39
    • 2.14 Common First-Session Failures 41
    • 2.15 Ending the Session Cleanly 42
    • 2.16 What We Learned From the First Session 43
  • 3 Context Files: CLAUDE.md and AGENTS.md 45
    • 3.1 Why Agents Need Project Memory 45
    • 3.2 The Three Instruction Layers 47
    • 3.3 CLAUDE.md, AGENTS.md, and Tool-Specific Context 49
    • 3.4 What Belongs in a Repository Context File 49
    • 3.5 What Does Not Belong in a Context File 51
    • 3.6 A Minimal Context File Template 52
    • 3.7 A Full Production Context File Template 53
    • 3.8 Stack-Specific Context Examples 55
    • 3.9 Architecture Boundaries 56
    • 3.10 Command Rules and Safety Levels 58
    • 3.11 Files and Directories the Agent Should Avoid 58
    • 3.12 Token Economy: Keeping Context Compact 59
    • 3.13 Testing the Context File 60
    • 3.14 Maintaining Context Files Over Time 61
    • 3.15 Team Context vs. Personal Context 63
    • 3.16 Hands-On Lab: Build a Context File for an Existing Repository 63
    • 3.17 Common Mistakes 65
    • 3.18 Chapter Summary 66
  • 4 Permissions, Sandboxing, and Safety 69
    • 4.1 Why Agent Safety Is Different From Normal Development Safety 69
    • 4.2 The Safety Model: Guide, Limit, Verify, Recover 71
    • 4.3 Threats and Failure Modes 72
    • 4.4 Permission Boundaries 73
    • 4.5 Command Risk Levels 75
    • 4.6 Host Execution vs. Sandboxed Execution 76
    • 4.7 The Minimal Practical Sandbox 77
    • 4.8 Building a Basic Agent Sandbox 78
    • 4.9 Mounting Repositories Safely 81
    • 4.10 Environment Variables and Secrets in Sandboxes 82
    • 4.11 Network Access 83
    • 4.12 Approval Gates 84
    • 4.13 Monitoring What the Agent Changed 85
    • 4.14 Recovery Patterns 87
    • 4.15 Hands-On Lab: Build and Use a Local Agent Sandbox 88
    • 4.16 When Sandboxing Is Not Enough 90
    • 4.17 Common Mistakes 90
    • 4.18 Chapter Summary 91
  • 5 Prompting for Code --- The Declarative Method 93
    • 5.1 Why ``Prompt Engineering'' Is the Wrong Frame for Coding Agents 93
    • 5.2 The Declarative Method 95
    • 5.3 Vague Prompt vs. Declarative Prompt 97
    • 5.4 Define the Goal Before the Implementation 99
    • 5.5 Define the Scope 100
    • 5.6 Files to Inspect, Modify, and Avoid 101
    • 5.7 Constraints That Prevent Architectural Drift 102
    • 5.8 Inputs and Expected Outputs 103
    • 5.9 Verification Commands 104
    • 5.10 Stopping Conditions 105
    • 5.11 The Investigation-First Prompt 107
    • 5.12 The Implementation Prompt 107
    • 5.13 The Test-First Prompt 109
    • 5.14 The Documentation Prompt 110
    • 5.15 The Refactor Prompt 111
    • 5.16 The Bug-Fix Prompt 112
    • 5.17 Incremental Prompting 114
    • 5.18 Prompt Libraries 115
    • 5.19 Common Prompting Mistakes 116
    • 5.20 Hands-On Lab: Turn a Vague Request Into a Work Order 116
    • 5.21 Chapter Summary 120
  • 6 Multi-File Refactoring and Navigation 121
    • 6.1 Why Multi-File Work Is Different 121
    • 6.2 Refactoring vs. Rewriting vs. Feature Work 122
    • 6.3 The Navigation-First Principle 123
    • 6.4 Repository Maps and Symbol Awareness 125
    • 6.5 Search Patterns for Codebase Navigation 126
    • 6.6 Identifying Dependency Chains 128
    • 6.7 Planning the Refactor Sequence 129
    • 6.8 Interface Changes and Ripple Effects 131
    • 6.9 Layered Architecture Refactors 132
    • 6.10 Keeping the Codebase Buildable 133
    • 6.11 Batching Changes 134
    • 6.12 Working With Tests During Refactors 136
    • 6.13 Handling Generated Files, Lock Files, and Snapshots 137
    • 6.14 Stopping Conditions for Multi-File Work 138
    • 6.15 Worked Example: Replace a Hardcoded Service With an Interface 139
    • 6.16 When to Let the Agent Continue vs. When to Take Over 141
    • 6.17 Hands-On Lab: Controlled Multi-File Refactor 142
    • 6.18 Common Mistakes 143
    • 6.19 Chapter Summary 144
  • 7 Reviewing Agent Output: Diffs and Audits 146
    • 7.1 The Diff Is the Real Answer 146
    • 7.2 First-Pass Review: What Changed? 148
    • 7.3 Changed Files: Expected, Unexpected, and Suspicious 149
    • 7.4 Mechanical vs. Semantic Changes 150
    • 7.5 Scope Compliance 151
    • 7.6 Architecture Review 152
    • 7.7 Security Review 154
    • 7.8 Test Review: Did the Agent Prove the Right Thing? 156
    • 7.9 Hallucinated APIs and Invented Behavior 158
    • 7.10 Dependency and Package Review 159
    • 7.11 Configuration, Migration, and Infrastructure Review 160
    • 7.12 Data and Behavior Review 161
    • 7.13 Performance and Maintainability Review 162
    • 7.14 Reviewing the Agent's Explanation 163
    • 7.15 Using an Agent to Review Another Agent 164
    • 7.16 Accept, Edit, Split, or Reject 165
    • 7.17 Worked Example: Hidden Agent Errors in a Small Diff 167
    • 7.18 Hands-On Lab: Audit an Agent-Generated Change 169
    • 7.19 Common Review Mistakes 171
    • 7.20 Chapter Summary 171
  • 8 When to Delegate vs. Do It Yourself 173
    • 8.1 The Delegation Trap 173
    • 8.2 The Five Delegation Filters 174
    • 8.3 The Delegation Spectrum 176
    • 8.4 Highly Delegable Tasks 177
    • 8.5 Collaborative Tasks 178
    • 8.6 Human-Only First Tasks 179
    • 8.7 The Review-Cost Equation 179
    • 8.8 Task Ambiguity 180
    • 8.9 Testability and Verification 181
    • 8.10 Reversibility 182
    • 8.11 Context Availability 183
    • 8.12 Tool Choice by Task Type 183
    • 8.13 Time, Token, and Attention Budgets 185
    • 8.14 Skill Retention 186
    • 8.15 Personal Delegation Rules 187
    • 8.16 Team Delegation Rules 187
    • 8.17 Worked Examples: Should I Delegate This? 188
    • 8.18 Hands-On Lab: Build a Delegation Decision 189
    • 8.19 Common Delegation Mistakes 191
    • 8.20 Chapter Summary 192
  • 9 Git Workflows with Agents: Branching and Micro-commits 193
    • 9.1 Why Git Matters More With Agents 193
    • 9.2 The Clean Baseline Rule 194
    • 9.3 Branching for Agent Tasks 195
    • 9.4 Micro-commits: The Atomic Checkpoint Pattern 197
    • 9.5 Commit Boundaries for Agent Work 199
    • 9.6 Keeping Human and Agent Work Separate 200
    • 9.7 Staging Discipline 201
    • 9.8 Writing Commit Messages From Diffs 202
    • 9.9 Using Agents to Summarize Diffs Safely 203
    • 9.10 The Agent Micro-commit Loop 205
    • 9.11 Rollback and Recovery 206
    • 9.12 Working With Generated Files and Lock Files 208
    • 9.13 Pull Requests for Agent-Assisted Work 209
    • 9.14 Agents and Merge Conflicts 210
    • 9.15 Git Worktrees for Parallel Agent Sessions 211
    • 9.16 Comparing Two Agent Approaches 212
    • 9.17 Hands-On Lab: Agent Work as Micro-commits 213
    • 9.18 Common Git Mistakes With Agents 215
    • 9.19 Chapter Summary 217
  • 10 Testing Agent-Written Code: The Auto-Repair Loop 218
    • 10.1 Tests Are the Agent's Reality Check 218
    • 10.2 Existing Tests Before New Code 219
    • 10.3 Test-First, Test-During, and Test-After 220
    • 10.4 What Makes a Good Agent-Written Test? 221
    • 10.5 Targeted Test Commands 223
    • 10.6 Feeding Failures Back to the Agent 224
    • 10.7 The Manual Repair Loop 226
    • 10.8 The Auto-Repair Loop 227
    • 10.9 Building a Simple Test-Repair Script 228
    • 10.10 Guardrails for Auto-Repair 230
    • 10.11 Preventing Test Cheating 231
    • 10.12 Coverage: Useful Signal, Not a Goal by Itself 233
    • 10.13 Flaky Tests and Environment Failures 234
    • 10.14 When Tests Are Missing 235
    • 10.15 Testing Across Stacks 236
    • 10.16 Worked Example: From Failing Test to Repair 236
    • 10.17 Hands-On Lab: Build a Bounded Repair Loop 239
    • 10.18 Common Testing Mistakes With Agents 241
    • 10.19 Chapter Summary 242
  • 11 Local vs. Cloud Trade-Offs 244
    • 11.1 The False Choice: Local or Cloud 244
    • 11.2 The Decision Dimensions 245
    • 11.3 What Cloud Models Are Usually Better At 246
    • 11.4 What Local Models Are Usually Better At 247
    • 11.5 Data Privacy and Code Exposure 248
    • 11.6 Cost and Token Economics Without Vendor Fragility 249
    • 11.7 Latency, Throughput, and Developer Flow 251
    • 11.8 Hardware Realities for Local Models 252
    • 11.9 Model Quality and Benchmark Traps 253
    • 11.10 Local Model Tooling 254
    • 11.11 Cloud Agent Tooling 255
    • 11.12 Hybrid Workflows 256
    • 11.13 Policy and Compliance 257
    • 11.14 Choosing a Setup by Task Type 258
    • 11.15 Budget Controls and Usage Hygiene 259
    • 11.16 When Local Is Not Worth It 260
    • 11.17 When Cloud Is Not Appropriate 261
    • 11.18 Hands-On Lab: Build a Local/Cloud Decision Matrix 262
    • 11.19 Common Mistakes 263
    • 11.20 Chapter Summary 264
  • 12 Model Context Protocol (MCP) and Custom Tools 265
    • 12.1 Why Coding Agents Need Tools 265
    • 12.2 MCP in One Practical Picture 266
    • 12.3 Tools vs. Shell Commands 267
    • 12.4 Good Custom Tool Candidates 268
    • 12.5 Bad Custom Tool Candidates 269
    • 12.6 Designing a Tool Contract 270
    • 12.7 Read-Only First 272
    • 12.8 Data Boundaries and Sanitization 272
    • 12.9 A Small Local Tool Server Example 274
    • 12.10 Tool Registration Conceptually 277
    • 12.11 Calling the Tool From an Agent Prompt 278
    • 12.12 Tool Output Review 279
    • 12.13 Tool Call Logging 280
    • 12.14 Approval-Gated Tools 281
    • 12.15 Tool Errors and Failure Modes 282
    • 12.16 Security Review for Custom Tools 283
    • 12.17 Local vs. Remote Tool Servers 285
    • 12.18 Hands-On Lab: Build a Read-Only Project Inventory Tool 286
    • 12.19 Common Mistakes 288
    • 12.20 Chapter Summary 289
  • 13 Team Patterns and Shared Guidelines 290
    • 13.1 Why Team AI Adoption Fails 290
    • 13.2 The Team Operating Model 291
    • 13.3 Approved, Restricted, and Forbidden Uses 292
    • 13.4 Shared Context Files Across Repositories 294
    • 13.5 Prompt Libraries as Team Assets 296
    • 13.6 Shared Sandboxes and Development Environments 297
    • 13.7 Shared Custom Tools and MCP Servers 298
    • 13.8 Review Expectations for Agent-Assisted Changes 299
    • 13.9 Disclosure and Traceability 301
    • 13.10 Junior Developers and Learning 302
    • 13.11 Senior Developers and Tech Leads 304
    • 13.12 Cost and Usage Visibility 304
    • 13.13 Security and Data Handling Rules 305
    • 13.14 Team Prompt and Context Reviews 307
    • 13.15 Handling Disagreements About Agent Use 308
    • 13.16 Team Metrics That Actually Help 308
    • 13.17 Hands-On Lab: Create a Team AI Usage Guide 309
    • 13.18 Common Mistakes 311
    • 13.19 Chapter Summary 312
  • 14 Continuous Integration and Agent Automation 314
    • 14.1 Why Put Agents in CI? 314
    • 14.2 Automation Levels 315
    • 14.3 The Safe CI Agent Pattern 316
    • 14.4 Permissions and Secrets in CI 317
    • 14.5 Runtime, Cost, and Loop Limits 319
    • 14.6 Report-Only Failure Analysis 320
    • 14.7 Patch Artifact Pattern 322
    • 14.8 Lint and Formatting Triage 325
    • 14.9 Test Failure Triage 325
    • 14.10 Dependency and Vulnerability Review 327
    • 14.11 Pull Request Summary Assistance 327
    • 14.12 CI Configuration Examples 329
    • 14.13 Handling Untrusted Contributions 333
    • 14.14 Prompt Injection in CI Logs and Files 334
    • 14.15 Approval Gates 335
    • 14.16 Observability and Audit Trails 336
    • 14.17 Hands-On Lab: Add a Report-Only Agent CI Job 337
    • 14.18 Common Mistakes 339
    • 14.19 Chapter Summary 340
  • 15 Pitfalls, Anti-Patterns, and Maintenance 342
    • 15.1 The Honeymoon Phase 342
    • 15.2 Anti-Pattern: Prompting Instead of Thinking 343
    • 15.3 Anti-Pattern: Accepting Code You Cannot Explain 344
    • 15.4 Anti-Pattern: Context Rot 346
    • 15.5 Anti-Pattern: Prompt Library Rot 347
    • 15.6 Anti-Pattern: Test Theater 349
    • 15.7 Anti-Pattern: Review Theater 350
    • 15.8 Anti-Pattern: Automation Without Ownership 351
    • 15.9 Anti-Pattern: Tool Sprawl 352
    • 15.10 Anti-Pattern: Invisible Cost Drift 353
    • 15.11 Anti-Pattern: Privacy Normalization 355
    • 15.12 Anti-Pattern: Skill Decay 356
    • 15.13 Anti-Pattern: Managerial Velocity Fantasy 357
    • 15.14 Maintenance Rhythm 358
    • 15.15 Workflow Health Checks 360
    • 15.16 When to Stop the Agent 361
    • 15.17 Recovery After a Bad Agent Session 363
    • 15.18 Hands-On Lab: Build Your AI Maintenance Plan 364
    • 15.19 The Sustainable AI-Assisted Developer 366
    • 15.20 Chapter Summary 367
  • Conclusion 368

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

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.

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 $15 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