Android Architecture
Developmentandroid-architectureAndroid Architecture is an Agent Skill for development published in the F0x1d/LogFox repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Enforces LogFox Android architecture — modified TEA (Reducer/EffectHandler/Store), api/impl/presentation module boundaries, ViewState mapping, passive UI containers, Hilt `@Binds` conventions. Use when creating or modifying feature modules, adding reducers/effect handlers/view state mappers, setting up navigation via side effects, or reviewing multi-file architectural changes in this repo.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/F0x1d/LogFox/blob/HEAD/.agents/skills/android-architecture/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/android-architecture, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Android Architecture
Architecture rules and patterns for LogFox feature code. Pairs with CLAUDE.md (which defines module layout, dependency direction, and naming) — this skill adds the TEA pattern, ViewState/UI split, and concrete examples.
When to use
- Creating a new
feature/<name>/{api,impl,presentation}module - Adding or modifying a
Reducer,EffectHandler,ViewStateMapper, orBaseStoreViewModelsubclass - Wiring navigation as a
SideEffect - Setting up Hilt
@Bindsfor a new repository or use case - Reviewing PRs that touch module boundaries, DI, or state management
When NOT to use
- Single-file bug fixes that don't touch state, DI, or module boundaries
- String, drawable, translation, or other resource-only changes
- Gradle/dependency version bumps
- Build-logic / convention-plugin edits (no feature logic involved)
Workflow
- Read
references/reference-index.md(10 lines) to pick the relevant references for the task. - Load one or two focused references; pull in more only if scope expands.
- For new features, read
references/example-feature.mdfirst — it's a full end-to-end walkthrough. - Implement the change with the smallest possible surface area. Follow the non-negotiable rules below.
- Run
references/checklist.md— each item is grep-able. Fix failures before reporting done. - Validate the build:
./gradlew :feature:<name>:presentation:compileDebugKotlin --quiet(or the module you touched). Compilation is the fastest boundary check.
Non-negotiable rules
These rules extend CLAUDE.md. If a rule here conflicts with CLAUDE.md, CLAUDE.md wins.
- Modified TEA: immutable
State,Command,SideEffect; pureReducer; asyncEffectHandler. UsewithSideEffects(...)/noSideEffects()helpers fromcore.tea— don't buildReduceResultby hand. Store.send()is Main-thread only.EffectHandlermay do background work but must re-enter commands on Main (BaseStoreViewModelalready handles this).- Both
StateandViewStateexist. Mapping happens inBaseStoreViewModelvia aViewStateMapper. UI never seesState. - UI is passive. Fragments/Composables call
render(ViewState)andhandleSideEffect(SideEffect)only. No business logic, no direct repository/use case calls. - Navigation and one-off UI actions are
SideEffects emitted from the reducer and consumed in the container fragment. - UI side effects get
Unitbranches inEffectHandler; business side effects getelse -> UnitinhandleSideEffect. Every side effect is seen by both sides — each ignores what isn't theirs. Seereferences/viewstate-and-ui.md(viaui-container-pattern.md). implclasses areinternal. Onlyapitypes are public. Presentation never importsimpl.- Hilt
@Bindsreturns the interface, never*Impl. Seereferences/di-and-reactive-flow.md. - Feature-prefixed names:
FooViewModel,FooReducer,FooEffectHandler,FooViewStateMapper,FooState,FooViewState,FooCommand,FooSideEffect.
Reference map
- Quick self-check before finalizing:
references/checklist.md - Index of all reference docs:
references/reference-index.md - Full worked example:
references/example-feature.md
Edge cases
- Legacy code violates the rules. Make the smallest safe change. Document the gap in the PR description. Don't refactor out of scope.
- Two rules conflict. Prefer dependency boundaries and thread-safety first, naming/style last.
- Hybrid Fragment + Compose feature. One source of truth in the ViewModel. Both UI layers stay passive.
- Expensive
ViewStateMapper. PassDispatchers.DefaultasviewStateMappingDispatchertoBaseStoreViewModel.