alpha

Sets development standards for Astro 7 sites: islands architecture, content collections, TypeScript, components and data fetching, for a coding assistant to follow.
description: 'Astro 7 development standards and best practices for content-driven websites'
applyTo: '**/.astro, **/.ts, **/.js, **/.md, **/*.mdx'
Instructions for building high-quality Astro applications following the content-driven, server-first architecture with modern best practices.
[!NOTE]
Examples and APIs in this guide target Astro 7.x.
tsconfig.json:{
"extends": "astro/tsconfigs/base",
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"]
}
.astro/types.d.ts; run astro sync after changing collections or config.astro components for static, server-rendered content<p>)src/content.config.ts with the Content Layer APIglob() for file-based content, file() for a single data filez from astro/zod (not from astro:content) and prefer top-level Zod helpers such as z.email() and z.url()getCollection() and getEntry()import { defineCollection } from 'astro:content';
import { z } from 'astro/zod';
import { glob } from 'astro/loaders';
const blog = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/blog' }),
schema: z.object({
title: z.string(),
pubDate: z.date(),
tags: z.array(z.string()).optional(),
}),
});
export const collections = { blog };
<ClientRouter /> component in your layout <head>astro:transitions: import { ClientRouter } from 'astro:transitions'transition:persist directive to preserve component stateclient:load, client:idle, client:visible).astro components by defaultcompressHTML: 'jsx'); add an explicit {" "} between inline elements when a visible space is requiredserver:defer to render a server island on demand without blocking the rest of the pageslot="fallback"---
import Avatar from '../components/Avatar.astro';
---
<Avatar server:defer>
<div slot="fallback">Loading…</div>
</Avatar>
src/actions/index.ts and prefer them over ad-hoc API routes for mutations and form handlingaccept: 'form' to handle HTML form submissionsastro:actions module and handle the { data, error } result// src/actions/index.ts
import { defineAction } from 'astro:actions';
import { z } from 'astro/zod';
export const server = {
subscribe: defineAction({
accept: 'form',
input: z.object({ email: z.email() }),
handler: async ({ email }) => {
// persist the subscription
return { success: true };
},
}),
};
Astro.session (get, set) instead of overloading cookiessrc/pages/api/ for dynamic functionality<Image /> component for automatic optimization© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com


Chibi character 16 frame dance reference sheet
Creates a square 4x4 sheet of sixteen consecutive dance keyframes of an uploaded character, following numbered choreography steps with identity locked and secondary motion on hair and cloth.
image-prompt, character-sheet, multi-panel, dance, chibi, reference-image, character-consistency, character-design, full-body, white-background, illustration, structured-output, square-format, negative-prompt, gpt-image, for-artists, for-designers, game-assets, long-form, advanced

Running Man Pulled Back by Semi Chibi Double
Makes a bright studio editorial photo of a running person from a reference photo, with a 3D semi-chibi double tugging their clothes back and realistic fabric tension.
image-prompt, gpt-image, reference-image, face-reference, negative-prompt, photorealistic, editorial, chibi, 3d-render, studio-lighting, white-background, fashion, portrait, full-body, motion-blur, whimsical, vertical-format, character-consistency, action-figure, fashion-shoot, pixar-style, soft-lighting, for-photographers, for-artists, humorous

Cornflower meadow path to a misty sailboat
Draws a portrait-format colored-pencil scene of a cornflower meadow with a winding path leading to a misty sea, a distant sailboat and a sunset sky.
image-prompt, illustration, landscape, flowers, ocean, dreamy, pastel, golden-hour, vertical-format, nano-banana, sketch, summer, for-artists, wallpaper, soft-lighting, wide-shot, high-angle
Loading reviews…
Loading comments…