mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
chore(ai): modernize and unify agent tooling and instructions (#5087)
This commit is contained in:
parent
d03e61af6f
commit
eeed780e51
27 changed files with 604 additions and 567 deletions
11
.github/instructions/android-source-set.instructions.md
vendored
Normal file
11
.github/instructions/android-source-set.instructions.md
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
applyTo: "**/androidMain/**/*.kt"
|
||||
---
|
||||
|
||||
# Android Source-Set Rules
|
||||
|
||||
- This is `androidMain` — Android framework imports (`android.*`, `java.*`) are allowed here.
|
||||
- Do NOT put business logic here. Business logic belongs in `commonMain`.
|
||||
- If you find identical pure-Kotlin logic in both `androidMain` and `jvmMain`, extract it to `commonMain`.
|
||||
- Use `expect`/`actual` only for small platform primitives. Prefer interfaces + DI.
|
||||
- Keep `expect` declarations in `FileIo.kt` and shared helpers in `FileIoUtils.kt` to avoid JVM duplicate class errors.
|
||||
10
.github/instructions/build-logic.instructions.md
vendored
Normal file
10
.github/instructions/build-logic.instructions.md
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
applyTo: "build-logic/**/*.kt"
|
||||
---
|
||||
|
||||
# Build-Logic Convention Plugin Rules
|
||||
|
||||
- Prefer lazy Gradle configuration (`configureEach`, `withPlugin`, provider APIs).
|
||||
- Avoid `afterEvaluate` unless there is no viable lazy alternative.
|
||||
- Check `gradle/libs.versions.toml` for version catalog aliases before adding new ones.
|
||||
- Convention plugins: `meshtastic.kmp.feature`, `meshtastic.kmp.library`, `meshtastic.kmp.jvm.android`, `meshtastic.koin`.
|
||||
14
.github/instructions/ci-workflows.instructions.md
vendored
Normal file
14
.github/instructions/ci-workflows.instructions.md
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
applyTo: "**/*.yml"
|
||||
excludeAgent: "code-review"
|
||||
---
|
||||
|
||||
# CI Workflow Rules
|
||||
|
||||
- Prefer explicit Gradle task paths (`app:lintFdroidDebug`) over shorthand (`lintDebug`).
|
||||
- CI uses `.github/ci-gradle.properties` — don't assume local `gradle.properties` values.
|
||||
- CI passes `-Pci=true` to enable full processor usage via `maxParallelForks`.
|
||||
- Use `fetch-depth: 0` only where needed (spotless ratcheting, version code). Use `fetch-depth: 1` otherwise.
|
||||
- Desktop build matrix: `macos-latest`, `windows-latest`, `ubuntu-24.04`, `ubuntu-24.04-arm`.
|
||||
- Lightweight jobs (labelers, triage, stale): use `ubuntu-24.04-arm` runners.
|
||||
- Gradle-heavy jobs: use `ubuntu-24.04` runners.
|
||||
17
.github/instructions/kmp-common.instructions.md
vendored
Normal file
17
.github/instructions/kmp-common.instructions.md
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
applyTo: "**/commonMain/**/*.kt"
|
||||
---
|
||||
|
||||
# KMP commonMain Rules
|
||||
|
||||
- NEVER import `java.*` or `android.*` in `commonMain`.
|
||||
- Use `org.meshtastic.core.common.util.ioDispatcher` instead of `Dispatchers.IO`.
|
||||
- Use Okio (`BufferedSource`/`BufferedSink`) instead of `java.io.*`.
|
||||
- Use `kotlinx.coroutines.sync.Mutex` instead of `java.util.concurrent.locks.*`.
|
||||
- Use `atomicfu` or Mutex-guarded `mutableMapOf()` instead of `ConcurrentHashMap`.
|
||||
- Use `jetbrains-*` catalog aliases for lifecycle/navigation dependencies.
|
||||
- Use `compose-multiplatform-*` catalog aliases for CMP dependencies.
|
||||
- Never use plain `androidx.compose` dependencies in `commonMain`.
|
||||
- Strings: use `stringResource(Res.string.key)` from `core:resources`. No hardcoded strings.
|
||||
- CMP `stringResource` only supports `%N$s` and `%N$d` — pre-format floats with `NumberFormatter.format()`.
|
||||
- Check `gradle/libs.versions.toml` before adding dependencies.
|
||||
Loading…
Add table
Add a link
Reference in a new issue