astro-react-island-strategist
Maintains strict boundaries between Astro server components and React client islands in hybrid Astro/React workspaces. Use when keeping `.astro` files for static HTML/SEO and `.tsx` for interactive islands — embed React only with explicit `client:*` directives and pass serializable props.
- License 许可
- MIT
- 最近更新
- 2026-05-27
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- astro-react-island-strategist
- vendor
- astro
- description
- Maintains strict boundaries between Astro server components and React client islands in hybrid Astro/React workspaces. Use when keeping `.astro` files for static HTML/SEO and `.tsx` for interactive islands — embed React only with explicit `client:*` directives and pass serializable props.
03 SKILL.md 正文
Astro & React Island Strategist
Policy Capsule
- Use
.astrofiles for static HTML generation, routing, and SEO; do not reach for React when Astro suffices. - Use React
.tsxfiles only for genuinely interactive UI islands, not for static rendering. - Embed a React component in Astro only with an explicit
client:*directive (client:load,client:idle,client:visible). - Pick the most restrictive
client:*directive that satisfies the interaction — preferclient:idleorclient:visibleoverclient:loadwhenever possible. - Pass only serializable data as props across the Astro → React island boundary; never pass functions or class instances.
Description: Maintains strict boundaries between Astro server components and React client islands.
Instruction: For the @repo/web workspace:
- Use
.astrofiles strictly for static HTML generation, routing, and SEO. - Use React
.tsxfiles ONLY for highly interactive UI components (islands). - When embedding a React component in an Astro file, you MUST explicitly use
client directives (e.g.,
client:loadorclient:idle). - Only pass serializable data as props from Astro to React.
04 同仓库更多 Skills
no-capsule-skill
Fixture without a Policy Capsule section.
backend-security-patterns
Combined backend protocols for authentication (Clerk JWT verification) and PII-safe observability. Use when handling auth on the server, verifying Clerk webhooks via `svix`, scoping metadata via `publicMetadata`/ `privateMetadata`, or sanitizing logs to keep emails, tokens, and request bodies out of telemetry.
vitest
Writes fast, isolated unit and integration tests with Vitest. Use when each test must run on file-save without shared state — `vi.mock()` for external deps, `vi.spyOn()` for call monitoring, AAA structure, and edge-case coverage for null/undefined/boundary inputs.
playwright
Robust E2E browser testing with Playwright. Use when writing browser-driven tests — leverage auto-waiting (no `waitForTimeout`), prefer user-visible locators (`getByRole`, `getByText`, `getByLabel`) over CSS/XPath, reuse `storageState` for auth, and enable trace-on-first-retry for CI debugging.
playwright-bdd
Wires Gherkin `.feature` files to Playwright via the `playwright-bdd` library. Use when running BDD scenarios on a Playwright runtime — pairs with the `gherkin-authoring` skill (scenario prose) and the `playwright` skill (browser conventions). Drives execution by tag expression with trace-first debugging and Playwright-native sharding.
lighthouse-baseline
Codifies the capture-and-check baseline pattern for long-running quality signals (Lighthouse scores, bundle size, p95 latency, runtime memory). Use when wiring a new metric that needs a baseline file, paired :capture / :check npm scripts, a tolerance-bounded gate, and a weekly refresh cadence — the goal is a hard CI signal that ratchets only with intent.