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天前更新