astro-dev
Complete Astro/Starlight development toolkit with skills, agents, and automated workflows
View on GitHubTable of content
Complete Astro/Starlight development toolkit with skills, agents, and automated workflows
Installation
npx claude-plugins install @superbenefit/sb-marketplace/astro-dev
Contents
Folders: commands, hooks, knowledge-base, skills
Files: CHANGELOG.md, LICENSE, README.md
Documentation
Astro Dev Plugin
Simplified Astro and Starlight development toolkit for Claude Code with intelligent tiered knowledge loading.
Overview
The astro-dev plugin provides expert assistance for Astro and Starlight development through two primary commands and a smart knowledge system that loads context efficiently based on your task.
Version: 0.4.0 (Simplified Architecture)
Quick Start
# Main development command - handles everything
/dev Create a blog with categories and pagination
# Quick API reference lookup
/lookup getCollection
# Architecture planning for complex systems
/design Multi-tenant docs system with GitBook integration
That’s it! The /dev command is your primary tool for all Astro/Starlight development.
Commands
/dev [description]
Your main command for all development tasks - from simple components to complex features.
# Simple component
/dev Add a Footer component with social links
# Feature with collections
/dev Create a blog with categories, tags, and pagination
# Bug fixes
/dev Fix all TypeScript errors in the components folder
# Complex integration
/dev Integrate external API with custom content loader
# With validation control
/dev Add authentication --audit=comprehensive
/dev Create test component --audit=off
Auto-validation: Automatically validates code based on task size (can override with --audit flag).
/lookup [query]
Quick API reference for Astro/Starlight APIs and syntax.
/lookup getCollection
/lookup client directives
/lookup starlight config
/lookup getStaticPaths
Returns current syntax, examples, and documentation links.
/design [system]
Architecture planning for complex systems (optional, use before complex builds).
/design Multi-language content system with versioning
/design Integration strategy for Supabase + Astro
/design Refactor 200 pages to content collections
Provides design documents, schemas, and implementation roadmaps. Then use /dev to implement.
Skills
The plugin provides two skills with intelligent loading:
astro-coding
Implementation knowledge loaded in three tiers:
- Tier 1 (Always, ~100 tokens): Critical rules that prevent breaking errors
- Tier 2 (Context-based, ~400 tokens): Relevant patterns for your task
- Tier 3 (On-demand, ~800 tokens): Deep-dive references for complex work
astro-knowledge
API reference for quick documentation lookups via /lookup command.
Critical Rules (Always Applied)
These 10 rules are enforced on every task to prevent build failures:
- ✅ File extensions required:
import Layout from './Layout.astro'(not'./Layout') - ✅ Correct module prefix:
'astro:content'(not'astro/content') - ✅ Use
classnotclassNamein .astro files - ✅ Await in frontmatter only, never in templates
- ✅ Never expose
SECRET_*environment variables client-side - ✅ Type all Props interfaces with TypeScript
- ✅ Define
getStaticPaths()for dynamic routes - ✅ Don’t access
Astro.paramsinsidegetStaticPaths() - ✅ Use
CollectionEntry<'name'>types for collections - ✅ Validate XSS risk with
set:html(only use with trusted sources)
Knowledge Base Structure
knowledge-base/
├── critical-rules.md # Tier 1: Always loaded (~100 tokens)
├── astro-patterns.md # Tier 2: Core patterns (~400 tokens)
├── error-catalog.md # Tier 2: 100+ errors indexed by symptom
├── starlight-guide.md # Tier 2: Starlight-specific patterns
└── deep-dive/ # Tier 3: On-demand (~800 tokens)
├── integrations.md # External data & custom loaders
├── content-collections-reference.md
├── content-loader-api.md
├── external-data-integration.md
├── routing-pages-reference.md
└── starlight-specific.md
Usage Examples
Simple Component
/dev Create a Card component with title, description, and image props
Result: Component created with proper TypeScript types, accessibility, and validation.
Feature Implementation
/dev Add a blog with categories, pagination, and RSS feed
Result: Complete blog system with content collections, dynamic routes, and all features.
Bug Fixing
/dev Fix the import errors in the components folder
Result: All imports fixed with proper extensions and module paths.
Complex Architecture
# Step 1: Design the system
/design Multi-tenant docs with role-based access control
# Step 2: Review the architecture document
# Step 3: Implement it
/dev Implement the multi-tenant docs architecture
Result: Full implementation following the design plan.
API Lookup
/lookup getStaticPaths
Result: Current syntax, usage examples, TypeSc
…(truncated)
Included Skills
This plugin includes 2 skill definitions:
astro-coding
Provides Astro/Starlight implementation patterns, best practices, and critical rules with tiered context loading
View skill definition
astro-coding Skill
Smart, context-aware implementation patterns for Astro and Starlight development. Provides the knowledge needed to write high-quality, standards-compliant Astro code.
Purpose
The astro-coding skill is a knowledge provider that supplies Astro-specific coding patterns, critical rules, and best practices. It uses a tiered loading strategy to minimize token usage while ensuring all critical rules are always available.
Tiered Loading Strategy
Tier 1: Critical Rules (ALWAYS LOADED - ~100 tokens)
The non-negotiable rules that prevent breaking errors. Loaded for every Astro/Starlight task.
Source: ${CLAUDE_PLUGIN_ROOT}/knowledge-base/critical-rules.md
Contains:
- File extensions in imports (
.astro,.ts,.js) - Correct module prefixes (
astro:contentnotastro/content) - Use
classnotclassNamein .astro files - Async operations in frontmatter only
- Never expose
SECRET_*client-side - Type all component Props interfaces
- Define
getStaticPaths()for dynamic routes - Don’t access
Astro.paramsinsidegetStaticPaths() - Use proper collection types (
CollectionEntry<'name'>) - Validate XSS risk with
set:html
Tier 2: Common Patterns (CONTEXT-LOADED - ~400 tokens)
Pattern-specific knowledge loaded based on task type detection.
Sources:
${CLAUDE_PLUGIN_ROOT}/knowledge-base/astro-patterns.md- Core Astro patterns${CLAUDE_PLUGIN_ROOT}/knowledge-base/error-catalog.md- 100+ error patterns
…(truncated)
astro-knowledge
API documentation and reference provider for Astro/Starlight. Provides on-demand documentation lookup, API verification, and feature availability checks.
View skill definition
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
/lookupcommand for quick API reference - During implementation via
/devfor API verification - When planning with
/designfor 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-
…(truncated)