Agent skill

PDF Annotations

by rcosteira79 in rcosteira79/android-skills

A skill your agent uses when reading, adding, updating, or removing PDF annotations (highlight, free-text, stamp) or page objects (path/text/image) with Android's platform PDF APIs, or when saving…

MITAuto-check passedDocuments & Office

Install PDF Annotations

skills CLI
$ npx skills add rcosteira79/android-skills --skill pdf-annotations -a claude-code

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

GitHub CLI
$ gh skill install rcosteira79/android-skills pdf-annotations --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/rcosteira79/android-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/android-skills/skills/pdf-annotations .claude/skills/pdf-annotations && 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
pdf-annotations
GitHub stars
151
Token cost
~1.6k tokens
SKILL.md length
500 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when reading, adding, updating, or removing PDF annotations (highlight, free-text, stamp) or page objects (path/text/image) with Android's platform PDF APIs, or when saving…

  • Removing PDF annotations (highlight
  • SKILL.md covers The version gate (decide the…, The workflow: open → edit →…, Rendering what you edited and Component vocabulary…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Page objects (path/text/image) with Androids platform PDF APIs

What it does

PDF Annotations is an agent skill from rcosteira79/android-skills. Use when reading, adding, updating, or removing PDF annotations (highlight, free-text, stamp) or page objects (path/text/image) with Android's platform PDF APIs, or when saving those edits back to disk — the editing surface added in API 36.1 (PdfRenderer.Page) and SDK extension 18 (PdfRendererPreV.Page on API 31+), android.graphics.pdf.component. Covers the version gate, the open-edit-write workflow, and the id/render-flag/save contracts. Not for display-only PdfViewerFragment work, PdfDocument…

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering PDF and Forms and invoices. It works with Android. The repository describes itself as: Claude Code skills for Android & KMP development. The licence is MIT.

When your agent uses it

  • Removing PDF annotations (highlight
  • Page objects (path/text/image) with Androids platform PDF APIs
  • Android.graphics.pdf.component

Example prompts

  • “/pdf-annotations”

What it can do on your machine

Read from SKILL.md and the folder at commit 0f9af5a. 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

    No URLs in SKILL.md.

    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

PDF Annotations loads about 1.6k tokens when it runs. Until then it costs about 151 tokens; SKILL.md has 500 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~151
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

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 rcosteira79/android-skills at commit 0f9af5a, republished under its MIT licence (© rcosteira79). 500 words, ~1,648 tokens.

Download SKILL.mdSave it as .claude/skills/pdf-annotations/SKILL.md (or your agent's skills folder).
name
pdf-annotations
description
Use when reading, adding, updating, or removing PDF annotations (highlight, free-text, stamp) or page objects (path/text/image) with Android's platform PDF APIs, or when saving those edits back to disk — the editing surface added in API 36.1 (PdfRenderer.Page) and SDK extension 18 (PdfRendererPreV.Page on API 31+), android.graphics.pdf.component. Covers the version gate, the open-edit-write workflow, and the id/render-flag/save contracts. Not for display-only PdfViewerFragment work, PdfDocument creation-from-scratch, form filling, or third-party PDF SDKs (iText, PDFBox, PSPDFKit).

Platform PDF annotation & page-object editing

Android can natively edit PDF annotations since API 36.1 — before that the platform story was render-only and the docs still say so: the Jetpack viewer guide's PDF surface is PdfViewerFragment, which explicitly does not support edit mode and hands annotation off to other apps via an android.intent.action.ANNOTATE intent [kb://android/develop/ui/views/layout/pdf/implement-pdf-viewer]. Do not conclude "use a third-party library" for annotation work before applying the version gate below.

The version gate (decide the entry point first)

Two parallel renderers expose the same editing surface (android.graphics.pdf.component):

Entry pointEditing availableDevice requirement
PdfRenderer.PageAPI 36.1+platform release
PdfRendererPreV.PageSDK extension 18API 31+ with the PDF module updated (PreV itself needs extension 13)

Gate at runtime with SdkExtensions.getExtensionVersion(Build.VERSION_CODES.S) [kb://android/guide/sdk-extensions/index]. Extension 18 reaches back to API 31 via mainline updates, so PdfRendererPreV is the branch that covers most devices.

The workflow: open → edit → write

kotlin
// The fd must be seekable — pipes/sockets are rejected at construction.
ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY).use { fd ->
    PdfRenderer(fd).use { renderer ->                    // or PdfRendererPreV on the ext-18 branch
        renderer.openPage(0).use { page ->
            // Only SUPPORTED annotation types are listed. The pairs are
            // android.util.Pair — NO Kotlin destructuring (no component1/2);
            // read them with .first / .second.
            val existing = page.getPageAnnotations()
            val staleId: Int? = existing.firstOrNull { it.second is FreeTextAnnotation }?.first

            val highlight = HighlightAnnotation(boundsList)   // List<RectF> quads
            val id = page.addPageAnnotation(highlight)
            check(id != -1) { "annotation rejected" }         // add returns -1, it does NOT throw

            highlight.color = newColor
            page.updatePageAnnotation(id, highlight)          // by id -> Boolean success
            staleId?.let { page.removePageAnnotation(it) }    // by id, not list position
        }
        // Write BEFORE close(), to a separate writable fd; the boolean is
        // removePasswordProtection (IOException if true and the doc stays encrypted).
        ParcelFileDescriptor.open(
            dest,
            ParcelFileDescriptor.MODE_READ_WRITE or ParcelFileDescriptor.MODE_CREATE,
        ).use { out ->
            renderer.write(out, false)
        }
    }
}

Contracts:

  • addPageAnnotation returns the annotation id, or -1 when the annotation cannot be added — check the return; only null/UNKNOWN-type/already-attached arguments throw (IllegalArgumentException).
  • An annotation instance is single-attach document-wide: adding one that is "already added in this page or some other page" throws. Construct a fresh component object per add; don't reuse a removed one across pages.
  • Ids, not list positions, drive update/remove. getPageAnnotations() returns only annotation types the API models, so a page with unsupported annotations has gaps — the Pair.first id is the stable handle.
  • One page open at a time — the pre-existing PdfRenderer invariant ("you can have only a single page opened at any given time") still applies; close the page before opening the next.
  • write() before close(), destination must be a distinct writable seekable fd; IllegalStateException after close.
  • The pairs are android.util.Pair, not kotlin.Pair — Kotlin destructuring (for ((id, a) in …)) does not compile against them; use .first/.second.
Show full SKILL.md (207 more words)Show less

Rendering what you edited

Annotation types render only when RenderParams.renderFlags includes them: FLAG_RENDER_TEXT_ANNOTATIONS / FLAG_RENDER_HIGHLIGHT_ANNOTATIONS (and the 36.1 additions FLAG_RENDER_FREETEXT_ANNOTATIONS / FLAG_RENDER_STAMP_ANNOTATIONS). An added stamp or free-text that "doesn't show up" in your preview bitmap is usually a missing render flag, not a failed add — re-render with the matching flags set via RenderParams.Builder.setRenderFlags(...) and the render(bitmap, clip, transform, params) overload. The render-mode constants live on RenderParams (and legacy PdfRenderer.Page) — PdfRendererPreV.Page has none, so on the PreV branch write RenderParams.Builder(RenderParams.RENDER_MODE_FOR_DISPLAY); qualifying it via PdfRendererPreV.Page does not compile.

Component vocabulary (android.graphics.pdf.component)

  • HighlightAnnotation(List<RectF>) — quad list, one rect per highlighted run.
  • FreeTextAnnotation(RectF, String) — bounds + text; text/background colors settable.
  • StampAnnotation(RectF) — a container: only PdfPagePathObject, PdfPageTextObject, or PdfPageImageObject children (addObject), per the class contract.
  • Page objects also attach directly to the page (addPageObject / getPageObjects / updatePageObject / removePageObject — same id-based contract as annotations), and carry a transform matrix (PdfPageObject.setMatrix/transform). PdfPagePathObject stroke defaults to opaque black in sRGB.
  • Page.getTopPageObjectAtPosition(PointF, …) hit-tests the topmost object — use it for tap-to-select before update/remove.

Out of scope (route elsewhere)

Creating PDFs from scratch (PdfDocument canvas API), form filling (applyEdit, API 35), text extraction/search, and embedding a viewer UI (PdfViewerFragment — display-only [kb://android/develop/ui/views/layout/pdf/implement-pdf-viewer]) are separate surfaces; third-party SDKs remain the answer only below the version gate or for annotation types the component API doesn't model.

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

Files

Just SKILL.md in plugins/android-skills/skills/pdf-annotations of rcosteira79/android-skills.

Open the folder on GitHubat commit 0f9af5a

Compare with similar skills

PDF Annotations 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.

PDF Annotations compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PDF Annotations this skillrcosteira79/android-skills151—~1.6kAutomated safety check: PassMIT
Code2mediatsingliuwin/autoclaw283—~956Automated safety check: PassMIT
Reportlabjimmc414/Kosmos5941 repos~4.2kAutomated safety check: PassNone
PDF ReadingWide-Moat/open-computer-use1261 repos~2.7kAutomated safety check: PassProprietary
PDF Processing Toolkittelagod/code-abyss243—~532Automated safety check: NotesMIT
Document Converter Suitedkyazzentwatwa/chatgpt-skills114—~386Automated safety check: PassNone

Similar skills

  • Code2media

    tsingliuwin/autoclaw

    Universal media renderer with no fixed template — any custom layout, size or style becomes pixel-perfect images (PNG/JPEG/WebP), vector SVG, paged PDFs or animations (WebP/GIF).

    283 GitHub stars~956 tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Reportlab

    jimmc414/Kosmos

    PDF generation toolkit. An agent skill from jimmc414/Kosmos.

    594 GitHub starsUsed in 1 repo~4.2k tokens
    Documents & OfficeAuto-check passed
  • PDF Reading

    Wide-Moat/open-computer-use

    A skill your agent uses when you need to read, inspect, or extract content from PDF files — especially when file content is NOT in your context and you need to read it from disk.

    126 GitHub starsUsed in 1 repo~2.7k tokens
    Documents & OfficeAuto-check passed
  • PDF Processing Toolkit

    telagod/code-abyss

    Picks the right Python library or CLI tool for a PDF task, text and table extraction, merging, splitting, OCR, watermarking or form filling, and points to a matching recipe.

    243 GitHub stars~532 tokensUpdated 2 mo ago
    Documents & OfficeAuto-check: notes
  • Document Converter Suite

    dkyazzentwatwa/chatgpt-skills

    Convert PDFs, Office docs, markdown, HTML, and tables between editable formats.

    114 GitHub stars~386 tokensUpdated 6 mo ago
    Documents & OfficeAuto-check passed
  • Create PDF

    theexperiencecompany/gaia

    Generate a polished, printable PDF: reports, letters, invoices, resumes, one-pagers.

    308 GitHub stars~1.3k tokensUpdated today
    Documents & OfficeAuto-check passed

More from rcosteira79/android-skills

All 21 skills in this repo
  • Guides writing correct, performant Compose and Compose Multiplatform UI across Android, desktop, iOS and web, from state and animation to design-to-code and crash fixes.

    151 GitHub stars~2.6k tokensUpdated 18 days ago
    Auto-check passed
  • Kotlin Multiplatform Boundaries

    rcosteira79/android-skills

    Helps choose how common Kotlin Multiplatform code reaches platform APIs: expect/actual, a common interface with platform bindings, or separate platform screens.

    151 GitHub stars~1.5k tokensUpdated 18 days ago
    Auto-check passed
  • Android Data Layer and Room in KMP

    rcosteira79/android-skills

    Sets out the repository pattern's error-propagation model for Android and Kotlin Multiplatform, plus the Room setup for commonMain.

    151 GitHub stars~1.2k tokensUpdated 18 days ago
    Auto-check passed
  • Android Debugging

    rcosteira79/android-skills

    Android and KMP debugging techniques for crashes, ANRs, memory leaks, R8 traces, Gradle failures and Compose recomposition, built on finding the root cause first.

    151 GitHub stars~2.6k tokensUpdated 18 days ago
    Auto-check passed
  • Android and KMP Baseline

    rcosteira79/android-skills

    Sets house defaults for Android and Kotlin Multiplatform work and routes to the right specialized skill for Compose, networking, testing or build tooling.

    151 GitHub stars~3k tokensUpdated 18 days ago
    Auto-check passed
  • Android Gradle Build Logic

    rcosteira79/android-skills

    Sets up Android Gradle convention plugins in a build-logic composite build, including the version catalog wiring and shared configuration that are easy to get wrong.

    151 GitHub stars~959 tokensUpdated 18 days ago
    Auto-check passed

Works with

Questions about PDF Annotations

What does PDF Annotations do?

A skill your agent uses when reading, adding, updating, or removing PDF annotations (highlight, free-text, stamp) or page objects (path/text/image) with Android's platform PDF APIs, or when saving…. PDF Annotations is an agent skill from rcosteira79/android-skills.component.

When should I use PDF Annotations?

PDF Annotations fits situations like: removing PDF annotations (highlight; page objects (path/text/image) with Androids platform PDF APIs; android.graphics.pdf.component.

How do I install PDF Annotations in Claude Code?

Run `npx skills add rcosteira79/android-skills --skill pdf-annotations -a claude-code`. Or copy the skill folder (plugins/android-skills/skills/pdf-annotations in rcosteira79/android-skills) into .claude/skills/pdf-annotations in your project. Claude Code loads it when a task matches its description.

How do I install PDF Annotations in Codex?

Run `npx skills add rcosteira79/android-skills --skill pdf-annotations -a codex`. Or copy the skill folder (plugins/android-skills/skills/pdf-annotations in rcosteira79/android-skills) into .agents/skills/pdf-annotations in your project. Codex loads it when a task matches its description.

Can I use PDF Annotations 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 rcosteira79/android-skills --skill pdf-annotations -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pdf-annotations, .gemini/skills/pdf-annotations, .github/skills/pdf-annotations and .opencode/skills/pdf-annotations in your project.

What does PDF Annotations need to run?

SKILL.md names no scripts, command-line tools or credentials: PDF Annotations is instructions for the agent only.

Does PDF Annotations access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is PDF Annotations 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 PDF Annotations use?

PDF Annotations 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 PDF Annotations use?

About 1.6k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to PDF Annotations?

Skills that share tags, products or a category with PDF Annotations: Code2media (tsingliuwin/autoclaw, 283 stars), Reportlab (jimmc414/Kosmos, 594 stars), PDF Reading (Wide-Moat/open-computer-use, 126 stars) and PDF Processing Toolkit (telagod/code-abyss, 243 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PDF Annotations?

rcosteira79 (a GitHub user) maintains it in rcosteira79/android-skills, which has 151 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 19, 2026.

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