Skip to content

Guide · Agent skill

How to use the Glance Canonical Layouts agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The Glance Canonical Layouts skill is an agent skill that teaches an AI coding agent to build Android home screen widgets with Jetpack Glance, following the standard layout patterns from Google's Android Platform Samples. This guide explains what the skill does, how to install it, how to ask for a layout in plain language, and what your project needs before it works. You do not need prior experience with agent skills to follow it.

Glance Canonical Layoutsandroid/skills · Apache-2.0

Quick start

  1. 1Download the ZIP. Download the glance-canonical-layouts ZIP file from this page.
  2. 2Install the skill. Unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ in your project, or upload the ZIP under Settings → Capabilities → Skills in the Claude apps.
  3. 3Check the project setup. Confirm your app uses Jetpack Glance and has the required Glance libraries, plus the newer Gradle and compileSdk settings if you want Snap Scrolling.
  4. 4Ask for a layout. Describe the widget you want in plain language, naming a layout such as Check List or Image Grid.
  5. 5Review the copied code. Check that package names, imports and class names now match your app and that unused parts were removed.
  6. 6Register the widget. Confirm the receiver is in AndroidManifest.xml inside application, after activity, with android:resource pointing to your Widget Info XML.
  7. 7Compile and test. Build the project in Android Studio or Gradle, then open the widget picker to confirm the widget appears.

What the skill makes the agent do

Jetpack Glance is Google's toolkit for building app widgets for the Android home screen. This skill tells the agent how to add one of Google's recommended widget layouts to an existing Android app. The skill lists layouts such as Check List, Image Grid, Action List, Snap Scrolling and Standard Toolbar, and the agent picks the one you ask for.

The agent then copies sample code and drawable icons from the Android Platform Samples project into your app, adapts package names and imports to match your app, removes parts you do not need, and registers the widget in your app manifest so it appears in the widget picker.

  • Picks a layout pattern such as Check List, Image Grid, Action List or Snap Scrolling
  • Copies sample widget code, data repositories, theme files and icon resources into your project
  • Updates package declarations, import paths and class names to your app
  • Removes unused classes, such as buttons you do not need
  • Registers the widget receiver in AndroidManifest.xml so it shows up in the widget picker

Install the Glance Canonical Layouts skill

Download the ZIP file from this page. You have two ways to install it.

For Claude Code, unzip the file into your user skills folder at ~/.claude/skills/, or into a project-specific folder at .claude/skills/ inside your project. The skill's folder should contain SKILL.md at its top level.

In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.

  • Personal install: ~/.claude/skills/ (available across your projects)
  • Project install: .claude/skills/ inside one Android project (available only there)
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Check your project before you ask

The skill only works with a project that uses Jetpack Glance. Before you start, confirm that your app module depends on the Glance libraries: glance-appwidget, glance-material3, glance-appwidget-preview and glance-preview. Each must be at the minimum version the skill lists, or higher.

Snap Scrolling needs more than the base Glance libraries. The skill lists a newer Glance alpha, a newer Android Gradle Plugin and a higher compileSdk for that layout, so check those settings before you request it.

If the sample data repositories load images, the skill notes that you may also need an image loading library such as Coil. The agent can add it if your project does not already have one.

  • Android project that already uses Jetpack Glance
  • Glance libraries: glance-appwidget, glance-material3, glance-appwidget-preview, glance-preview
  • Extra requirements for Snap Scrolling: newer Glance alpha, Android Gradle Plugin and compileSdk, as listed in the skill
  • Optional: Coil or another image loading library for image-based samples
  • Android Studio or a Gradle build to compile and check the result

Ask for a layout in plain language

Start a session in your Android project and name the layout you want, along with the fact that you want a home screen widget. The skill's description matches requests about home screen widgets and the standard widget layout patterns, so a request like the examples below is enough.

The agent should follow the skill's steps: it uses a Glance widget, sets the widget size mode, copies the reference files, updates the package names, cleans up unused code and registers the receiver. Read its summary and check the result by compiling the project.

  • "Add a Check List home screen widget to my app using Jetpack Glance."
  • "Create an Image Grid widget for my Android app."
  • "Implement a Snap Scrolling widget following Google's canonical layouts."

Register the widget so it appears in the picker

The widget only appears in the widget picker if its receiver is declared in AndroidManifest.xml. The skill adds this inside the application element, after the activity element. The android:resource value must match the name of the copied Widget Info XML file.

This is the pattern the skill follows. Replace the names with your own widget class and XML file names if the agent has not already done so.

  • Place the receiver inside <application>, after <activity>
  • Make sure android:resource points to the exact filename of the copied Widget Info XML
<receiver android:name=".glance.MyReceiver" android:exported="true"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/my_app_widget_info" /> </receiver>

Safety, scope and what the skill does not do

The skill's files are mostly sample icon and drawable XML resources plus written instructions. According to the skill, it does not run any scripts and does not use the network. It works by editing your source code, so review the changes it makes, especially to the manifest and package names, before you commit them.

The skill is designed for Jetpack Glance only. Its instructions and layouts will not fit widgets built with other frameworks, such as RemoteViews-based widgets.

  • Runs scripts: no
  • Uses network: no
  • Edits app source code and manifest, so use version control and review the diff
  • Not suitable for RemoteViews-based widgets

Tips for better results

Name one layout per request. Asking for a single pattern, such as Check List, gives the agent a clear set of reference files to copy. After the agent finishes, compile the project and fix any remaining package or import errors. Then open the widget picker on a device or emulator to confirm the widget appears.

Use the preview files and sample data to check the design before you connect real data. Replace the fake data repository with your app's own data source once the layout looks right.

  • Request one layout at a time
  • Compile the project before testing on a device
  • Replace the sample data repository with real app data once the layout works
  • Keep the sample icons only if they fit your design

What people use it for

  • Adding a Check List widget to a to-do or task app so users can tick items from the home screen
  • Building an Image Grid widget that shows a set of photos or media items
  • Creating an Action List widget with tappable rows that trigger actions in the app
  • Setting up a Snap Scrolling widget for a scrollable home screen list
  • Starting a widget from Google's sample code instead of writing the boilerplate by hand

Frequently asked questions

What is the Glance Canonical Layouts skill?

It is an agent skill that instructs an AI coding agent to build Android home screen widgets with Jetpack Glance using standard layout patterns from Google's Android Platform Samples. The agent copies sample code and icons into your project, adapts them, and registers the widget in your manifest.

How do I install the Glance Canonical Layouts skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project. In the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.

Do I need Jetpack Glance to use this skill?

Yes. The skill's instructions require Jetpack Glance, and its layouts will not fit other widget frameworks such as RemoteViews-based widgets. Your project must also be an Android project that compiles.

Is the Glance Canonical Layouts skill free?

The skill is listed under the Apache-2.0 licence. Check the LICENSE.txt included with the skill for the complete terms before you reuse its files in your own product.

Does the skill run scripts or access the internet?

According to the skill's listing, it does not run scripts and does not use the network. It does edit your project's source code and manifest, so review its changes before committing them.

Why doesn't my widget appear in the widget picker?

The most common cause is a missing or incorrect receiver entry in AndroidManifest.xml. The receiver must be inside application after activity, and its android:resource value must exactly match the filename of the copied Widget Info XML.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits Android developers who already use Jetpack Glance and want a widget that follows Google's recommended layout patterns, with the manifest and boilerplate handled for them. It is not useful for people who only want a widget on their phone, for projects without Jetpack Glance, or for teams that need a different widget framework.

Download the skill