ACTIVATE when creating dynamic routes, catch-all routes, pagination, API endpoints, or static path generation in Astro. ACTIVATE for 'getStaticPaths', '[slug]', '[...slug]', 'paginate', 'API route', 'redirect'. Covers: file-based routing, single/multiple/nested dynamic parameters, catch-all routes with priority, built-in pagination, API routes (JSON/RSS), URL utilities, redirects. DO NOT use for: content collection queries (see astro-content-collections), i18n routes (see astro-i18n).
From astronpx claudepluginhub fabiensalles/claude-marketplace --plugin astroThis skill uses the workspace's default tool permissions.
references/routing-examples.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
Patterns for file-based and dynamic routing in Astro.
src/pages/
├── index.astro -> /
├── about.astro -> /about
├── blog/
│ ├── index.astro -> /blog
│ └── [slug].astro -> /blog/:slug
├── [...slug].astro -> /* (catch-all)
└── api/
└── data.json.ts -> /api/data.json
---
// src/pages/blog/[slug].astro
import { getCollection } from 'astro:content';
export async function getStaticPaths() {
const posts = await getCollection('blog');
return posts.map((post) => ({
params: { slug: post.slug },
props: { post },
}));
}
const { post } = Astro.props;
---
<h1>{post.data.title}</h1>
---
// src/pages/[lang]/blog/[slug].astro
export async function getStaticPaths() {
const posts = await getCollection('blog');
const languages = ['en', 'fr'];
return languages.flatMap((lang) =>
posts.map((post) => ({
params: { lang, slug: post.slug },
props: { post, lang },
}))
);
}
---
/about.astro) -- highest/blog/[slug].astro) -- medium/[...slug].astro) -- lowestWhen implementing nested dynamic routes, catch-all routes, pagination, or API endpoints, read
references/routing-examples.mdfor complete implementations with getStaticPaths, paginate, JSON/RSS endpoints, and redirect patterns.
| Pattern | Route | Example URL |
|---|---|---|
index.astro | Root | / |
about.astro | Static | /about |
[slug].astro | Dynamic | /post-1, /post-2 |
[...slug].astro | Catch-all | /a/b/c |
[lang]/[slug].astro | Multi-param | /en/about |
[page].astro + paginate | Pagination | /1, /2 |
file.json.ts | API | /file.json |