jdevalk/specification.website

GitHub: jdevalk/specification.website

将分散的 Web 标准聚合为一套平台无关、每条均有出处的网站规范,覆盖 HTML、SEO、无障碍、安全、性能等十大类别,同时提供 MCP 接口供 AI Agent 调用。

Stars: 655 | Forks: 41

# 网站规范 [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/afb40dcf0b062012.svg)](https://github.com/jdevalk/specification.website/actions/workflows/ci.yml) [![Lint](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/70aea10276062012.svg)](https://github.com/jdevalk/specification.website/actions/workflows/lint.yml) [![Format](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/9990a34dfe062013.svg)](https://github.com/jdevalk/specification.website/actions/workflows/format.yml) [![Links](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/0407c63020062014.svg)](https://github.com/jdevalk/specification.website/actions/workflows/links.yml) [![Security](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/0348651c14062015.svg)](https://github.com/jdevalk/specification.website/actions/workflows/security.yml) [![代码许可:MIT](https://img.shields.io/badge/code-MIT-blue.svg)](LICENSE) [![内容许可:CC BY 4.0](https://img.shields.io/badge/content-CC%20BY%204.0-blue.svg)](https://creativecommons.org/licenses/by/4.0/) [![部署在 Cloudflare Pages](https://img.shields.io/badge/deploy-Cloudflare%20Pages-orange.svg)](https://specification.website) 网站规范 —— 从 `` 到 `/.well-known/security.txt`,从 WCAG 对比度到 `llms.txt`。平台无关,每个页面均提供来源,为人类和 Agent 编写。MIT 许可,开放接受 Pull Request。 **线上网站:** <https://specification.website> **MCP 服务器:** <https://mcp.specification.website/mcp> ## 这是什么 Web 是一层标准的层叠蛋糕:WHATWG 定义 HTML,W3C 批准 WCAG,IETF 发布安全 Header 和 `/.well-known/` URI 背后的 RFC,IANA 注册命名空间,搜索引擎发布自己的规则,浏览器增加怪癖行为。几乎没有人能掌握全貌。 本站将这些切片收集到一个与平台无关的规范中 —— 每个页面都引用了来源。 它 _不是_ 框架。它 _不是_ 教程。它是一份规范,就像 HTML Living Standard 是一份规范一样:包含结果、要求、参考。 ## 这不是什么 - 不是特定平台的。没有“使用这个 Next.js 插件”之类的建议 —— 规范描述的是结果,由你选择实现方式。 - 不是个人观点。在没有确立标准的地方,规范会如实说明。 - 不是营销网站。没有邮件订阅捕获。没有 Cookie。仅有聚合的 Plausible 分析;仅此而已。 ## 分类 - **基础** — HTML、head、文档基础。 - **SEO** — 搜索可见性。 - **无障碍** — 与 WCAG 对齐的规则。 - **安全** — Header、传输、策略。 - **Well-Known URI** — `/.well-known/` 下的约定路径。 - **Agent 准备度** — 让网站对 AI Agent 具备可读性。 - **性能** — Core Web Vitals、缓存、字体。 - **隐私** — 同意、信号、尊重选择。 - **韧性** — 优雅降级。 - **国际化** — 语言、区域设置、文本方向。 ## 开发 要求:Node.js 22.12+,npm。 ``` npm install npm run dev # http://localhost:31337 npm run build # static output in ./dist npm run preview # serve ./dist on port 31337 ``` 开发服务器默认运行在 `31337` 端口(理当如此)。 ## 添加或修改规范页面 1. 在 `src/content/spec/<category>/` 下找到正确的分类。 2. 复制一个现有的 `.md` 文件 —— 例如,`src/content/spec/foundations/title.md`。 3. 填写 Front Matter(参见 [`src/content.config.ts`](src/content.config.ts) 中的 schema)。至少包括:`title`、`summary`、`category`、`status`、`order` 和 `sources`。 4. 编写正文。章节包括:`## What it is`、`## Why it matters`、`## How to implement`、`## Common mistakes`、`## Verification`。 5. 提交一个 PR。 如果 schema 无效,构建将会失败 —— 这是故意的。 所有派生自规范内容的页面都会自动更新:`/spec/`、`/checklist/`、`/llms.txt`、`/llms-full.txt`、`/sitemap-index.xml`、`/rss.xml`、每页的 `.md` 端点、Pagefind 搜索索引,以及 MCP 服务器的捆绑数据。切勿手动编辑这些内容;请编辑源 Markdown 文件。 ## 状态级别 - **必需** — 没有它,Web 平台契约就会失效。 - **推荐** — 现代网站应该做到。 - **可选** — 视上下文而定。 - **避免** — 过时的、有害的或已被明确取代的。 ## 来源 每个页面都至少引用一个来源。本站借鉴了: - [WHATWG HTML Living Standard](https://html.spec.whatwg.org/) - [MDN Web Docs](https://developer.mozilla.org/) - [WCAG 2.2](https://www.w3.org/TR/WCAG22/) 及其理解文档 - 用于协议级项目的 [IETF RFCs](https://www.rfc-editor.org/) - [sitemaps.org](https://www.sitemaps.org/)、[schema.org](https://schema.org/)、[llmstxt.org](https://llmstxt.org/) - [Google Search Central](https://developers.google.com/search)、[web.dev](https://web.dev/) - [Yoast Developer Portal](https://developer.yoast.com/) - [Equalize Digital Accessibility Checker 文档](https://equalizedigital.com/accessibility-checker/documentation/) - [WP Accessibility 知识库](https://wpaccessibility.org/) - [Is It Agent Ready?](https://isitagentready.com/) - [Overlay Fact Sheet](https://overlayfactsheet.com/) ## MCP 服务器 [`mcp/`](mcp/) 中单独的 Cloudflare Worker 将规范暴露给支持 MCP 的 Agent。有关工具、连接配置以及如何部署,请参见 [`mcp/README.md`](mcp/README.md)。 ## 许可证 内容基于 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 许可。代码基于 [MIT](LICENSE) 许可。可随意使用、复刻、发布。 ## 贡献 参见 [CONTRIBUTING.md](CONTRIBUTING.md)。三条规则:引用你的来源、保持平台无关、对状态保持诚实。 ## 安全 参见 [SECURITY.md](SECURITY.md) 或 [/.well-known/security.txt](https://specification.website/.well-known/security.txt)。</div><div><strong>标签:</strong>AI智能体, CC BY 4.0, Cloudflare Pages, HTML, IANA, IETF, llms.txt, LLM优化, MCP Server, MITM代理, MIT开源协议, RFC标准, security.txt, SEO优化, W3C, WCAG, Web架构, Web标准, /.well-known/, WHATWG, 安全响应头, 平台无关, 开发者文档, 搜索引擎优化, 无障碍访问, 程序员工具, 网站规范, 网络安全, 自动化CI/CD, 自动化攻击, 规范化指南, 防御加固, 隐私保护</div></article></div> <!-- 人机验证 --> <script> (function () { var base = (document.querySelector('base') && document.querySelector('base').getAttribute('href')) || ''; var path = base.replace(/\/?$/, '') + '/cap-wasm/cap_wasm.min.js'; window.CAP_CUSTOM_WASM_URL = new URL(path, window.location.href).href; })(); </script> </body> </html>