arayaroma/ether/astro-separation-of-concerns
- community
Checking that the SKILL.md file is still in the repository.
Use when creating or editing any .astro component — enforces splitting markup, styles, script, and types into separate files instead of one large inline .astro file. Triggers on "componente astro", "separa responsabilidades", "buenas practicas astro", or any non-trivial .astro file (interactive component, >~80 lines, has both <style> and <script>).
Install
npx vskill@latest install arayaroma/ether/astro-separation-of-concernsSKILL.md
Astro: Separation of Concerns
A .astro file with a big inline <style> block and a big inline <script> block becomes unmaintainable fast — nobody wants to scroll 400 lines to find one selector or one event handler. Split it like any other component.
Structure per component
For a component Foo, use a folder, not a single file:
Rules
- Foo.astro holds markup only. Frontmatter (
---) is for props typing, data shaping, and template logic (.map(), conditionals) — not for styling or DOM event wiring. - Styles go in Foo.css, imported at the top of the frontmatter (
import './Foo.css'). Since external CSS imports are NOT auto-scoped by Astro (only inline<style>is), wrap the component's root markup in one class (e.g..foo) and prefix every selector in the CSS file under it, so nothing leaks globally. - Script goes in foo.client.ts, referenced via `<script src="./foo.client.ts"></script>` at the bottom of the template — not inlined. Type DOM lookups properly (
as HTMLElement, etc.) since it runs through Astro's TS pipeline. - Shared types (props shape, data shape consumed from content collections) go in
types.tsand get imported by both the.astrofrontmatter and content schema /.client.tswhere relevant — don't redeclare the same interface twice. - Data stays out of the script file. If the client script needs page data (e.g. a lookup table), pass it via a
<script type="application/json">tag populated from the frontmatter and parsed infoo.client.ts— don't hardcode content into the script. - Keep the same rule for any nested pieces: if a sub-part (e.g. a modal) grows past ~40 lines of markup, it can become its own
.astrofile imported by the parent, still following the same split.
Apply this from the start when scaffolding a new component — don't write everything inline "for now" and plan to refactor later.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/astro-separation-of-concerns/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/arayaroma/ether/astro-separation-of-concerns)