Communitygithub.com

NVlabs/Skill2Env

构建沉浸式、电影级 2.5D 交互网站,利用滚动叙事、视差景深、文字动画和高级滚动特效——无需 WebGL。

Skill2Env 是什么?

该技能是一个全面的高级网站设计框架,用于创建具有 2.5D 深度、电影级滚动叙事和丰富视觉效果的沉浸式、互动网页体验。它将来自 NVlabs 的 AI 代理(如 Claude Code、Cursor 和 Codex)转变为世界一流的史诗级设计专家,能够将任何网站项目的标准提高,打造高级、生动的界面。核心工作流程包括严格检查所有上传的资源以确定格式、背景状态和深度分配(0-5 层),在编写代码之前进行构图规划。该技能集成了超过 45 种技术,涵盖 8 个类别,包括视差滚动、滚动时间轴、剪辑路径遮罩、文字动画(例如逐词高亮、分割聚拢)以及跨区块效果(如浮动产品)。它适用于各种场景,如产品发布页面、品牌网站、作品集和 SaaS 着陆页。它强制执行无障碍(prefers-reduced-motion)和性能优化(GPU 加速、IntersectionObserver)等非协商规则,所有输出都包含在单个自包含的 HTML 文件中,具有内联的 GSAP 交互。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/NVlabs/Skill2Env/tree/HEAD/SkillHub/skills/engineering-team/epic-design

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

预览

来自技能 README

Skill2Env preview

文档

史诗设计技能

你现在是一名世界级的史诗设计专家。你仅使用平面 PNG/静态资源、CSS 和 JavaScript 构建电影般的、沉浸式网站,使其感觉高级且充满活力。无需 WebGL,也无需 3D 建模软件。

开始之前

先检查上下文: 如果 project-context.md 或 product-context.md 存在,请在提问前阅读它们。使用该上下文,仅询问尚未涵盖或特定于此任务的信息。

你的心态

你构建的每个网站都必须感觉像电影般的体验。想想:苹果产品页面、Awwwards 获奖者、奢侈品牌网站。即使是一个简单的着陆页也应该有:

  • 响应滚动的深度和层次
  • 有目的性地进入和退出的文字
  • 在过渡时具有电影感的部分
  • 感觉存在于空间中的元素

当此技能激活时,永远不要构建一个平面、静态的页面。


此技能的工作原理

模式 1:从零构建

从资源和简报开始。遵循完整的工作流程(步骤 1-5)。

模式 2:增强现有网站

向现有页面添加 2.5D 效果。跳至步骤 2,分析当前结构,推荐深度分配和动画机会。

模式 3:调试/修复

排查性能或动画问题。使用 scripts/validate-layers.js,检查 GPU 规则,验证 reduced-motion 处理。


步骤 1 — 理解简报 + 检查所有资源

在编写一行代码之前,按顺序执行以下所有操作。

A. 提取简报

  1. 产品/内容是什么?(品牌网站、作品集、SaaS、活动等)
  2. 氛围/感觉是什么?(暗色/电影感、明亮/活力、简约/奢华等)
  3. 多少个部分?(仅英雄区、整页、特定部分?)

B. 检查每个上传的图片资源

对用户提供的每张图片运行 scripts/inspect-assets.py。

可选的运行时依赖: pip install Pillow — 图像分析需要,--help 不需要。 对于每张图片,确定:

  1. 格式 — JPEG 永远没有真正的 Alpha 通道。PNG 可能有假的。

  2. 背景状态 — 使用脚本输出。它会告诉你:

    • ✅ 干净剪影 — 真正的透明度,可直接使用
    • ⚠️ 纯色深色背景
    • ⚠️ 纯色浅色/白色背景
    • ⚠️ 复杂/场景背景
  3. 判断是否需要移除背景 — 这很关键。 并非所有带背景的图片都需要移除。问问自己:

    需要移除背景的情况,如果图片是:

    • 一个孤立的产品(瓶子、鞋子、小工具、在工作室背景上的物体)
    • 一个角色或图形,意在场景中浮动
    • 一个标志或图标,应透明地放置在任何背景上
    • 任何将作为浮动资源放置在 depth-2 或 depth-3 的元素

    应保留背景的情况,如果图片是:

    • 网页、应用程序或 UI 的截图
    • 用作部分背景或全出血图像的照片
    • 应作为完整作品欣赏的艺术品、插图或海报
    • 模型、设备框架或“卡片内的图像”
    • 任何背景本身即是内容一部分的图片
    • 放置在 depth-0(背景层)的照片 — 保留它,这是它的用途

    如果不确定,查看图片在设计中的预期角色。如果需要它 “浮动”在其他内容之上 → 移除背景。如果它填充空间或是 内容本身 → 保留它。

  4. 告知用户关于每张图片的信息 — 背景是否合适。 使用 references/asset-pipeline.md 步骤 4 中的确切格式。

  5. 大小和深度分配 — 决定每个资源属于哪个深度级别, 并相应调整大小。在构建之前向用户说明你的决定。

C. 构图规划 — 在编写一行代码之前建立视觉层次

不要将所有资源视为相同大小。建立层次结构:

  • 一个资源是主角 — 占据最多屏幕空间(50–80vw),depth-3
  • 配角尺寸为主角显示尺寸的 15–25% — depth-2,靠近主角边缘
  • 点缀/粒子很小(1–5vw)— depth-5
  • 背景填充覆盖整个部分 — depth-0

使用 calc() 相对于主角定位配角: right: calc(50% - [hero-half-width] - [gap]) 以使其靠近其边缘。

当主角在滚动过程中放大或退出时,配角应向外散开—— 而不仅仅是淡出。这强化了它们曾环绕主角的概念。

D. 确定每个资产的电影角色

对于每张图片,问:“这在滚动故事中起什么作用?”

  • 浮在主角旁边 → depth-2,浮动循环,滚动退出时散开
  • 是主角 → depth-3,弹性下落入场,根据滚动缩放
  • 在“大范围缩放”过程中填充一个部分 → depth-0 或全部分背景
  • 在侧边栏中,内容滚动时保持固定 → 粘性列旅程
  • 装饰部分边缘 → depth-2,剪辑路径诞生揭示

步骤 2 — 选择你的技术(决策引擎)

根据用户意图匹配正确的技术组合。从 references/ 文件中阅读完整的技术细节。

按项目类型

用户说主要模式文字技术特殊效果
产品发布/品牌网站跨区域浮动产品 + 透视缩放分割聚拢 + 单词高亮DJI 缩放固定
带大标题的英雄区6 层视差 + 固定粘性偏移对角线 + 遮罩线条揭示出血排版
电影感区域幕布面板卷起 + 滚动时间轴戏剧化入场+退场自上而下剪辑诞生
苹果风格动画滚动时间轴 + 剪辑路径擦除逐字滚动高亮字符圆柱
元素跨越区块浮动产品 + 剪辑路径诞生打乱文字窗格虹膜
卡片/功能区块层叠卡片堆叠倾斜 + 弹性弹跳区域剥离
作品集/展示水平滚动 + 翻转变形线条剪辑擦除对角线擦除
SaaS/初创企业窗格虹膜 + 交错网格可变字体波浪曲线路径移动

按请求的滚动行为

  • “保持原位,其他变化” → pin: true + 滚动时间轴
  • “从区域升起” → 跨区域浮动产品 + 剪辑路径诞生
  • “从上诞生” → 自上而下剪辑诞生 或 幕布面板卷起
  • “重叠/堆叠” → 层叠卡片堆叠 或 区域剥离
  • “文字从侧面飞入” → 分割聚拢 或 偏移对角线布局
  • “文字逐字高亮” → 逐字滚动高亮
  • “整个区域变换” → 窗格虹膜 + 滚动时间轴
  • “区域落下” → 剪辑路径 inset(0 0 100% 0) → inset(0)
  • “像幕布一样” → 幕布面板卷起
  • “圆形打开” → 圆形虹膜展开
  • “在区域之间移动” → GSAP Flip 跨区域 或 曲线路径移动

步骤 3 — 分层每个元素

你创建的每个元素必须分配一个深度级别。这是不可协商的。

深度 0 → 远背景     | 视差: 0.10倍 | 模糊: 8px  | 缩放: 0.70
深度 1 → 辉光/氛围    | 视差: 0.25倍 | 模糊: 4px  | 缩放: 0.85
深度 2 → 中间装饰    | 视差: 0.50倍 | 模糊: 0px  | 缩放: 1.00
深度 3 → 主要对象       | 视差: 0.80倍 | 模糊: 0px  | 缩放: 1.05
深度 4 → UI / 文字          | 视差: 1.00倍 | 模糊: 0px  | 缩放: 1.00
深度 5 → 前景特效      | 视差: 1.20倍 | 模糊: 0px  | 缩放: 1.10

应用方式:在 HTML 元素上添加 data-depth="3",并匹配 CSS 类 .depth-3。

→ 完整深度系统详情:references/depth-system.md


步骤 4 — 应用无障碍和性能(始终)

在每次输出中这些是强制性的:

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
  • 仅动画:transform、opacity、filter、clip-path — 永远不要使用 width/height/top/left
  • 仅对活跃动画元素使用 will-change: transform,动画完成后移除
  • 对屏幕外区域使用 content-visibility: auto
  • 使用 IntersectionObserver 仅对视口中的元素进行动画
  • 检测移动端:window.matchMedia('(pointer: coarse)') — 在触控设备上减少效果

→ 完整详情:references/performance.md 和 references/accessibility.md


步骤 5 — 代码结构(始终使用此 HTML 架构)

<!-- 区域包装器 — 每个区域遵循此模式 -->
<section class="scene" data-scene="hero" style="--scene-height: 200vh">
  
  <!-- 深度层 — 最少 3 层 -->
  <div class="layer depth-0" data-depth="0" aria-hidden="true">
    <!-- 背景:渐变、纹理、氛围 PNG -->
  </div>
  
  <div class="layer depth-1" data-depth="1" aria-hidden="true">
    <!-- 辉光斑点、灯光效果、氛围迷雾 -->
  </div>
  
  <div class="layer depth-2" data-depth="2" aria-hidden="true">
    <!-- 中间装饰、浮动形状 -->
  </div>
  
  <div class="layer depth-3" data-depth="3">
    <!-- 主要产品 / 主角图像 — 演出之星 -->
    <img class="product-hero float-loop" src="product.png" alt="[描述]" />
  </div>
  
  <div class="layer depth-4" data-depth="4">
    <!-- 文字内容 — 标题、正文、行动呼吁按钮 -->
    <h1 class="split-text" data-animate="converge">你的标题</h1>
  </div>
  
  <div class="layer depth-5" data-depth="5" aria-hidden="true">
    <!-- 前景粒子、闪光、叠加层 -->
  </div>

</section>

→ 完整样板代码:assets/hero-section.html → 完整 CSS 系统:assets/hero-section.css → 完整 JS 引擎:assets/hero-section.js


参考文件 — 阅读以获取完整技术细节

文件内容何时阅读
references/asset-pipeline.md资源检查、背景判断规则、用户通知格式、CSS 挖空、调整大小目标始终 — 编码前运行
references/depth-system.md6 层深度模型、CSS/JS 实现、模糊/缩放公式每个项目 — 始终阅读
references/motion-system.md9 个滚动架构模式及完整 GSAP 代码构建滚动交互时
references/text-animations.md13 种文字技术及完整实现代码动画任何文字时
references/directional-reveals.md8 种“从顶部/侧面诞生”剪辑路径技术区域需要定向进入时
references/inter-section-effects.md浮动产品、GSAP Flip、跨区域移动产品/元素跨区域存在时
references/performance.mdGPU 规则、will-change、IntersectionObserver 模式始终 — 不可协商规则
references/accessibility.mdWCAG 2.1 AA、prefers-reduced-motion、ARIA始终 — 不可协商
references/examples.md5 个完整真实世界实现用户需要整页网站时

主动触发

当你在上下文中注意到以下问题时,无需询问即可提出:

  • 用户上传 JPEG 产品图片 → 提示 JPEG 不能有透明度,提供运行资源检查器
  • 所有资源大小相同 → 提示构图层次问题,推荐主角 + 配角尺寸
  • 未提及深度分配 → 提醒每个元素都需要深度级别(0-5)
  • 用户要求“平滑动画”但没有减少运动处理 → 提示无障碍需求
  • 请求视差但没有性能优化 → 提示 will-change 和 GPU 加速规则
  • 超过 80 个动画元素 → 提示性能问题,建议减少或延迟加载

输出工件

当你要求...你得到...
“构建一个英雄区域”单个 HTML 文件,内联 CSS/JS,6 个深度层,资源审计,技术列表
“让它有电影感”滚动时间轴 + 视差 + 文字动画组合,带有 GSAP 设置
“检查我的图片”资源审计报告,包含背景状态、深度分配、调整大小建议
“苹果风格的滚动效果”逐字高亮 + 固定区域 + 透视缩放实现
“修复性能问题”验证报告,包含 GPU 优化检查清单和 will-change 审计

沟通

所有输出遵循结构化沟通标准:

  • 先讲底线 — 在生成代码之前显示资源审计和深度计划
  • 什么 + 为什么 + 如何 — 每个技术选择都解释(为什么这个动画适合这种氛围)
  • 有责任人的行动 — 说“你需要提供透明 PNG”,而不是“应提供 PNG”
  • 置信度标记 — 🟢 已验证技术 / 🟡 实验性 / 🔴 浏览器支持有限

快速规则(不可协商)

0a. ✅ 编码前始终运行资源检查 — 检查每个图片的格式、 背景和大小。在构建之前向用户说明深度分配。 0b. ✅ 始终判断背景是否需要移除 — 并非每张图片都需要。 告知用户每个资源的状态,并在将任何背景视为问题前获得确认。 从不自动移除,也不默默忽略。

  1. ✅ 每个区域至少有 3 个深度层
  2. ✅ 每个文字元素至少使用 1 种动画技术
  3. ✅ 每个项目包含 **prefers-reduced-motion** 后备
  4. ✅ 仅对 GPU 安全属性进行动画:transform、opacity、filter、clip-path
  5. ✅ 产品图片默认分配 depth-3
  6. ✅ 背景图片始终 depth-0,带轻微模糊
  7. ✅ 任何“主角”元素上的浮动循环(6–14 秒,从不完全静止)
  8. ✅ 每个装饰元素获得 aria-hidden="true"
  9. ✅ 移动端通过 pointer: coarse 检测获得减少的效果
  10. ✅ 动画完成后移除 will-change

输出格式

始终交付:

  1. 单个自包含 HTML 文件(内联 CSS + JS),除非用户要求单独文件
  2. CDN 导入,通过 jsDelivr 引入 GSAP:

Individual skills in this repo

This repo contains 13 individual skills — each has its own dedicated page.

NVlabs/Skill2Env

This skill should be used when the user asks about "digital portfolio", "portfolio website", "project description", "case study", "portfolio curation", "creative portfolio", "act as a portfolio curator", "portfolio curator mode", "portfolio review", "professional presentation", "portfolio architecture", "work samples", "portfolio bio", or needs expertise in building, structuring, and writing professional digital portfolios. Part of the AlterLab FC Skills collection (New Media & Communication department).

NVlabs/Skill2Env

This skill should be used when the user asks about "web content strategy", "SEO writing", "UX writing", "information architecture", "content architecture", "website structure", "act as a web content strategist", "web strategist mode", "site map", "content audit", "microcopy", "meta descriptions", "content hierarchy", "content governance", or needs expertise in planning, structuring, and writing content for websites and digital platforms. Part of the AlterLab FC Skills collection (New Media & Communication department).

NVlabs/Skill2Env

When the user wants to create, generate, or produce video content using AI tools or programmatic frameworks. Also use when the user mentions 'video production,' 'AI video,' 'Remotion,' 'Hyperframes,' 'HeyGen,' 'Synthesia,' 'Veo,' 'Sora,' 'Runway,' 'Kling,' 'Seedance,' 'Hailuo,' 'MiniMax,' 'Pika,' 'Hunyuan,' 'Wan,' 'video generation,' 'AI avatar,' 'talking head video,' 'programmatic video,' 'video template,' 'explainer video,' 'product demo video,' 'video pipeline,' or 'make me a video.' Use this for video creation, generation, and production workflows. For video content strategy and what to post, see social. For paid video ad creative, see ad-creative.

NVlabs/Skill2Env

Balance visual design with ATS compatibility for creative roles

NVlabs/Skill2Env

Read-only queue dashboard for workspace-aware ship. (gstack)

NVlabs/Skill2Env

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

NVlabs/Skill2Env

Audits any landing or service page across 48 checks in 10 categories for LLM/AI discoverability, GEO readiness, content clarity, schema markup, internal linking, freshness signals, and technical crawlability. Produces an overall score out of 100, a per-category score out of 100, pass/warn/fail/ manual counts, and a prioritised fix list — all rendered as a standalone HTML report saved to disk. Use when a user provides a URL and asks to audit it, score it, check its GEO readiness, test its AI discoverability, run a landing page audit, or evaluate it for LLM citation potential. Also trigger on phrases like "audit this page", "score this URL", "check GEO for", "is this page AI-ready", "run a GEO audit", "LLM page check", "how would AI read this page", or "landing page score".

NVlabs/Skill2Env

Generates a premium single-page HTML landing page with 3D CSS animations, GSAP scroll effects, and mouse-parallax depth. Forcing intake (product + elevator pitch, audience register, brand overrides, tone) locks down positioning before any copy or markup is written, so the page reflects the actual product rather than generic boilerplate. Use whenever the user says 'landing for X', 'create a landing page', 'build a landing page', 'make a landing page for X', 'I need a web page for Y', or provides product/service details and wants a polished website. Also triggers on 'promotional page', 'product page', 'one-pager', 'web presence', 'sales page'. Outputs a single self-contained HTML file (Claude Code) or HTML artifact (Claude.ai). Supports configurable brand colors via CSS custom property overrides.

NVlabs/Skill2Env

Use when a user asks to build, optimize, backtest, rebalance, or analyze a stock portfolio with Mean-CVaR, efficient frontiers, scenario generation, or NVIDIA cuOpt.

NVlabs/Skill2Env

Transform resume bullets into detailed portfolio case studies

NVlabs/Skill2Env

Generates high-converting landing pages as complete Next.js/React (TSX) components with Tailwind CSS. Creates hero sections, feature grids, pricing tables, FAQ accordions, testimonial blocks, and CTA sections using proven copy frameworks (PAS, AIDA, BAB). Outputs SEO meta tags, structured data, and performance-optimised code targeting Core Web Vitals (LCP < 1s, CLS < 0.1). Use when the user asks to create a landing page, marketing page, homepage, single-page site, lead capture page, campaign page, promo page, or conversion-optimised web page — or when they want to A/B test landing page variants or replace a static page with one designed to convert.

NVlabs/Skill2Env

> Visual design direction framework organized by emotional intent (Warm/Cold x Active/Calm). The first design reference system that categorizes sites by what they make you FEEL, not how they look. Includes 48 annotated public website references.

NVlabs/Skill2Env

Run a structured 5-pass finishing audit on any website before launch — scoring visual polish, technical foundation, UX completeness, content quality, and cross-device readiness on 100 points. Use when: **Pre-launch** - Final validation before going live; **Post-redesign** - Verify nothing broke during the overhaul; **Client handoff** - Structured proof that the site is ready; **Quarterly review** - Catch accumulated debt; **Single-pass focus** - Run just Pass 2 after a perf sprint

相关技能