architecture
This skill defines the only right architecture for android projects. Activate when doing big tasks (related to several files and their interconnections) in this project
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Android Architecture
This skill defines how to design and review architecture changes in LogFox Android modules.
When to use this skill
Use this skill when at least one is true:
- The task touches multiple related Android files or modules.
- A new feature/module is added or existing module boundaries are changed.
- State management, ViewModel flow, reducers, effect handlers, or navigation patterns are updated.
- A PR needs architecture compliance review.
Skip this skill for tiny isolated edits (for example: text change, one-off constant rename).
Fast workflow
- Identify impacted modules (
api,impl,presentation, andcore). - Apply the non-negotiable rules in this file.
- Load only the reference sections needed for the task:
-
references/CHECKLIST.md(quick compliance pass) -
references/REFERENCE_INDEX.md(choose targeted rule groups)
-
- Implement changes with minimal surface area while preserving boundaries.
- Validate with the checklist before finalizing.
Non-negotiable rules
- Use modified TEA: immutable
State,Command,SideEffect, pureReducer, asynchronousEffectHandler. -
Store.send()must be called from Main thread. - Every feature has both
StateandViewState; mapping happens inside ViewModel viaViewStateMapper. - UI is passive: Fragments/Composables render state and emit events only; no business logic in views.
-
presentationdepends only onapi; never depend on another module'simpl(except:app). - Use cases expose
operator fun invoke; failable operations returnResult<T>. - Repository interfaces live in
api; data sources and implementations stayinternalinimpl. - Hilt bindings return interfaces, not implementation types.
- Use SideEffects for navigation and one-off UI actions.
- One file contains one top-level type; file name matches type name.
Reference map
- Quick compliance checklist:
references/CHECKLIST.md - Rule-group index:
references/REFERENCE_INDEX.md
Expected output when applying this skill
When you perform architecture work, report:
- Which rules were applied.
- Which modules and layers were changed.
- Any deliberate deviation and why.
- Remaining risks or follow-up refactors.
Edge-case guidance
- If existing code violates these rules and full refactor is out of scope, make the smallest safe change and document the gap.
- If two rules conflict, prefer dependency boundaries and thread-safety first, then naming/style.
- If a feature is hybrid (Fragment + Compose), keep a single source of truth in ViewModel and preserve passive UI on both sides.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!