Appfunctions

android/skills/device-ai/appfunctions

作者 android42dc2270e960Complete terms in LICENSE.txt7.7K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫13 天前更新

Analyzes Android apps to identify key user workflows for AppFunctions such as creating a note, playing media, or sending an automated or AI agent triggered message, voice commands, or system shortcuts, without needing to open the app UI. Generates Kotlin code to expose these workflows to the Android system, allowing agents to discover and execute them on-device. Also refines KDoc documentation to ensure AI agents correctly understand and use the provided functionality.

AI 產生的概覽

引導 Android 開發者探索、實作、撰寫文件並測試 AppFunctions,將應用程式工作流程開放給裝置端 AI 代理。

功能
此技能以四個步驟說明 Android 應用程式的 AppFunctions 開發流程:探索候選使用者工作流程、產生 Kotlin 實作並處理建置與系統設定、調整 KDoc 讓 AI 代理與 MCP 用戶端正確理解這些函式,以及使用 ADB 指令進行測試與偵錯。它也說明架構術語,並介紹如何將舊版 AppFunctionConfiguration.Provider 程式碼遷移到 AppFunctionServiceEntryPoint 架構。產出包括 Kotlin 程式碼、設定指引、調整後的 KDoc 與 ADB 測試指令。
適用情境
適用於目標為 Android 16 或更新版本的應用程式,且希望在不開啟介面的情況下,把建立筆記、播放媒體等應用程式功能開放給系統代理時。適合「探索 AppFunctions」、「實作或設定此架構」、「為 LLM 或 MCP 最佳化工具描述」以及「在裝置上驗證函式註冊」等需求。也適用於將 1.0.0-alpha09 及更早版本的現有 AppFunctions 程式碼升級。
執行需求
目標 Android 應用程式需使用 targetSdk 36 或更新版本、compileSdk 37 或更新版本,並建議使用 Jetpack AppFunctions 程式庫以維持向後相容。測試步驟需要能透過 ADB 存取裝置。此技能僅包含說明,不附帶指令碼,需搭配隨附的參考文件。

Analyzes Android apps to identify key user workflows for AppFunctions such as creating a note, playing media, or sending an automated or AI agent triggered message, voice commands, or system shortcuts, without needing to open the app UI.

Generates Kotlin code to expose these workflows to the Android system, allowing agents to discover and execute them on-device.

Also refines KDoc documentation to ensure AI agents correctly understand and use the provided functionality.

Prerequisites

The app must targetSdk 36 or newer and use compileSdk 37 or newer as AppFunctions, part of the Android platform API, are available from Android 16 onwards. Always use the Jetpack library because it handles backward compatibility.

Workflows

This skill enables the caller to discover features that will be provided to system agents, implement these with AppFunctions, improve function description for agents, and use ADB commands for local evaluation and testing.

The full AppFunction development flow consists of these four steps:

  • Step 1: Discovery [blocked]: Analyze Android codebases to identify and recommend potential AppFunctions. Use this step when a user asks to "discover AppFunctions," "find features for AI," or "analyze my app for agentic tools."
  • Step 2: Implementation and configuration [blocked]: Generate Kotlin implementations of AppFunctions, manage system-wide configuration, and configure build dependencies. Use this step when a user asks to "implement AppFunctions," "set up the AppFunctions framework," or "configure Hilt for AppFunctions."
  • Step 3: KDoc refinement [blocked]: Optimize AppFunction KDoc for AI agents and Model Context Protocol. If a user asks to "write KDoc", "optimize for MCP", or "refactor tool descriptions for LLMs", use this step.
  • Step 4: Testing and debugging [blocked]: Provide commands to interact with AppFunctions using ADB for testing and debugging. If a user wants to "list app functions", "invoke an app function", or "verify app function registration" on a device, use this step.

If users request a subset of steps, you must encourage them to use all steps.

If they apply, you must load the following references:

  • Context and terminology [blocked]: Defines the ubiquitous language, architecture definitions, and design patterns across the AppFunctions skill suite. Load when you need to understand core architecture terminology or check the distinctions between modern and legacy AppFunctions APIs.
  • Migration to service entry point [blocked] : Documents the systematic procedure for migrating Android applications using AppFunctions versions 1.0.0-alpha09 and lower to AppFunctionServiceEntryPoint architecture introduced in version 1.0.0-alpha10. Load when a user asks to migrate or upgrade existing AppFunctions code, or when you encounter legacy AppFunctionConfiguration.Provider implementations.

Critical constraints

  • Modular consistency: You must refine KDocs immediately after you generate AppFunction implementations.
  • Security: Don't expose sensitive data or run destructive actions without user confirmation.

Troubleshooting

  • If you encounter build-time errors such as Kotlin Symbol Processing (KSP) issues, see Implementation and configuration [blocked].
  • If you encounter runtime errors such as missing services or execution failures, see Testing and debugging [blocked].
  • If you need architecture definitions and vocabulary, see Context and terminology [blocked].
  • If you encounter issues when upgrading legacy configurations, see Migration to service entry point [blocked].

來源與署名

來源:android/skills位於device-ai/appfunctions提交42dc227

授權條款: Complete terms in LICENSE.txt

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 android/skills 的技能

Wear Compose M3

android

指導建置、更新與移轉 Wear OS Compose Material3 應用程式,並提供標準元件範例與版本規則。

Software Development7.7K13 天前更新

Display Glasses With Jetpack Compose Glimmer

android

Provides guidelines for developing projected Android XR apps for display glasses using the Jetpack Compose Glimmer UI toolkit. This skill covers foundational Glimmer design principles, workflows for implementing Jetpack Compose Glimmer, and interaction models for the glasses form factor. Use this skill to build an Android XR Augmented Experience app with Jetpack Compose Glimmer that adheres to the Glimmer design system for optimized glasses styling.

待分類7.7K13 天前更新

Play Billing Library Version Upgrade

android

引導將 Android 專案從舊版 Google Play 帳務程式庫升級到最新穩定版本。

Software Development7.7K13 天前更新

Leanback To Compose Tv Migration

android

Provides instructions and architectural patterns for migrating Android TV applications from legacy Leanback UI Toolkit, Android Views, or Support Fragments to Jetpack Compose for TV (androidx.tv). Use this skill for Leanback to Compose migrations, including browse screen, settings screen, authentication screen, login screen, or video playback screen migrations, or when replacing BrowseSupportFragment, LeanbackSettingsFragment, PreferenceFragment, BaseLeanbackPreferenceFragmentCompat, VideoSupportFragment, GuidedStepSupportFragment, SearchSupportFragment, VerticalGridSupportFragment, Presenter, ArrayObjectAdapter, or CursorMapper with modern Compose equivalents, implementing immersive carousels with focus memory, Media3 video playback with PlayerSurface, or custom 10-foot hero layouts.

待分類7.7K13 天前更新

Testing Setup

android

分析 Android 專案的測試設定,並安裝測試框架、測試基礎設施,以及單元、UI、截圖與端對端測試。

Software Development7.7K13 天前更新

Android Profiler

android

引導 Android 效能分析:錄製系統追蹤、堆積轉儲與方法記錄,並以 Perfetto SQL 進行分析。

Software Development7.7K13 天前更新