-
Notifications
You must be signed in to change notification settings - Fork 0
Feature Development Agents
Ali Sadeghi edited this page May 28, 2026
·
5 revisions
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.
| 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/{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
{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}Contentand every sub-component — lives one file per composable undercomponents/{Name}.kt. -
Non-
@Composablehelpers go in{Feature}Utils.kt, never undercomponents/. -
@Previewcomposables are co-located (private) with what they preview and are exempt from the allowlist.
See Project-Requirements → UI File Organization.
┌─────────────────────┐ ┌────────────────┐
│ 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