create-feature
Create a new feature screen in the Edifikana front-end app. Use when asked to create a new screen, feature, or UI component with ViewModel pattern.
When & Why to Use This Skill
This Claude skill automates the creation of front-end feature screens for Kotlin Multiplatform applications. It streamlines the development process by generating standardized boilerplate files—including Screens, ViewModels, UI States, and Tests—following the MVVM (Model-View-ViewModel) architectural pattern. By handling package structure and initial registration, it ensures consistency across the codebase and significantly reduces manual setup time for developers.
Use Cases
- Rapid Feature Scaffolding: Quickly generate all necessary files for a new UI screen, such as a 'Settings' or 'User Profile' page, with the architectural skeleton pre-configured.
- Architectural Consistency: Enforce the MVVM pattern across a development team by using standardized templates for state management, event handling, and UI logic.
- Automated Testing Setup: Automatically create companion unit test files and UI previews alongside new features to encourage immediate verification and high code quality.
- Boilerplate Reduction: Eliminate repetitive manual tasks involved in creating multiple related files (ViewModel, UIState, Event) for every new application component.
| name | create-feature |
|---|---|
| description | "Create a new feature screen in the Edifikana front-end app. Use when asked to create a new screen, feature, or UI component with ViewModel pattern." |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash |
Create Feature - Front-End Feature Generator
Purpose
This skill generates the boilerplate files for a new feature screen in our Kotlin Multiplatform front-end application following the established MVVM architecture pattern.
Required Information
Before creating a feature, gather:
- Feature name (e.g., "SelectOrg", "AddProperty", "Notifications")
- Parent folder. This is the directory where the new package will be created. If the feature is named "AddProperty", the package will be named
addproperty. So the parent folder could beedifikana/front-end/shared-app/src/commonMain/kotlin/com/cramsan/edifikana/client/lib/features/for a path likeedifikana/front-end/shared-app/src/commonMain/kotlin/com/cramsan/edifikana/client/lib/features/addproperty/.
Provide the user with some examples of valid feature names and parent folders but DO NOT provide them with options to select from.
Files to Create
For a feature named {FeatureName} in package {packagePath}:
Look at the templates in .idea/fileTemplates/Compose Feature* and create each file by injecting the feature name and package path.
Registration
After creating the files, run through the TODOs in the templates to complete each step. Some files may need to be moved, for example the test files should be moved to the test source set.
Verification
After creating all files, compile and run the tests to ensure everything is set up correctly.
Examples
Example 1: Creating "AddProperty" feature in home
Feature name:
AddPropertyParent folder:
edifikana/front-end/shared-app/src/commonMain/kotlin/com/cramsan/edifikana/client/lib/features/Creating feature
AddPropertyin packagecom.cramsan.edifikana.client.lib.features.addpropertySource folder is
edifikana/front-end/shared-app/src/commonMain/kotlin/com/cramsan/edifikana/client/lib/features/addproperty/Files created:
AddPropertyScreen.ktAddPropertyViewModel.ktAddPropertyUIState.ktAddPropertyEvent.ktAddPropertyViewModelTest.ktAddPropertyScreen.preview.kt
Completing tasks in the TODOs in each file.