Quick API documentation and reference lookup for Astro/Starlight
/plugin marketplace add superbenefit/sb-marketplace/plugin install astro-dev@sb-marketplaceFast API verification and documentation search using the astro-knowledge skill.
/lookup [api-name or topic]
The /lookup command provides quick access to Astro and Starlight API documentation, syntax examples, and best practices via the astro-knowledge skill.
/lookup getStaticPaths
/lookup content collections
/lookup starlight config
/lookup client directives
/lookup image optimization
/lookup defineCollection
// Latest API syntax with TypeScript types
import { getCollection } from 'astro:content';
const posts = await getCollection('blog');
// Common patterns
const published = await getCollection('blog', ({ data }) => {
return data.draft !== true;
});
/lookup getCollection
Returns:
import { getCollection, getEntry, getEntries } from 'astro:content';
// Get all entries
const allPosts = await getCollection('blog');
// Filter entries
const publishedPosts = await getCollection('blog', ({ data }) =>
!data.draft
);
// Get single entry
const post = await getEntry('blog', 'post-slug');
/lookup getStaticPaths
Returns:
export async function getStaticPaths() {
const posts = await getCollection('blog');
return posts.map(post => ({
params: { slug: post.slug },
props: { post },
}));
}
const { post } = Astro.props;
/lookup client directives
Returns:
<!-- Load on page load -->
<Component client:load />
<!-- Load when browser idle -->
<Component client:idle />
<!-- Load when visible -->
<Component client:visible />
<!-- Conditional load -->
<Component client:media="(max-width: 768px)" />
<!-- Client-only render -->
<Component client:only="react" />
/lookup starlight config
Returns:
import starlight from '@astrojs/starlight';
export default defineConfig({
integrations: [
starlight({
title: 'My Docs',
social: {
github: 'https://github.com/user/repo',
},
sidebar: [
{
label: 'Guides',
items: [
{ label: 'Getting Started', link: '/guides/start/' },
],
},
],
}),
],
});
/lookup image
Returns:
---
import { Image } from 'astro:assets';
import myImage from '../assets/image.png';
---
<!-- Optimized local image -->
<Image src={myImage} alt="Description" />
<!-- With dimensions -->
<Image src={myImage} alt="Description" width={600} height={400} />
<!-- Remote image -->
<Image
src="https://example.com/image.jpg"
alt="Description"
width={600}
height={400}
/>
getCollection, getEntry, getEntries)getStaticPaths)Astro.props, Astro.params)defineConfig)@astrojs/starlight@astrojs/mdx@astrojs/sitemap@astrojs/tailwindIf astro-docs MCP server is available:
Cached References:
${CLAUDE_PLUGIN_ROOT}/skills/astro-knowledge/references/
Knowledge Base:
${CLAUDE_PLUGIN_ROOT}/knowledge-base/
Official Docs:
# [API/Feature Name]
## Current Syntax
[Code example with types]
## Common Usage
[Practical examples]
## Documentation
Source: https://docs.astro.build/...
## Notes
- Available since: vX.X.X
- Deprecations: [if any]
- Related: [Related APIs]
Be Specific:
❌ /lookup routing
✅ /lookup getStaticPaths
Use Keywords:
✅ /lookup content collections
✅ /lookup client hydration
✅ /lookup markdown config
Ask About Versions:
✅ /lookup getCollection (Astro 4.x)
Use /lookup for:
Use /design for:
Use /dev for:
getCollection - Content queriesgetStaticPaths - Dynamic routesstarlight config - Starlight setupclient directives - HydrationImage - Image optimizationdefineCollection - Schema definitionCommand Version: 2.0 (v0.4.0) Compatible with: astro-dev plugin v0.4.0+ Last Updated: 2025-11-05
Use /lookup for fast, accurate API reference.