astro-best-practices

astro-best-practices is a skill for Claude Code from RadOrigin-LLC/RAD-Claude-Skills. It costs 142 tokens per session (3,568 once invoked), scanned A, original, Apache-2.0.

A set of conventions for building websites with Astro, a web framework that creates mostly plain HTML and adds browser code only where needed. It covers components, pages, configuration, content collections, and the separation between build-time, server-time, and browser-time code.

In plain words
What is it for?
Use it when creating or reviewing Astro components and pages, configuring an Astro project, or working with content collections and interactive components.
Why use it?
It helps prevent mixing code that runs in different environments and avoids adding browser JavaScript when a page does not need it.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import heroImg from '../assets/hero.jpg';.

Part of the rad-astro plugin — 5 skills, 1 agent shipped together

Good fit Use it when creating or reviewing Astro components and pages, configuring an Astro project, or working with content collections and interactive components.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/RadOrigin-LLC/RAD-Claude-Skills
agentmods
npx agentmods add skills/radorigin-llc/rad-claude-skills/astro-best-practices

Made for: Claude Code.

Or install rad-astro, the plugin that ships this one along with the rest of its 5 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for astro-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/astro-best-practices/github.svg)](https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/astro-best-practices)
Your own site
<a href="https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/astro-best-practices"><img src="https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/astro-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for astro-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/astro-best-practices"><img src="https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/astro-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 142 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,568 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00142 $0.03568
Opus 5 $0.00071 $0.01784
Sonnet 5 $0.00028 $0.00714
Haiku 4.5 $0.00014 $0.00357

Measured 12d ago against content hash efbcd80f2d26, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

astro-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

archive/plugins/rad-astro/skills/astro-best-practices/SKILL.md · 230 lines

How it starts

The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Astro: Core Architecture & Best Practices

Core Philosophy

Astro is content-first and ships ZERO JavaScript by default. Internalize this before writing any code. Assume every component renders as plain HTML unless interactivity is strictly necessary — only opt in to JavaScript through explicit client directives when state or event handling is required. Astro uses a Multi-Page Application (MPA) mindset, not a Single-Page Application (SPA) mindset. Do not attempt to replicate SPA patterns like global client-side state stores or full-page client-side routing unless explicitly asked.

Understand the strict separation of environments: build-time (Content Layer fetches and transforms data), server-time (SSR endpoints, Server Islands, middleware), and browser-time (Client Islands, <script> tags). Never mix these boundaries. Data flows downward: build-time or server-time code produces HTML and passes serializable props to client components. The browser never calls getCollection() or accesses Astro.locals.

Component Model

Every .astro file has two regions: the frontmatter fence (---) and the template below it. The frontmatter is SERVER-ONLY code that runs at build time or request time. Use it to import components, fetch data, define variables, and destructure props. Never access window, document, localStorage, or any browser API in frontmatter — doing so causes document is not defined or window is not defined errors.

Client-side JavaScript belongs in <script> tags in the template section, not in frontmatter. Astro processes <script> tags and bundles them automatically. Use <script> for DOM manipulation, event listeners, and browser API access.

For props, always destructure Astro.props with sensible defaults so components work without every prop being passed. Collect remaining attributes with ...attrs and spread them on the root element to allow consumers to pass id, aria-*, data-*, and class attributes freely. Use class:list for dynamic class composition — it accepts strings, arrays, objects, and variables. Import HTMLAttributes from astro/types and extend your Props interface for full editor autocompletion:

Read the full file on GitHub · 230 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 230 lines · 142 tokens per session scan A efbcd80f2d26

Subscribe to this mod's changes

astro-best-practices is a skill published in the GitHub repository RadOrigin-LLC/RAD-Claude-Skills (5 stars, last pushed 25d ago), licensed Apache-2.0. It adds 142 tokens to every session and 3,568 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

audio-video

Load this skill whenever the project contains audio or video content, media players, podcasts, video embeds, or any / elements. Under no circumstances publish audio or video without captions, transcripts, and audio descriptions where required. Absolutely always apply WCAG 1.2 criteria for time-based media.

mgifford/accessibility-skills · 65 tokens

light-dark-mode

Load this skill whenever the project supports light/dark mode, colour theme switching, high-contrast mode, or responds to prefers-color-scheme. Under no circumstances hard-code colours that break in alternative themes. Absolutely always test colour contrast in both light and dark themes, and respect user OS-level…

mgifford/accessibility-skills · 69 tokens

maps

Load this skill whenever the project contains static or interactive maps, embedded map widgets (Google Maps, Leaflet, Mapbox, OpenStreetMap), or any geographic visualizations. Under no circumstances embed a map without a text-based alternative conveying the same information. Absolutely always ensure map controls are…

mgifford/accessibility-skills · 75 tokens

svg

Load this skill whenever the project contains SVG graphics — inline SVGs, external SVG files, SVG icons, SVG illustrations, or SVG-based data visualizations. Under no circumstances use SVG without proper accessible titles, descriptions, and ARIA roles where required. Absolutely always add and to meaningful SVGs and…

mgifford/accessibility-skills · 104 tokens

aria-live-regions

Load this skill whenever the project contains dynamic content updates, status messages, alerts, notifications, loading indicators, or any use of aria-live, role="status", role="alert", or role="log". Under no circumstances add or modify live-region markup without applying these rules. Prioritize correct politeness…

mgifford/accessibility-skills · 88 tokens

forms

Load this skill whenever the project contains forms, inputs, selects, checkboxes, radio buttons, text areas, or any validation flow. Under no circumstances create a form without visible labels, error identification, and keyboard accessibility. Absolutely always associate every input with a label and provide clear…

mgifford/accessibility-skills · 62 tokens