Skip to content

webkubor/ui-craft / skills/frontend-e2e

frontend-e2e

Verified

前端页面'完成/对齐 PRD/可移待验证'的浏览器结构化验收——使用当前环境浏览器与可用遥测取证,逐区逐字段逐交互 diff,禁止关键词命中当验证。触发条件: 声称某前端页做完/对齐原型、移待验证前、验收 UI。触发词: 验收、对齐 PRD、移待验证、页面做完了、浏览器验证、E2E、UI 验证。

FileKindSize
SKILL.mdskill md4.7 KB
references/cf-pages-vite-env-debug.mdmarkdown2.5 KB
scripts/page-check.cjsscript933 B

references/cf-pages-vite-env-debug.md

View on GitHub
# Cloudflare Pages + Vite 配置排障参考

由一次项目白屏事故抽象。适用于该供应商与构建工具组合,不是默认托管方案;项目域名、账号、项目标识与历史事故资产留在项目,不进入全局方法。

## 先区分配置在哪个阶段被消费

| 阶段 | 检查什么 | 常见误判 |
|---|---|---|
| 本地构建后上传静态产物 | 构建进程环境、所选 mode、对应 env 文件、产物版本 | 上传平台已有变量就会补进已构建的 JS |
| 平台 Git 构建 | 所选生产/预览环境、分支、构建设置和日志 | 本地 env 文件会自动存在于远端构建 |
| Functions 等服务运行时 | 运行时 binding/secret 与代码读取方式 | 运行时 secret 能自动改变静态前端产物 |

Vite 暴露给客户端的配置会进入可下载产物;只放公开配置,例如 API 基地址或供应商允许公开的客户端标识。服务端密钥、管理 token、service-role 凭据不得使用客户端前缀或打入前端。

## 诊断顺序

1. 复现实际路由,记录部署版本、环境、分支和浏览器异常。HTTP 200 与资源 200 仅证明传输,不能证明初始化成功。
2. 追踪报错配置项在代码中如何读取、在哪一步消费。未配置、mode 不符、命名错误、初始化顺序和 URL 格式分别验证,不凭密钥字符数猜原因。
3. 确认真实构建发生位置。对本地构建,检查本地构建进程;对平台构建,检查相应环境的构建配置。仅记录变量是否存在及校验结果,不打印值。
4. 检查产物是否引用预期的公开 API 基地址,以及 HTML、JS hash、缓存和部署版本是否匹配。不要搜索或输出完整密钥。
5. 按项目发布流程修正后重新构建、部署,再在目标环境打开页面,验证关键路径、console 与请求。记录任何仍未解释的异常。

## 凭据与工具输出

凭据通过项目批准的密钥存储或平台 UI/自动化注入;不放进聊天、截图、临时明文文件或终端输出。若工具脱敏或截断,使用安全注入通道及布尔校验结果,不能编码绕过脱敏。供应商 CLI、绑定模型与部署设置可能变化,操作前查其当前文档和帮助。

参考:[Vite 环境变量](https://vite.dev/guide/env-and-mode)、[Pages 构建配置](https://developers.cloudflare.com/pages/configuration/build-configuration/)、[Pages Functions bindings](https://developers.cloudflare.com/pages/functions/bindings/)。
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance 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.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall