Skip to content

Commit 28c437b

Browse files
committed
update CLAUDE.md and cursor rules
1 parent 54adb8f commit 28c437b

6 files changed

Lines changed: 110 additions & 0 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
description: Required checklist when adding a new Action
3+
alwaysApply: true
4+
---
5+
6+
# Adding A New Action
7+
8+
Before implementing, confirm whether the action is editable.
9+
- Branch names must follow `feature/123-branch-name` or `fix/123-branch-name`.
10+
11+
Then follow this sequence:
12+
13+
1. Add an ID in `ActionId`.
14+
2. Add a new `ActionData` sealed class variant.
15+
3. Map entity conversions in `ActionDataEntityMapper`.
16+
4. Assign category in `ActionUtils`.
17+
5. If editable, add it to `ActionUtils.isEditable`.
18+
6. Add title string in `strings.xml`.
19+
7. Add title and Compose icon in `ActionUtils` (ignore drawables).
20+
8. Add title in `ActionUiHelper`.
21+
9. Add execution handling in `PerformActionsUseCase`.
22+
10. Handle creation in `CreateActionDelegate`.
23+
24+
Do not delete existing action code; follow existing names and place additions near similar actions.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
description: Module boundaries and architectural conventions for KeyMapper
3+
alwaysApply: true
4+
---
5+
6+
# KeyMapper Architecture
7+
8+
- Branch names must follow `feature/123-branch-name` or `fix/123-branch-name`.
9+
- Treat the codebase as Clean Architecture + MVVM with unidirectional data flow.
10+
- Keep dependency direction as `:app` -> `:base` -> `:common`/`:data`/`:system`/`:sysbridge`.
11+
- Keep domain models in `:common` and persistence entities in `:data` with explicit mappers.
12+
- Put business logic in use cases and inject them into ViewModels.
13+
- Expose UI state via `Flow`/`StateFlow`; collect from UI and send events back to ViewModels.
14+
- Use Hilt for DI and preserve app-specific binding overrides in app modules.
15+
- Use coroutines for async work and `viewModelScope` for ViewModel-owned jobs.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Build, test, and tooling commands for KeyMapper
3+
alwaysApply: true
4+
---
5+
6+
# KeyMapper Build And Tooling
7+
8+
- Branch names must follow `feature/123-branch-name` or `fix/123-branch-name`.
9+
- Use these common commands:
10+
- `./gradlew assembleDebug`
11+
- `./gradlew test`
12+
- `./gradlew connectedAndroidTest`
13+
- `./gradlew ktlintCheck` or `./gradlew ktlintFormat`
14+
- Release builds require `KEYSTORE_PASSWORD` and `KEY_PASSWORD` environment variables.
15+
- Target platform constraints: min SDK 26, target SDK 36, Java 11.
16+
- Dependency versions are managed in `gradle/libs.versions.toml`.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
description: Commit message format convention for KeyMapper
3+
alwaysApply: true
4+
---
5+
6+
# KeyMapper Commit Messages
7+
8+
Use this format for commits:
9+
10+
`#<issue_number> <type>: <description>`
11+
12+
Allowed types:
13+
14+
- `feat`
15+
- `fix`
16+
- `chore`
17+
- `refactor`
18+
- `style`
19+
20+
Example:
21+
22+
`#2025 feat: add button to report bug on home screen`
23+
24+
# Branch Naming Convention
25+
26+
- Use `feature/123-branch-name` for new features.
27+
- Use `fix/123-branch-name` for bug fixes.
28+
29+
# Pull Request Changelog Requirement
30+
31+
- When preparing a PR, update `CHANGELOG.md` for any user-facing fix/feature/change or notable
32+
internal change.
33+
- If no changelog entry is needed (for example, docs-only or CI-only), explicitly note that in the PR
34+
description.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Compose coding conventions used in KeyMapper
3+
globs: "**/*.kt"
4+
alwaysApply: false
5+
---
6+
7+
# KeyMapper Compose Guidelines
8+
9+
Apply this when editing Compose code:
10+
11+
- Branch names must follow `feature/123-branch-name` or `fix/123-branch-name`.
12+
- Put `Modifier` as the first optional parameter after required parameters.
13+
- For non-standard colors, use `LocalCustomColorsPalette` instead of `MaterialTheme.colorScheme`.
14+
- Check `KeyMapperIcons` before introducing icons from other sources.
15+
- Use `LocalUriHandler.openUriSafe` for URL launching and do not hoist URL launching logic.
16+
- Prefer imports; avoid fully qualified names in Compose call sites.

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ Types: `feat`, `fix`, `chore`, `refactor`, `style`
7070

7171
Example: `#2025 feat: add button to report bug on home screen`
7272

73+
## Branch Naming Convention
74+
75+
- Use `feature/123-branch-name` for new features.
76+
- Use `fix/123-branch-name` for bug fixes.
77+
7378
## Pull Request Requirement
7479

7580
- Any user-facing behavior change, fix, feature, or notable internal change in a PR must include an

0 commit comments

Comments
 (0)