appfunctions
Skill này làm gì
Skill này rà soát ứng dụng Android để tìm các tác vụ thường gặp của người dùng, chẳng hạn tạo ghi chú hoặc phát media, rồi biến chúng thành AppFunctions. Khi đã được công khai, agent AI và lệnh giọng nói có thể chạy chúng mà không cần mở ứng dụng. Nó dành cho lập trình viên Android muốn ứng dụng của mình hoạt động với các agent của hệ thống.
Khi nào nên dùng
- ✓Khi bạn muốn agent AI hoặc lệnh giọng nói tạo ghi chú hoặc phát media trong ứng dụng Android của bạn.
- ✓Khi bạn muốn tìm xem hành động nào trong ứng dụng đáng được công khai cho các agent của hệ thống.
- ✓Khi bạn cần mã Kotlin và mô tả rõ ràng để agent chọn và gọi đúng hàm của bạn.
Liên kết skill
https://github.com/android/skills/blob/main/device-ai/appfunctions/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tìm các tác vụ chính trong ứng dụng Android của tôi mà tôi nên công khai dưới dạng AppFunctions cho agent AI.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill phân tích ứng dụng để tìm luồng công việc của người dùng, rồi viết mã Kotlin dùng thư viện androidx.appfunctions. Nó cũng cải thiện mô tả để agent hiểu khi nào nên dùng từng hàm.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
AppFunctionServiceEntryPointarchitecture 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 legacyAppFunctionConfiguration.Providerimplementations,@AppFunctionannotations, orappfn:descriptionattributes, 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
- If you encounter build-time errors such as Kotlin Symbol Processing (KSP) issues, see Implementation and configuration.
- If you encounter runtime errors such as missing services or execution failures, see Testing and debugging.
- If you need architecture definitions and vocabulary, see Context and terminology.
- If you encounter issues when upgrading AppFunct
Câu hỏi thường gặp
Ứng dụng của tôi cần phiên bản Android nào?
Ứng dụng phải nhắm tới SDK 36 trở lên và biên dịch với SDK 37 trở lên, vì AppFunctions là một phần của Android 16 trở lên.
Tôi có thể kiểm thử các hàm mà không cần màn hình của ứng dụng không?
Có. Skill bao gồm các lệnh ADB để kiểm thử và đánh giá cục bộ.
Nó có thay đổi giao diện màn hình của ứng dụng không?
Không. Mục tiêu của nó là công khai các luồng công việc để agent có thể chạy mà không cần mở màn hình của ứng dụng.
Chi tiết
Mô tả gốc của tác giả
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, AppFunctionServ
repo: android/skills
Độ phổ biến
- Sao GitHub
- 10k
- Vị trí xếp hạng
- #11910
- Giấy phép
- Apache-2.0
- Cập nhật
- 29/10/2026
Bình luận
- …
Thêm skill từ kho mã này
agp-9-upgrade
10kGiúp agent của bạn nâng cấp ứng dụng Android lên Android Gradle Plugin 9 và xử lý các thay đổi gây lỗi. Không dành cho dự án đa nền tảng.
camerax
10kGiúp agent của bạn xây dựng các tính năng camera Android bằng CameraX, gồm quay video, điều khiển phần cứng, ML Kit và hiệu ứng Media3.
android-for-cars-parked-apps
10kĐiều chỉnh một ứng dụng video, trò chơi hoặc trình duyệt Android để chạy như ứng dụng khi xe đỗ trên Android Auto và Android Automotive.
litert-lm
10kGiúp agent của bạn xây dựng một ứng dụng Android chạy mô hình AI văn bản mở ngay trên thiết bị, dùng API Kotlin của LiteRT-LM.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.