Skip to content

Modifying KMP Feature

Ali Sadeghi edited this page Jan 20, 2026 · 6 revisions

Modifying KMP Feature Skill

Auto-activates when: User mentions "change feature", "modify feature", "update feature", "add to feature"

Spec-First Modification Workflow

Phase 0: Context Discovery (AUTO)
└── Detect project structure

Phase 1: Load Specification
├── Check for .claude/docs/{feature}/spec/*.md
├── If missing: Generate spec using /audit-spec
└── Load spec into context

Phase 2: Understand Current Implementation
├── Parse spec for architecture patterns
├── Identify data models, API contracts
├── Understand state management
└── Map navigation structure

Phase 3: Plan Changes
├── Determine affected layers (data/ui/integration)
├── Load relevant architecture references
├── Plan implementation approach
└── Identify files to modify

Phase 4: Draft Spec Changes
├── Identify affected spec sections
├── Draft modifications using diff format
├── Prepare changelog entry
└── Document rationale for changes

Phase 5: Review Gate (MANDATORY)
├── Present proposed spec changes to user
├── User must explicitly approve before implementation
├── Prevents scope creep and maintains spec authority
└── Enables rollback if implementation fails

Phase 6: Implement Changes
├── Apply changes following established patterns
├── Maintain consistency with existing code
└── Follow 10 critical rules

Phase 7: Validate
├── Run incremental build
├── Run ktlintFormat
└── Fix any errors

Phase 8: Update Specification
├── Apply approved spec changes with changelog entry
├── Preserve WHY sections (Goals, Rationale, Decisions)
└── Preserve previous changelog entries

Examples

Add Functionality

> Add sorting by price and date to the product list feature

Changes: ProductListViewModel (add sort state), ProductListScreen (add sort UI)

Refactor

> Refactor the login screen to use a stepper for multi-step authentication

Changes: LoginUiState (add step state), LoginScreen (add stepper UI)

Fix Issues

> Fix the loading state not showing in the profile feature

Changes: ProfileViewModel (fix state transition), ProfileScreen (verify loading UI)

Add New Screen

> Add a forgot password screen to the login feature

Changes: Add ForgotPasswordScreen, update navigation, add ViewModel

Spec Changelog Entry

## Last Updated

2025-01-05 - Added sorting by price and date
- ProductListUiState: Added sortBy field
- ProductListViewModel: Added setSortOrder function
- ProductListScreen: Added sort dropdown menu

2025-01-03 - Initial implementation
- Created product list with search and filters

Back to Skills

Clone this wiki locally