appfunctions

Generates Kotlin AppFunctions code exposing Android app workflows to on-device AI agents.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill appfunctions-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: appfunctions
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/pi/.pi/agent/skills/appfunctions
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill appfunctions-ravitejakarra24

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Android developers need to expose app features to system AI agents without forcing users to open the app UI, but implementing AppFunctions correctly requires coordinating Gradle/KSP setup, metadata XML, Kotlin annotations, KDoc optimization, and ADB testing across many steps. ## Core Features & Use Cases - Feature Discovery: Analyzes Android codebases (manifests, activities, services) to identify and recommend high-value AppFunctions with rationale for AI agent use. - Implementation & Configuration: Generates Kotlin code with correct @AppFunction annotations, KSP setup, app_metadata.xml, and optional Hilt dependency injection. - KDoc Refinement: Optimizes function and serializable documentation so LLM agents correctly understand workflows, parameters, and error recovery. - ADB Testing: Provides commands to list, invoke, enable, and disable AppFunctions on a connected device for verification. - Use Case: A notes app developer asks to expose note creation to the system assistant; the skill discovers candidate functions, generates the Kotlin implementation, refines the KDoc, and verifies registration via ADB. ## Quick Start Analyze my Android app and implement AppFunctions so system AI agents can create notes without opening the app UI.

Frequently Asked Questions about appfunctions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement AppFunctions in an Android app?

Add the androidx.appfunctions, appfunctions-service, and KSP compiler dependencies, define app_metadata.xml describing app capabilities, then annotate functions with @AppFunction(isDescribedByKDoc = true). The first parameter must be AppFunctionContext and functions should be suspend functions.

How do I test AppFunctions with ADB?

Use adb shell cmd app_function list-app-functions to see registered functions, then execute one with adb shell cmd app_function execute-app-function --package <pkg> --function <id> --parameters '<json>'. Wrap the JSON in single quotes to avoid shell escaping issues.

What Android version is required for AppFunctions?

The app must target SDK 36 or newer and compile against SDK 37 or newer, since AppFunctions are part of the Android platform API available from Android 16 onwards. Always use the Jetpack library for backwards compatibility.

Why is my AppFunction KDoc not extracted by KSP?

For @AppFunctionSerializable data classes, KSP only extracts documentation written as inline KDoc directly on each property. Class-level @param or @property tags are ignored, so move all property documentation inline.

What data types can AppFunction parameters use?

Supported types include primitives (Int, Long, Float, Double, Boolean), their arrays, String, PendingIntent, Uri, LocalDate, LocalDateTime, Instant, classes annotated with @AppFunctionSerializable, and Lists of supported non-primitive types.

Why does adb return 'Can't find service: app_function'?

This error means the connected device does not support the AppFunctions feature. Verify device support first by running adb shell cmd app_function help, which returns a help page when the service is available.