---
name: phone-assistant-skill
description: Comprehensive Phone Assistant Capability Layer for Gemma 4 E2B on Android. Handles phone action intent detection, app deep-link handoffs (WhatsApp, Chrome, YouTube, Maps, Settings), multi-step task planning, text-to-PDF document creation, content processing, and native Android capability fallback detection.
metadata:
  homepage: https://my-9bm.pages.dev/
---

# Phone Assistant Skill

A capability-aware phone assistant skill designed for Google AI Edge Gallery and Gemma 4 E2B.

## Capabilities Overview

1. **App Handoff & Deep Links**: Open WhatsApp, Chrome, YouTube, Google Maps, Android Settings via standard deep-link URL schemes.
2. **Document & PDF Creation**: Transform text or model-generated content into styled multi-page PDF files with title metadata and page numbers.
3. **Multi-Step Task Planning**: Model complex requests into observable step states (`PENDING`, `RUNNING`, `COMPLETED`, `FAILED`, `BLOCKED_NATIVE`, `NEEDS_USER`).
4. **Capability Detection & Native Fallback**: Detect WebView runtime capabilities dynamically and gracefully explain when native Android OS integrations (Intents/AccessibilityService) are required.

## Instructions for Gemma Model

When the user requests phone operations (e.g., opening apps like WhatsApp, Chrome, Maps, YouTube, Settings, creating PDFs, transforming documents, or executing multi-step phone workflows), invoke the `run_js` tool with the following parameters:

- **script name**: `index.html`
- **data**: A JSON string containing:
  - `command` (String, required): The user's prompt or request string.
  - `action` (String, optional): Explicit action intent, e.g., `open_whatsapp`, `open_chrome`, `open_youtube`, `open_maps`, `open_settings`, `open_app`, `create_pdf`, `process_document`, `prepare_share`, `multi_step`.
  - `app` (String, optional): Target application name if applicable.
  - `steps` (Array of Strings, optional): Planned execution steps for multi-step tasks.
  - `params` (Object, optional): Parameters such as `{ content: "...", title: "...", query: "...", phone: "..." }`.

### Parameter Examples

- **Open App**:
  ```json
  {"command": "Open WhatsApp and send a message", "action": "open_whatsapp", "app": "WhatsApp"}
  ```

- **Generate PDF**:
  ```json
  {"command": "Create PDF of project report", "action": "create_pdf", "params": {"title": "Project Summary", "content": "1. Introduction\n2. Implementation Details"}}
  ```

- **Multi-Step Workflow**:
  ```json
  {"command": "Open Google Maps and Chrome to find location", "steps": ["Open Google Maps for direction", "Open Chrome to read venue info"]}
  ```

## Host Interface & Return Contract

The JavaScript skill script defines `window.ai_edge_gallery_get_result(data)` which returns:

```json
{
  "result": "Human-readable summary of action, plan status, or PDF generation result",
  "webview": {
    "url": "data:text/html;charset=utf-8,...",
    "aspectRatio": 1.25
  }
}
```

## Hosted Skill Reality & Native android Architecture

- **Hosted Web Scope**: This Cloudflare-hosted skill runs inside AI Edge Gallery's Webview. Deep links request app handoff from Android; they do NOT guarantee the app opened or performed actions autonomously.
- **Native Android Integration**: Actions requiring direct screen interaction, typing into external apps, or hardware toggles are classified as `NATIVE_REQUIRED` and present a structured native bridge contract (`window.nativeBridge.execute()`).
- **No False Claims**: The skill never claims an action succeeded when it was only an attempted deep link handoff.
