Imported from joguel63/portfolio (
AGENTS.md). Install upstream withnpx skills add joguel63/portfolio. Copyright stays with the author.
AGENTS Guide
Project Overview
This repository is a bilingual Astro portfolio site.
- Runtime: Astro static site
- Languages: Spanish (
/) and English (/en/) - Content source: local JSON files under
src/content/ - Validation: Zod schemas + Vitest tests +
astro check
The site is a single home page composed from structured content, not a CMS-backed app.
How The App Is Built
Request flow:
src/pages/index.astroorsrc/pages/en/index.astroloadSiteContent(locale)loads and validates JSON contentmapHomePage(locale, content)builds the page view modelBaseLayout.astroloads global styles, SEO, and shell markupHomeTemplate.astrocomposes the page sections
Key files:
src/pages/index.astro— Spanish home page entrysrc/pages/en/index.astro— English home page entrysrc/layouts/BaseLayout.astro— global layout, metadata, stylesheet importssrc/components/templates/HomeTemplate.astro— top-level section compositionsrc/lib/content/loaders/load-site-content.ts— loads all content JSONsrc/lib/content/mappers/map-home-page.ts— builds the final page modelsrc/lib/content/types/content.ts— canonical content and page model types
Content Architecture
Content is split by concern and locale.
src/content/global/site.json— author, social links, assets, site URLnavigation.json— section ids and localized labels
src/content/pages/home.es.jsonhome.en.json- Copy for hero, about, section headings, contact
src/content/projects/projects.es.jsonprojects.en.json- Project cards and featured project data
src/content/stack/stack.es.jsonstack.en.json- Tech stack cards
src/content/seo/seo.es.jsonseo.en.json
Schema definitions live in src/lib/content/schemas/ and are wired in src/content.config.ts.
When changing content shape:
- Update the schema in
src/lib/content/schemas/ - Update the TypeScript types in
src/lib/content/types/content.ts - Update the JSON content files
- Update mapping logic if needed
- Update tests
Component Structure
Components follow an atomic-ish split:
src/components/atoms/— small reusable primitivessrc/components/molecules/— composed small UI unitssrc/components/organisms/— page sectionssrc/components/templates/— page composition
Important organisms:
Header.astroHeroSection.astroAboutSection.astroStackSection.astroProjectsSection.astroContactSection.astroFooter.astro
Recent pattern example:
src/components/atoms/HeroOrb.astro+src/styles/components/hero-orb.css
If a visual element has independent structure or is likely to evolve, prefer extracting it into its own component rather than growing the section file.
Styling Architecture
Styles are global CSS files imported from BaseLayout.astro.
Import order currently lives in:
src/layouts/BaseLayout.astro
Style layers:
src/styles/tokens/— design tokenssrc/styles/globals/— reset, fonts, base primitivessrc/styles/components/— section/component-specific styles
Important rule: styles are not colocated in Astro components right now. Follow the existing pattern unless there is a strong reason to change it.
When editing visuals:
- Prefer changing the section CSS file first
- Check whether a shared global class is also applied (
panel,media-frame,eyebrow, etc.) - If a global utility causes the issue, override it locally instead of changing global behavior unless the change is intended everywhere
I18n Rules
Locales:
esis default at/enlives at/en/
Core i18n files:
src/lib/i18n/config.tssrc/lib/i18n/locale.tssrc/lib/i18n/navigation.tssrc/lib/i18n/root-locale-redirect.ts
Navigation labels are localized in content, not hardcoded in components.
Testing And Verification
Primary commands:
npm test— full Vitest suitenpm test -- tests/content/map-home-page.test.ts— focused page/content regression testnpm run check— Astro type and diagnostics checknpm run build— production build
Use this verification baseline after non-trivial changes:
- Relevant focused
npm test -- ... npm run checknpm run build
Test directories:
tests/content/— content loading, mapping, and source regression teststests/design-system/— tokens and design-system rulestests/i18n/— locale behavior
tests/content/map-home-page.test.ts is especially important. It acts as a regression suite for page structure and many styling decisions reflected in source/CSS.
Safe Editing Guidelines For Agents
Prefer these rules when working in this repo:
- Make the smallest correct change
- Preserve the existing Astro + global CSS structure
- Do not rewrite content architecture unless needed
- Do not edit generated artifacts unless explicitly asked
- Keep Spanish and English content aligned when changing content semantics
- If a change affects both locale copies, update both
When working on visuals:
- Check
docs/reference/stitch-artifacts/if matching Stitch matters - Compare against existing CSS before inventing new patterns
- Keep section-specific behavior in that section CSS file
When working on content:
- Update source JSON first
- Then update tests expecting the old literal values
Files Agents Usually Should Not Edit
Avoid touching these unless the task explicitly requires it:
.astro/— generated Astro cache/datadist/— build output.playwright-mcp/— generated snapshots and browser artifacts
These may contain stale values and are not the source of truth.
Reference Artifacts
The repo includes local reference files used during visual alignment work:
docs/reference/stitch-artifacts/desktop-home.htmldocs/reference/stitch-artifacts/mobile-home.html
Treat them as comparison references, not as runtime source.
Recommended Workflow For Future Agents
- Read this file
- Inspect the relevant section/component and CSS file
- Check whether the data comes from
src/content/and whether schemas/types are involved - Add or update a focused regression test when behavior changes
- Run focused tests, then
npm run check, thennpm run build - Update both locales when the change is content-facing
Quick Map
- Page assembly:
src/components/templates/HomeTemplate.astro - Global shell:
src/layouts/BaseLayout.astro - Content loading:
src/lib/content/loaders/load-site-content.ts - Page mapping:
src/lib/content/mappers/map-home-page.ts - Source content:
src/content/ - Section styles:
src/styles/components/ - Regression tests:
tests/content/