@@ -4,51 +4,95 @@ You are an experienced Android developer working on a project template generator
44
55Android project template generator using [ Nimble Compass] ( https://nimblehq.co/compass/ ) conventions.
66
7- ** Stack:** Kotlin, Jetpack Compose, Hilt, Kscript (generator)
7+ ## Technology Stack
8+
9+ | Category | Technology |
10+ | ----------| ------------|
11+ | ** Language** | Kotlin |
12+ | ** UI Framework** | Jetpack Compose |
13+ | ** Architecture** | MVVM / Clean Architecture (app → domain ← data) |
14+ | ** Dependency Injection** | Hilt |
15+ | ** Generator** | Kscript |
16+ | ** Build System** | Gradle (Kotlin DSL) |
17+ | ** Static Analysis** | Detekt, Android Lint |
18+ | ** Coverage** | Kover |
819
920## Project Structure
1021
11- - Generator script: ` scripts/new_project.kts ` (Kscript)
12- - Source template: ` template-compose/ ` (see its AGENTS.md for Android-specific guidance)
13- - Example output: ` sample-compose/ ` (regenerate, don't edit directly)
22+ ```
23+ /scripts → Generator script (new_project.kts)
24+ /template-compose → Source template (see its AGENTS.md for Android guidance)
25+ /sample-compose → Example output (regenerate, don't edit directly)
26+ /build-logic → Shared Gradle convention plugins
27+ /.github → CI workflows and PR templates
28+ ```
29+
30+ ## Prerequisites
31+
32+ - Android Studio (Latest Stable)
33+ - JDK 17+
34+ - Kscript installed (` brew install holgerbrandl/tap/kscript ` )
1435
1536## Commands
1637
38+ ### Build
1739``` bash
18- # Build template
1940cd template-compose && ./gradlew assembleDebug
41+ ```
2042
21- # Static analysis
43+ ### Static Analysis
44+ ``` bash
2245cd template-compose && ./gradlew detekt lint
46+ ```
2347
24- # Run tests
48+ ### Tests
49+ ``` bash
2550cd template-compose && ./gradlew app:testStagingDebugUnitTest data:testDebugUnitTest domain:test
51+ ```
2652
27- # Coverage report
53+ ### Coverage
54+ ``` bash
2855cd template-compose && ./gradlew koverXmlReportCustom
56+ ```
2957
30- # Generate new project
58+ ### Generate New Project
59+ ``` bash
3160cd scripts && kscript new_project.kts package-name=com.example.app app-name=" My App" template=compose
3261```
3362
3463## Testing
3564
36- Before commit:
65+ ** Before commit:**
3766``` bash
3867cd template-compose && ./gradlew detekt lint assembleDebug
3968```
4069
41- Before PR:
70+ ** Before PR:**
4271``` bash
4372cd template-compose && ./gradlew detekt lint app:testStagingDebugUnitTest data:testDebugUnitTest domain:test koverXmlReportCustom
4473```
4574
46- After changing template, verify generator works:
75+ ** After template changes: ** Verify generator works:
4776``` bash
4877cd scripts && kscript new_project.kts package-name=co.test.app app-name=" Test App" template=compose
4978```
5079
51- CI pipeline: Detekt → Lint → Tests → Coverage → Danger
80+ ## Configuration Files
81+
82+ | File | Purpose |
83+ | ------| ---------|
84+ | ` template-compose/config/detekt/detekt.yml ` | Detekt rules |
85+ | ` build-logic/convention/ ` | Shared Gradle plugins |
86+ | ` .github/workflows/android.yml ` | CI pipeline |
87+ | ` .github/workflows/danger.yml ` | Danger PR checks |
88+
89+ ## CI/CD
90+
91+ ** Pipeline:** Detekt → Lint → Tests → Coverage → Danger
92+
93+ Workflows defined in ` .github/workflows/ ` :
94+ - ` android.yml ` — Main CI (build, test, coverage)
95+ - ` danger.yml ` — PR automation and checks
5296
5397## Template Placeholders
5498
@@ -63,20 +107,38 @@ The generator replaces these strings — don't modify them:
63107
64108## Git Workflow
65109
66- - ` main ` — Production. Never commit directly.
67- - ` develop ` — Staging. Never commit directly.
68- - Feature branches from ` develop `
110+ ** Branches:**
111+ - ` main ` — Production (protected, no direct commits)
112+ - ` develop ` — Staging (protected, no direct commits)
113+ - Feature branches from ` develop ` using ` kebab-case ` : ` feature/add-login ` , ` bug/fix-crash `
114+
115+ ** Commits:**
116+ - Format: ` [#123] Add feature ` — capitalize first word, present tense
117+ - One logical change per commit
118+ - Include ticket ID for traceability
119+
120+ ** Pull Requests:**
121+ - Title: ` [#ticket] Description `
122+ - 2 approvals required (include Team Lead or senior for large squads)
123+ - Target merge within 2-3 days
124+ - Only Team Lead merges to protected branches
69125
70- Commit format: ` [#123] Add feature ` or ` [Brand-456] Fix bug `
126+ ## Key Guidelines for Agents
71127
72- PR title: ` [#ticket] Description `
128+ 1 . ** Template Awareness** : Never modify placeholder strings used by the generator
129+ 2 . ** Regenerate, Don't Edit** : Changes to ` sample-compose/ ` are overwritten — modify ` template-compose/ ` instead
130+ 3 . ** Static Analysis** : Always run ` ./gradlew detekt lint ` before committing
131+ 4 . ** Test Generator** : After any template change, verify generation still works
132+ 5 . ** Module Boundaries** : Core modules must not depend on feature modules
133+ 6 . ** Compose Only** : All UI must use Jetpack Compose — never suggest XML layouts
73134
74135## Boundaries
75136
76137✅ ** Required:**
77138- Run ` detekt lint ` before commits
78139- Test generator after template changes
79140- 2 PR approvals
141+ - Follow Nimble Compass conventions
80142
81143⚠️ ** Ask before:**
82144- Adding modules to template
@@ -89,3 +151,4 @@ PR title: `[#ticket] Description`
89151- Push to ` main ` or ` develop `
90152- Skip CI checks
91153- Commit secrets or credentials
154+ - Merge PRs without Team Lead approval
0 commit comments