tokens

tokens is a command for Claude Code from jiushiwon/wg-skills. It costs 0 tokens per session (1,334 once invoked), scanned A, original, Apache-2.0.

A command for managing design tokens, which are named reusable values for things like colors, spacing, fonts, borders, and shadows. It can extract values from a project, add token files, export them in several formats, validate them, and list available palettes and font pairings.

In plain words
What is it for?
It is used to audit existing styles, add a design-token system, export tokens for a chosen technology, validate token files, and review available visual themes.
Why use it?
It helps replace scattered visual values with shared settings and check whether token files are complete. Exporting supports projects that use CSS, Tailwind, SCSS, JavaScript, or JSON.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node scripts/match-profile.mjs current.json > profile.json.

Good fit It is used to audit existing styles, add a design-token system, export tokens for a chosen technology, validate token files, and review available visual themes.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/jiushiwon/wg-skills
agentmods
npx agentmods add commands/jiushiwon/wg-skills/tokens

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tokens

README.md
[![agentmods](https://agentmods.dev/badge/commands/jiushiwon/wg-skills/tokens/github.svg)](https://agentmods.dev/commands/jiushiwon/wg-skills/tokens)
Your own site
<a href="https://agentmods.dev/commands/jiushiwon/wg-skills/tokens"><img src="https://agentmods.dev/badge/commands/jiushiwon/wg-skills/tokens/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tokens

Your own site · 80×15
<a href="https://agentmods.dev/commands/jiushiwon/wg-skills/tokens"><img src="https://agentmods.dev/badge/commands/jiushiwon/wg-skills/tokens.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,334 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01334
Opus 5 $0.00000 $0.00667
Sonnet 5 $0.00000 $0.00267
Haiku 4.5 $0.00000 $0.00133

Measured 13d ago against content hash 9e947af8cd83, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

tokens scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

vibeCoding/frontend/frontend-ui-foundry/references/commands/tokens.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.

tokens — Token 提取 / 注入 / 导出

设计 Token 是 foundry 的核心资产。tokens 子命令管理 Token 的全生命周期。

用法

tokens <action> [args]
Action 说明
extract <path> 从项目代码提取 Token(频次统计)
inject <target> 注入 Token 文件到项目
export <format> 导出为不同格式(CSS / Tailwind / SCSS / JS / JSON)
validate <path> 验证 Token 文件的完整性
list 列出当前可用调色板 + 字体配对

extract — 提取

tokens extract [path]

调用 scripts/extract-tokens.mjs,输出"事实 Token"(用户当前使用的频次统计)。

tokens extract /path/to/project > project-tokens.json

输出示例:

{
  "filesScanned": 87,
  "summary": { "uniqueColors": 47, "uniqueSpacings": 28, ... },
  "colors": [
    ["#c45c48", 23],
    ["#1a1a1a", 18],
    ...
  ],
  "warnings": ["检测到 47 种独立颜色值", "约 35% 间距值不在 4pt 网格上"]
}

inject — 注入

tokens inject [path] [--palette vermilion-amber] [--strategy replace|append]

把 foundry 模板的 Token 注入到目标项目。

步骤

  1. 检测项目(detect-stack.mjs
  2. 选择 Token 模板(templates/tokens.css.tpltokens.tailwind.tpl
  3. 选择调色板(默认 vermilion-amber
  4. 复制到目标位置:
    • HTML+Tailwindassets/css/tokens.css + 替换 tailwind.config
    • React/Nextsrc/styles/tokens.css + tailwind.config.ts
    • Vue/Nuxtassets/css/tokens.css + 引入 nuxt.config.ts
    • uniappstatic/css/tokens.css + App.vue 引入

选项

  • --strategy replace:完全替换现有 Token
  • --strategy append:追加新 Token(保留旧的)

export — 导出

tokens export <format> [--output <file>]
格式 输出
css CSS 变量文件
tailwind tailwind.config.js / .ts
scss SCSS 变量
js JS 主题对象(用于 styled-components / Emotion)
json JSON(用于 Style Dictionary)
swift iOS Swift Constants
kotlin Android Kotlin Constants

示例

# 导出为 Tailwind 配置
tokens export tailwind --output tailwind.config.ts

# 导出为 iOS Swift
tokens export swift --output Theme.swift

# 导出为 Style Dictionary
tokens export json --output tokens.json

validate — 验证

tokens validate <path>

Read the full file on GitHub · 175 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 175 lines · 0 tokens per session scan A 9e947af8cd83

Subscribe to this mod's changes

tokens is a command published in the GitHub repository jiushiwon/wg-skills (100 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,334 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.