-
Notifications
You must be signed in to change notification settings - Fork 0
Feature Development Agents
Ali Sadeghi edited this page May 18, 2026
·
5 revisions
Three specialized sub-agents that implement Clean Architecture layers for a single feature. They run during Phase 3 of creating-kmp-feature, typically in parallel.
| Agent | Layer | Color |
|---|---|---|
| Data-Layer-Agent | Models, Resources, DataSource, Repository | blue |
| UI-Layer-Agent | UiState, UiModel, ViewModel, Screen + ScreenRoot, Navigation | purple |
| Integration-Agent | DI module + 4 integration points + spec.md | green |
All three import agents/_base/common.md for shared base instructions (build validation, error patterns, context-variable contract).
feature/{featurename}/
├── build.gradle.kts ← data-layer-agent (gradle template)
├── src/commonMain/kotlin/{pkg}/{featurename}/
│ ├── data/
│ │ ├── model/ DTOs with @Serializable
│ │ ├── remote/ Ktor Resources
│ │ ├── datasource/ Interface + Impl
│ │ └── repository/ Interface + Impl
│ ├── presentation/
│ │ ├── {Feature}ViewModel.kt ← top-level, not nested
│ │ ├── {Feature}UiState.kt
│ │ ├── {Feature}UiModel.kt
│ │ ├── ui/
│ │ │ ├── {Feature}Screen.kt Screen + ScreenRoot + state routing
│ │ │ └── components/ self-contained UI units
│ │ └── navigation/ Route + NavGraphBuilder extension
│ └── di/
│ └── {Feature}Modules.kt object : BaseFeature
presentation/is flat —{Feature}ViewModel.kt,{Feature}UiState.kt,{Feature}UiModel.ktsit at the root ofpresentation/. There is noviewmodel/ormodel/subdirectory.
{Feature}Screen.kt is the orchestrator and must stay lean:
-
Keep in
{Feature}Screen.kt— structural glue:Screen,ScreenRoot, state routing (when (uiState)), the top-level layout scaffold, and state screens (LoadingContent,ErrorContent). -
Move to
components/{Name}.kt— self-contained UI units that have meaning on their own (cards, sections, custom inputs with internal state).
┌─────────────────────┐ ┌────────────────┐
│ data-layer-agent │ │ ui-layer-agent │
│ (parallel) │ │ (parallel) │
└─────────────────────┘ └────────────────┘
│ │
└───────────┬───────────┘
▼
┌──────────────────┐
│ integration-agent│
│ (last) │
└──────────────────┘
▼
./gradlew assembleDebug
./gradlew ktlintFormat
The orchestrator passes a subset of these to each agent (see agents/_base/common.md):
| Variable | Data | UI | Integration |
|---|---|---|---|
{featurename} |
✅ | ✅ | ✅ |
{PKG_PREFIX} |
✅ | ✅ | ✅ |
{PKG_PATH} |
✅ | ✅ | ✅ |
{CORE_COMMON_PKG} |
✅ | ✅ | ✅ |
{CORE_DATA_PKG} |
✅ | — | ✅ |
{CORE_DESIGNSYSTEM_PKG} |
✅ | ✅ | ✅ |
{CORE_MODULES} |
✅ | — | ✅ |
{INIT_KOIN_PATH} |
— | — | ✅ |
{NAV_HOST_PATH} |
— | — | ✅ |
Back to Agents