GoogleChrome / modern-web-guidance-src

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

Modern Web Guidance (Source) This repo is the source repository for GoogleChrome/modern-web-guidance and includes the code and documentation for authoring, calibrating, and evaluating its contents.

Modern Web Guidance (Source) 是 GoogleChrome/modern-web-guidance 的源代码仓库,其中包含了用于编写、校准和评估其内容的各种代码与文档。

Modern Web Guidance is a set of skills that embed web platform expertise, best practices, and browser compatibility data directly into your coding agents. It helps to steer your coding agents away from legacy patterns, and instead toward solutions that harness the power and capabilities of the modern web platform.

Modern Web Guidance 是一套技能集,旨在将 Web 平台专业知识、最佳实践以及浏览器兼容性数据直接嵌入到您的编码代理中。它有助于引导您的编码代理远离遗留模式,转而采用能够充分利用现代 Web 平台强大功能与特性的解决方案。

See CONTRIBUTING.md and GOVERNANCE.md for how we work on the project and orientation of the codebase. Stewarded by the Google Chrome, Microsoft Edge, Mozilla Firefox, and MDN teams, alongside the web development community.

请参阅 CONTRIBUTING.md 和 GOVERNANCE.md 以了解我们如何开展项目工作以及代码库的定位。该项目由 Google Chrome、Microsoft Edge、Mozilla Firefox 和 MDN 团队以及 Web 开发社区共同管理。

Documentation · Eval Dashboard · Source Code · Report an Issue

文档 · 评估仪表板 · 源代码 · 报告问题

Quickstart: npx modern-web-guidance@latest install. This command runs an interactive wizard to install Modern Web Guidance. See Alternative Installation Methods below.

快速入门:npx modern-web-guidance@latest install。此命令将运行一个交互式向导来安装 Modern Web Guidance。请参阅下方的“替代安装方法”。

Try it out (without installing): # Search for relevant guides: npx modern-web-guidance@latest search “animate a dialog modal backdrop” # Retrieve a guide by ID: npx modern-web-guidance@latest retrieve “animate-to-from-top-layer” # Scan a codebase for legacy patterns to modernize: npx modern-web-guidance@latest legacy-scan .

试用(无需安装):# 搜索相关指南:npx modern-web-guidance@latest search “animate a dialog modal backdrop” # 按 ID 获取指南:npx modern-web-guidance@latest retrieve “animate-to-from-top-layer” # 扫描代码库以查找需要现代化的遗留模式:npx modern-web-guidance@latest legacy-scan .

Why? Coding agents often default to older patterns because LLM training data contains vast amounts of legacy code. This often leads them to generate bloated JavaScript for tasks that now have native, high-performance web platform solutions.

为什么?编码代理通常会默认使用旧模式,因为大语言模型(LLM)的训练数据中包含海量的遗留代码。这往往导致它们为那些现在已有原生、高性能 Web 平台解决方案的任务生成臃肿的 JavaScript 代码。

Even if a model knows an API exists, it often lacks the density of real-world, modern implementation patterns required for production-ready code. Modern Web Guidance bridges this gap.

即使模型知道某个 API 的存在,它通常也缺乏生产级代码所需的、高密度的现代真实实现模式。Modern Web Guidance 弥补了这一差距。

Our skill’s CLI returns targeted, expert-curated guidelines directly into your agent’s context window, focusing on: Modern Browser APIs, Performance & Accessibility, and Responsible Fallbacks.

我们的技能 CLI 会将专家策划的针对性指南直接返回到您代理的上下文窗口中,重点关注:现代浏览器 API、性能与可访问性,以及负责任的降级方案。

What’s Included? We cover the past several years of the web platform’s new features, all the way up to the cutting edge. The guides are designed to be token-efficient; we run evals enabling us to prune lowest-common-denominator content that models already know.

包含哪些内容?我们涵盖了过去几年 Web 平台的新特性,一直到最前沿的技术。这些指南在设计上注重 Token 效率;我们通过运行评估来剔除模型已经掌握的“最小公分母”内容。

Core Disciplines: 🎨 User Experience, 📐 CSS Layout, ⚡ Performance, 📝 Forms & UI, ♿ Accessibility, 🤖 Built-in AI.

核心领域:🎨 用户体验、📐 CSS 布局、⚡ 性能、📝 表单与 UI、♿ 可访问性、🤖 内置 AI。