Agent skill

ML Kit Genai Prompt API

by rosuH in rosuH/EasyWatermark

Analyzes Android codebases to implement ML Kit GenAI Prompt API.

MITAuto-check passedAI & LLM Engineering

Install ML Kit Genai Prompt API

skills CLI
$ npx skills add rosuH/EasyWatermark --skill ml-kit-genai-prompt-api -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rosuH/EasyWatermark ml-kit-genai-prompt-api --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rosuH/EasyWatermark.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ml-kit-genai-prompt-api .claude/skills/ml-kit-genai-prompt-api && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ml-kit-genai-prompt-api
GitHub stars
1.9k
Used in
1 other repo
Token cost
~1k tokens
SKILL.md length
265 words
Files
7 (incl. references)
Skills in repo
28
Repo updated
First seen
Licence
MIT

At a glance

Analyzes Android codebases to implement ML Kit GenAI Prompt API.

  • Works in 4 steps: Prompt optimization → Prefix caching optimization → Lifecycle and best practices → …
  • Send natural language requests on-device to Gemini Nano
  • SKILL.md covers Prerequisites and Detailed steps
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

ML Kit Genai Prompt API is an agent skill from rosuH/EasyWatermark. Analyzes Android codebases to implement ML Kit GenAI Prompt API. Use this skill to send natural language requests on-device to Gemini Nano, use structured output with Prompt API, implement prefix caching, optimize the current prompt, or apply best practices."

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/get-started.md`, `references/prefix-caching.md` and `references/prompt-design.md`).

It sits in AI & LLM Engineering, covering Structured output and tool calling and Caching. It works with Android. The repository describes itself as: 🔒 🖼 Securely, easily add a watermark to your sensitive photos. 安全、简单地为你的敏感照片添加水印,防止被人泄露、利用. The licence is MIT.

When your agent uses it

  • Send natural language requests on-device to Gemini Nano
  • Use structured output with Prompt API
  • Implement prefix caching
  • Optimize the current prompt

Example prompts

  • “Use the ml-kit-genai-prompt-api skill to analyz Android codebases to implement ML Kit GenAI Prompt API”
  • “/ml-kit-genai-prompt-api”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Prompt optimization
  2. Prefix caching optimization
  3. Lifecycle and best practices
  4. Structured output

What it can do on your machine

Read from SKILL.md and the folder at commit 61223db. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developer.android.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

ML Kit Genai Prompt API loads about 1k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 71 tokens; SKILL.md has 265 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rosuH/EasyWatermark at commit 61223db, republished under its MIT licence (© rosuH). 265 words, ~1,045 tokens.

Download SKILL.mdSave it as .claude/skills/ml-kit-genai-prompt-api/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
ml-kit-genai-prompt-api
description
Analyzes Android codebases to implement ML Kit GenAI Prompt API. Use this skill to send natural language requests on-device to Gemini Nano, use structured output with Prompt API, implement prefix caching, optimize the current prompt, or apply best practices."
license
Complete terms in LICENSE.txt
metadata.author
Google LLC
metadata.last-updated
2026-09-03
metadata.keywords
ML Kit, Prompt API, Structured Output, Prefix Caching, Gemini Nano

This skill provides step-by-step guidance for integrating and optimizing the ML Kit GenAI Prompt API in Android apps.

Prerequisites

  • Android API level must be 26 or higher. If minSdk is below 26, update it to 26.
  • Add the ML Kit GenAI Prompt API dependency (com.google.mlkit:genai-prompt) to the app-level build.gradle file, with version at least 1.0.0-beta4.
  • If com.google.mlkit:genai-schema-compiler dependency is used and KSP plugin version is below 2.3.6, update it to 2.3.6.

Detailed steps

1. Prompt optimization

To optimize prompts for use with the ML Kit Prompt API, follow the prompt optimization guide.

2. Prefix caching optimization

If the prompt is more than 200 words, implement the prefix caching API.

3. Lifecycle and best practices
  • The model must be fully downloaded and available before calling the first inference. Follow the guide on implementing a generative model to check that the FeatureStatus of a model is AVAILABLE before making an inference.

  • Release ML Kit instances by calling close() when an Activity, Fragment, or ViewModel is destroyed. Example:

    kotlin
    // Instantiating model in activity, fragment, or ViewModel
        val generativeModel = Generation.getClient()
    
    // When activity, fragment, or ViewModel is destroyed
        generativeModel.close()
    <br />
Show full SKILL.md (187 more words)Show less
4. Structured output

When implementing or refactoring a prompt to use structured output, follow these rules:

  1. Check for API availability: Verify Structured Output feature is available on the device with isStructuredOutputFeatureAvailable() before using it. Refer to the Structured Output API guide for full instructions.

  2. Return type: Return the @Generable typed object from the function signature instead of a String or JSON string.

    For example:

    fun parseEmail(email: String): String {
        ... 
    }

    should be refactored to:

    fun parseEmail(email: String): ParsedEmail? {
        ...
    }
    
  3. Example:

    This is the example code before refactoring:

    kotlin
    suspend fun parseEmail(email: String): String {
        val parseEmailPrompt = "Parse this email and return the sender, title, and short summary of the email less than 10 words: "
    
        val parsedEmail = generativeModel.generateContent(parseEmailPrompt + email)
    
        return parsedEmail.candidates[0].text
    }
    <br />

    This is the example code after using Structured Output API:

    kotlin
    @Generable
    data class ParsedEmail(
        @Guide(description = "Sender of the email")
        var sender: String = "",
    
        @Guide(description = "Title of the email")
        var title: String = "",
    
        @Guide(description = "Summary of the email less than 10 words")
        var summary: String = ""
    )
    
    suspend fun parseEmail(email: String): ParsedEmail? {
        val parseEmailPrompt =
            "Parse this email: $email"
    
        val baseRequest = GenerateContentRequest.Builder(TextPart(parseEmailPrompt)).build()
        val typedRequest = generateTypedContentRequest(baseRequest, ParsedEmail::class)
        val typedResponse = generativeModel.generateContent(typedRequest)
        return typedResponse.candidates[0].response
    }
    <br />

© rosuH, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in skills/ml-kit-genai-prompt-api of rosuH/EasyWatermark.

  • SKILL.md
  • references/get-started.md
  • references/prefix-caching.md
  • references/prompt-design.md
  • references/prompt-optimization.md
  • references/structured-output.md
  • references/system-instructions.md

Open the folder on GitHubat commit 61223db

Used in 1 other repository

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in rosuH/EasyWatermark, which our catalogue first saw on October 7, 2026.

Compare with similar skills

ML Kit Genai Prompt API next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

ML Kit Genai Prompt API compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
ML Kit Genai Prompt API this skillrosuH/EasyWatermark1.9k1 repos~1kAutomated safety check: PassMIT
SGLang Structured ServingOrchestra-Research/AI-Research-SKILLs13k2 repos~2.9kAutomated safety check: PassMIT
Context Engineering Reviewmohitagw15856/pm-claude-skills1.4k—~1.4kAutomated safety check: PassMIT
SDK CoreVectorSpaceLab/AREX-Skill330—~1.1kAutomated safety check: PassCustom licence
Planning With Filesjarrodwatts/claude-code-config1.1k5 repos~967Automated safety check: PassNone
Tool Use Data Synthesissunny-glow/Auto-BenchMax1.3k—~3.3kAutomated safety check: PassNone

Similar skills

  • SGLang Structured Serving

    Orchestra-Research/AI-Research-SKILLs

    Covers serving LLMs with SGLang, whose RadixAttention reuses cached prefixes, and constraining output to JSON, regex or grammar for agent and tool-calling workloads.

    13k GitHub starsUsed in 2 repos~2.9k tokens
    AI & LLM EngineeringAuto-check passed
  • Context Engineering Review

    mohitagw15856/pm-claude-skills

    Review what an LLM feature or agent actually puts in its context window — and find what's bloating, missing, or fighting itself.

    1.4k GitHub stars~1.4k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • SDK Core

    VectorSpaceLab/AREX-Skill

    A skill your agent uses for direct LiteLLM Python SDK work: chat/text completions, async calls, streaming, embeddings, structured outputs, tools, token/cost checks, caching, callbacks, import/smoke…

    330 GitHub stars~1.1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Planning With Files

    jarrodwatts/claude-code-config

    Transforms workflow to use Manus-style persistent markdown files for planning, progress tracking, and knowledge storage.

    1.1k GitHub starsUsed in 5 repos~967 tokens
    AI & LLM EngineeringAuto-check passed
  • Tool Use Data Synthesis

    sunny-glow/Auto-BenchMax

    Synthesize training data for ANY tool-use / agentic benchmark, in ANY repo.

    1.3k GitHub stars~3.3k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Agent Harness Construction

    KartikLabhshetwar/mind-mentor

    Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.

    148 GitHub starsUsed in 6 repos~500 tokens
    AI & LLM EngineeringAuto-check passed

More from rosuH/EasyWatermark

All 28 skills in this repo
  • Deferring State Reads

    rosuH/EasyWatermark

    A skill your agent uses to push frequently-changing Jetpack Compose state reads (scroll position, animation values, drag offsets) out of the Composition phase and down into Layout or Draw using…

    1.9k GitHub starsUsed in 1 repo~3.8k tokens
    Auto-check passed
  • Diagnosing Compose Stability

    rosuH/EasyWatermark

    A skill your agent uses to diagnose Jetpack Compose stability problems by enabling and reading the Compose Compiler Reports (classes.txt, composables.txt, composables.csv, module.json).

    1.9k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Generating Baseline Profiles

    rosuH/EasyWatermark

    A skill your agent uses to generate and measure Jetpack Compose Baseline Profiles end-to-end with the AGP 8.2+ Baseline Profile Generator module and the Macrobenchmark harness.

    1.9k GitHub starsUsed in 1 repo~5k tokens
    Auto-check passed
  • Migrating To Modifier Node

    rosuH/EasyWatermark

    A skill your agent uses to author new custom Jetpack Compose modifiers and migrate legacy ones from Modifier.composed { } to Modifier.Node + ModifierNodeElement<T.

    1.9k GitHub starsUsed in 1 repo~5k tokens
    Auto-check passed
  • Stabilizing Compose Types

    rosuH/EasyWatermark

    A skill your agent uses to fix unstable Jetpack Compose types once a stability diagnosis has identified them.

    1.9k GitHub starsUsed in 1 repo~4.4k tokens
    Auto-check passed
  • A skill your agent uses to explain why the Compose compiler classified a class or composable parameter as stable, runtime, unknown, or unstable.

    1.9k GitHub starsUsed in 1 repo~4.3k tokens
    Auto-check passed

Works with

Questions about ML Kit Genai Prompt API

What does ML Kit Genai Prompt API do?

Analyzes Android codebases to implement ML Kit GenAI Prompt API. ML Kit Genai Prompt API is an agent skill from rosuH/EasyWatermark. Analyzes Android codebases to implement ML Kit GenAI Prompt API.

When should I use ML Kit Genai Prompt API?

ML Kit Genai Prompt API fits situations like: send natural language requests on-device to Gemini Nano; use structured output with Prompt API; implement prefix caching; optimize the current prompt.

How do I install ML Kit Genai Prompt API in Claude Code?

Run `npx skills add rosuH/EasyWatermark --skill ml-kit-genai-prompt-api -a claude-code`. Or copy the skill folder (skills/ml-kit-genai-prompt-api in rosuH/EasyWatermark) into .claude/skills/ml-kit-genai-prompt-api in your project. Claude Code loads it when a task matches its description.

How do I install ML Kit Genai Prompt API in Codex?

Run `npx skills add rosuH/EasyWatermark --skill ml-kit-genai-prompt-api -a codex`. Or copy the skill folder (skills/ml-kit-genai-prompt-api in rosuH/EasyWatermark) into .agents/skills/ml-kit-genai-prompt-api in your project. Codex loads it when a task matches its description.

Can I use ML Kit Genai Prompt API in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rosuH/EasyWatermark --skill ml-kit-genai-prompt-api -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ml-kit-genai-prompt-api, .gemini/skills/ml-kit-genai-prompt-api, .github/skills/ml-kit-genai-prompt-api and .opencode/skills/ml-kit-genai-prompt-api in your project.

What does ML Kit Genai Prompt API need to run?

SKILL.md names no scripts, command-line tools or credentials: ML Kit Genai Prompt API is instructions for the agent only.

Does ML Kit Genai Prompt API access the network?

SKILL.md names 1 domain. As links in the text: developer.android.com. This is read from the text; nothing was executed.

Is ML Kit Genai Prompt API safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does ML Kit Genai Prompt API use?

ML Kit Genai Prompt API is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does ML Kit Genai Prompt API use?

About 1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.7k tokens, read only when the agent opens those files.

What are the alternatives to ML Kit Genai Prompt API?

Skills that share tags, products or a category with ML Kit Genai Prompt API: SGLang Structured Serving (Orchestra-Research/AI-Research-SKILLs, 13k stars), Context Engineering Review (mohitagw15856/pm-claude-skills, 1.4k stars), SDK Core (VectorSpaceLab/AREX-Skill, 330 stars) and Planning With Files (jarrodwatts/claude-code-config, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains ML Kit Genai Prompt API?

rosuH (a GitHub user) maintains it in rosuH/EasyWatermark, which has 1,895 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on October 6, 2026.

Source: rosuH/EasyWatermark on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.