Imported from ehgp/ehgp.github.io (
AGENTS.md). Install upstream withnpx skills add ehgp/ehgp.github.io. Copyright stays with the author.
AGENTS.md
Mission Brief
- Replace the current Python 3.8.16 + Frozen-Flask site (
website.py,templates/,content/,_build/) with a statically exported Next.js 16 + TypeScript + MUI v7 portfolio that retains all existing content and theme cues while adding modern interactions. - Preserve the monochrome+purple visual identity defined in
static/style.css(black #000 backgrounds, white #fff typography, purple accentrgb(211,144,211)/#d390d3, muted gray #333) and the Inter/Roboto Mono typography choices. - Mirror every page and data point from the Markdown/source files (
content/home.md,content/about.md,content/my-work.md) and template fragments (templates/*) inside the new application, expanding them into richer card layouts, animated sections, and responsive behavior. - Maintain deployability to GitHub Pages by producing a full static export (
next build && next export) and retiring the Frozen-Flask freezer-only workflow once the Next.js pipeline is verified.
Current State Snapshot
- Flask app entry (
website.py) renders Markdown viamarkdown2and Jinja templates layered over a singlebase.htmllayout. Deployment relies onfreezer.pyand_build/artifacts promoted togh-pagesthrough.github/workflows/python-lint-analyze-test-build-frozen-flask.yml. - Static assets live under
static/(favicons,wave.gif,sketch.jseyelid animation,resume-pic.webp, manifest) andmedia/. CSS is centralized instatic/style.cssand controls the entire theme. - Content highlights:
- Home: emoji greeting, hero tagline, GitHub stats/streak cards, badge grids (languages, frameworks, tools, platforms), Wakatime embed, and social buttons.
- My Work: Markdown introduction + Google Drive project embed (
1UvN-gFCw8ms_Yo7RnwL3kBEOU8pJAKRE). - About: Profile banner (
me-card.html), summary list fromcontent/about.md. - Contact + Resumes: icon list of socials, mailto obfuscation, Drive-based resume embed (
1yokQ2vI0eXsm9Uc5RfBffDwV5nTR01wz).
- Package metadata already includes Next 16 scripts but lacks an implemented React codebase. Requirements.txt/pyproject still lock onto Flask/Frozen-Flask 0.18.
Target Stack & Guardrails
- Runtime & Tooling: Node.js 20 (or latest LTS), npm (or pnpm) with lockfile committed, TypeScript ≥ 5.6 in strict mode, ESLint 9 +
@typescript-eslint, Prettier, Husky + lint-staged, Jest or Vitest + React Testing Library. - Framework: Next.js 16 App Router (
src/app), React 19, MUI v7 (@mui/material@^7,@emotion/react,@emotion/styled,@mui/icons-material). - Styling & Animations: MUI theme overrides + CSS variables for palette, Framer Motion for declarative transitions, and
prefers-reduced-motionfallbacks. - Content Pipeline: Either Contentlayer, MDX, or strongly typed JSON/TS modules that ingest the existing Markdown while allowing the heavy HTML (badge sections) to live in MDX-friendly components.
- Deployment:
next build+next exporttoout/, publish viapeaceiris/actions-gh-pages@v3(Node job) or migrate to Vercel; keep Frozen-Flask pipeline until static export is validated. - Compliance Requirements:
- Before modifying any tracked file, duplicate it to
filename.BAK(orfilename.YYYYMMDDHHMM.BAK) usingcp file file.BAK. Never skip this backup step. - Preserve color palette, fonts, wording, and Google integrations (Tag Manager
GTM-WFF39GD, AdSenseca-pub-6937005527826464, visitor badge) unless replacements are explicitly approved. - Every new UI addition must stay responsive (≥320px) and ship accessible focus states, alt text, and keyboard navigation.
- Secrets/IDs must come from environment variables (
NEXT_PUBLIC_GTM_ID,NEXT_PUBLIC_ADSENSE_CLIENT) sourced via.env.local, never hard-coded.
- Before modifying any tracked file, duplicate it to
Migration Plan (LLM Execution Steps)
-
Baseline & Backups
- Verify
.BAKcopies exist for any file you intend to rewrite (ex:cp templates/base.html templates/base.html.BAK). - Document current behavior via screenshots or notes so feature parity can be checked later; note third-party embed IDs and social handles.
- Verify
-
Next.js 16 Foundation
- Initialize
src/appwithlayout.tsx,page.tsx(Home), and route segments for/about,/my-work,/contact,/resumes. - Add
tsconfig.jsonwith strict settings, baseUrlsrc, and path aliases (@/components,@/content). - Create
next.config.mjsenabling static export (output: 'export'), remote image allow-list (github-readme-stats.vercel.app,github-readme-streak-stats.herokuapp.com,img.shields.io,wakatime.com,visitor-badge.laobi.icu,drive.google.com), and disableswcMinifyonly if necessary.
- Initialize
-
Design System & Theme
- Build a dedicated
src/theme/palette.tsthat codifies: primary.main = #d390d3,primary.contrastText = #ffffffbackground.default = #000000,background.paper = #0a0a0atext.primary = #f5f5f5,text.secondary = #bdbdbddivider = #333333
- Build a dedicated
- Load Inter + Roboto Mono via
next/font/google, inject through<CssBaseline />, and mirror the card/glow look withPapershadows andboxShadow: '-40px -22px 0 0 rgba(128,0,128,0.35)'. - Encapsulate repeated card shells (title, optional arrow link, body) as a
SectionCardcomponent with variants for hero/about/work/contact/resume. - Wrap the entire layout body with
AppRouterCacheProviderfrom@mui/material-nextjs/v14-appRouterbefore mounting the app’s theme provider so that Emotion caches stay in sync across SSR/CSR and prevent hydration mismatches. - Expose client-only libs (MUI ThemeProvider, animations) inside dedicated client components so server components stay deterministic.
-
Content Migration
- Convert Markdown files into either MDX (
/content/*.mdx) or structured data modules (e.g.,src/content/home.ts) that export typed objects for: hero copy, badge metadata, stats image URLs, embed IDs, contact links, resume/project IDs. - Introduce a
data/socials.tsfile containing Twitter (ehgp93), LinkedIn (/in/ehgp), GitHub (ehgp), and email (obfuscated string). Provide helper utilities to rendermailto:addresses while keeping obfuscation. - Recreate project/resume embeds using responsive wrappers (MUI
AspectRatioor customResponsiveEmbed) withiframeattributesloading="lazy"andreferrerPolicy="no-referrer". - Port
static/sketch.jsinto a lazily-loaded client component (dynamic import ofp5) or replace it with a canvas-based React component that mimics the eye animation. Respectprefers-reduced-motionby pausing animation when necessary.
- Convert Markdown files into either MDX (
-
Experience Enhancements
- Add Framer Motion transitions (fade/slide) for section entry, hero underline blink, and nav hover sweeps; use
reducedMotionhook to disable when needed. - Implement sticky/slide-in nav replicating
ul#navbarstyling, but optimized for mobile (hamburger + Drawer) while keeping the uppercase typography. - Build reusable components for GitHub stats badges and language/framework grids; load data from config arrays to limit HTML duplication.
- Introduce call-to-action buttons (Projects, Contact) with subtle gradients or animated outlines matching the original purple accent.
- The contact page is a social/email link list only. The contact form (and its reCAPTCHA/Formik/
contact-apiplumbing) was removed in July 2026 — do not reintroduce it without explicit approval.
- Add Framer Motion transitions (fade/slide) for section entry, hero underline blink, and nav hover sweeps; use
-
Testing, Accessibility & Performance
- Add unit tests for content mappers and page rendering (React Testing Library). Use Playwright or Cypress smoke tests for nav routing.
- Run
npm run lint,npm run typecheck,npm run test, andnpm run buildbefore every commit. Fix warnings, especially aroundImageremote sources andiframeallowattributes. - Use Lighthouse (desktop & mobile) to confirm ≥95 performance/accessibility. Tune MUI loading (
next/scriptfor GTM/AdSense deferred) to avoid layout shift.
-
CI/CD & Deployment
- Replace the Python workflow with a Node-based pipeline: checkout →
actions/setup-node@v4(Node 20) →npm ci→ lint/typecheck/test/build/export → deployout/viapeaceiris/actions-gh-pages@v3. - Keep the legacy Flask workflow reachable (rename to
python-legacy.yml) until the Next export has been live-tested. Document rollback steps. - Update README to describe the new stack and remove instructions about running
freezer.pyonce migration completes.
- Replace the Python workflow with a Node-based pipeline: checkout →
Implementation Guidelines
- Directory Layout (new):
src/app/(pages)/page.tsx,about/page.tsx, etc. for routes.src/components/for SectionCard, Navbar, Hero, BadgeGrid, ContactList, ResumeEmbed, ProjectEmbed, AnimatedBackground.src/content/orsrc/data/for structured content mirroring Markdown.public/for all assets fromstatic/(favicons,wave.gif, manifest, resume picture) plus newly generatedrobots.txtandsitemap.xmlvia Next route handlers.legacy/flask/(optional) to archivewebsite.py,templates/,content/once the move is complete.
- Theme & Typography: Use MUI's ThemeProvider at the root, expose palette + typography tokens through
Themeaugmentation, and centralize spacing constants (e.g., 8px grid). Keep uppercase headings for section titles. - Animations: Use Framer Motion
motion.divwrappers with spring transitions for hero text, nav underline sweeps, and card hover lifts (scale: 1.02). ProvideprefersReducedMotionchecks and disable heavy animations forprefers-reduced-motionusers. - Responsiveness: Implement CSS Grid/Stack breakpoints at 600px, 900px, 1200px; ensure nav collapses to Drawer under 768px. All embed iframes must be 100% width with 16:9 wrappers.
- External Scripts: Load GTM + AdSense through
next/script,strategy="afterInteractive", mirroring IDs frombase.html. Provide noscript fallback for GTM. - Images & Icons: Configure
next.config.mjsremote patterns for GitHub badge providers and optionally download static badges into/public/badgesif caching is needed. Use@mui/icons-materialfor socials while matching brand colors (#1DA1F2 for Twitter, #4078c0 for GitHub/LinkedIn, #ffa930 for email). - SEO: Recreate canonical URL, og/twitter meta, theme color, favicon links, and Google site verification meta via the App Router
metadataexport. Add JSON-LD (Personschema) describing EHGP's roles. - Content Integrity: Keep wording from Markdown files verbatim unless asked otherwise. Provide toggles (accordion) for the long badge sections similar to the
<details>sections currently used. - Data Privacy: Do not hard-code secrets. If adding third-party integrations that need keys, load them via environment variables and expose only public keys client-side.
Repository Guidelines
- Backups: Every edit must start with
cp <file> <file>.BAK. Include.BAKfiles in.gitignoreonly after confirming the user no longer needs them; until then, keep them tracked so diffs are obvious. - Branching: Use feature branches (
feature/next-migration,chore/update-theme). Never merge directly tomainwithout CI passing. - Commits: Conventional Commits (
feat:,chore:,fix:). Reference issues/TODO items (e.g.,TODO-AGENTS.md) when applicable. - Tooling:
npm run dev→ Next dev server.npm run lint→ ESLint.npm run typecheck→tsc --noEmit.npm run test→ unit/integration tests.npm run build && npm run export→ production bundle toout/.
- Coding Standards: Enforce TypeScript strictness, avoid
any, prefer hooks + server components where static data suffices, and isolate client-only behavior ("use client"). Document complex logic with concise comments. - Documentation: Update README + AGENTS anytime instructions change. Include screenshots/gifs after major visual work. Track open questions inside
TODO-AGENTS.md. - Documentation of dynamic UX: Whenever animations, embed behaviors, or third-party scripts change, record the decision (including fallbacks and accessibility impacts) in AGENTS + README. Supplement with
docs/animation-embed-guidelines.md(animations/embeds/cache),docs/badge-strategy.md(badge hosting rationale), anddocs/observability.md(Lighthouse + screenshot workflow). - Legacy Code: Keep Flask files read-only references until the Next.js site is deployed; after sign-off, move them under
legacy/with notes explaining archival status.
Validation Checklist (Run Before Hand-off)
.BAKexists for each modified file.npm run lint,npm run typecheck,npm run test,npm run test:e2e,npm run build,npm run exportall succeed locally.- Lighthouse ≥95 on both desktop and mobile for Performance, Accessibility, Best Practices, SEO.
- All remote embeds (GitHub stats, Wakatime, Google Drive) render inside responsive containers without console errors.
- Animations respect
prefers-reduced-motionand maintain ≥45fps on mid-tier hardware. - CI workflow green on GitHub Actions, artifact
out/published togh-pages. - README + AGENTS describe the new stack and steps accurately.
.envvalues (NEXT_PUBLIC_GTM_ID,NEXT_PUBLIC_ADSENSE_CLIENT) exist as repository-level Actions secrets or analytics are gracefully disabled with warnings.
Deliverables & Open Items
- ✅ This AGENTS.md directive.
- ✅ Next.js 16 codebase with replicated content, animations, and theming.
- ✅ Updated CI/CD pipeline, README, and environment variable guidance.
- ✅ Documented decision to retain the p5-inspired animation as a React client component with reduced-motion safeguards.
- ✅ Archived Flask assets under
legacy/flask/for rollback.
Follow this document whenever an LLM is instructed to work inside ehgp.github.io. Update the plan (with a fresh .BAK) any time new requirements arrive.