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 via astro-seo, forms via astro-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-images skill
- ❌ SEO markup not using
astro-seo skill
- ❌ Missing required pages (404, Privacy Policy)
- ❌
client:load without 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 |
> 2.5s |
| LCP |
< 2.5s |
> 4s |
| 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
- gtm.md — Only if GTM/GA4 tracking enabled
- fonts.md — Only if custom fonts used
Definition of Done
Architecture is complete when ALL are true:
1---2name: astro-architecture3description: Technical architecture for Astro lead generation websites. Use when setting up new projects, configuring build tools, or establishing project foundations. For images use astro-images skill. For SEO use astro-seo skill.4---5
6# Astro Architecture Skill
7
8Technical foundation for high-performance, accessible, translation-ready lead gen sites.
9
10## Core Rules (Non-Negotiable)
11
121. **Astro static or hybrid only** — No SPA routing, no client-side frameworks
132. **TypeScript strict mode** — Always enabled, no `any`
143. **All text from i18n** — No hardcoded strings in components
154. **Mobile-first CSS** — Base styles for mobile, `md:` and up for larger
165. **Performance is build-time** — No runtime optimization hacks
176. **One source of truth** — All site data in `site.ts`
187. **Skill boundaries** — Images via `astro-images`, SEO via `astro-seo`, forms via `astro-forms`
19
20## Forbidden (STOP)
21
22STOP and reassess if any of these occur:
23
24- ❌ Client-side routing framework (React Router, etc.)
25- ❌ UI component library (shadcn, DaisyUI, Chakra)
26- ❌ Inline business logic in `<script>` tags
27- ❌ Hardcoded translations in components
28- ❌ Images not using `astro-images` skill
29- ❌ SEO markup not using `astro-seo` skill
30- ❌ Missing required pages (404, Privacy Policy)
31- ❌ `client:load` without explicit justification
32- ❌ External fonts via Google Fonts API (self-host instead)
33- ❌ PageSpeed score below 90
34
35## Tech Stack
36
37| Layer | Technology |
38|-------|------------|
39| Framework | Astro (latest stable) |
40| Styling | Tailwind CSS (latest stable) |
41| Language | TypeScript (strict) |
42| Deploy | Cloudflare Pages |
43| Forms | `astro-forms` skill |
44| Calculator | `lead-gen-calculator` skill |
45| Images | `astro-images` skill |
46| SEO | `astro-seo` skill |
47| UX | `astro-ux` skill |
48
49## Performance Targets
50
51| Metric | Target | FAIL if |
52|--------|--------|---------|
53| PageSpeed (mobile) | ≥ 95 | < 90 |
54| PageSpeed (desktop) | ≥ 95 | < 90 |
55| Load time (desktop) | < 0.8s | > 1.5s |
56| Load time (mobile) | < 1.4s | > 2.5s |
57| LCP | < 2.5s | > 4s |
58| CLS | < 0.1 | > 0.25 |
59| Total JS | < 50KB | > 100KB |
60
61## Browser Compatibility
62
63Must work on:
64- Chrome, Firefox, Safari, Edge, Opera, Brave
65- iOS Safari (all versions), Android Chrome, Samsung Internet
66- **Old devices:** iOS 12+, Android 7+
67
68FAIL if site breaks on any of these.
69
70## File Structure
71
72```
73src/
74├── config/
75│ └── site.ts # ALL site data
76├── i18n/
77│ ├── ui.ts # UI strings
78│ ├── en.json # English
79│ └── [lang].json # Other languages
80├── layouts/
81│ ├── BaseLayout.astro # HTML shell
82│ └── LandingLayout.astro
83├── pages/
84│ ├── index.astro
85│ ├── thank-you.astro
86│ ├── privacy-policy.astro # REQUIRED
87│ ├── 404.astro # REQUIRED
88│ ├── 410.astro # REQUIRED
89│ └── [lang]/ # Translated pages
90│ └── index.astro
91├── components/
92│ ├── sections/ # From astro-ux
93│ ├── ui/
94│ ├── layout/
95│ │ ├── Header.astro
96│ │ ├── Footer.astro # Must have business data
97│ │ └── MobileMenu.astro
98│ └── common/
99│ └── LanguageSwitcher.astro
100├── actions/ # From astro-forms
101├── lib/
102│ ├── i18n.ts # Translation helpers
103│ └── gtm.ts # GTM/GA4 helpers
104├── styles/
105│ └── global.css
106└── assets/
107 ├── fonts/ # Self-hosted fonts
108 └── images/
109```
110
111## Central Config
112
113```typescript
114// src/config/site.ts
115export const site = {
116 name: "Business Name",
117 phone: "+44 XXX XXX XXXX",
118 email: "info@example.com",
119 address: "123 Street, City, Postcode",
120
121 colors: {
122 primary: "#1C202F",
123 secondary: "#E5F2FF",
124 accent: "#FF6B35",
125 },
126
127 defaultLocale: 'en',
128 locales: ['en', 'hu', 'es'] as const,
129
130 gtm: {
131 id: "GTM-XXXXXXX",
132 cookieYesId: "XXXXXXXX",
133 },
134
135 social: {
136 google: { rating: 4.9, count: 270 },
137 },
138};
139```
140
141## References
142
143### Required (Always Read)
144
145- [pages.md](references/pages.md) — 404, 410, Privacy Policy (MUST exist)
146- [a11y.md](references/a11y.md) — Accessibility requirements
147- [config.md](references/config.md) — Config file templates
148
149### Required if Multi-Language
150
151- [i18n.md](references/i18n.md) — Translation setup, hreflang
152
153### Conditional
154
155- [gtm.md](references/gtm.md) — Only if GTM/GA4 tracking enabled
156- [fonts.md](references/fonts.md) — Only if custom fonts used
157
158## Definition of Done
159
160Architecture is complete when ALL are true:
161
162- [ ] All pages render without JavaScript enabled
163- [ ] PageSpeed ≥ 90 on both mobile and desktop
164- [ ] No CLS on page load (test with throttled connection)
165- [ ] All visible text comes from i18n dictionaries
166- [ ] Required pages exist: 404, Privacy Policy
167- [ ] Footer contains business data (name, address, phone, email)
168- [ ] hreflang tags present if multi-language
169- [ ] GTM fires correctly (test in GTM Preview)
170- [ ] Cookie consent blocks tracking until accepted
171- [ ] Site works on iOS Safari and Android Chrome
172- [ ] Keyboard navigation works throughout
173- [ ] Skip link present and functional