跳到正文
cccskills
免费在 GitHub 公开

handoff-text-spacing-extractor

Handoff text-spacing extractor SKILL — 從 canonical HTML/JSX/TSX inline style 盡量抽出字間距與空間細節(letterSpacing, gap, padding, margin, fontSize, lineHeight 等),並回補到 Design System/design_handoff/source/ui-design-tokens.json 的 handoffTextSpacingExtracted 區段。

USE FOR: UI 對齊前先把參考圖 / handoff source 的 spacing recipe 轉成可重用 token;DO NOT USE FOR: 只有 runtime 截圖、沒有 source 設定,或純 CSS module / computed style 無法直接讀取的場景。

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md3.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Handoff Text Spacing Extractor

把 handoff source 裡的細粒度字距與版面間距,整理成可重用的 design token 與 component recipe。

Unity 對照:相當於先把 Prefab / UI 參考圖中的字級、字距、欄距、行距、內距整理成一份可重跑的 style recipe,而不是每次都靠手工比對。

何時使用

  • 你要從 canonical handoff source 抽出 letterSpacing / gap / padding / margin / fontSize / lineHeight
  • 你已經有 UI reference 或 JSX/HTML handoff source,想回補到 ui-design-tokens.json
  • 你希望下次做相同 UI 時直接重用 token,而不是重新目測

適用來源

優先使用能看到真實 spacing 的 canonical source:

  • React / JSX / TSX 中的 inline style object,例如 style: { ... } 或 style={{ ... }}
  • HTML inline style,例如 style="..."
  • 單一檔或整個資料夾都可;若傳資料夾,工具會遞迴掃描支援副檔名

不要這樣用

  • 不要只拿 runtime screenshot 當唯一來源,因為看不到原始 spacing recipe
  • 不要拿純 CSS module / className 直接當真相,除非你已先把 computed style 解析成可見值
  • 不要把這一步當成最後美術評審;它只負責抽取與回填 token

標準流程

  1. 找到 canonical handoff source,優先選有 inline style 的 HTML/JSX/TSX 檔
  2. 執行:
npm run tokens:backfill-handoff-text-spacing -- --source <file-or-folder>
  1. 如需換 token 檔或 section,可加參數:
npm run tokens:backfill-handoff-text-spacing -- --source <file-or-folder> --tokens "Design System/design_handoff/source/ui-design-tokens.json" --section handoffTextSpacingExtracted
  1. 檢查輸出 token 區段是否包含:
  • typography
  • spacing
  • componentRecipes
  • sourceSummaries
  1. 若回填後要動 UI layout / skin,先用 token 的全域尺度,再回 canonical source 的 component recipe 補局部 spacing

輸出原則

  • 先抽出可重用的全域 token,再補 component-specific recipe
  • 對齊時優先相信 canonical source 的實際數值,不要只靠肉眼
  • 每次跑完都要看 handoffTextSpacingExtracted 是否有更新來源與樣本

已知限制

  • 目前最適合抽 inline style;如果 source 完全沒有 inline style,只靠 class 名稱,工具不會自動算出 computed style
  • 若同一畫面有多個來源檔,請把它們都放進同一個 folder 或以逗號分隔的 source list
  • 這個 skill 的目標是建立可重跑的 token recipe,不是替代最終的 visual QA

與其他 skills 的銜接

  • 需要先從參考圖建立結構化 view:ui-reference-decompose
  • 需要把結構分派成 family:ui-family-architect
  • 需要把落地版面驗證到 runtime:ui-runtime-verify

完成標準

  • 你已經能用同一條命令重跑抽取
  • 新的 spacing recipe 被回補到 ui-design-tokens.json
  • 下一次做相同 UI 時,先查 token,不再從零猜 spacing

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Deterministic external-evidence web validation workflow for Sanguo ETL/RAG. USE FOR: 外部證據網站檢查、來源健康度、allowlist 驗證、來源 seed 覆蓋、3kweb-check、external evidence source health、fetch/parse/hash first、LLM reviewer second。

中文简介正在准备中。当前显示原文说明。

eaglhuang/3klife32026年10月23日 更新

Use when the user asks to switch AI role/mode/persona or uses role-trigger words such as Captain, Coordinator, 寫文章, 寫文章模式, 文章模式, 技術文章, 部落格, 出版, 預覽. Routes the request to Project Captain, Publishing Director, or Article Writing Mode, loads the matching keep memory when available, and applies the role's workflow without excessive roleplay.

中文简介正在准备中。当前显示原文说明。

eaglhuang/3klife32026年10月23日 更新

Write or revise AI-learning-notes article pages in "寫文章模式" when the user asks for articles, technical articles, blog posts, bilingual versions, article formatting consistency, shared article-base alignment, responsive layout, summary/TOC decisions, contrast, or publishing-flow compatibility.

中文简介正在准备中。当前显示原文说明。

eaglhuang/3klife32026年10月23日 更新

Plan ATM framework refactors by preserving atom/map semantics before splitting large governance modules.

中文简介正在准备中。当前显示原文说明。

eaglhuang/3klife32026年10月23日 更新

Captain 派工規範與決策手冊。當 AI 進入隊長模式或進行派工/派任務語境時,遵照這套標準,產出可供人類直接轉貼、高度結構化、符合 token 經濟且能動態適應可用 Roster 的派工單。

中文简介正在准备中。当前显示原文说明。

eaglhuang/3klife32026年10月23日 更新

Create and register an atom through the provisioning facade.

中文简介正在准备中。当前显示原文说明。

eaglhuang/3klife32026年10月23日 更新

查看 eaglhuang 的全部技能

报告此技能的问题