AgentSkillsCN

check-platform-code

对androidMain和iosMain中的平台专属代码进行审计,查找expect/actual声明,并识别出可移至commonMain的代码片段。

SKILL.md
--- frontmatter
name: check-platform-code
description: Audit platform-specific code in androidMain and iosMain. Finds expect/actual declarations and identifies code that could be moved to commonMain.
allowed-tools: Glob, Grep, Read
user-invocable: true

Audit platform-specific code in the DocuBox KMP project.

Steps:

  1. Find all expect declarations in commonMain:

    • Search for expect class, expect fun, expect val, expect object in composeApp/src/commonMain/
  2. Find all actual implementations:

    • Search composeApp/src/androidMain/ for actual declarations
    • Search composeApp/src/iosMain/ for actual declarations
  3. Find platform-specific code that isn't part of expect/actual:

    • List all Kotlin files in androidMain and iosMain
    • Identify any logic beyond the actual implementations
  4. Analyze and report:

    • List each expect/actual pair and its purpose
    • Flag any code in platform source sets that could move to commonMain
    • Flag any missing actual implementations (expect without matching actual)
    • Flag any use of deprecated platform APIs