Skip to content

Guide · Agent skill

How to use the CameraX Android Camera Guide agent skill

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

The camerax skill is an agent skill that gives an AI coding agent Google's reference guidance for building Android camera apps with the CameraX Jetpack library. This guide explains what the skill changes about the agent's behaviour, how to install it, how to ask for help in plain language, and what to check before relying on its output. By the end you will know how to get the agent to write CameraX code that follows the skill's patterns and avoids common mistakes.

CameraX Android Camera Guideandroid/skills · Apache-2.0

Quick start

  1. 1Download the ZIP. Download the camerax skill ZIP from this page.
  2. 2Unzip into a skills folder. Unzip the folder into ~/.claude/skills/ for personal use, or into your project's .claude/skills/ folder.
  3. 3Or upload it in the apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the skill.
  4. 4Check the project setup. Make sure your Android project uses Kotlin and has the CameraX Jetpack libraries, since the examples depend on them.
  5. 5Describe the camera task. Ask for the feature in plain language, naming the API and the goal, such as video recording or a Camera1 migration.
  6. 6Review and test. Check the generated code for the reassignment rule, permissions and main-thread updates, then build and test on a device.

What the camerax skill makes the agent do

Once installed, the agent follows the skill's procedures when you ask for camera work in an Android project. The skill covers the correct way to chain CameraX VideoCapture builder calls, how to migrate code from the older Camera1 and Camera2 APIs, and common pitfalls such as checking recording state, handling permissions, and dispatching UI updates on the main thread.

The skill also points the agent to deeper reference notes on ML Kit analysis, low-light modes, foldables, thermals, testing with fakes, and Wear OS remote triggers. The agent reads these notes only when a task touches those topics.

  • Builder chaining rules for CameraX VideoCapture, where method calls return a new instance that must be reassigned.
  • Migration steps from android.hardware.Camera (Camera1) and android.hardware.camera2 (Camera2) to CameraX.
  • Pitfalls: check isRecording before stop or pause, handle VideoRecordEvent.Start for UI state, check CAMERA and RECORD_AUDIO permissions.
  • Preference for higher-level abstractions such as MlKitAnalyzer, Media3Effect and ConcurrentCamera APIs.

Install the camerax skill

Download the skill ZIP from this page and unzip it. Place the unzipped camerax folder in one of two locations. Use ~/.claude/skills/ to make the skill available across your projects, or use a project's .claude/skills/ folder to limit it to that project.

If you use the Claude apps instead, you can upload the skill under Settings → Capabilities → Skills.

  • Personal install: unzip into ~/.claude/skills/.
  • Project install: unzip into the .claude/skills/ folder of your Android project.
  • Claude apps: upload the skill under Settings → Capabilities → Skills.

Ask for camera work in plain language

The skill is triggered by the kind of task you describe. Its description covers implementing camera features, handling asynchronous recording lifecycles, wiring low-level hardware interop using CameraX, and integrating ML Kit or Media3 effects. You do not need to name the skill; describe the task in your own words and mention Android and CameraX so the agent knows the context.

For multi-step features, the skill asks the agent to work in phases, such as ViewModel state first, then controller wiring, then Camera2Interop wiring. This reduces the chance of a timed-out, half-finished change.

  • Good: 'In my Android app, add video recording with CameraX and audio, and stop it safely when the user taps a button.'
  • Good: 'Migrate this Camera1 preview screen to CameraX. Keep the existing layout.'
  • Good: 'Add ML Kit barcode analysis to my CameraX ImageAnalysis pipeline.'
  • Vague: 'Make the camera better.' Name the feature, the API and the goal.

Watch the builder reassignment rule

Several CameraX and media APIs, especially VideoCapture, return a new instance from each builder-style method. If the result is not reassigned, the setting is silently ignored. For example, audio can be left off even though the code looks correct.

The skill's rule is to chain the calls or reassign the result. Check generated code for this pattern, because it is easy to miss in review.

  • Chaining works: each call's return value is passed on to the next call.
  • Reassignment also works: store the returned instance back into the variable.
  • Calling a method and discarding its return value does nothing.
val pending = recorder.prepareRecording(context, opts) .withAudioEnabled() val active = pending.start(exec, listener)

Migrate legacy Camera1 or Camera2 code

For Camera1 code, the skill's migration guide covers deleting android.hardware.Camera instances, removing SurfaceView callbacks, removing custom code that opens or releases the camera in onResume or onPause, and removing manual orientation matrix calculations. CameraX then binds use cases to the Activity or Fragment lifecycle through ProcessCameraProvider.

For Camera2 code, the migration guide covers removing manual HandlerThread and executor handling, deleting CameraDevice and CameraCaptureSession state callbacks, removing manual Surface routing, and removing manual orientation logic. Ask the agent to migrate one screen at a time so you can test each step.

  • Camera1: ask for the preview, capture and lifecycle changes to be listed before any deletion.
  • Camera2: ask the agent to keep any Camera2Interop calls you still need and explain them.

Check the output before you ship it

The skill tells the agent to write tests with fakes rather than mocks, to use Google Truth assertions such as assertThat, to declare an explicit @RunWith on test classes, and to use semantics { mergeDescendants = true } for custom Compose camera controls so screen readers announce them as one unit.

Treat the output as a starting point. Build the project, run the app on a real device, and test recording, permissions and orientation yourself. The skill does not replace device testing.

  • Confirm that VideoCapture settings are reassigned or chained.
  • Confirm that the app asks for CAMERA, and RECORD_AUDIO when audio is enabled.
  • Confirm that UI updates run on the main thread.
  • Run the tests the agent wrote and read any test that relies on mocks.

What people use it for

  • Adding video recording with audio to an Android app, with the agent checking recording state before stop or pause.
  • Migrating a legacy Camera1 preview screen to CameraX and binding it to the Activity or Fragment lifecycle.
  • Moving a Camera2 app that manages its own threads and session callbacks to CameraX use cases.
  • Adding ML Kit analysis to a CameraX ImageAnalysis pipeline using the skill's preferred higher-level APIs.
  • Writing fake-based tests for a CameraX analysis pipeline without mocking libraries.

Frequently asked questions

Is the camerax skill free to use?

The listing states the licence is Apache-2.0. The skill's SKILL.md says the complete terms are in LICENSE.txt, so read that file for the full terms. This page does not list any price.

What do I need before I install the camerax skill?

You need an Android development environment and Kotlin knowledge. The examples only help if the target project includes the CameraX Jetpack libraries. The skill runs no scripts and uses no network access, according to its listing.

Where do I install the camerax skill?

Unzip the skill into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps, you can upload it under Settings → Capabilities → Skills.

Does the camerax skill work for non-developers who just want to take photos?

No. The listing describes it as a coding guide, not a camera app. It helps a developer write or change Android code that uses CameraX.

Can the camerax skill migrate code from Camera1 and Camera2?

Yes. It includes migration guides for Camera1 (android.hardware.Camera) and Camera2 (android.hardware.camera2) code, covering lifecycle, surface, callback and orientation changes.

What are the alternatives to the camerax skill, and how does it compare?

The source does not compare this skill with other tools or libraries. It only covers CameraX and migrations from Camera1 and Camera2, and it is not useful for projects that do not use Android or Kotlin.

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

Use the camerax skill if you are an Android developer adding capture, video, analysis or ML Kit features with CameraX, or migrating a Camera1 or Camera2 app. Pick something else if you only want to take photos, if your project does not use Android or Kotlin, or if you need guidance that goes beyond CameraX.

Download the skill