astro
Astro web framework patterns for content-driven sites. Covers content collections with Zod schemas and loaders, island architecture with selective hydration directives, view transitions with ClientRouter, server-side and hybrid rendering modes, server islands, Astro DB with astro:db, middleware with onRequest, and framework integrations (React, Svelte, Vue). Use when building content-driven websites, configuring island hydration strategies, setting up view transitions, choosing between static and server rendering, integrating UI framework components, defining content collection schemas, or adding middleware.
What this skill does
# Astro
## Overview
Astro is an **all-in-one web framework** for building fast, content-focused websites. It uses an islands architecture that ships zero JavaScript by default, hydrating only interactive components on demand. Components from React, Svelte, Vue, Solid, and Preact can coexist in a single project.
**When to use:** Content-driven sites (blogs, docs, marketing), portfolios, e-commerce storefronts, any site where most pages are primarily static with isolated interactive regions.
**When NOT to use:** Highly interactive single-page applications (dashboards, real-time collaboration tools), apps requiring full client-side routing with shared global state across all components.
## Quick Reference
| Pattern | API / Directive | Key Points |
| ---------------------- | ------------------------------------------------- | ----------------------------------------------------- |
| Content collection | `defineCollection({ loader, schema })` | Zod schemas, glob/file loaders, type-safe queries |
| Query collection | `getCollection('blog')` | Returns typed array, supports filter callback |
| Single entry | `getEntry('blog', 'my-post')` | Fetch by collection name and entry ID |
| Island (load) | `<Component client:load />` | Hydrate immediately on page load |
| Island (idle) | `<Component client:idle />` | Hydrate when browser is idle |
| Island (visible) | `<Component client:visible />` | Hydrate when component enters viewport |
| Island (media) | `<Component client:media="(max-width: 768px)" />` | Hydrate on media query match |
| Island (client-only) | `<Component client:only="react" />` | Skip SSR, render only on client |
| View transitions | `<ClientRouter />` | Add to `<head>`, enables SPA-like navigation |
| Persist state | `transition:persist` | Maintain island state across navigations |
| Programmatic navigate | `navigate(href)` | Client-side navigation from scripts |
| Static output | `output: 'static'` | Pre-render all pages at build time (default) |
| Server output | `output: 'server'` | Server-render all pages on demand |
| Hybrid (opt-in SSR) | `output: 'static'` + per-page `prerender = false` | Static by default, opt individual pages into SSR |
| Hybrid (opt-in static) | `output: 'server'` + per-page `prerender = true` | SSR by default, opt individual pages into static |
| Server islands | `<Component server:defer />` | Defer server rendering for dynamic content in static |
| Middleware | `onRequest(context, next)` | Runs before every route, chain with `sequence()` |
| Astro DB table | `defineTable({ columns })` | Type-safe SQL with column definitions |
| Framework component | Import `.jsx` / `.svelte` / `.vue` | Auto-detected by file extension |
| Integration | `astro add react` | CLI to add framework adapters and tools |
| Render content | `const { Content } = await entry.render()` | Compile Markdown/MDX to component |
| Dynamic routes | `getStaticPaths()` + collection query | Generate pages from collection entries |
| API endpoint | `export const GET: APIRoute` | Server-rendered REST endpoints |
| Shared island state | `nanostores` | Reactive state across framework boundaries |
| Environment variables | `import.meta.env.PUBLIC_*` | `PUBLIC_` prefix for client-accessible vars |
| Transition animation | `transition:animate="slide"` | `initial`, `fade`, `slide`, `none` |
| Prefetch links | `data-astro-prefetch` | `hover`, `viewport`, `load`, or `false` |
| Collection reference | `reference('authors')` | Type-safe cross-collection relations |
| Script re-execution | `data-astro-rerun` | Re-run `<script>` on every view transition navigation |
| Redirect | `context.redirect(url, status)` | Redirect from middleware or server pages |
## Common Mistakes
| Mistake | Correct Pattern |
| ------------------------------------------------- | ------------------------------------------------------------------------- |
| Adding `client:` directive to `.astro` components | Only UI framework components (React, Svelte, Vue) accept `client:` |
| Using `client:load` everywhere | Default to `client:idle` or `client:visible`; use `client:load` sparingly |
| Forgetting framework string with `client:only` | Must specify framework: `client:only="react"` |
| Mixing framework components in non-Astro files | Only `.astro` files can compose components from multiple frameworks |
| Using `output: 'server'` for mostly static sites | Use `output: 'static'` with per-page `prerender = false` for hybrid |
| Omitting `<ClientRouter />` for view transitions | Must be in `<head>` of every page (use shared layout) |
| Content config not at `src/content.config.ts` | File must be named `content.config.ts` in `src/` root |
| Not awaiting `getCollection()` calls | Always `await` collection queries in frontmatter |
| Importing from `astro:content` in client scripts | Content APIs are server-only; pass data as props to client components |
| Placing middleware outside `src/middleware.ts` | Middleware must be at `src/middleware.ts` or `src/middleware/index.ts` |
| Passing functions as props to islands | Only serializable data crosses the server/client boundary |
| Using `transition:persist` without matching pages | Component must appear on both old and new page with same persist value |
| Missing adapter for server/hybrid mode | Install an adapter: `npx astro add vercel` (or node, netlify, etc.) |
## Delegation
- **Pattern discovery**: Use `Explore` agent
- **Build configuration**: Use `Task` agent
- **Code review**: Delegate to `code-reviewer` agent
> If the `tailwind` skill is available, delegate styling and Tailwind CSS configuration to it.
> If the `vitest` skill is available, delegate unit testing patterns to it.
> If the `playwright` skill is available, delegate end-to-end testing patterns to it.
> If the `vite` skill is available, delegate build configuration and Vite plugin setup to it.
> If the `drizzle` skill is available, delegate advanced database query patterns to it.
> If the `sentry` skill is available, delegate error monitoring and observability setup to it.
> If the `pino-logging` skill is available, delegate server-side logging configuration to it.
> If the `tanstack-query` skill is available, delegate client-side data fetching and caching to it.
## References
- [Content collections, schemas, loaders, and querying](references/content-collections.Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.