AgentSkillsCN

android-dev-assistant

为BuyOrNot-Android项目进行代码审查与预览生成。在审查Pull Request、生成Compose预览,或确保架构符合模块化与技术栈(Hilt、Kotlin 2.3.0)要求时使用。

SKILL.md
--- frontmatter
name: android-dev-assistant
description: Code review and preview generation for BuyOrNot-Android project. Use when reviewing pull requests, generating Compose previews, or ensuring architectural compliance with modularization and tech stack (Hilt, Kotlin 2.3.0).

Android Dev Assistant

Overview

The android-dev-assistant skill provides specialized knowledge for the BuyOrNot-Android project. It focuses on maintaining architectural boundaries (e.g., pure Kotlin domain), ensuring consistent Hilt and Compose usage, and generating high-quality Jetpack Compose previews using the project's design system.

Task Category 1: Code Review

Use this skill when performing a code review to ensure adherence to project standards.

Architectural Compliance

  • Module Boundaries: Verify that modules depend only on allowed layers. See modularization.md.
  • Domain Layer: Ensure domain has NO Android dependencies (e.g., Context, Intent, ViewModel).
  • Feature Layer: Ensure UI logic is in feature:* and uses ViewModel and Compose UI.
  • Hilt Setup: Check for correct Hilt annotations (@HiltAndroidApp, @AndroidEntryPoint, @HiltViewModel).

Compose & UI

  • Design System: Ensure all colors, fonts, and dimensions are sourced from core:designsystem.
  • State Hoisting: Check for proper state management in Composables.
  • ktlint: Verify code matches ktlint standards (v14.0.1).

Task Category 2: Preview Generation

Use this skill to generate or improve @Preview functions for Compose components.

Generation Guidelines

  • Theme Wrapper: Always wrap previews in BuyOrNotTheme.
  • Surface: Use Surface with BuyOrNotTheme.colors.background for correct background rendering.
  • Variants: Include both Light and Dark mode previews.
  • Reference: See compose.md for detailed patterns and templates.

Example Request

"Generate a Compose preview for the ProductCard component in feature:home. Include Dark Mode and use sample data."

Task Category 3: MVI Architecture

Use this skill to ensure the ViewModel follows the project's MVI pattern.

MVI Guidelines

  • BaseViewModel: Ensure ViewModel inherits from BaseViewModel<S, I, E> in core.ui.base.
  • Intent-Driven: Logic must be triggered via handleIntent(I).
  • Contract.kt: Check if UiState, Intent, and SideEffect are correctly defined.
  • SideEffect: Use sendSideEffect(E) for navigation, snackbars, and one-time events.
  • Reference: See mvi.md for architecture rules.

References