section-anatomy

Defines how Astro page builder sections choose their root tag, width, and shared layout settings.

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/malikkotb/shellpluscore --skill section-anatomy-malikkotb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: section-anatomy
Source: https://github.com/malikkotb/shellpluscore/tree/main/.agents/skills/section-anatomy
Command: npx skills add https://github.com/malikkotb/shellpluscore --skill section-anatomy-malikkotb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When building or modifying page builder sections in an Astro + Sanity project, developers often make inconsistent decisions about which HTML tag a section renders, how its width is controlled, and where shared layout switches live. This Skill enforces a single set of rules so every section owns its outer shape, renders SectionFrame as its root, and keeps PageSections.astro as a bare registry. ## Core Features & Use Cases - Tag selection rules: Decide between section, div, or figure based on whether the section carries its own heading in the document outline. - Shared layout switches: Add a new editor-facing switch (like Full Bleed) in exactly three places—schema fields, the SECTION_SETTINGS GROQ slice, and the sectionLayout() handler—never per-section. - Registry discipline: Keep PageSections.astro as a pure type-to-component map with no wrappers, tag maps, or conditional logic. - Use Case: You are adding a new testimonials section and need to decide its root tag, wire its width to the Sanity editor's Full Bleed toggle, and register it without polluting the shared registry. ## Quick Start Ask the assistant to apply the section-anatomy rules when creating or modifying a page builder section so it renders SectionFrame with the correct tag and settings.

Frequently Asked Questions about section-anatomy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right HTML tag for an Astro page builder section?

Choose the tag based on the document outline: a section carrying its own heading renders `section`, while a content block introduced by surrounding prose stays generic with `div`, or `figure` for a media block with a caption. The tag decision lives in the section's own file, never in the registry.

How do I add a full bleed or layout switch to all Sanity page builder sections?

Add the field to sectionLayoutFields in create-page-builder.tsx, include it in the SECTION_SETTINGS GROQ slice in section-layout.ts, and handle it in sectionLayout() so SectionFrame applies it. Never add shared switches section by section.

Should PageSections.astro wrap sections or apply conditional logic?

No. PageSections.astro is a bare registry that maps a Sanity _type to a component and passes docId, sectionKey, and isFirst. It holds no tag maps, bleed lists, or wrappers; adding a section means one import and one map entry.

Why does my section lose the page gutter when I add padding classes?

SectionFrame merges caller classes through tailwind-merge, so a conflicting class like p-24 or px-* replaces the frame's px-(--page-gutter) and drops the page margin. Put padded cards in their own box inside the frame instead of padding the frame itself.

When should a page builder section be split into multiple files?

Keep a section as one file by default since it both fetches its GROQ slice and renders. Only split when the section genuinely outgrows one file, and then follow the section-colocation rules for where companion files live.