Skip to content

Guide · Agent skill

How to use the Astropy Astronomy Toolkit agent skill

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

The Astropy skill is an agent skill for the astronomy library Astropy. Once installed, your AI agent follows Astropy's conventions and common pitfalls when you ask for help with astronomical data, and it consults bundled reference notes instead of relying on memory. This guide explains what the skill does, how to install it, how to trigger it, and what to check before you trust the output.

Astropy Astronomy ToolkitK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Check requirements. Confirm Python 3.11 or newer, Astropy 8.0.1, NumPy 2 or newer, and SciPy if you need cosmology, matching or fitting. uv is recommended for installation.
  2. 2Download the ZIP. Download the skill ZIP from this page and unzip it.
  3. 3Place the skill folder. Copy the folder to ~/.claude/skills/ for personal use or to .claude/skills/ inside a project. Alternatively, upload the ZIP under Settings → Capabilities → Skills in the Claude apps.
  4. 4Ask a specific astronomy question. Describe the task, the data type and the expected result in plain language.
  5. 5Review the code. Read the generated script, replacing placeholder filenames with your own files before running it.
  6. 6Verify the output. Check units, coordinate frames, WCS round trips and HDU selection against your data before using results.

What an agent skill is and what this one makes the agent do

An agent skill is a folder of instructions and reference files that an AI agent loads when a task matches the skill's description. The astropy skill covers the core Astropy APIs: units and quantities, coordinates, FITS input and output, tables, time systems, WCS pixel-to-sky mapping, and cosmology.

When the skill is active, the agent writes code using these APIs and points to detailed reference notes for each area, such as coordinates, FITS, tables, time, units, cosmology and WCS.

  • Convert units, for example Jy to mJy or parsecs to km
  • Create SkyCoord objects and transform between frames such as ICRS, Galactic and AltAz
  • Read and write FITS files, headers and tables
  • Handle time scales (UTC, TAI, TT, TDB) and formats (JD, MJD, ISO)
  • Map pixel coordinates to world coordinates with WCS
  • Run cosmology calculations such as luminosity distance and lookback time

Install the Astropy skill

Download the skill ZIP from this page and unzip it. Then place the skill folder in one of these locations:

For a personal install available across projects, put it in ~/.claude/skills/. For a single project, put it in that project's .claude/skills/ folder.

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

  • Personal: ~/.claude/skills/
  • Project: .claude/skills/ inside your project folder
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Set up the requirements

The skill states these requirements. Code will fail if they are not met, so check them before you start.

uv is recommended for installation. Some features need network access, including object name resolution, site lookups, remote FITS reads and IERS updates.

  • Python 3.11 or newer
  • Astropy 8.0.1
  • NumPy 2 or newer
  • SciPy, needed for cosmology, matching and fitting
  • uv (recommended for installation)

Trigger the skill with natural requests

You do not need a special command. Describe the astronomy task in plain language. The skill's description mentions implementing or debugging astronomical data analysis code with Astropy, so ask for that kind of work directly.

Name the data type and the result you want. Mention FITS, catalogs, coordinates, times or redshifts when you can.

  • Convert these RA and Dec values from ICRS to Galactic coordinates using Astropy.
  • Read the table in catalog.fits with Astropy and filter rows where the flux is above 1 Jy.
  • My WCS code returns the wrong pixel for a star. Debug it using Astropy.
  • Calculate the luminosity distance at z = 1 using Planck18 in Astropy.

Example: a short Astropy script

The skill's quick start shows the kind of code it produces. It covers units, coordinates, time, FITS, tables and cosmology. Filenames such as image.fits and catalog.fits are placeholders, so replace them with your own files and select the correct image extension after inspecting the file.

import astropy.units as u from astropy.coordinates import SkyCoord from astropy.time import Time from astropy.io import fits from astropy.table import Table from astropy.cosmology import Planck18 distance = 100 * u.pc distance_km = distance.to(u.km) coord = SkyCoord(ra=10.5*u.degree, dec=41.2*u.degree, frame='icrs') coord_galactic = coord.galactic t = Time('2023-01-15 12:30:00', scale='utc') jd = t.jd data, header = fits.getdata('image.fits', ext=0, header=True) table = Table.read('catalog.fits') d_L = Planck18.luminosity_distance(1.0)

Safety notes: scripts and network access

The skill runs scripts and uses the network. Object name resolution, site lookups, remote FITS reads and IERS updates contact online services. Review any script the agent proposes before you run it, and check which data leaves your machine when a remote lookup is involved.

The skill's quick start notes that numerical and small synthetic examples were executed, while blocks using observation or catalog filenames, online services or a GUI are illustrative and need your own inputs.

  • Review generated scripts before running them
  • Be aware that remote FITS reads and online name lookups use the network
  • Use your own input files; the example filenames are placeholders

Tips for reliable results

Pixel coordinates in high-level WCS methods are zero-based (x, y), while NumPy images are indexed [row, column], which is [y, x]. Use world_to_array_index for array indexing and check bounds. FITS header CRPIX values keep the one-based FITS convention.

Before extracting sources, verify a pixel to world to pixel round trip. Cosmology imports should come directly from astropy.cosmology, because the old submodule paths were removed in Astropy 8.0.

  • Verify a pixel to world to pixel round trip before extracting sources
  • Import cosmology classes directly from astropy.cosmology
  • Inspect a FITS file with .info() before choosing an HDU
  • Check results independently before publishing

What people use it for

  • Converting a list of sky positions from ICRS to Galactic coordinates for a survey plot
  • Reading a FITS catalog into a table, filtering rows and cross-matching against another catalog
  • Debugging a WCS mapping that places sources at the wrong pixel
  • Computing luminosity distance, comoving distance or lookback time for a set of redshifts
  • Converting timestamps between UTC, TAI and TT for a timing analysis

Frequently asked questions

How do I install the Astropy agent skill?

Download the skill ZIP from this page and unzip it. Put the folder in ~/.claude/skills/ for personal use or in a project's .claude/skills/ folder. In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.

What Python and library versions do I need?

The skill requires Python 3.11 or newer, Astropy 8.0.1, and NumPy 2 or newer. SciPy is needed for cosmology, matching and fitting, and uv is recommended for installation.

Is the Astropy skill free and what is its licence?

The listing states the licence is MIT. The skill's SKILL.md metadata lists BSD-3-Clause for the license field, so check the licence file in the downloaded folder if the terms matter to you.

Does the skill need an internet connection?

Some features need network access, including object name resolution, site lookups, remote FITS reads and IERS updates. Basic local calculations and local FITS I/O do not need it.

Why does my WCS code return the wrong pixel?

High-level WCS pixel methods use zero-based (x, y) coordinates, while NumPy arrays index [row, column]. Use world_to_array_index for array indexing and verify a pixel to world to pixel round trip. FITS CRPIX values stay one-based.

Can I use this skill for non-astronomy data?

It is not suited to that. The skill is built around astronomy-specific APIs, so for general data work those add no value. Pick a general data tool instead.

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 this skill if you are an astronomy student, a researcher writing or debugging Astropy scripts, or a developer building astronomy pipelines and want fewer API mistakes. Skip it for non-astronomy data work, or if you cannot meet the Python 3.11 and NumPy 2 requirements. Any result you plan to publish still needs independent checking.

Download the skill