support-archis a multi-module Android and Kotlin architecture library.- Optimize for reusable library abstractions, consumer ergonomics, and clear public documentation.
- The main downstream consumer today is
anitrend-v2, so assume changes should be understandable to an external app team.
- Public API docs are generated with Dokka and published to
https://anitrend.github.io/support-arch/. - CI publishes docs by running
./gradlew dokkaGenerateondevelopand deployingdokka-docsto thedocsbranch. - Most modules use the shared
co.anitrend.archGradle plugin frombuildSrc. - Shared Android and Kotlin defaults live in
buildSrc, not in individual module build files. - The pinned Java version is
.java-version = 21.0.8and the shared toolchain is Java 21.
- Foundation:
extension,domain,request,data - UI scaffolding:
theme,core,recycler,recycler-paging-legacy,ui - Legacy paging:
paging-legacy,recycler-paging-legacy - Code generation:
annotation,processor - Integration:
analytics
domainshould remain low-level and broadly reusable.requestbuilds request lifecycle and reporting on top ofdomainandextension.dataadds converters, mappers, states, and sources on top ofdomain,extension, andrequest.coreprovides reusable workers, presenters, providers, and model helpers on top ofextension,data, anddomain.recycleranduiprovide consumer-facing presentation infrastructure.annotationis the public annotation API andprocessoris the KSP implementation.- Avoid adding upward dependencies into low-level modules.
- Shared state and value types:
domain - Request queueing, listener dispatch, wrappers, and reports:
request - Converters, mappers, data sources, and repository-side transformations:
data - Generic Android helpers and extension functions:
extension - Workers, presenters, providers, and reusable model helpers:
core - RecyclerView adapters, holders, shared adapter state, widgets, and load-state rows:
recycler - Fragments, activities, pagers, view widgets, and screen-scaffolding helpers:
ui - Public annotations:
annotation; generated-code implementation:processor
- Treat KDoc as product surface, not optional commentary.
- Dokka is configured with
reportUndocumented = truefor source sets. - Document new or changed public and protected APIs in the same patch.
- Explain what the API does, when to use it, and what a consumer must provide, override, observe, or expect.
- Document lifecycle, threading, side effects, and state transitions when they matter.
- Packages matching
.internalare suppressed from published docs, so consumer-facing APIs should not live there.
- When major repository behavior changes, update the relevant
.github/instructions,.github/skills,AGENTS.md, and consumer-facing docs in the same patch. - Prefer replacing stale guidance over adding new guidance that contradicts it.
- New instructions or skills should be added only for recurring workflows or durable repo knowledge, not one-off tasks.
- Add dependency versions and aliases to
gradle/libs.versions.tomlfirst. - Prefer changing shared behavior in
buildSrcover duplicating configuration in several module build files. - Shared formatting comes from Spotless and ktlint in
buildSrc, with the header file underspotless/. - Shared documentation behavior lives in
ProjectDokka.kt, the root build script, and.github/workflows/gradle-dokka.yml. annotationis JVM-only.processoruses KSP and KotlinPoet. Most other modules are Android libraries.
- Formatting:
./gradlew spotlessCheckor./gradlew spotlessApply - Docs:
./gradlew dokkaGenerate - Tests: prefer targeted module tests before full-project runs
- If Gradle or Java alignment is unstable, use the existing
jenv-gradle-low-ramskill
- Start with
README.mdand the Dokka module page for the area you are touching. - Inspect the module build file and package roots.
- Read
buildSrcbefore changing shared build behavior. - Update KDoc whenever public behavior changes.
IMPORTANT: This project has a knowledge graph. ALWAYS use the code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore the codebase. The graph is faster, cheaper (fewer tokens), and gives you structural context (callers, dependents, test coverage) that file scanning cannot.
- Exploring code:
semantic_search_nodesorquery_graphinstead of Grep - Understanding impact:
get_impact_radiusinstead of manually tracing imports - Code review:
detect_changes+get_review_contextinstead of reading entire files - Finding relationships:
query_graphwith callers_of/callees_of/imports_of/tests_for - Architecture questions:
get_architecture_overview+list_communities
Fall back to Grep/Glob/Read only when the graph doesn't cover what you need.
| Tool | Use when |
|---|---|
detect_changes |
Reviewing code changes — gives risk-scored analysis |
get_review_context |
Need source snippets for review — token-efficient |
get_impact_radius |
Understanding blast radius of a change |
get_affected_flows |
Finding which execution paths are impacted |
query_graph |
Tracing callers, callees, imports, tests, dependencies |
semantic_search_nodes |
Finding functions/classes by name or keyword |
get_architecture_overview |
Understanding high-level codebase structure |
refactor_tool |
Planning renames, finding dead code |
- The graph auto-updates on file changes (via hooks).
- Use
detect_changesfor code review. - Use
get_affected_flowsto understand impact. - Use
query_graphpattern="tests_for" to check coverage.
A full codemap is available at codemap.md in the project root.
Before working on any task, read codemap.md to understand:
- Project architecture and entry points
- Directory responsibilities and design patterns
- Data flow and integration points between modules
For deep work on a specific folder, also read that folder's codemap.md.