From 01ab91a10dc037b35877f6a6ecc567521fb0ff29 Mon Sep 17 00:00:00 2001 From: Ashik Abbas Date: Wed, 28 Oct 2026 13:54:17 +0530 Subject: [PATCH] docs: add token-efficient Gradle and CLI execution rules to AGENTS.md --- AGENTS.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2a4de533..9dd73240 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -88,8 +88,16 @@ When generating, refactoring, or editing code, strictly adhere to these rules: 1. **Zero Wildcard Imports:** - ❌ `import com.google.android.gms.maps.model.*` is **strictly forbidden**. - ✅ Every imported symbol must be explicitly listed to conform to `ktlint` and `spotless`. -2. **Spotless Compliance:** - - Always verify and run `./gradlew spotlessApply` on touched modules before finishing a task. +2. **Spotless Compliance & Token-Efficient CLI Execution:** + - Always verify and run `./gradlew spotlessApply --console=plain --quiet` on touched modules before finishing a task. + - **Gradle (`./gradlew`):** Always pass `--console=plain --quiet` (or `-q`) on standard build, compile, formatting, install, and test commands to suppress noisy task lifecycle logs and conserve context tokens: + ```bash + ./gradlew --console=plain --quiet + ``` + *(Exception: Omit `--quiet` while keeping `--console=plain` only when explicitly auditing compiler/deprecation warnings `w:` or diagnosing task-level build progress.)* + - **Other CLI Tools:** + - **Git:** `git status -s`, `git diff --stat`, `git fetch -q`, `git checkout -q` + - **ADB Logcat:** `adb logcat -d -s AndroidRuntime:E *:S` (always filter by tag/priority rather than dumping unfiltered logs) 3. **Modern Kotlin Idioms & Pragmatic Warning Hygiene:** - Prefer modern standard library idioms where applicable (e.g., `kotlin.time.Duration` with `delay(100.milliseconds)` instead of legacy millisecond `Long`s). - Prefer Android KTX extensions (e.g., `hexColorString.toColorInt()`) over legacy utility methods.