astro-knowledge
API documentation and reference provider for Astro/Starlight. Provides on-demand documentation lookup, API verification, and feature availability checks.
What this skill does
# astro-knowledge Skill
Expert documentation and API reference provider for Astro and Starlight development.
## Purpose
The astro-knowledge skill provides **on-demand documentation lookup** and API verification. It helps agents confirm current syntax, check feature availability, and access comprehensive API references.
## Capabilities
- **API Verification**: Confirm current syntax for Astro/Starlight APIs
- **Feature Lookup**: Check availability and usage patterns
- **Documentation Search**: Find relevant docs quickly
- **Best Practices**: Provide current recommendations
- **Version Checking**: Note version-specific features
## Loading Strategy
This skill loads **on-demand** when agents need:
- API syntax confirmation
- Feature availability verification
- Documentation references
- Configuration examples
- Migration guidance
## Usage
This skill is loaded when:
- Using the `/lookup` command for quick API reference
- During implementation via `/dev` for API verification
- When planning with `/design` for feature availability checks
- Whenever current syntax or API documentation is needed
## Documentation Resources
### Cached References
Location: `\${CLAUDE_PLUGIN_ROOT}/skills/astro-knowledge/references/`
- Full Astro API reference
- Starlight configuration guide
- Content Collections API
- Routing patterns
### Knowledge Base
Location: `\${CLAUDE_PLUGIN_ROOT}/knowledge-base/`
- Syntax details
- Common patterns
- Best practices
### MCP Server Integration
If `astro-docs` MCP server is available:
- Real-time documentation lookups
- Latest API information
- Version-specific documentation
## Common Lookups
### Collections API
\`\`\`typescript
// getCollection, getEntry, getEntries
import { getCollection, getEntry } from 'astro:content';
// Get all entries
const posts = await getCollection('blog');
// Get single entry
const post = await getEntry('blog', 'post-slug');
// Filter entries
const published = await getCollection('blog', ({ data }) =>
data.draft !== true
);
\`\`\`
### Dynamic Routes
\`\`\`typescript
// getStaticPaths return format
export async function getStaticPaths() {
const entries = await getCollection('docs');
return entries.map(entry => ({
params: { slug: entry.slug },
props: { entry }
}));
}
\`\`\`
### Client Directives
\`\`\`astro
<!-- Load immediately -->
<Component client:load />
<!-- Load when browser idle -->
<Component client:idle />
<!-- Load when visible -->
<Component client:visible />
<!-- Load when media query matches -->
<Component client:media="(max-width: 768px)" />
<!-- Only render on client -->
<Component client:only="react" />
\`\`\`
### Starlight Config
\`\`\`javascript
import { defineConfig } from 'astro/config';
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/getting-started/' },
],
},
],
})
]
});
\`\`\`
## Search Strategy
1. **Identify Section**: Determine relevant docs area
2. **Check Cache**: Look in cached references first
3. **MCP Fallback**: Use MCP server if available
4. **Provide Context**: Include examples and links
## Output Format
When providing documentation:
\`\`\`markdown
# [API Name]
## Current Syntax
[Code example]
## Documentation
Source: https://docs.astro.build/...
## Common Patterns
[Usage patterns]
## Notes
- Available since: vX.X.X
- Deprecations: [if any]
- Related: [Related APIs]
\`\`\`
## Token Optimization
**Quick lookup**: API signature + example (~100 tokens)
**Standard lookup**: Full documentation + patterns (~300 tokens)
**Comprehensive**: Multiple related APIs + guides (~600 tokens)
## Version
**Skill Version**: 2.0 (On-Demand Reference)
**Plugin Version**: v0.4.0+
**Last Updated**: 2025-11-05
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.