Mobile — Android

Setup: One File, One Command

Download init_skeleton.sh, copy it into a project and run it — there's nothing to answer along the way. Prerequisites for macOS, Windows and Linux, and troubleshooting, are below.

Quick Start

Quick Start

What is this? A starting point for Android projects, pre-wired with a real tech stack (Compose, Hilt, Retrofit, Coroutines) and a script that generates complete, compiling features — so an AI coding agent never has to guess your architecture or hand-write boilerplate.

What do I need? Android Studio (or just the gradlew wrapper), a JDK, and the Android SDK. See Setup by platform for exact prerequisites on your OS.

What do I download? One file: init_skeleton.sh. Nothing else — it self-extracts everything else on first run.

Download init_skeleton.sh

What command do I run?

chmod +x init_skeleton.sh
./init_skeleton.sh

What do I get after running it? A five-module Gradle project, ready to build:

my-project/
├── app/
├── core-ui/
├── core-network/
├── core-utils/
├── auth/
└── init_skeleton.sh
Quick Start

The flow: Download → Run → Configure API → Build → Done

1. Download — copy init_skeleton.sh into your project's root. That's the only file you need by hand.

2. Run — no arguments needed; it auto-detects the package your Android Studio project already has.

chmod +x init_skeleton.sh
./init_skeleton.sh

3. Configure API

Important: NetworkConfig.BASE_URL (in :core-network) is the one manual step every project needs. It defaults to a placeholder, https://example.com/api/, and nothing checks at build time or launch time that you've changed it — every generated feature's networking shares this single value. Set it before you build anything that actually calls an API.

4. Build

./gradlew :app:assembleDebug

5. Done

Tip: Success looks like: a BUILD SUCCESSFUL message, and a project on disk matching the five-folder structure shown above. If it doesn't match — see Troubleshooting.

Setup by platform

Setup by platform

The script itself is plain, portable bash — the commands are identical on every OS. What differs is what you need installed before you run it.

macOS / Windows

Use Android Studio's own setup (its installer bundles a JDK and lets you install SDK platforms through SDK Manager). Once a project's open in it, prerequisites are already satisfied — jump straight to Quick Start.

Linux

Android Studio's Linux build works the same way, but a few things are worth confirming explicitly if you're setting up a machine that hasn't had it installed before, or working from the command line only:

  • Android Studio — download from the official site and extract; or install the Android SDK command-line tools only, if you don't need the IDE.
  • JDK — see Requirements below. Most distros: apt install openjdk-21-jdk (Debian/Ubuntu) or your package manager's equivalent.
  • Android SDK + ANDROID_HOME — after installing SDK Manager or the command-line tools, set:
    export ANDROID_HOME=$HOME/Android/Sdk
    export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
    Add those two lines to your ~/.bashrc/~/.zshrc so they persist across terminal sessions.
  • Git — apt install git or your distro's equivalent, if not already present.

Once those are in place, the run command is identical to any other platform:

chmod +x init_skeleton.sh
./init_skeleton.sh

Note: This section describes what the script needs, not a machine we've run it on ourselves — the script has no macOS-specific commands in it, but if you hit a Linux-specific failure this doc doesn't cover, that's worth reporting so it can be added here.

Setup by platform

Requirements

  • Android Studio (recent), or just the gradlew wrapper on the command line
  • A JDK on PATH — Gradle's daemon is pinned (gradle/gradle-daemon-jvm.properties) to auto-provision JDK 21 for itself the first time you build, regardless of what JDK you already have installed, so you don't need to hunt down an exact version yourself. That first auto-provision needs an internet connection.
  • Android SDK Platform 37.0 installed — compileSdk is pinned there (see Troubleshooting if you hit an AAR-metadata error)
What the script does

What does the script actually do?

Running init_skeleton.sh does all of the following, in one pass:

ComponentWhat you get
Gradle modulesCreates :core-ui, :core-network, :core-utils, :auth and wires :app to depend on all four. Moves Android Studio's default ui/theme/ into :core-ui.
ComposeNo XML layouts — everything generated is a Composable, wired to Material 3.
Hilt + KSPApp.kt (@HiltAndroidApp), @AndroidEntryPoint on MainActivity, annotation processing wired into Gradle.
Retrofit / OkHttpNetworkModule.kt + NetworkConfig.kt in :core-network — real Hilt-provided singletons, not just a dependency line.
shared_widgets/LoadingIndicator.kt, ErrorView.kt, EmptyState.kt in :core-ui, ready for every generated screen to reuse.
AI rule filesCLAUDE.md, docs/ai/*.md, docs/PROJECT_MAP.md — the architecture/Compose/UI rules an AI agent reads automatically.
Scripts + skillsscripts/new_feature.sh, scripts/check_embedded_sync.sh, scripts/check_hardcoded_colors.sh, and all four .claude/skills/* slash commands.
ktlintWired into all five modules + .editorconfig, with one automatic ktlintFormat pass so a fresh project starts style-clean.
Git hooksIf .git exists: .githooks/pre-commit wired via core.hooksPath, blocking a commit that fails the embedded-sync check, has a hardcoded color, or fails ktlintCheck/build/tests.
Theme configui/theme/ThemeConfig.kt — one value picking SYSTEM/LIGHT/DARK mode.

Note: What it does not do: wire Navigation Compose, add a database, or write a .claude/settings.json permission file — this repo's own copy of that file was committed by hand, not generated by the script. See Known limitations for what's deliberately left out and why.

It's also idempotent — safe to re-run any time, every step is skip-if-already-done, so it never clobbers something you've since customized.

Alternative

Alternative: cloning this repo instead

If you'd rather start from this exact repo (its own sample theme, its own package name to rename):

./init_skeleton.sh com.yourcompany.yourapp

This renames the package everywhere — namespace, applicationId, folder layout, every package/import declaration.

Warning: If the project has already been built once before you rename it, run ./gradlew clean once afterward — stale incremental/KSP build state from the old package name can otherwise cause a spurious compile error.

Troubleshooting

Troubleshooting

Before the first build

permission denied running ./init_skeleton.sh. The chmod +x step got skipped:

chmod +x init_skeleton.sh
./init_skeleton.sh

SDK location not found / local.properties missing. This file normally gets created the first time Android Studio opens the project and syncs it against your installed SDK — it's gitignored and machine-specific, never part of the template. If you're bootstrapping from just the script with no IDE involved yet, open the project in Android Studio once (or create local.properties yourself with sdk.dir=/path/to/your/Android/Sdk) before building from the command line.

During a build

CheckAarMetadataWorkAction fails, "requires... version 37 or later" / "compiled against android-36.1".

sdkmanager "platforms;android-37.0"

(sdkmanager lives under your SDK's cmdline-tools/latest/bin/. The plain platforms;android-37 won't resolve — use the versioned form.)

A build fails on mergeExtDexDebug/packageDebug with no code change involved. This has happened intermittently on a memory-constrained Gradle daemon in this project's own testing, and resolved itself on an immediate retry with nothing else changed:

./gradlew :app:assembleDebug

If it fails the same way twice in a row, treat it as a real problem, not a fluke.

After renaming the package

hiltJavaCompileDebug fails with "Could not find class file for '...App'" after renaming the package. Stale incremental/KSP state from before the rename, not a real error:

./gradlew clean :app:assembleDebug

Style

ktlintFormat didn't run automatically during setup. init_skeleton.sh prints a note ("couldn't run ./gradlew ktlintFormat automatically — no SDK configured yet?") when it can't run this step — it needs local.properties/an SDK already configured, which isn't necessarily true on the very first run. Run it yourself once the SDK's set up, before your first commit — the pre-commit hook runs ktlintCheck on any staged .kt/.kts file, so a skipped format pass means that first commit gets blocked on violations in files you didn't hand-write:

./gradlew ktlintFormat
Recap

One file, one command, no questions

Setup is one file and one command — copying init_skeleton.sh into a project and running it is the entire process, with nothing to answer along the way.

  1. Get the one file into a project. Two starting points, same result: a brand-new project — create it in Android Studio first (Empty Activity, Compose, Kotlin), then copy just init_skeleton.sh into its root and run ./init_skeleton.sh with no arguments, which auto-detects the package Android Studio's wizard already picked; or clone this repo directly and give it your own package name with ./init_skeleton.sh com.yourcompany.yourapp, which renames the namespace, folder layout, and every package/import line for you.
  2. That's the whole question set. One command wires the :core-ui/:core-network/:core-utils/:auth Gradle modules alongside :app, Hilt + KSP + Retrofit + OkHttp + Coroutines, ktlint with .editorconfig, the four meta-doc files, all four skills, and — if .git exists — a pre-commit hook. (It does not write a .claude/settings.json permission allowlist; copy the skeleton repo's one by hand if your team wants it.) It's idempotent: every step is skip-if-already-done, so re-running it never clobbers a file you've since customized.
  3. Point NetworkConfig.BASE_URL at your real API. The one manual step, in :core-network's NetworkConfig.kt, shared by every feature's generated ApiService. Unlike a launch-time config check that crashes on a placeholder value, this one doesn't guard itself — leaving it unset fails quietly at the network call, not loudly at startup.
  4. Build. ./gradlew :app:assembleDebug
Check your understanding
1. Why does init_skeleton.sh ask zero setup questions?
Correct.Not quite. There's exactly one fixed topology and one fixed pattern generated every time — with nothing left to choose, there's nothing left to ask.
2. What happens if you leave NetworkConfig.BASE_URL at its placeholder value and ship a feature that uses it?
Correct.Not quite. Worth knowing rather than assuming otherwise — this is a documented, deliberate limitation, not a bug.