Skip to content

Feature Development Agents

Ali Sadeghi edited this page May 28, 2026 · 5 revisions

Feature Development Agents

Three specialized sub-agents that implement Clean Architecture layers for a single feature. They run during Phase 4 (Implementation) of creating-kmp-feature, typically in parallel.

Overview

Agent Layer Color
Data-Layer-Agent Models, Resources, DataSource, Repository blue
UI-Layer-Agent UiModel (single container), 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 Module Structure (What Gets Generated)

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}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

UI organization rule

{Feature}Screen.kt follows a strict allowlist — the only top-level composables allowed are {Feature}Screen, {Feature}ScreenRoot, and the optional state shells LoadingContent/FailedContent/EmptyContent (present only when the design specifies a dedicated state screen).

  • Everything else — including {Feature}Content and every sub-component — lives one file per composable under components/{Name}.kt.
  • Non-@Composable helpers go in {Feature}Utils.kt, never under components/.
  • @Preview composables are co-located (private) with what they preview and are exempt from the allowlist.

See Project-Requirements → UI File Organization.

Execution Pattern

   ┌─────────────────────┐    ┌────────────────┐
   │ data-layer-agent    │    │ ui-layer-agent │
   │ (parallel)          │    │ (parallel)     │
   └─────────────────────┘    └────────────────┘
              │                       │
              └───────────┬───────────┘
                          ▼
                  ┌──────────────────┐
                  │ integration-agent│
                  │ (last)           │
                  └──────────────────┘
                          ▼
                  ./gradlew assembleDebug
                  ./gradlew ktlintFormat

Context Variables

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}

Agent Pages


Back to Agents

Clone this wiki locally