src/orchestrator/plugins/astro/SKILL.md
Creates pages/layouts, defines content collections, configures hydration directives, and wires integrations. Use when adding or modifying Astro pages, layouts, components, or content collections. Trigger terms: Astro, content collection, client:load, client:visible, astro:content
npx skillsauth add etylsarin/opencastle astro-frameworkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Top-level: src/, public/, astro.config.mjs. Inside src/: pages/, layouts/, components/, content/, styles/, assets/. public/ serves static assets as-is; src/assets/ goes through Astro's build pipeline.
src/
├── pages/ # file-based routing (.astro, .md, .mdx)
├── layouts/ # BaseLayout.astro, etc.
├── components/ # .astro + framework components (React islands)
├── content/ # Content collections (blog/, docs/, etc.)
├── styles/ # global.css
└── assets/ # processed images
Default: Zero JS — author .astro components that render HTML with no client-side JavaScript where possible.
Islands Architecture — hydrate interactivity only where needed using client:* directives.
---
interface Props { title: string; description?: string; }
const { title, description = 'Default description' } = Astro.props;
---
<section>
<h2>{title}</h2>
<p>{description}</p>
</section>
<style>
section { max-width: 800px; margin: 0 auto; }
</style>
Use only the hydration directive required by the interaction to minimize shipped JS. Typical mappings:
client:load — immediate hydration for critical interactive widgetsclient:idle — non-critical behavior after page idleclient:visible — hydrate when visible (lazy)client:media — hydrate on media matchclient:only — last resort for non-SSR-able componentssrc/content.config.ts using defineCollection and Zod validators.src/content/<collection> and add one sample .md or .mdx content file with frontmatter.pnpm build and pnpm dev → run node scripts/validate-content.js (or your project's validation script) to verify typed collection imports.const posts = await getCollection('blog')) and confirm build-time typing.pnpm build exits zero and TypeScript reports no errors for collection types.Define collections in src/content.config.ts (Astro v5+) using astro:content and export typed collections.
import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';
const blog = defineCollection({
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/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 collections:
---
import { getCollection } from 'astro:content';
const posts = (await getCollection('blog', ({ data }) => !data.draft))
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
---
Every .astro or .md file in src/pages/ becomes a route. For dynamic routes:
---
// 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.id }, props: { post } }));
}
const { post } = Astro.props;
const { Content } = await post.render();
---
<Content />
SSR: Set output: 'server' (or 'hybrid') and add an adapter (node, vercel, netlify, cloudflare) in astro.config.mjs.
Define in src/layouts/BaseLayout.astro — a full HTML shell with <slot /> for page content. Pass title and description as props.
Use astro add for react, tailwind, mdx, sitemap, node, vercel, netlify, cloudflare.
GET/POST handlers from src/pages/api/*.ts returning new Response(...).defineAction in src/actions/index.ts for type-safe server mutations with Zod validation.Extracted anti-patterns and SSR configuration details are available in REFERENCE.md in this directory to keep this skill focused and concise.
development
Defines 10 sequential validation gates: secret scanning, lint/test/build checks, blast radius analysis, dependency auditing, browser testing, cache management, regression checks, and smoke tests. Use when running pre-deploy validation or CI checks, CI/CD pipelines, deployment pipeline validation, pre-merge checks, continuous integration, or pull request validation.
development
Generates test plans, writes unit/integration/E2E test files, identifies coverage gaps, and flags common testing anti-patterns. Use when writing tests, creating test suites, planning test strategies, mocking dependencies, measuring code coverage, or test planning.
development
Provides model routing rules, validates delegation prerequisites, supplies cost tracking templates, and defines dead-letter queue formats for Team Lead orchestration. Load when assigning tasks to agents, choosing model tiers, starting a delegation session, running a multi-agent workflow, delegating work, choosing which model to use, or assigning tasks.
testing
Saves and restores session state including task progress, file changes, and delegation history. Use when saving progress, resuming interrupted work, picking up where you left off, or checkpointing current work.