astro · mindrally — Claude Code skill: Astro framework conventions
A skill that tells the agent how to build Astro sites: static generation, partial hydration, file-based routing and as little client-side JavaScript as possible.
npx skills add Mindrally/skills --skill astro -a claude-codeWhat astro does
This skill turns the assistant into an Astro specialist. It lays out the project structure with src/components, src/layouts, src/pages, src/styles and astro.config.mjs, and asks for components in .astro files, with React, Vue or Svelte pulled in only when a framework is actually needed.
Routing rules are covered too: file-based routing under src/pages/, dynamic routes as [...slug].astro, static page generation with getStaticPaths(), and a 404.astro for errors. Separate sections handle the client:load, client:idle and client:visible directives, Markdown and MDX content, content collections, scoped <style> tags, and Tailwind through @astrojs/tailwind.
There is a section on SEO and accessibility: metadata in <head>, canonical URLs, semantic HTML, ARIA attributes and keyboard navigation. Performance advice ties back to Core Web Vitals (LCP, FID, CLS), with Lighthouse and WebPageTest as the check. Nothing beyond the instruction file gets installed, and the skill assumes a project that already runs Astro with TypeScript — drop it into an empty folder and the getStaticPaths() and content collection examples have nothing to attach to.
What it helps with
- Lay out pages and components along Astro's file-based routing
- Pick the right hydration directive for an interactive block
- Generate static routes with
getStaticPaths() - Wire up Markdown and MDX through content collections
- Trim client-side JavaScript without losing interactivity
Example prompts for the agent
- Create an Astro blog page with a dynamic
[...slug].astroroute andgetStaticPaths() - Rewrite this React widget as an Astro component and hydrate it with
client:visible - Set up a content collection for MDX posts and list them on the home page
How to install astro
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill astro -a claude-code2Manually: put the files in place
~/.claude/skills/astro/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/astro/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill astro -a codex2Manually: put the files in place
.agents/skills/astro/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill astro -a cursor2Manually: put the files in place
.cursor/skills/astro/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills astro2Manually: put the files in place
.github/skills/astro/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill astro -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path astroManually: put the files in place
.devin/skills/astro/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill astro -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about astro
How do I install the astro skill in Claude?
Run npx skills add Mindrally/skills --skill astro -a claude-code. The file lands at ~/.claude/skills/astro/SKILL.md.
What does the astro skill do?
It gives the agent Astro conventions: project structure, .astro components, file-based routing, client:* directives, Markdown and MDX handling, styling and accessibility.
Does the astro skill need anything else?
The skill is just an instruction file. It leans on a project that already uses Astro and TypeScript, so the getStaticPaths() and content collection examples only make sense in an existing setup.
Source text
SKILL.md · Apache-2.0
--- name: astro description: Expert in Astro framework with static generation and partial hydration patterns metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Astro You are an expert in JavaScript, TypeScript, and Astro framework for scalable web development. ## Core Principles - Write concise, technical responses with accurate Astro examples - Leverage Astro's partial hydration and multi-framework support - Prioritize static generation and minimal JavaScript for performance - Use descriptive variable names following Astro conventions - Organize files using Astro's file-based routing ## Project Structure ``` src/ - components/ - layouts/ - pages/ - styles/ public/ astro.config.mjs ``` ## Component Development - Create `.astro` files for components - Use framework-specific components (React, Vue, Svelte) when necessary - Implement proper composition and reusability - Pass data via Astro's component props ## Routing & Pages - Use file-based routing in `src/pages/` - Implement dynamic routes with `[...slug].astro` - Use `getStaticPaths()` for static page generation - Create `404.astro` for error handling ## Performance Optimization - Minimize client-side JavaScript - Use `client:*` directives strategically: - `client:load` for immediate interactivity - `client:idle` for non-critical features - `client:visible` for viewport-triggered hydration - Implement lazy loading for assets - Utilize built-in asset optimization ## Content Management - Use Markdown (`.md`) or MDX (`.mdx`) files - Leverage frontmatter support - Implement content collections ## Styling - Use scoped `<style>` tags in `.astro` files - Import global styles in layouts - Integrate Tailwind via `@astrojs/tailwind` - Use utility classes extensively ## Data Fetching - Use `Astro.props` for component data - Use `getStaticPaths()` for build-time fetching - Use `Astro.glob()` for local files - Implement proper error handling ## SEO & Accessibility - Use Astro's `<head>` tag for metadata - Implement canonical URLs - Use semantic HTML - Implement ARIA attributes - Ensure keyboard navigation ## Performance Metrics - Prioritize Core Web Vitals (LCP, FID, CLS) - Use Lighthouse and WebPageTest - Monitor performance budgets
© Mindrally · Apache-2.0 · Mindrally/skills
Similar skills
Everything for Frontend and UI →astro by other authors comes first.