Agent Skills › android/skills › appfunctions

appfunctions

GitHub

用于Android应用开发,分析用户工作流并生成AppFunction代码,优化KDoc以支持AI代理调用。涵盖功能发现、实现配置、文档优化及ADB测试调试全流程。

device-ai/appfunctions/SKILL.md android/skills

Trigger Scenarios

发现AppFunction功能 实现AppFunction代码 优化KDoc文档 使用ADB测试AppFunction

Install

npx skills add android/skills --skill appfunctions -g -y
More Options

Non-standard path

npx skills add https://github.com/android/skills/tree/main/device-ai/appfunctions -g -y

Use without installing

npx skills use android/skills@appfunctions

指定 Agent (Claude Code)

npx skills add android/skills --skill appfunctions -a claude-code -g -y

安装 repo 全部 skill

npx skills add android/skills --all -g -y

预览 repo 内 skill

npx skills add android/skills --list

SKILL.md

Frontmatter
{
    "name": "appfunctions",
    "license": "Complete terms in LICENSE.txt",
    "metadata": {
        "author": "Google LLC",
        "keywords": [
            "AppFunctions",
            "Kotlin",
            "KSP",
            "ADB",
            "AI",
            "LLM",
            "MCP"
        ],
        "last-updated": "2026-10-28"
    },
    "description": "Analyzes Android apps to find user workflows to expose as AppFunctions, such as creating a note, playing media, or sending a message. AI agents, voice commands, and system shortcuts then run them without opening the app UI. Generates Kotlin code with the androidx.appfunctions library, and refines KDoc and the app description so that agents choose and call functions correctly. Use this skill when discovering, implementing, documenting, testing, or upgrading AppFunctions in an Android app, including @AppFunctionDeclaration, @AppFunctionSerializable, @AppFunctionServiceEntryPoint, AppFunctionService, app_metadata.xml, appfn:instructions, adb shell cmd app_function, and legacy @AppFunction or AppFunctionConfiguration.Provider code. Don't use for building agents that call AppFunctions or for remote MCP servers."
}

Analyzes Android apps to identify key user workflows to expose as AppFunctions, such as creating a note, playing media, or sending a message, for AI agents, voice commands, and system shortcuts to run without opening 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 and the app description so 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. Use androidx.appfunctions:appfunctions and the KSP compiler androidx.appfunctions:appfunctions-compiler, version 1.0.0-beta01 or later.

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: 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: 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: Optimize AppFunction KDoc and the app description 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: 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.

When the user asks for a subset of the steps, run those steps and any step that the critical constraints require. Then list the skipped steps and ask whether to run them.

If they apply, you must load the following references:

  • Context and terminology: 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 : Migrates apps on AppFunctions 1.0.0-alpha09 or lower to the AppFunctionServiceEntryPoint architecture from 1.0.0-alpha10, and upgrades apps to 1.0.0-beta01. Load it when a user asks to migrate or upgrade existing AppFunctions code. When you find legacy AppFunctionConfiguration.Provider implementations, @AppFunction annotations, or appfn:description attributes, load it and ask the user before you migrate.

Critical constraints

  • Modular consistency: You must refine KDocs immediately after you generate AppFunction implementations.
  • Security: Expose only safe, non-destructive tasks that the app's UI already offers on that form factor. Never give agents wide-ranging access to user data or system resources. Never require or return passwords, financial details, private keys, or other highly sensitive personal information.
  • Descriptions: Describe what each function does, never how an agent must behave. Put call order across functions in the app description, not in function KDoc.

Troubleshooting

Version History

  • 6daa53e Current 2026-11-02 23:09

    更新依赖库版本至1.0.0-beta01或更高,新增MCP相关参考文档及迁移指南,完善四步工作流说明。

  • aaca635 2026-08-27 20:07
  • 6685cac 2026-08-19 22:25

    更新技能描述,细化四个工作流程步骤(发现、实现、KDoc优化、测试),新增上下文术语和迁移指南参考文档。

  • 47e1dff 2026-07-24 22:27

Same Skill Collection

build-system/agp/agp-9-upgrade/SKILL.md
camera/camerax/SKILL.md
device-ai/ml-kit-genai-prompt-api/SKILL.md
devtools/android-cli/SKILL.md
identity/restore-credentials/SKILL.md
identity/verified-email/SKILL.md
jetpack-compose/jetpack-compose-performance/SKILL.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/SKILL.md
jetpack-compose/theming/styles/SKILL.md
media/media3-cast-integration/SKILL.md
navigation/navigation-3/SKILL.md
navigation/navigation-event/SKILL.md
performance/anr-audit-and-fix/SKILL.md
performance/r8-analyzer/SKILL.md
play/engage-sdk-integration/SKILL.md
play/play-billing-library-version-upgrade/SKILL.md
play/play-policy-insights/SKILL.md
profilers/perfetto-sql/SKILL.md
profilers/perfetto-trace-analysis/SKILL.md
security/android-intent-security/SKILL.md
security/android-permissions-security/SKILL.md
system/edge-to-edge/SKILL.md
system/glance-canonical-layouts/SKILL.md
testing/testing-setup/SKILL.md
wear/wear-compose-m3/SKILL.md
xr/display-glasses-with-jetpack-compose-glimmer/SKILL.md
xr/projected-hardware/SKILL.md
cars/android-for-cars-parked-apps/SKILL.md
device-ai/litert/litert-lm/SKILL.md
device-ai/litert/litert-runtime/SKILL.md
device-ai/mlkit-agent-api/SKILL.md
jetpack-compose/adaptive/SKILL.md
jetpack-compose/ink/ink-app-builder/SKILL.md
jetpack-compose/ink/ink-custom-brush-builder/SKILL.md
profilers/android-profiler/SKILL.md
system/glance-appwidget-updates-and-memory/SKILL.md
tv/leanback-to-compose-tv-migration/SKILL.md
wear/wear-widgets/SKILL.md

Metadata

Files
0
Version
6daa53e
Hash
9c114f12
Indexed
2026-07-24 22:27

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-05 06:04
浙ICP备14020137号-1