October 16, 2026

Architecting Complexity: How a Structured Multi-Prompt Strategy Enabled an AI Agent to Build a Multi-Platform Messenger

In the rapidly evolving landscape of artificial intelligence, the narrative has shifted from simple code generation to the complex orchestration of entire software ecosystems. A recent development project has demonstrated that while AI coding agents are often relegated to building simple "CRUD" applications, they are increasingly capable of handling sophisticated, multi-surface products when guided by a rigorous architectural framework. The project in question—a comprehensive "Family Messenger"—was developed not through a single, sprawling request, but through a calculated "architecture-first" methodology that mirrors the workflow of a professional engineering team.

The scope of the project was intentionally broad, designed to test the limits of what an AI agent can coherently execute. The requirements included a robust backend, a shared data layer, and four distinct client targets—Android, iOS, Desktop, and Web—all running on a single codebase. Beyond the basic interface, the system required complex features such as data synchronization, delivery and read receipts, push notifications, and a self-hosted deployment strategy targeting a plain Virtual Private Server (VPS).

In a traditional corporate environment, a project of this magnitude would typically necessitate a multi-disciplinary team. It would require a backend developer to handle the server logic and database, a mobile developer for the handheld platforms, a web specialist for the browser interface, and a lead architect to ensure that all components interact seamlessly before a single line of business logic is even written. The goal of this experiment was to determine if an AI agent could fill all these roles by following a structured sequence of prompts that prioritized architectural integrity over immediate code output.

The Shift from Code Generation to Architectural Contracts

The developer behind the project, who has made the entire repository and every prompt used publicly available on GitHub, noted that the primary challenge was not the generation of code itself, but the maintenance of coherence across a wide surface area. A common pitfall in AI-assisted development is the "single prompt" approach. Asking an AI to "build a family messenger in Kotlin" might produce a functional prototype, but it rarely results in a production-ready system where the backend and four different clients agree on the same Data Transfer Objects (DTOs), or where data synchronization can survive a dropped connection.

To solve this, the developer utilized a two-stage planning process. First, the core idea was described to a web-based Large Language Model, such as ChatGPT or Claude. This model acted as a senior architect, translating the high-level requirements into a massive "master prompt" that functioned as a solution architecture document. This document fixed the boundaries of the system before any implementation began.

This master prompt, an extensive document of approximately 33 KB, served as the project’s contract. It laid out specific technical constraints that are often overlooked in casual AI prompting. For instance, it mandated that the backend run on an Ubuntu 24.04 VPS via Docker Compose, specifically eschewing the complexity of Kubernetes. It also dictated that the system use polling as its primary method for message retrieval to ensure reliability across all platforms, making Firebase Cloud Messaging (FCM) push notifications an optional enhancement rather than a hard dependency.

The architectural contract also defined the internal plumbing of the application. It specified the use of Koin for dependency injection on both the backend and the client sides. Crucially, it required a separate, shared Kotlin module to hold all request and response DTOs, enums, and transport contracts. This ensured that the backend and the various clients were using the exact same definitions, preventing the duplication and divergence that often plague multi-platform projects.