astro-architecture
4
总安装量
4
周安装量
#52257
全站排名
安装命令
npx skills add https://github.com/soborbo/claudeskills --skill astro-architecture
Agent 安装分布
github-copilot
4
opencode
3
antigravity
3
codex
3
kimi-cli
3
gemini-cli
3
Skill 文档
Astro Architecture Skill
Technical foundation for high-performance, accessible, translation-ready lead gen sites.
Core Rules (Non-Negotiable)
- Astro static or hybrid only â No SPA routing, no client-side frameworks
- TypeScript strict mode â Always enabled, no
any - All text from i18n â No hardcoded strings in components
- Mobile-first CSS â Base styles for mobile,
md:and up for larger - Performance is build-time â No runtime optimization hacks
- One source of truth â All site data in
site.ts - Skill boundaries â Images via
astro-images, SEO viaastro-seo, forms viaastro-forms
Forbidden (STOP)
STOP and reassess if any of these occur:
- â Client-side routing framework (React Router, etc.)
- â UI component library (shadcn, DaisyUI, Chakra)
- â Inline business logic in
<script>tags - â Hardcoded translations in components
- â Images not using
astro-imagesskill - â SEO markup not using
astro-seoskill - â Missing required pages (404, Privacy Policy)
- â
client:loadwithout explicit justification - â External fonts via Google Fonts API (self-host instead)
- â PageSpeed score below 90
Tech Stack
| Layer | Technology |
|---|---|
| Framework | Astro (latest stable) |
| Styling | Tailwind CSS (latest stable) |
| Language | TypeScript (strict) |
| Deploy | Cloudflare Pages |
| Forms | astro-forms skill |
| Calculator | lead-gen-calculator skill |
| Images | astro-images skill |
| SEO | astro-seo skill |
| UX | astro-ux skill |
Performance Targets
| Metric | Target | FAIL if |
|---|---|---|
| PageSpeed (mobile) | ⥠95 | < 90 |
| PageSpeed (desktop) | ⥠95 | < 90 |
| Load time (desktop) | < 0.8s | > 1.5s |
| Load time (mobile) | < 1.4s | > 1.9s |
| LCP | < 1.5s | > 3s |
| CLS | < 0.1 | > 0.25 |
| Total JS | < 50KB | > 100KB |
Browser Compatibility
Must work on:
- Chrome, Firefox, Safari, Edge, Opera, Brave
- iOS Safari (all versions), Android Chrome, Samsung Internet
- Old devices: iOS 12+, Android 7+
FAIL if site breaks on any of these.
File Structure
src/
âââ config/
â âââ site.ts # ALL site data
âââ i18n/
â âââ ui.ts # UI strings
â âââ en.json # English
â âââ [lang].json # Other languages
âââ layouts/
â âââ BaseLayout.astro # HTML shell
â âââ LandingLayout.astro
âââ pages/
â âââ index.astro
â âââ thank-you.astro
â âââ privacy-policy.astro # REQUIRED
â âââ 404.astro # REQUIRED
â âââ 410.astro # REQUIRED
â âââ [lang]/ # Translated pages
â âââ index.astro
âââ components/
â âââ sections/ # From astro-ux
â âââ ui/
â âââ layout/
â â âââ Header.astro
â â âââ Footer.astro # Must have business data
â â âââ MobileMenu.astro
â âââ common/
â âââ LanguageSwitcher.astro
âââ actions/ # From astro-forms
âââ lib/
â âââ i18n.ts # Translation helpers
â âââ gtm.ts # GTM/GA4 helpers
âââ styles/
â âââ global.css
âââ assets/
âââ fonts/ # Self-hosted fonts
âââ images/
Central Config
// src/config/site.ts
export const site = {
name: "Business Name",
phone: "+44 XXX XXX XXXX",
email: "info@example.com",
address: "123 Street, City, Postcode",
colors: {
primary: "#1C202F",
secondary: "#E5F2FF",
accent: "#FF6B35",
},
defaultLocale: 'en',
locales: ['en', 'hu', 'es'] as const,
gtm: {
id: "GTM-XXXXXXX",
cookieYesId: "XXXXXXXX",
},
social: {
google: { rating: 4.9, count: 270 },
},
};
References
Required (Always Read)
- pages.md â 404, 410, Privacy Policy (MUST exist)
- a11y.md â Accessibility requirements
- config.md â Config file templates
Required if Multi-Language
- i18n.md â Translation setup, hreflang
Conditional
Definition of Done
Architecture is complete when ALL are true:
- All pages render without JavaScript enabled
- PageSpeed ⥠90 on both mobile and desktop
- No CLS on page load (test with throttled connection)
- All visible text comes from i18n dictionaries
- Required pages exist: 404, Privacy Policy
- Footer contains business data (name, address, phone, email)
- hreflang tags present if multi-language
- GTM fires correctly (test in GTM Preview)
- Cookie consent blocks tracking until accepted
- Site works on iOS Safari and Android Chrome
- Keyboard navigation works throughout
- Skip link present and functional