Skip to content

Modifying KMP Feature

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

Modifying KMP Feature Skill

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

Spec-First Modification Workflow

User Request: "modify {feature} to..."
    ↓
[0] Parse → Extract feature name, validate exists
    ↓
[1] Spec Check → Load .claude/docs/{name}/spec.md (or generate via /audit-spec)
    ↓
[2] Understand → Read spec (architecture, state, navigation)
    ↓
[3] Plan → Determine affected layers (data/ui/integration)
    ↓
[4] Draft Spec Changes → Propose updates to spec sections
    ↓
[5] Review Gate → USER APPROVES spec changes before coding (MANDATORY)
    ↓
[6] Implement → Apply changes following patterns
    ↓
[7] Validate → Build + Format
    ↓
[8] Update Spec → Apply approved changes + changelog
    ↓
✅ Done

Review Gate (Step 5) - MANDATORY

This step is required and cannot be skipped.

The skill presents proposed spec changes in diff format:

## Spec Change Review: {featurename}

**Requested modification:** "{user's original request}"

### Proposed Spec Updates

| Section | Change Type | Description |
|---------|-------------|-------------|
| 3.1 Requirements | Addition | Added FR-X.Y for {capability} |
| 6.2 State | Modification | Added {NewState} to UiState |
| 7.1 Test Scenarios | Addition | Added scenario for {behavior} |

### Proposed Changelog Entry
- {YYYY-MM-DD} - {Brief description of change}

**Please review the proposed spec changes above.**

- [ ] **Approve** - Proceed with implementation
- [ ] **Modify** - Request changes (please specify)
- [ ] **Reject** - Do not proceed

Why This Gate Matters

  • Prevents scope creep - User sees exactly what will change
  • Maintains spec authority - Spec updated intentionally, not as afterthought
  • Enables rollback - If implementation fails, spec wasn't yet changed
  • Documents decisions - User explicitly approved the contract change

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