
astro-best-practices
Apply performant, accessible, and maintainable defaults when building or reviewing Astro projects.
- Installs
- 533
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/incluud/astro-agent-skills --skill astro-best-practices- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads astro-best-practices automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Astro Best Practices
Use this skill as the baseline when designing, implementing, or reviewing Astro work. It translates Astro-specific architectural guidance into portable instructions that can be applied across agents.
Core Principles
- prefer static generation when request-time rendering is not necessary
- keep client-side JavaScript minimal
- use framework islands only for real interactivity
- preserve clear project structure and predictable routing
- optimize for accessibility and maintainability, not just output parity
Architecture Defaults
Prefer .astro first
- use
.astrocomponents for static and mostly static UI - reach for React, Vue, or another framework only when local state or client-side behavior is genuinely needed
- keep interactive islands small and leaf-like
Use hydration deliberately
client:visiblefor deferred UIclient:idlefor lower-priority enhancementclient:loadfor critical immediate interactivity onlyclient:onlyonly when skipping server rendering is intentional
Default away from hydrating broad layout regions.
Keep the project shape predictable
Typical structure:
src/
components/
layouts/
pages/
content/
styles/
assets/
public/
Do not invent novel folder structure without a clear project-specific reason.
Content and Data
- use content collections for structured content
- define schemas instead of accepting loose frontmatter
- fetch server-side data in Astro frontmatter unless there is a clear reason not to
- keep data flow obvious and close to the component or page that owns it
Accessibility
- use semantic landmarks such as
header,nav,main,article, andfooter - ensure keyboard access for all interactive controls
- provide meaningful labels and accessible names
- maintain correct heading hierarchy
- use appropriate image alt text
- preserve visible focus states
- treat color contrast as a non-negotiable baseline
Performance
- use
astro:assetsor the project’s chosen image pipeline intentionally - prevent layout shift by providing image dimensions or stable containers
- avoid unnecessary client hydration
- keep CSS and JavaScript scoped to the features that need them
- prefer simple server-rendered markup over client complexity
Styling
- default to scoped component styles unless the project has a defined styling system
- use CSS custom properties for reusable tokens
- favor maintainable layout patterns over one-off utility sprawl when the project is not already utility-first
- keep responsive behavior intentional and testable
Review Checklist
Before finalizing Astro work, check:
- is any hydrated code unnecessary
- does the HTML stay semantic
- is the route/layout structure still clear
- are content schemas strong enough
- is the result accessible by keyboard and assistive tech
- does the implementation match the existing project conventions
FAQ
What does the astro-best-practices skill do?
Apply performant, accessible, and maintainable defaults when building or reviewing Astro projects.
How do I install astro-best-practices?
Run npx skills add https://github.com/incluud/astro-agent-skills --skill astro-best-practices in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/astro-best-practices/ (personal) or .claude/skills/astro-best-practices/ (project).
Which AI agents can use astro-best-practices?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is astro-best-practices safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains astro-best-practices?
It is published by incluud in incluud/astro-agent-skills. It has 533 recorded installs.
More from incluud/astro-agent-skills
create-component
incluud/astro-agent-skills
Open the skill to read its SKILL.md instructions.
docs-lookup
incluud/astro-agent-skills
Open the skill to read its SKILL.md instructions.
content-collection
incluud/astro-agent-skills
Open the skill to read its SKILL.md instructions.
add-integration
incluud/astro-agent-skills
Open the skill to read its SKILL.md instructions.
migrate
incluud/astro-agent-skills
Open the skill to read its SKILL.md instructions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.