Skip to content
Web apps

Astro static site

Astro conventions for fast, zero-JS-by-default sites with content collections, plus a skill for deploying to Cloudflare Pages with headers and redirects.

Verified install Not agent-tested v1.0.0 MIT updated astrotypescriptcloudflare
Equips
  • 2 2 Rules
  • 1 1 Skills
  • – 0 MCP

Astro is a great fit for portfolios, docs, blogs and landing pages, but agents love to turn it into a React app with a hydrated component on every line. This loadout keeps pages static and fast, uses content collections for anything that looks like content, and finishes with a reliable Cloudflare Pages deploy. (This very site is built on the same approach.)

What's in it

  • Zero JavaScript by default; islands only where there is real interactivity
  • Typed content collections with schemas instead of ad-hoc markdown imports
  • Images through astro:assets, semantic HTML and accessibility basics
  • Cloudflare Pages deploy skill: build settings, _headers, _redirects and custom domains

You'll need

  • Tools: node, wrangler
Level 1 · automated

Verification

Verified install

Checked at commit ad36e85 · 9 passed, 0 failed, 1 not applicable

CheckResultWhat we found
Listinglisting.yaml matches the schema and declares every file in the folder. Pass
Schema valid; 5 files declared, none missing or extra
  • tested.status: untested (agent tests are separate from Level 1)
Files parseJSON parses; SKILL.md and .mdc front matter is valid YAML with the fields each agent needs; code fences are closed. Pass All 5 files parse; front matter valid
AdaptersCLAUDE.md imports @AGENTS.md, GEMINI.md imports @./AGENTS.md, and both match the generator. Pass
CLAUDE.md and GEMINI.md import AGENTS.md and are up to date
  • CLAUDE.md: matches the generator
  • GEMINI.md: matches the generator
Install pathsEvery file lands where each agent documents it, with no collisions, and the laid-out project is re-discovered correctly. Pass
Correct paths for all 5 agents; layouts re-discovered
  • Claude Code: 3 files, 1 skill in .claude/skills/
  • Codex CLI: 2 files, 1 skill in .agents/skills/
  • Cursor: 3 files, 1 skill in .agents/skills/, 1 rule
  • Gemini CLI: 3 files, 1 skill in .agents/skills/
  • GitHub Copilot: 2 files, 1 skill in .agents/skills/
MCP configmcp.json is structurally valid, converts to each agent's format, declares no literal secrets, and referenced packages exist on npm/PyPI. Not applicable No MCP servers in this loadout
Safety scanThe intake scanner finds no credentials, risky shell, hidden Unicode or prompt-injection wording, and the listing's network flag is honest. Pass
Clean: no credentials, risky shell or hidden text
  • Scanner intake-precheck/1: verdict clean; network yes (listing says yes)
ReferencesLinks and file paths between the loadout's files resolve, including for each agent's installed layout. Pass No cross-file references to check
Size limitsFile count and sizes are within the submission limits; SKILL.md bodies stay under 500 lines. Pass
5 files, 6.4 KB total; largest AGENTS.md 2.6 KB
  • Limits: 30 files, 32 KB per file, 128 KB total, 500 lines per skill or rule
LicenceA recognised SPDX licence, with the licence text available. Pass MIT, by Agent Loadout; text in the repository LICENSE
Starter buildA minimal fixture project with the loadout applied installs and builds or type-checks, and the loadout's own code examples compile. Pass
Static Astro site in the loadout's layout (content collection, layout, components) builds with the loadout applied and ships no client JavaScript
  • Applied 6 loadout files at every agent's paths
  • ✓ install: npm ci --no-audit --no-fund
  • ✓ astro build: npm run build
  • ✓ check dist: node check-dist.mjs
  • Covers: src/content.config.ts collection with a glob() loader and zod schema; getCollection + render (AGENTS.md)
  • Covers: Typed Props, class:list and scoped styles in a component (Cursor rule)
  • Covers: Every page has a unique <title> and meta description; no <script> shipped ("ship no JavaScript unless a feature needs it")

What this means: a script checked the files themselves: they parse, they install where each agent looks, any MCP config is sound, the safety scan is clean, references between files resolve, and, where a free and repeatable fixture exists, a small starter project builds with the loadout applied. No AI agent was run. Per-agent results ("tested with agent") are separate and stay untested until an agent actually runs.

Install

Choose your agent. Run the commands from your project root, or download a zip already laid out in the right folders.

Claude Code reads CLAUDE.md (imports AGENTS.md with @AGENTS.md) and skills from .claude/skills/.

Download zip
curl -fsSL --create-dirs -o AGENTS.md https://loadout.jnw-it.com/raw/astro-static-site/1.0.0/AGENTS.md
curl -fsSL --create-dirs -o CLAUDE.md https://loadout.jnw-it.com/raw/astro-static-site/1.0.0/CLAUDE.md
curl -fsSL --create-dirs -o .claude/skills/cloudflare-pages-deploy/SKILL.md https://loadout.jnw-it.com/raw/astro-static-site/1.0.0/skills/cloudflare-pages-deploy/SKILL.md
FileGoes to
AGENTS.mdAGENTS.md
CLAUDE.mdCLAUDE.md
skills/cloudflare-pages-deploy/SKILL.md.claude/skills/cloudflare-pages-deploy/SKILL.md

Already have an AGENTS.md or CLAUDE.md? The commands above overwrite it — download the file instead and merge the sections you want.

Files

Rules AGENTS.md Astro static site rules. 46 lines
Download Raw
# AGENTS.md: Astro static site

Static output (`output: "static"`, the default). The built site is plain HTML/CSS in `dist/`.

## Principles
- **Ship no JavaScript unless a feature needs it.** `.astro` components render to HTML at build time.
  A UI framework component (React, Svelte, Vue) only runs in the browser with a `client:*` directive — use
  `client:visible` or `client:idle` over `client:load`, and only for genuinely interactive parts.
- Small inline `<script>` tags in `.astro` files are fine for simple interactivity (menus, copy buttons). Astro bundles them.
- Do not add a UI framework integration just for one widget.

## Layout
```
src/pages/          routes (file-based). [slug].astro + getStaticPaths for dynamic pages
src/layouts/        page shells (Base.astro holds <head>, meta tags, header, footer)
src/components/     .astro components
src/content/        markdown/MDX/JSON content
src/content.config.ts   collection definitions with zod schemas
src/styles/         global CSS (tokens as custom properties)
public/             copied as-is: favicon, robots.txt, _headers, _redirects
```

## Content collections
- Anything list-like (posts, projects, docs) is a collection defined in `src/content.config.ts` with a `glob()` loader and a `schema`.
- Read with `getCollection("blog")` / `getEntry(...)`; render markdown with `render(entry)`.
- Add new frontmatter fields to the schema first. The build should fail on bad content, not render `undefined`.

## Pages and SEO
- Every page sets a unique `<title>` and `<meta name="description">` via the layout props.
- Set `site` in `astro.config.mjs` so canonical URLs, sitemaps and RSS work.
- Use `@astrojs/sitemap` for a sitemap; add `robots.txt` in `public/`.
- Internal links are root-relative (`/about/`). Respect the configured `trailingSlash` setting.

## Images and assets
- Local images live in `src/assets/` and go through `<Image />` / `<Picture />` from `astro:assets` (sizes, formats, lazy loading).
- Always set meaningful `alt` text (empty `alt=""` for decorative images).
- Self-host fonts or use system fonts; preload only the one font file used above the fold.

## HTML and CSS
- Semantic HTML: one `<h1>`, landmarks (`header`, `main`, `nav`, `footer`), real `<button>`s and `<a>`s.
- Component styles in `<style>` (scoped by default). Global tokens (colours, spacing, fonts) as CSS custom properties.
- Check colour contrast and visible focus states. Respect `prefers-reduced-motion`.

## Before you say "done"
`npm run build` passes with no warnings you introduced, and `npm run preview` shows the change. Mention any new page or route.
Adapter CLAUDE.md Imports AGENTS.md for Claude Code. 10 lines
Download Raw
# CLAUDE.md

@AGENTS.md

## Claude Code notes
- Skills from this loadout live in `.claude/skills/`: `cloudflare-pages-deploy`. Use them when their description matches the task.
- Follow AGENTS.md above; where this file and AGENTS.md disagree, AGENTS.md wins.

<!-- From the Agent Loadout "Astro static site" v1.0.0 — https://loadout.jnw-it.com/loadouts/astro-static-site/ -->
Adapter GEMINI.md Imports AGENTS.md for Gemini CLI. 10 lines
Download Raw
# GEMINI.md

@./AGENTS.md

## Gemini CLI notes
- Skills from this loadout live in `.agents/skills/`: `cloudflare-pages-deploy`. Use them when their description matches the task.
- Follow AGENTS.md above; where this file and AGENTS.md disagree, AGENTS.md wins.

<!-- From the Agent Loadout "Astro static site" v1.0.0 — https://loadout.jnw-it.com/loadouts/astro-static-site/ -->
Cursor rule .cursor/rules/astro-components.mdc Rule applied to .astro files. 14 lines
Download Raw
---
description: Astro component conventions
globs: "**/*.astro"
alwaysApply: false
---

- Frontmatter (between `---`) runs at build time only. Never put secrets in client `<script>` tags; frontmatter is fine.
- Type props: `interface Props { title: string; tags?: string[] }` then `const { title, tags = [] } = Astro.props;`.
- Use `class:list={[...]}` for conditional classes and `set:html` only with trusted, sanitised HTML.
- Framework components need a `client:*` directive to be interactive; omit it when the component is static.
- Prefer `<Image />` from `astro:assets` over `<img>` for local images.
- Keep components small and composable; use `<slot />` (and named slots) instead of passing HTML strings as props.
- Scoped `<style>` by default; `:global()` only when styling slotted or third-party markup.
Skill skills/cloudflare-pages-deploy/SKILL.md Deploys a static build to Cloudflare Pages. 52 lines
Download Raw
---
name: cloudflare-pages-deploy
description: Deploy a static site (Astro, Vite or plain HTML) to Cloudflare Pages, with headers, redirects and a custom domain. Use when the user asks to deploy, host or publish a static site on Cloudflare.
---

# Deploy a static site to Cloudflare Pages

## 1. Confirm the build
- Build command and output folder: Astro `npm run build` → `dist`; Vite `npm run build` → `dist`; plain HTML: no build, output is the folder.
- Run the build locally and check the output folder has `index.html`.
- Set the Node version Cloudflare should use: add a `.nvmrc` (e.g. `22`) or the `NODE_VERSION` environment variable in the project settings.

## 2. Add Pages config files to `public/` (copied into the output)
`public/_headers`:
```
/*
  X-Content-Type-Options: nosniff
  Referrer-Policy: strict-origin-when-cross-origin
  X-Frame-Options: DENY

/_astro/*
  Cache-Control: public, max-age=31536000, immutable
```
`public/_redirects` (only if needed):
```
/old-page /new-page/ 301
```

## 3. Choose a deploy route (ask the human which they prefer)
**A. Git integration (recommended for ongoing sites):** the human connects the repo in the Cloudflare dashboard
(Workers & Pages → Create → Pages → Connect to Git), sets the build command and output directory from step 1.
Every push to the production branch deploys; other branches get preview URLs.

**B. Direct upload with Wrangler:**
```sh
npx wrangler login                     # human does this once, in a browser
npx wrangler pages project create <project-name> --production-branch main
npx wrangler pages deploy dist --project-name <project-name>
```
Never paste or store a Cloudflare API token in the repo. In CI, use the `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` secrets.

## 4. Custom domain
In the Pages project → Custom domains → add `sub.example.com`. If the zone is on the same Cloudflare account, the DNS record is
created automatically; otherwise the human adds a CNAME to `<project>.pages.dev`. Certificates take a few minutes.

## 5. Verify
- Open the `*.pages.dev` URL and the custom domain. Check a deep link, the 404 page, and response headers
  (`curl -sI https://sub.example.com/ | grep -i x-content-type`).

## 6. Report
Project name, production URL, preview URL pattern, and anything the human still needs to click.

All files: source zip · Licence MIT · By Agent Loadout · First listed

Installing and testing

How do I install Astro static site in Claude Code?

From your project root, put AGENTS.md, CLAUDE.md, skills/cloudflare-pages-deploy/SKILL.md at .claude/skills/cloudflare-pages-deploy/SKILL.md. The "Claude Code" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/astro-static-site/claude-code.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Astro static site in Codex CLI?

From your project root, put AGENTS.md, skills/cloudflare-pages-deploy/SKILL.md at .agents/skills/cloudflare-pages-deploy/SKILL.md. The "Codex CLI" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/astro-static-site/codex.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Astro static site in Cursor?

From your project root, put AGENTS.md, .cursor/rules/astro-components.mdc, skills/cloudflare-pages-deploy/SKILL.md at .agents/skills/cloudflare-pages-deploy/SKILL.md. The "Cursor" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/astro-static-site/cursor.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Astro static site in Gemini CLI?

From your project root, put AGENTS.md, GEMINI.md, skills/cloudflare-pages-deploy/SKILL.md at .agents/skills/cloudflare-pages-deploy/SKILL.md. The "Gemini CLI" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/astro-static-site/gemini-cli.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install Astro static site in GitHub Copilot?

From your project root, put AGENTS.md, skills/cloudflare-pages-deploy/SKILL.md at .agents/skills/cloudflare-pages-deploy/SKILL.md. The "GitHub Copilot" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/astro-static-site/copilot.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

Has Astro static site been tested?

It passed the Level 1 automated install checks on 2026-10-16: the files parse, install to each agent's documented paths, and pass the safety scan. No AI agent has run it yet, so no agent pass or fail is claimed.

More for Claude Code, Codex, Cursor, Gemini CLI and GitHub Copilot.