2026-10-02 β€’ 8 min read

Building HomeTutorPro: How I Mastered Agentic Programming

Android
Agentic Coding
Kotlin
Gemini
Clean Architecture

1. Introduction

As a Senior Android Engineer with over 7 years in production systems (including high-security banking and high-concurrency consumer apps), I was skeptical about early AI coding demos. Generic chat assistants often generated deprecated APIs, invented synthetic annotations, or broke Clean Architecture boundaries.

When developing HomeTutorPro, I chose a different path: Agentic Programming. Rather than using AI as a casual autocomplete tool, I designed an autonomous multi-agent pipeline with deterministic safeguards to audit architecture, generate unit test skeletons, and enforce code quality rules.

2. The Architectural Challenge

HomeTutorPro is a production-grade application featuring:

β€’

Layered Clean Architecture: Strict 3-tier separation (Domain, Data, Presentation) ensuring zero framework leakage into core business logic.

β€’

Offline-First Persistence: Room Database as single source of truth with complex relational queries.

β€’

Unidirectional Data Flow (UDF): Jetpack Compose with strict ViewModel state machines.

β€’

On-Device AI Inference: Google MediaPipe GenAI and Gemma running directly on device silicon.

When maintaining such a system solo, technical debt can compound quickly. I needed an automated mechanism to verify that:

β€’

1. Pure Domain: Domain layers never leak Android SDK or framework dependencies.

β€’

2. Test Coverage: Every ViewModel state transition is covered by test assertions.

β€’

3. Contract Enforcement: Architecture guidelines specified in AGENTS.md are strictly followed.

3. The 5-Agent Architecture Suite

I designed 5 specialized local agents orchestrated by Python scripts and Gemini models:

MULTI-AGENT SYSTEM
Copy
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚        Local Agent Orchestrator        β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β–Ό           β–Ό           β–Ό           β–Ό           β–Ό
   [Arch Aud]  [Security]  [Testing]    [KDoc]    [Refactor]
   β€’ Clean     β€’ Redacts   β€’ JUnit &    β€’ API     β€’ Modernize
     Arch        PII         Flow         docs      Compose

Deterministic Safeguards

Language models are probabilistic; software architecture cannot be. To make agents reliable:

β€’

AGENTS.md Contracts: Explicit structural guidelines defining allowed imports, package conventions, and naming rules.

β€’

Git Diff Scrapers: Agents only inspect and propose changes within the precise scope of modified files.

β€’

Compiler as Supreme Judge: No agent proposal is accepted unless ./gradlew test passes without warning.

4. Handling Free-Tier LLM Rate Limits in Local Workflows

One major practical hurdle was LLM rate limiting during large codebase reviews. To make the pipeline resilient:

β€’

Exponential Backoff with Jitter: Gracefully pauses and retries requests when encountering HTTP 429 rate limits.

β€’

Local AST & Symbol Caching: Cached Abstract Syntax Trees and symbol tables locally to prevent redundant prompt token consumption.

β€’

Deterministic Test Mocks: Built mock response fixtures for offline and deterministic test runs without hitting network APIs.

5. Key Learnings & Architecture Impact

β€’

Specialization Beats Generalization: Five small, specialized agents with distinct system prompts outperform one monolithic general-purpose prompt by a wide margin.

β€’

Deterministic Bounds are Non-Negotiable: Always couple AI outputs with compilers, linters, and unit tests.

β€’

Productivity as a Force Multiplier: Routine boilerplate (KDocs, test doubles, dependency declarations) was reduced by 60%, allowing focus on high-impact architecture, memory management, and UX design.

πŸ’‘ Core Philosophy: "Agents propose, compilers & tests dispose". Agentic programming isn't about replacing developer judgmentβ€”it's about automating the cognitive burden of repetitive verification. By treating agent prompts as version-controlled code, our mobile architecture remains pristine even under rapid iteration.

Β© 2026 Susana CΓ³rdoba Serrano β€’ Built with Kotlin & Kobweb β€’ Deployed with Firebase Hosting
βŒπŸ•ΈοΈ