AI-native first β agent context (AGENTS.md), Agent Skills under .ai/, and Cursor rules are part of the product, not a README afterthought. You extend the stack with AI, not against it.
All-in-one starter combining Astro, Strapi CMS, TailwindCSS, and shadcn/ui with support for Strapi Astro Loader and Strapi Astro Blocks Field. Details: AI-native support.
- β‘ Astro 6 - Latest version with ultra-fast static sites
- π Strapi CMS - Headless CMS for content management
- π§± Strapi Astro Blocks Field - Modular & flexible content block system
- π Strapi Astro Loader - Automatic content loading from Strapi
- π€ AI-native support -
AGENTS.md, Agent Skills under.ai/, and Cursor rules tailored to Astro x Strapi for Loader & Blocks - π¨ TailwindCSS 4 - Modern utility-first CSS styling
- π§© shadcn/ui - Pre-configured React component library (optional)
- π Dark / Light mode - Toggle with system preference detection
- π Tailwind / shadcn toggle - Live component showcase comparing both approaches
- π€ Inter font - Self-hosted variable font via
@fontsource - π± Responsive Design - Optimized for all devices
- π TypeScript - Full type support
- β¨ Features
- π Quick Start
- ποΈ Project Structure
- π€ AI-native support
- π Lighthouse Score
- π Dark / Light Mode
- π§© UI Components: shadcn/ui vs Pure Tailwind
- π¦ Strapi Astro Packages
- π¨ Available Commands
- π Deploy
- π Useful Links
- π§ Development
- π€ Contributing
- π License
# NPM
npm create astro@latest -- --template VirtusLab-Open-Source/astro-strapi-starter
# Yarn
yarn create astro --template VirtusLab-Open-Source/astro-strapi-starterCreate a .env file in the root directory:
# Strapi Configuration
STRAPI_URL=http://localhost:1337
STRAPI_TOKEN=your_strapi_api_token_herenpm run devOpen http://localhost:4321 in your browser.
/
βββ src/
β βββ components/
β β βββ blocks/ # Strapi block components (Astro + Tailwind)
β β β βββ BlockRenderer.astro
β β β βββ TextBlock.astro
β β β βββ QuoteBlock.astro
β β β βββ MediaBlock.astro
β β β βββ CTABlock.astro
β β β βββ HeroBlock.astro
β β βββ tailwind/ # Pure Tailwind Astro components
β β β βββ Button.astro
β β β βββ Card.astro
β β β βββ CardHeader.astro
β β β βββ CardTitle.astro
β β β βββ CardDescription.astro
β β β βββ CardContent.astro
β β β βββ Badge.astro
β β βββ ui/ # shadcn/ui React components
β β β βββ button.tsx
β β β βββ card.tsx
β β β βββ badge.tsx
β β β βββ separator.tsx
β β βββ showcase/ # Side-by-side component demos
β β β βββ TailwindShowcase.astro
β β β βββ ShadcnShowcase.tsx
β β βββ Toolbar.astro # Sticky header with logo + toggles
β β βββ ThemeToggle.astro # Dark / Light mode switch
β β βββ UIToggle.astro # Tailwind / shadcn switch
β βββ lib/
β β βββ utils.ts # cn() utility for class merging
β βββ pages/
β β βββ index.astro # Homepage
β βββ types/
β β βββ strapi/ # Strapi TS types (`index.ts` re-exports modules)
β βββ content.config.ts # Strapi Loader configuration
β βββ styles/
β β βββ global.css # Theme, fonts, toggle visibility rules
β βββ utils/
β βββ media.ts # Strapi Media utils
βββ components.json # shadcn/ui configuration
βββ package.json
βββ astro.config.mjs
This starter ships first-class agent context for any AI coding tool (Cursor, Claude Code, Copilot, and other SKILL.mdβcompatible clients):
AGENTS.md(root) points to the full guide:.ai/AGENTS.md- Agent Skills (YAML + markdown) under
.ai/:.ai/astro-strapi-starter/SKILL.mdβ end-to-end workflow for this template (the only long-form skill kept here).ai/astro-strapi-loader/SKILL.mdand.ai/astro-strapi-blocks/SKILL.mdβ short stubs with links to the canonical SKILL (and related) files inastro-strapi-loaderandastro-strapi-blocks(no duplicate prose in this repo)
- Cursor project rules in
.cursor/rules/βastro-strapi-loaderandastro-strapi-blocksare thin pointers to the loader and blocks upstream rules;astro-strapi-starterandtailwind-shadcnare defined in this repo
The authoritative manuals for the packages live in those upstream .ai trees. Pin a tag or commit in the raw-GitHub URLs to match your package.json version when you need strict reproducibility.
To use a skill in a tool that only loads from .cursor/skills/, copy or symlink .ai/astro-strapi-starter/ there. For loader and blocks, copy from upstream raw URLs (see the stub files) or fetch them in your tool if it supports URL-based skills.
Nearly perfect scores out of the box β no extra optimization needed.
| Desktop | Mobile |
|---|---|
![]() |
![]() |
The starter includes a theme toggle in the header. It:
- Detects system preference on first visit
- Saves choice to
localStorage - Renders an inline script in
<head>to prevent flash of wrong theme - Toggles the
darkclass on<html>β all semantic tokens adapt automatically
All components use semantic color tokens (text-foreground, bg-card, border-border, etc.) so dark mode works everywhere out of the box.
This starter ships with two parallel component sets β switch between them live using the toggle in the header.
Components in src/components/tailwind/ are .astro files styled with Tailwind utility classes. Zero JavaScript, server-rendered.
---
import Button from "@/components/tailwind/Button.astro";
import Card from "@/components/tailwind/Card.astro";
import CardHeader from "@/components/tailwind/CardHeader.astro";
import CardTitle from "@/components/tailwind/CardTitle.astro";
import CardContent from "@/components/tailwind/CardContent.astro";
---
<Card>
<CardHeader>
<CardTitle>My Card</CardTitle>
</CardHeader>
<CardContent>
<Button variant="outline">Click me</Button>
</CardContent>
</Card>Components in src/components/ui/ are React components built on Radix UI primitives. Accessible, composable, interactive.
---
import { Button } from "@/components/ui/button";
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
---
<Card>
<CardHeader>
<CardTitle>My Card</CardTitle>
</CardHeader>
<CardContent>
<Button client:load variant="outline">Click me</Button>
</CardContent>
</Card>npx shadcn@latest add dialog dropdown-menu tabsIf you prefer pure Tailwind only:
- Delete
src/components/ui/,src/components/showcase/ShadcnShowcase.tsx, andsrc/lib/utils.ts - Delete
components.json - Remove
@astrojs/reactfromastro.config.mjs(if not using React elsewhere) - Uninstall:
npm uninstall @astrojs/react radix-ui class-variance-authority clsx tailwind-merge lucide-react tw-animate-css shadcn
@sensinum/astro-strapi-loaderβ Automatic content loading from Strapi@sensinum/astro-strapi-blocksβ Modular & flexible block rendering
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally |
npm run astro ... |
Run CLI commands like astro add, astro check |
- Connect your repository to Vercel
- Add environment variables in project settings
- Deploy!
- Connect your repository to Netlify
- Set build command:
npm run build - Set publish directory:
dist - Add environment variables
- Astro Documentation
- TailwindCSS Documentation
- shadcn/ui Documentation
- Strapi Documentation
- Sensinum Astro Strapi Loader
- Sensinum Astro Strapi Blocks Field
- Clone the repository
- Install dependencies:
npm install- Run development mode:
npm run dev- Check types:
npx astro checkWe welcome contributions to this project! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please make sure to:
- Follow the existing code style
- Write tests for new features
- Update documentation as needed
- Keep your PR focused and concise
Copyright Β© Sensinum
This project is licensed under the MIT License - see the LICENSE.md file for details.



