01
Entry
theme/index.tsx| Export | Required | Purpose |
|---|---|---|
| Layout | yes | Wraps every page |
| sections | preferred | Array of defineSection contracts |
| stylesheet | no | CSS copied into dist/ |
export { Layout };
export const sections = [hero, features, faq, cta];
export const stylesheet = "styles.css";
02
defineSection
Contract Checklistexport const hero = defineSection({
type: "hero",
description: "Opening band with headline and optional CTA",
guidance: "Use once near the top. Keep heading under ~12 words.",
props: z.object({
heading: z.string().min(1),
subheading: z.string().optional(),
ctaLabel: z.string().optional(),
ctaHref: z.string().optional(),
}),
component: Hero,
example: {
type: "hero",
heading: "Ship the site. Skip the retainer.",
ctaLabel: "See the work",
ctaHref: "/work",
},
});
| Field | Notes |
|---|---|
| type | Stable string — renaming breaks content |
| description | One line for AGENTS.md |
| props | Zod schema excluding type |
| component | React renderer |
| example | Must include matching type |
| guidance | Optional longer owner instructions |
03
Images
Content-Drivenimport { image, imageProps } from "aftercare";
props: z.object({
heading: z.string(),
image: image(),
})
// in component:
<img {...imageProps(image)} />
Content uses /images/team.webp; file lives at public/images/team.webp. Doctor checks local paths and alt text.
04
Sync
Agent Surfacenpx aftercare watch
npx aftercare sync
| Path | Purpose |
|---|---|
| AGENTS.md | Site-owner agent guide |
| agent/catalog.toon | Compact section catalog |
| agent/schemas/*.json | Per-section JSON Schema |
| .cursor/skills/aftercare-* | Cursor skills + scripts |
Do not hand-edit generated agent files. Change contracts, then re-run sync/watch.
Do
- Keep watch running while building the theme
- Export sections via defineSection
- Use image() for content-driven assets
- Run doctor before handoff
Don't
- Rename section types casually
- Hand-edit AGENTS.md or agent/
- Rely on browser-only APIs in SSR components
- Skip sync after contract changes