82f8bc62a0
- Add desktopApp module with JVM entry point and sidebar navigation - Add Claude specs for AI-assisted development: - Agent definitions: nostr-protocol, kotlin-multiplatform, compose-ui, kotlin-coroutines - Skills: quartz-kmp conversion, compose-desktop patterns - Commands: desktop-run, nip, extract - Update Gradle configuration with Compose Multiplatform 1.7.1 plugin - Add coroutines and secp256k1 JVM dependencies to version catalog Next steps: - Convert Quartz library to full KMP (expect/actual for crypto) - Implement relay connections in desktop app - Share UI components between Android and Desktop 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
description
| description |
|---|
| Extract a composable from amethyst to shared code |
Extract the component $ARGUMENTS from the Android app to shared KMP code:
Process
-
Locate the component in the amethyst module:
find amethyst/src -name "*$ARGUMENTS*" -o -name "*$ARGUMENTS*" grep -r "fun $ARGUMENTS\|class $ARGUMENTS" amethyst/src/ -
Analyze dependencies:
- Android-specific imports (Context, Intent, etc.)
- Platform APIs (Camera, MediaStore, etc.)
- Android Compose specifics vs standard Compose
-
Identify what can be shared:
- Pure Composable functions →
shared-ui/commonMain/ - Business logic →
quartz/commonMain/ - Platform-specific → create expect/actual
- Pure Composable functions →
-
Create shared version:
- Move to appropriate shared module
- Replace Android imports with multiplatform alternatives
- Add expect declarations for platform-specific parts
-
Update references:
- Change imports in amethyst module
- Add implementations in desktopApp if needed
Common Replacements
| Android | Multiplatform |
|---|---|
LocalContext.current |
expect/actual or parameter |
stringResource() |
Res.string.* |
painterResource() |
painterResource(Res.drawable.*) |
Toast.makeText() |
Custom snackbar/notification |
Intent |
expect/actual for navigation |
Example
/extract NoteCard
This will find NoteCard, analyze its dependencies, and guide you through extracting it to shared code.