AgentSkillsCN

portfolio-guide

SergioMarquez.dev 作品集网站的架构与规范指南。 当出现以下关键词时启用:「architecture」、「arquitectura」、「structure」、「estructura」、「conventions」、「convenciones」、「how does」、「como funciona」、「where is」、「donde esta」、「data flow」、「flujo de datos」、「cv.json」、「add section」、「nueva seccion」、「deployment」、「despliegue」、「testing」、「design system」、「sistema de diseno」、「new component」、「nuevo componente」、「update content」、「actualizar contenido」。 适用场景:理解架构、查找文件、遵循规范、更新内容。USAR PARA:理解架构、寻找文件、遵守约定、更新内容。

SKILL.md
--- frontmatter
name: portfolio-guide
description: >
  Architecture and conventions guide for the sergiomarquez.dev portfolio site.

  ACTIVATE when: "architecture", "arquitectura", "structure", "estructura",
  "conventions", "convenciones", "how does", "como funciona", "where is", "donde esta",
  "data flow", "flujo de datos", "cv.json", "add section", "nueva seccion",
  "deployment", "despliegue", "testing", "design system", "sistema de diseno",
  "new component", "nuevo componente", "update content", "actualizar contenido".

  USE FOR: understanding architecture, finding files, following conventions, updating content.
  USAR PARA: entender arquitectura, encontrar archivos, seguir convenciones, actualizar contenido.

sergiomarquez.dev Portfolio Guide

Single-page portfolio site. All content driven by public/cv.json.

Content Updates

To update portfolio content, edit public/cv.json:

SectionJSON PathComponent
Bio/summarybasics.summaryAbout.astro
Job titlebasics.labelSidebarLeft.astro
Work historyexperience[]Experience.astro
Projectsprojects[]Projects.astro
Certificationscertifications[]Certifications.astro
Social linksbasics.profiles[]SocialLinks.astro

No code changes needed for content updates -- just edit the JSON.

Adding a New Section

  1. Add data to public/cv.json under a new key
  2. Update CvData type in src/data/cv.ts
  3. Create component: src/components/NewSection.astro
  4. Add to src/pages/index.astro with <section id="new-section">
  5. Add nav link in src/components/layout/Navigation.astro
  6. Add test in src/data/__tests__/cv.test.ts

Adding a Social Redirect

Create src/pages/platform-name/index.astro:

astro
---
import { cv } from '@/data/cv';
const url = cv.basics.profiles.find(p => p.network === 'PlatformName')?.url;
return Astro.redirect(url ?? 'https://sergiomarquez.dev');
---

Layout Structure

code
┌──────────────────────────────────────────────┐
│                  Spotlight                     │
├──────────┬───────────────────────┬────────────┤
│ Sidebar  │    Main Content       │  Sidebar   │
│ Left     │                       │  Right     │
│ (sticky) │  ┌─ About ──────┐    │  (email)   │
│          │  ├─ Experience ──┤    │            │
│ Name     │  ├─ Projects ───┤    │            │
│ Title    │  └─ Certs ──────┘    │            │
│ Nav      │                       │            │
│ Social   │                       │            │
├──────────┴───────────────────────┴────────────┤
│              (mobile: single column)           │
└──────────────────────────────────────────────┘

Desktop: three-column (sidebar sticky at lg: breakpoint). Mobile: single column with mobile header.

File Conventions

TypeLocationNaming
Section componentssrc/components/PascalCase.astro
Layout componentssrc/components/layout/PascalCase.astro
Icon componentssrc/components/icons/PascalCaseIcon.astro
Data loaderssrc/data/kebab-case.ts
Testssrc/data/__tests__/module-name.test.ts
Pagessrc/pages/kebab-case or index.astro
Stylessrc/styles/kebab-case.css

Design Tokens

TokenValueUsage
--background#0a192fPage background (navy)
--primary-text#ccd6f6Headings, primary text
--secondary-text#8892b0Body text, descriptions
--accent#64ffdaLinks, highlights, hover
--accent-mutedrgba(100,255,218,0.1)Subtle backgrounds
--navy-light#112240Card backgrounds
--navy-lighter#233554Borders, hover states

Font: Geist Variable (non.geist package).

Testing

  • Runner: Vitest (globals mode)
  • Tests: src/data/__tests__/cv.test.ts, github.test.ts
  • Focus: Data loader validation (structure, required fields)
  • Command: bun run test

CI/CD Pipeline

code
Push/PR to main → GitHub Actions (ci.yml)
  ├── bun install
  ├── type-check (astro check)
  ├── lint (biome check)
  ├── test (vitest)
  └── build (astro build)

Push to main → Cloudflare Pages (automatic)
  ├── npm ci (uses package-lock.json)
  └── npm run build → dist/

Pre-commit: Husky runs lint-staged → Biome check on src/**/*.

Key Gotchas

  1. Content = JSON only: All portfolio content lives in public/cv.json. Never hardcode content in components.
  2. Dual lockfile: bun.lock + package-lock.json must stay in sync.
  3. Path alias: Use @/ imports (e.g., import { cv } from '@/data/cv').
  4. Biome LF: Enforces LF endings. Windows users may see phantom diffs.
  5. Redirect pages: astro check false positives on unused imports -- ignore.
  6. Lighthouse target: 95+ performance, 100 SEO. Test before merging visual changes.