agentleFS
incluudincluud/astro-agent-skills/skills/astro-best-practices/SKILL.md

astro-best-practices

Skill10 starsChanged 7 months agoMITView on GitHub

Apply performant, accessible, and maintainable defaults when building or reviewing Astro projects.

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. About 0 are common, 19 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈19

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill as the baseline when designing, implementing, or reviewing Astro work.

    line 8
  2. Distinctive:

    prefer static generation when request-time rendering is not necessary

    line 12
  3. Distinctive:

    keep client-side JavaScript minimal

    line 13
  4. Distinctive:

    use framework islands only for real interactivity

    line 14
  5. Very specific:

    use .astro components for static and mostly static UI

    line 22
  6. Distinctive:

    keep interactive islands small and leaf-like

    line 24
  7. Distinctive:

    Default away from hydrating broad layout regions.

    line 33
  8. Distinctive:

    Do not invent novel folder structure without a clear project-specific reason.

    line 50
  9. Distinctive:

    use content collections for structured content

    line 54
  10. Distinctive:

    keep data flow obvious and close to the component or page that owns it

    line 57
  11. Very specific:

    use semantic landmarks such as header, nav, main, article, and footer

    line 61
  12. Distinctive:

    ensure keyboard access for all interactive controls

    line 62
  13. Distinctive:

    use appropriate image alt text

    line 65
  14. Distinctive:

    treat color contrast as a non-negotiable baseline

    line 67
  15. Very specific:

    use astro:assets or the project’s chosen image pipeline intentionally

    line 71
  16. Distinctive:

    avoid unnecessary client hydration

    line 73
  17. Distinctive:

    keep CSS and JavaScript scoped to the features that need them

    line 74
  18. Distinctive:

    prefer simple server-rendered markup over client complexity

    line 75
  19. Distinctive:

    default to scoped component styles unless the project has a defined styling system

    line 79
  20. Distinctive:

    use CSS custom properties for reusable tokens

    line 80
  21. Distinctive:

    keep responsive behavior intentional and testable

    line 82
  22. Distinctive:

    Before finalizing Astro work, check:

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 .astro components 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:visible for deferred UI
  • client:idle for lower-priority enhancement
  • client:load for critical immediate interactivity only
  • client:only only 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, and footer
  • 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:assets or 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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.