Astro logo

Astro

Community
ericrisco
astro

Use when building a content-driven or marketing site with Astro 6: static-first pages, islands and partial hydration, content collections, server islands, per-route on-demand rendering, deploy adapters, and Astro 5→6 migration. NOT app-router React with server actions and heavy client interactivity (that is `nextjs`).

Overview

Publisherericrisco
Repositoryrsc-harness
Skill nameastro
Stars
239
Forks
24
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ericrisco on GitHub. Read the source before you install it.

Installation

Install the Astro AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ericrisco/rsc-harness/tree/main/skills/astro
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ericrisco/rsc-harness.git /tmp/rsc-harness
mkdir -p .claude/skills
cp -r /tmp/rsc-harness/skills/astro .claude/skills/astro
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Astro in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Astro on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Astro is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Astro 6 — static-first sites, islands, content collections

The prime directive

Ship zero client JavaScript by default. Hydrate the smallest possible surface, as late as you can get away with. An .astro component renders to HTML at build time and ships no runtime; every island is a bundle the visitor downloads, parses, and executes. Content and marketing sites win on TTFB/LCP and Lighthouse, not on React-everywhere. If you find yourself adding client:load to make a page "work," stop — the page already works; you are adding interactivity, and interactivity is the expensive exception, not the default.

First: detect the project version

Astro 6.0 is stable (released 2026-03-10); the Astro 5 line is still production-ready. Do not mix advice across majors — read package.json → the astro version before advising. What v6 changes, per the upgrade-to-v6 guide:

  • Node 22.12.0 or higher is required (18 and 20 are dropped) — check the actual runtime.
  • Content config lives at src/content.config.ts. The legacy src/content/config.ts path is removed, not merely discouraged, and the old auto-detection (legacy.collections) is gone. The legacy.collectionsBackwardsCompat escape hatch is a migration crutch, not a supported layout.
  • Vite 7 and Zod 4 for content schemas — z is imported from astro/zod, not astro:content (see Content collections below).
  • Live Content Collections, the Fonts API and the CSP API are stable.
  • The Rust compiler succeeding the Go one is experimental — do not rely on or configure it in production advice.

Decision table — what kind of thing is this?

Pick the cheapest row that satisfies the requirement. Read top-down; stop at the first match.

NeedUseWhy
Pure content, no interactivity.astro component, staticRenders to HTML at build, ships 0 KB JS
One small interactive widgetUI-framework component + client:*Hydrate just that island; the rest stays static
Per-request personalization on a mostly-static pageserver island (server:defer)Static CDN page + one deferred fragment, no full SSR
Whole route needs request data on every loadexport const prerender = false + adapterOpt that one route into on-demand rendering
Many static routes generated from datagetStaticPaths()Build-time fan-out, still fully static

Rendering model

Default: every page is prerendered to static HTML at build time. You opt into dynamism per route — never the other way around.

astro
---
// src/pages/dashboard.astro — opt this ONE route into on-demand (SSR) rendering.
// Requires a configured adapter (Vercel/Netlify/Cloudflare/Node). Everything else stays static.
export const prerender = false;
const user = await getUser(Astro.request); // runs per request
---
<h1>Hello {user.name}</h1>
astro
---
// src/pages/blog/[slug].astro — many STATIC routes generated from data at build time.
import { getCollection } from "astro:content";

export async function getStaticPaths() {
  const posts = await getCollection("blog");
  return posts.map((post) => ({ params: { slug: post.id }, props: { post } }));
}
const { post } = Astro.props;
---
<h1>{post.data.title}</h1>

In Astro 6 the dev server runs the production runtime (Vite 7 Environment API), so dev no longer diverges from prod on Cloudflare/Bun/Deno — fewer "works in dev, breaks on deploy" surprises. Adapter choice per platform → references/deploy-and-integrations.md.

Islands & client directives

A client:* directive turns a framework component into a hydrated island. Choose the latest directive that still feels instant to the user — never default to client:load.

DirectiveHydrates whenUse for
client:loadImmediately on page loadAbove-the-fold, must-be-interactive-now controls
client:idleOn requestIdleCallbackImportant but not first-paint-critical widgets
client:visibleWhen it scrolls into view (IO)Below-the-fold carousels, comment boxes, maps
client:media={query}When a media query matchesMobile-only menu, desktop-only panel
client:only="react"Client-only, no SSR HTMLComponents that crash during SSR (browser-only deps)
astro
---
import Carousel from "../components/Carousel.tsx";
---
<!-- Bad: a below-the-fold carousel paying for JS at first paint -->
<Carousel client:load />

<!-- Good: defer its bundle until the user actually scrolls to it -->
<Carousel client:visible />

client:only gotcha: it skips SSR entirely, so the component produces no server HTML (expect a flash/layout shift) and you must name the framework (client:only="react") — Astro can't infer it without the server render. Reach for it only when SSR genuinely breaks; otherwise prefer client:visible.

Content collections (Content Layer)

Type-safe content lives in a single config file. The path is load-bearing:

typescript
// src/content.config.ts  ← v6 path. NOT src/content/config.ts (legacy path removed in v6)
import { defineCollection } from "astro:content";
import { z } from "astro/zod"; // v6: z moved OUT of astro:content into astro/zod (Zod 4)
import { glob } from "astro/loaders";

const blog = defineCollection({
  // glob() sources files from anywhere; `id` comes from the filename minus extension
  loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/data/blog" }),
  schema: z.object({
    title: z.string(),
    pubDate: z.coerce.date(),
    draft: z.boolean().default(false),
    tags: z.array(z.string()).default([]),
  }),
});

export const collections = { blog };

Query and render in a page. render() is now a standalone call (not entry.render()):

astro
---
// src/pages/blog/[slug].astro
import { getCollection, getEntry, render } from "astro:content";

export async function getStaticPaths() {
  const posts = await getCollection("blog", ({ data }) => !data.draft);
  return posts.map((post) => ({ params: { slug: post.id }, props: { post } }));
}
const { post } = Astro.props;
const { Content } = await render(post);
---
<article><h1>{post.data.title}</h1><Content /></article>

Built-in loaders are glob() (many files) and file() (one JSON/YAML array). Custom and CMS loaders, Zod 4 schema patterns, collection references, Live Content Collections (real-time data with no rebuild, stable in v6), querying and MDX details → references/content-layer.md.

Server islands

When most of a page is static and CDN-cacheable but one fragment is per-visitor, use a server island instead of turning the whole route into SSR. The page ships static; the island is fetched and rendered after first paint.

astro
---
// src/components/UserGreeting.astro — rendered on demand, deferred after the static shell
const user = await getUserFromCookie(Astro.request);
---
<span>Welcome back, {user.name}</span>
astro
---
import UserGreeting from "../components/UserGreeting.astro";
---
<header>
  <!-- static page, one deferred personalized fragment with a placeholder while it loads -->
  <UserGreeting server:defer>
    <span slot="fallback">Welcome</span>
  </UserGreeting>
</header>

This beats full SSR when: the page is otherwise cacheable on a CDN, and only a small slice depends on the request. You keep static LCP and personalize without making every request hit the origin.

Integrations & setup

Use astro add so it patches astro.config.mjs and installs peers in one step:

bash
npx astro add react mdx sitemap
  • Tailwind 4 wires through the official Vite plugin (@tailwindcss/vite), not the legacy @astrojs/tailwind integration (that path was for Tailwind 3).
  • Fonts API (stable in v6) self-hosts and optimizes fonts from astro.config.mjs — no manual @font-face.
  • CSP API (stable in v6) emits a Content-Security-Policy with hashes for your inline scripts/styles.

Adapter recipes per platform, hybrid rendering, env handling, SSR endpoints (src/pages/api/*.ts) and the Fonts/CSP config → references/deploy-and-integrations.md.

Performance rules

  • Images: always <Image>/<Picture> from astro:assets — automatic width/height, format, and lazy-loading kill CLS and over-sized payloads. Never a raw <img> for local assets.
  • Never global-hydrate: there is no "make the page interactive" switch; hydrate per island.
  • View transitions: add <ClientRouter /> from astro:transitions to the <head> for SPA-like navigation without an SPA. Prefetch links with the prefetch config/attribute.

Astro 5 → 6 migration checklist

Run the codemod first, then verify each item:

bash
npx @astrojs/upgrade
  • Node runtime is 22.12.0+ (CI image, local, deploy target).
  • Dependencies on Vite 7 (Vite v7.0; custom Vite plugins/config may need updates).
  • Schema z import moved: import { z } from "astro/zod" — z and astro:schema are gone from astro:content. Then review for Zod 4 breaking changes.
  • Content config renamed to src/content.config.ts (delete src/content/config.ts; the legacy path is removed, not just deprecated).
  • Full guide (dated 2026): docs.astro.build/en/guides/upgrade-to/v6.

Anti-patterns

Anti-patternReality
"Add client:load so the page works"An .astro page already works statically; you're shipping JS for nothing
"client:load everywhere, simplest"Pick client:visible/idle/media; first-paint JS is the LCP killer
"Make the whole route SSR to personalize the header"Use a server island (server:defer); keep the page static & CDN-cached
"src/content/config.ts worked before, keep it"v6 removed that path (LegacyContentConfigError) — must be src/content.config.ts
"fetch() the CMS inside the .astro frontmatter"Write a content-collection loader so content is typed, cached, and queryable
"Pull in React just to render this static markup"Static markup is an .astro component — 0 KB, no framework runtime
"Skip the Zod schema, content is just frontmatter"Untyped content = silent build-time drift; the schema is the contract
"client:only without the framework name"It can't infer the framework with no SSR — must be client:only="react"
"Use the old @astrojs/tailwind for Tailwind 4"Tailwind 4 wires through @tailwindcss/vite; the old integration is v3-era

Verify

bash scripts/verify.sh from the Astro project root — grep-based, needs no install. It FAILS if a v6 project still has src/content/config.ts instead of src/content.config.ts, WARNS on over-hydration smells (many client:load, or client:only with no framework string), CHECKS that content schemas import from astro:content, and — only if the astro binary resolves — optionally runs npx astro check. On an empty or clean tree it prints OK and exits 0; warnings are advisory and never fail the run.

See Also

  • ../nextjs/SKILL.md — when the project is really an app-router React app with server actions and heavy client interactivity, not a content/marketing site.
  • ../landing-copy/SKILL.md and ../seo-geo/SKILL.md — this skill builds the site; those write the copy and decide the SEO/structured-data strategy that fills it.
  • ../vercel/SKILL.md, ../netlify/SKILL.md, ../cloudflare/SKILL.md — platform mechanics (DNS, env, build settings) once the code and adapter are ready.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Astro AI skill do?

Use when building a content-driven or marketing site with Astro 6: static-first pages, islands and partial hydration, content collections, server islands, per-route on-demand rendering, deploy adapters, and Astro 5→6 migration. NOT app-router React with server actions and heavy client interactivity (that is `nextjs`).

Why use Astro on TypingMind?

Because you install it once and use it with any model. Astro is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Astro in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ericrisco/rsc-harness/tree/main/skills/astro. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Astro?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Astro?

As many as you like. As long as a model supports skills, you can use Astro with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Astro AI skill free?

Yes. It is published on GitHub by ericrisco under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇