Hi everyone,
I’m working on a mobile application that contains both a legacy codebase and a newer Kotlin Multiplatform (KMP) architecture. I’m looking for feedback from people who have already introduced an agentic architecture or AI-assisted development workflows into a similar mobile project.
## Current architecture
- **Legacy part:**
- Legacy UI is implemented with UIKit on iOS and classic Android Views / XML layouts on Android.
- Legacy services are implemented natively in Swift for iOS and Kotlin for Android.
- **New KMP part:**
- Business logic, use cases, repositories, data sources, and ViewModels are shared in Kotlin Multiplatform.
- **New UI layer:**
- New screens are implemented with SwiftUI on iOS and Jetpack Compose on Android.
- Both platforms consume the shared KMP ViewModels.
So, the shared KMP layer covers domain/business logic through to the ViewModel, while the UI remains native on each platform. The legacy screens remain in UIKit on iOS and Android Views on Android, while new screens use SwiftUI and Compose.
## What I want to introduce
I want to introduce an **agentic architecture** to support development, code review, documentation, testing, and the progressive migration of legacy code into KMP.
I have access to both **GitHub Copilot** and **Claude**, and I’m looking for best practices to build a proper **agent harness** around them, rather than using them only as chat-based coding assistants.
By “agent harness”, I mean the surrounding system that makes agents reliable and useful in a real codebase:
- Structured project context and documentation
- Architecture rules and coding conventions
- Controlled access to repositories, files, and tools
- MCP integrations where relevant
- Task planning, delegation, and validation
- Test execution, static analysis, and review gates
- Guardrails around legacy UIKit and Android Views code
- Observability, feedback loops, and human approval for critical changes
The goal is not necessarily to create a fully autonomous agent that modifies the repository without supervision. I’m looking for a practical, controlled setup where agents can support analysis, planning, implementation, testing, documentation, and progressive migration, while developers remain responsible for architectural decisions, critical reviews, and production-facing changes.
## Questions
How would you structure the agents?
- One orchestrator agent plus specialised agents?
- Domain-specific agents?
- MCP tools?
- Or a simpler deterministic workflow with AI-assisted steps?
How would you design an agent harness using GitHub Copilot and Claude in a mobile KMP project?
- Which responsibilities should be given to Copilot versus Claude?
- Should Claude be used as the orchestrator/planner and Copilot for IDE-native implementation?
- What MCP servers, tools, permissions, and validation steps would you expose?
- How would you structure prompts, rules files, project documentation, and task workflows?
- How would you prevent agents from modifying critical legacy UIKit or Android Views code without approval?
What project context should be exposed to the agents?
- Architecture documentation
- KMP module map
- Coding conventions
- Legacy service inventory
- Legacy UI inventory
- API contracts
- Test strategy
- CI/CD information
- ADRs / technical decision records
For the legacy native Swift/Kotlin services and UIKit/Android Views screens, what strategy would you recommend?
- Create an adapter layer in KMP
- Expose legacy services through interfaces/ports
- Migrate use cases progressively
- Keep some services or screens native on purpose
- Treat legacy UI as a protected area with stricter review rules
What guardrails would you put in place?
- Mandatory tests
- Static analysis
- Human review
- Limited write permissions
- Protected legacy areas
- Approval gates before changes
Has anyone used AI agents in a multi-module mobile repository with KMP, Xcode, Gradle, CI/CD, UIKit, Android Views, SwiftUI, and Compose?
- What worked well?
- What failed?
- What would you do differently?
## My initial idea
I’m thinking of starting with a progressive approach:
- Create a structured project context: architecture docs, conventions, module map, migration rules, legacy inventory, and UI inventory.
- Define specialised agents:
- Architecture agent
- KMP/Kotlin agent
- iOS/SwiftUI agent
- Android/Compose agent
- Legacy iOS/UIKit agent
- Legacy Android/Views agent
- Testing agent
- Code review agent
- Documentation agent
- Use an orchestrator that receives a task, creates a plan, delegates work, and validates the result.
- Add guardrails: mandatory tests, static analysis, human approval, and restricted access to critical legacy code.
My assumption is that agents should not have unrestricted access to the whole repository from day one. They should work within a clearly defined scope, use verifiable tools, and follow repeatable workflows.
Any feedback, real-world experience, architecture examples, tooling recommendations, or pitfalls to avoid would be greatly appreciated.
Thanks!