Component composition
cosmos-digital-services should be shared-component first.
Decision rule
Section titled “Decision rule”- Use
@cosmos/ui-astrowhen behavior or presentation is reusable. - Use app-local components in
src/componentsonly when app-specific and not a good shared fit. - Keep route files in
src/pagesfocused on composition, not large inline logic.
What is currently shared
Section titled “What is currently shared”Most page sections are imported from @cosmos/ui-astro:
- Layout/navigation:
SeoHead,Header,Footer. - Marketing sections:
Hero,CTA,Services,InfoGridSection,ListPanelSection, etc. - Common layout blocks:
CenteredTextHeadAndDescription,TwoColumn,LeftAlignedText.
Theme runtime behavior comes from @cosmos/theme/runtime in Layout.astro.
What is currently local
Section titled “What is currently local”src/components/marketing/ComparisonSection.astrois app-local.- App-specific page logic/scripts and worker integration behavior remain local to this workspace.
When to create a local component
Section titled “When to create a local component”Create app-local when all are true:
- The behavior is tied to this app’s route/content model.
- Reuse outside this app is unlikely.
- Extracting to shared package would add friction without clear value.
Otherwise, prefer extending @cosmos/ui-astro and consuming it here.
Suggested PR notes for component changes
Section titled “Suggested PR notes for component changes”- Why shared vs local was chosen.
- Any new props/contracts added.
- Which routes depend on the change.