Applied Form engine

io.github.Applied-Form由 GitHub 帳號 Applied-Form 發布v3.3.1更新於 Nov 6, 2026

Lint rendered pages against a design system in a real browser, across six widths, with the fix.

概覽

AI 產生的概覽

在真實 Chromium 瀏覽器中依設計系統檢查算繪後的頁面,回傳違規項目與修正建議,並提供權杖、對比度與漂移分析工具。

可以做什麼
  • 對草稿 HTML 或已上線的網址依設計系統規則進行檢查,列出每項違規與其修正方式
  • 自動套用引擎能做的修正,回傳修正後的 HTML 以及已修正、被拒絕與仍失敗項目的報告
  • 查詢規則清單、允許的權杖取值,以及某個具名編排手法的組成配方
  • 量測前景與背景的對比度(WCAG 2 比值、所需下限、APCA 參考值),並由色相與紙色推導整套配色
  • 匯入外部撰寫的設計系統,並量測其他頁面偏離該系統的程度
適用情境
適合在助理撰寫或修改 HTML 後、交付前依既定設計系統做檢核;也適合在接手他人系統時,從並非依該系統建置的頁面了解其配色、間距與字級層級。
執行需求
以 npm 套件 @appliedform/engine 透過 stdio 在本機執行,需要為 Playwright 安裝 Chromium(可用 STANDARDS_CHROMIUM 指定執行檔)。設計系統需從 DTCG 權杖檔案載入,未載入時只檢查通用規則。未宣告任何驗證或 API 金鑰。
安裝前請注意
修正功能會寫出檔案(例如 page.fixed.html),稽核也會產生報告,因此會更動磁碟內容。README 說明此套件已改名:@appliedform/engine 已被 @appliedform/standards 取代,af_* 工具名稱屬於舊版,安裝前請確認版本。檢查與修正工具只量測呼叫端指定的寬度,未指定 320px 時不會檢查該寬度下的橫向溢出。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Applied Form engine,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Standards by Applied Form

A design-system conformance gate measured in a real browser. Give it a DTCG token file and a page; it renders the page in Chromium at four fixed widths and two sampled ones, under reduced motion and in print, and checks every computed value against the system's rules. It reports what the browser drew, not what the stylesheet says.

Standards is open so the evidence about it can be checked. Every comparison it is quoted in can be rerun from this repository: the gate beside axe-core and stylelint, the drift survey of public design systems, and the model study and its judging rounds, with every record they were scored from.

Start

sh
npm install @appliedform/standards && npx playwright install chromiumnpx standards init --pack instrument  # load a system: the free Standards pack, or your pack's tokens.jsonnpx standards lint page.html          # your page, judged by that system's rules, at every width

With no system loaded, standards lint judges a page by the rules that hold for any page (contrast, focus, target size, overflow, alt text, heading order, motion) and says how to load one. For an agent, npx standards mcp-config prints the server block for Claude Code or Cursor.

Use

sh
npx standards lint page.html https://example.com/page      # every rule, every widthnpx standards lint https://example.com/ --register ii      # a page that has not declared a registernpx standards baseline https://example.com/a --out standards-baseline.jsonnpx standards lint https://example.com/a --baseline standards-baseline.jsonnpx standards fix page.html                                # apply the fixes it can make; writes page.fixed.htmlnpx standards audit pages/ --fix                           # every page in a folder, as found and as the fixer would leave it, as one reportnpx standards drift https://example.com/ --out drift.json  # what system a site actually rendersnpx standards rules                                        # every rule, its severity and what it checksnpx standards mcp                                          # the same tools for a model, over MCP

standards fix exits 0 when the fixed page passes every checked rule, 1 when violations remain, and lists what it could not fix by rule and element. standards audit writes one self-contained HTML page (and --json) with the findings by rule and by page, the WCAG criteria the rules touch, what is not checked, and the command that repeats the run. standards lint exits 1 on any error-severity violation not held in the baseline. standards.config.json sets a rule to error, warn or off; standards.config.example.json is a starting point. The exception is a mandatory rule: contrast, text-too-small, target-size, focus-hidden, link-not-underlined, alt-missing, horizontal-overflow and wordmark-live-text, listed under $extensions["form.applied"].levels.mandatory in the token file. A config that sets one of them to warn or off is refused, and standards lint exits 2 (decision 0027 in the Applied Form repository). A system loaded over the token file may raise the thresholds contrast and text-too-small read (floors.body-contrast, display-contrast, large-text-px, large-bold-text-px, text-min-px) and is refused if it lowers one below the token file's own value. A system that declares a pack and states no register.pack is refused too: it judged every page by register alone and then dropped that house rule, so no mandatory rule was measured. So is a system with a register whose background is not a colour. Four gaps are known. On a page whose register the loaded system does not define, with or without a system, a config that lowers register leaves the mandatory rules unmeasured. A system file that declares itself a pack is judged without text-too-small, link-not-underlined and wordmark-live-text. On a page that paints no ground, contrast measures against the ground the system names. The MCP tools standards_lint and standards_fix measure only the widths a caller names, so a call without 320 never measures horizontal-overflow at 320px.

Names that changed

Standards 5.0.0 removed the names the product had before it was called Standards: the af and af-mcp commands, the af_* MCP tools, AF_BRAND and AF_CHROMIUM, af.config.json, af-baseline.json and .af/. They are not read: standards stops with exit status 2 and one line naming the replacement when a variable or file under an old name is in use. standards, the standards_* tools, STANDARDS_SYSTEM, STANDARDS_CHROMIUM, standards.config.json, standards-baseline.json and .standards/ replace them, and the default report file is standards-audit.html. Uninstall @appliedform/engine before installing @appliedform/standards: both ship the af and af-mcp bins, so a global install of one over the other fails with EEXIST. The full list, with what to change, is in docs/migrating-to-5.md.

Documents recorded before the rename, such as the decision records and the evaluation protocol and its results, use the old names, and are not rewritten.

The token file

tokens/applied-form.tokens.json is the Reference system: Standards' structure (registers, voices, spacing, floors and every rule's parameters) with a neutral palette derived by standards brand. It exists so Standards can be tested and published. It is not a design to ship. Point it at your own system by replacing the file, or by importing a Standards pack with standards system import.

Evidence

WhatWhereRerun
The gate beside axe-core and stylelint on planted defectseval/compare.mjs, test/compare.test.mjsnpm run eval:compare
Drift across public design systemseval/drift/npm run drift:batch -- all
Models generating pages with and without the ruleseval/, docs/evaluation-protocol.mdnpm run eval -- --models stub offline, then with keys
A judging round with anchors and attention checkseval/judge-run.mjsnpm run eval:judge

The protocol was written before the runs it governs, and it says what result would count against Standards. These run from a clone of this repository: the npm package carries Standards and nothing that needs a model SDK, axe-core or stylelint.

Develop

sh
npm installnpm run check    # build, unit tests, and the clean fixture linted in a real browser

Tests use node:test. Set STANDARDS_CHROMIUM to a Chromium executable if Playwright has not downloaded one.

Licence

Apache-2.0. See LICENSE and NOTICE. The name Applied Form and its marks are not licensed.

來源:README.md,提交 9be9518

工具

9

af_lint

Measure a page against the design system in a real browser and return every violation with the fix. Pass html for a draft, or url for something already served. This is the loop: draft, lint, apply the fixes, lint again.

輸入參數urlhtmlregisterviewports

af_fix

Apply the fixes the engine can make on its own to a draft, measured in a real browser, and return the fixed HTML with a report: rules fixed, patches applied and refused, and what still fails, by element. No model is called, and a fix that makes any rule worse is not applied. Pass html; what remains needs a change to the markup.

輸入參數html必填registerviewports

af_rules

Every rule the gate enforces: what it requires, why, how to fix it, and which WCAG criteria it touches. Filter by group to keep the answer small.

輸入參數wcaggroup

af_tokens

The values the system permits: colours, spacing scale, type scale, voices, floors, ratios, and what it declares absent. Ask for this instead of guessing a value.

輸入參數group

af_contrast

Measure a foreground against a background: the WCAG 2 ratio, the floor required at that size and weight, whether it passes, and the APCA reading as an advisory.

輸入參數sizePxweightbackground必填foreground必填

af_brand

Derive a complete palette from a hue and a paper colour, measured against every floor, or refuse it with the reasons. Use this instead of inventing a palette.

輸入參數hue必填paper必填

af_move

The recipe for a named compositional move: its cells, layers, voices and ground. One move is active per artefact; ask for the one you need rather than reading all of them.

輸入參數name

af_system

Read a design system authored elsewhere (a Standards pack tokens.json) into this one, reporting what it stated, what had to be derived, and what could not be carried across.

輸入參數pack必填

af_drift

Measure what a design system actually is on pages that were not built to this one, and how far they have drifted from it: the palette, spacing step and type scale in use, plus how many values are indistinguishable duplicates. Use this to learn somebody else's system before working in it, rather than guessing from a screenshot.

輸入參數htmlurlsdeclaredviewports

版本歷史

3
  1. v3.3.1最新Oct 23, 2026
  2. v3.3.0Oct 20, 2026
  3. v3.2.1Oct 15, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分