appfunctions
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnalyzes 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.
分析Android应用,识别AppFunctions的关键用户工作流,例如
创建笔记、播放媒体、发送由自动化或AI Agent触发的
消息、语音命令或系统快捷方式,无需打开应用
UI。
生成Kotlin代码将这些工作流暴露给Android系统,
允许Agent在设备上发现并执行它们。
同时优化KDoc文档,确保AI Agent能正确
理解并使用所提供的功能。
Prerequisites
前提条件
The app must or newer and use or newer as
AppFunctions, part of the Android platform API, are available from Android 16
onwards.
Always use the Jetpack library, as it handles backwards compatibility.
targetSdk 36compileSdk 37应用必须以**或更高版本为目标,并使用**或更高版本,
因为作为Android平台API一部分的AppFunctions从Android 16
开始可用。
请始终使用Jetpack库,因为它能处理向后兼容性。
targetSdk 36compileSdk 37Workflows
工作流
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: Analyzes Android codebases to identify and recommend high-value AppFunctions. Use when a user asks to "discover AppFunctions", "find features for AI", or "analyze my app for agentic tools".
- Step 2: Implementation & Configuration: Specialized for generating Kotlin implementations of AppFunctions, handling system-wide configuration, and managing build dependencies. Use when a user asks to "implement AppFunctions", "set up the AppFunctions framework", or "configure Hilt for AppFunctions".
- Step 3: KDoc Refinement: Optimizes AppFunction KDoc for AI agents and Model Context Protocol. Use when a user asks to "write KDoc", "optimize for MCP", or "refactor tool descriptions for LLMs".
- Step 4: Testing & Debugging: Provides commands to interact with AppFunctions using ADB for testing and debugging. Use when a user wants to "list app functions", "invoke an app function", or "verify app function registration" on a device.
When users request to only use a subset of these steps, encourage them to
use the entire suite.
该技能允许调用者发现将提供给系统Agent的功能,使用AppFunctions实现这些功能,优化面向Agent的功能描述,并使用ADB命令进行本地评估和测试。
完整的AppFunction开发流程包含以下四个步骤:
- 步骤1:发现: 分析Android代码库,识别并推荐高价值的AppFunctions。当用户要求“发现AppFunctions”、“为AI寻找功能”或“分析我的应用以适配Agent工具”时使用此步骤。
- 步骤2:实现与配置: 专门用于生成AppFunctions的Kotlin实现、处理系统级配置以及管理构建依赖。当用户要求“实现AppFunctions”、“搭建AppFunctions框架”或“为AppFunctions配置Hilt”时使用此步骤。
- 步骤3:KDoc优化: 针对AI Agent和Model Context Protocol优化AppFunction的KDoc。当用户要求“编写KDoc”、“针对MCP优化”或“为LLM重构工具描述”时使用此步骤。
- 步骤4:测试与调试: 提供使用ADB与AppFunctions交互的命令,用于测试和调试。当用户想要在设备上“列出应用功能”、“调用应用功能”或“验证应用功能注册”时使用此步骤。
当用户要求仅使用这些步骤中的一部分时,建议他们使用完整的流程。
Critical Constraints
关键约束
- Modular Consistency : Always ensure that implementations generated using Implementation & Configuration are immediately followed by KDoc refinement using KDoc Refinement to ensure maximum agent compatibility.
- Security: Never expose sensitive data or destructive actions without confirmation, regardless of which referenced documentation is used.
- 模块一致性 : 始终确保使用实现与配置生成的实现后,立即使用KDoc优化进行KDoc优化,以确保与Agent的最大兼容性。
- 安全性: 无论使用哪份参考文档,未经确认绝不能暴露敏感数据或执行破坏性操作。
Troubleshooting
故障排除
- For build-time errors (KSP, Metadata), refer to Implementation & Configuration.
- For runtime errors (Service not found, Execution failed), refer to Testing & Debugging.
- 对于构建时错误(KSP、元数据),请参考实现与配置。
- 对于运行时错误(服务未找到、执行失败),请参考测试与调试。