Token导航 LogoToken导航

Agent Skill · 研究检索

token-usage(代币使用)

token-usage 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

token-usage 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 46,976。

总安装 753周安装 32GitHub Stars 公开资料未说明下载 264核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:token-usage(代币使用)
来源仓库:https://github.com/iress/design-system
仓库路径:skills/token-usage
安装命令:
npx skills add https://github.com/iress/design-system --skill token-usage
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/iress/design-system --skill token-usage

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于分析与检索代币使用模式的相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中基于场景筛选有效用例。通过 GitHub 仓库安装,建议查看原始文档了解输入输出规范。使用前需评估数据源可靠性,避免引用过时或未经验证的统计。输出结果为信息摘要,不可直接用于产品设计或策略制定。

来源仓库内路径:skills/token-usage

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/iress/design-system --skill token-usage;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

token-usage 怎么安装?

在终端执行 npx skills add https://github.com/iress/design-system --skill token-usage。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

token-usage 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

token-usage 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

token-usage 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

token-usage 用的人多吗?

公开数据是累计安装 753 次,近一周安装 32 次,下载 264 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

token-usage 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
token-usage

代币使用 · 本页

753—接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Skill: IDS Token Usage

Purpose

Guide AI agents on correctly using IDS design tokens in React components and CSS. This skill covers import patterns, common mistakes, and practical usage rules for each token category.

When to Use

  • Generating React components that need colours, spacing, typography, or border-radius values
  • Writing custom CSS or inline styles for IDS-based applications
  • Reviewing or fixing design token usage in existing code
  • Choosing between component props, CSS variables, and the cssVars JS object
  • Answering questions about available token values and naming conventions

Workflow

  1. Check if a component prop handles it — Most IDS components accept IressCSSProps (e.g. p, m, gap, bg, color, textStyle). Use props before reaching for tokens directly.
  2. Identify the token category — Is it colour, spacing, typography, or radius?
  3. Choose the right import — Use cssVars for inline styles, CSS variables for stylesheets. See the import patterns below.
  4. Look up the value — See references/token-reference.md for the full list of available tokens if you need to find a specific value.

Quick Start

Installation

Important: IDS v6 is currently in beta. Install with the @beta tag: ``bash npm install @iress-oss/ids-tokens@beta # If also using IDS React components: npm install @iress-oss/ids-components@beta ``

Prerequisites (React only)

If you are using IDS React components, wrap your application in IressProvider and import the CSS variables stylesheet:

Note: IressProvider already includes IressModalProvider, IressSlideoutProvider, IressToasterProvider, and IressIconProvider — you do not need to add these separately. If using IressShadow, no additional providers are needed as it includes IressProvider internally.
import '@iress-oss/ids-tokens/build/css-vars.css';
import { IressProvider } from '@iress-oss/ids-components';

function App() {
  return <IressProvider>{/* your UI */}</IressProvider>;
}
Non-React usage: The tokens package works without React. Import the CSS stylesheet or use cssVars / designTokens directly in any JavaScript or CSS environment.
CSP note: IressProvider loads fonts from fonts.googleapis.com and fonts.gstatic.com at runtime. If your app enforces a Content Security Policy, allowlist these origins in style-src and font-src. If you use IressShadow and your CSP blocks inline styles, add <meta name="csp-nonce" content="..."> for nonce support. See the CSP Guide at node_modules/@iress-oss/ids-components/.ai/guides/get-started-content-security-policy.md for details (requires @iress-oss/ids-components to be installed).

CSS Variables Stylesheet (Recommended for CSS)

The CSS stylesheet is the simplest way to use tokens. Import it once and use var() references anywhere in your CSS.

Important: Use the variable names defined in @iress-oss/ids-tokens/build/css-vars.css (e.g. --colour-neutral-10). Do not reference --iress-* variables directly — those are set by theme files and are not part of the public token API.
/* Import the stylesheet once in your app root */
@import '@iress-oss/ids-tokens/build/css-vars.css';

/* Use variables anywhere in your CSS */
.card {
  background: var(--colour-neutral-10);
  padding: var(--spacing-4);
  border-radius: var(--radius-3);
  color: var(--colour-neutral-90);
}

cssVars Object (Recommended for CSS-in-JS)

For inline styles and CSS-in-JS, use the cssVars export. It mirrors the token structure but returns var() strings with embedded fallbacks — fully type-safe.

import { cssVars } from '@iress-oss/ids-tokens';

// Each leaf is a var() string with a fallback value
cssVars.colour.primary.fill; // 'var(--iress-colour-primary-fill, #003271)'
cssVars.spacing[4]; // 'var(--iress-spacing-4, calc(4 * var(--iress-spacing-100, .25rem)))'
cssVars.radius[1]; // 'var(--iress-radius-1, 0.25rem)'
cssVars.typography.heading[1]; // 'var(--iress-typography-heading-1, 500 calc(...) / 1.33 Ubuntu, ...)'

// Use in inline styles
<div
  style={{
    background: cssVars.colour.neutral[20],
    padding: cssVars.spacing[4],
  }}
>
  Themed content
</div>;

JavaScript Schema (For Metadata / Tooling)

Use the raw designTokens schema only when you need to inspect token metadata (descriptions, types, extensions) or iterate programmatically. For styling, use cssVars or CSS variables instead.

import { designTokens } from '@iress-oss/ids-tokens';

// Each token is an IressDesignToken object with $value, $type, $description, etc.
designTokens.colour.primary.fill.$value; // '#003271'
designTokens.spacing[4].$value; // 'calc(4 * {spacing.100 || .25rem})'
designTokens.radius[1].$value; // '0.25rem'
designTokens.typography.heading[1].$value; // { fontFamily, fontSize, fontWeight, lineHeight }

Import Patterns

For CSS Styling

/* In your app entry point */
@import '@iress-oss/ids-tokens/build/css-vars.css';

Once imported, all public token variables (e.g. --colour-*, --spacing-*, --radius-*, --typography-*) are available globally.

For CSS-in-JS / Inline Styles

import { cssVars } from '@iress-oss/ids-tokens';

// Type-safe var() references with fallbacks — use anywhere you need a style value
cssVars.colour.neutral[10]; // 'var(--iress-colour-neutral-10, #FFFFFF)'
cssVars.spacing[4]; // 'var(--iress-spacing-4, ...)'

For Token Metadata / Tooling

import { designTokens } from '@iress-oss/ids-tokens';

// Access raw token objects for metadata inspection
const { colour, spacing, radius, typography } = designTokens;

Internal Helpers (Theme Editors Only)

Note: These helpers are intended for internal tooling such as theme editors (e.g. Styler). Consumers should use cssVars or CSS variables instead.
// Convert token schema to a nested object of CSS variable references
import { mapTokensToCssVariables } from '@iress-oss/ids-tokens/mapTokensToCssVariables';

// Resolve `{colour.neutral.10}` token references to CSS vars
import { convertReferencesToVariables } from '@iress-oss/ids-tokens/convertReferencesToVariables';

Usage Rules by Category

Colour

Always use colour tokens for colours — never hardcode hex, rgb, or hsl values.

Use CaseTokenExample
Page backgroundcolour.neutral.10bg="colour.neutral.10"
Subtle backgroundcolour.neutral.20bg="colour.neutral.20"
Default textcolour.neutral.90color="colour.neutral.90"
Secondary textcolour.neutral.80color="colour.neutral.80"
Borderscolour.neutral.30*Use component props*
Primary actioncolour.primary.fill*Use Button mode="primary"*
Success indicatorcolour.system.success.fill*Use Alert/Tag status*
Danger/Errorcolour.system.danger.fill*Use Alert/Tag status*
// ✅ Correct
<IressText color="colour.neutral.80">Subtitle</IressText>
<IressStack bg="colour.neutral.20" p="spacing.4">...</IressStack>

// ❌ Wrong — hardcoded colours
<div style={{ color: '#384666' }}>Subtitle</div>
<div style={{ background: '#F5F6F8' }}>...</div>

Spacing

Use spacing tokens for all spacing — gaps, padding, margins.

Base unit: 4px (0.25rem). Token value = multiple of base unit.

TokenAliasValueUse For
0none0No space
1xs4pxTight inline spacing
2sm8pxDefault element spacing
3—12pxCompact section spacing
4md16pxStandard section spacing
5—20pxMedium section spacing
6lg24pxSection separation
7—28pxLarge section spacing
8—32pxLarge group spacing
10xl40pxPage-level spacing
// ✅ Correct — use full token path
<IressStack gap="spacing.4" p="spacing.6">...</IressStack>
<IressInline gap="spacing.2">...</IressInline>

// ✅ Also correct — use token aliases
<IressStack gap="md" p="lg">...</IressStack>
<IressInline gap="sm">...</IressInline>

// ❌ Wrong — arbitrary values
<div style={{ gap: '15px', padding: '25px' }}>...</div>
Note: There is no spacing[9] token. Valid spacing values: spacing.0 through spacing.10 (excluding 9), or aliases: none, xs, sm, md, lg, xl. Positive vs negative spacing: Padding props (p, px, py, pb, pl, pr, pt) only accept positive spacing tokens. Margin props (m, mx, my, mb, ml, mr, mt) also accept negative values (e.g., -spacing.2, -sm) for overlapping elements.

Border Radius

Use radius tokens for all rounded corners.

TokenValueSemantic Use
radius.00Square/sharp corners
radius.14pxButtons, form inputs, tags
radius.28pxGeneral purpose
radius.312pxCards, panels, layout containers
radius.416pxPills, badges
// ✅ Correct — IDS components already have correct radius
<IressButton>Submit</IressButton>  // radius.1 built in
<IressCard>...</IressCard>         // radius.3 built in

// Manual radius only when building custom layout
<IressStack borderRadius="radius.3">Custom panel</IressStack>

Typography

Use IressText for all text rendering instead of raw headings or paragraphs.

ElementtextStyle valueFontSizeWeight
h1typography.heading.1Ubuntu1.5rem (24px)500
h2typography.heading.2Ubuntu1.25rem (20px)500
h3typography.heading.3Ubuntu1.125rem (18px)500
h4typography.heading.4Ubuntu1rem (16px)500
h5typography.heading.5Ubuntu1rem (16px)400
body (default)typography.body.mdInter0.875rem (14px)400
body strongtypography.body.md.strongInter0.875rem (14px)600
small texttypography.body.smInter0.75rem (12px)400
small strongtypography.body.sm.strongInter0.75rem (12px)600
codetypography.codeSpace1rem (16px)400

All textStyle values: typography.heading.1 – .5, typography.body.sm (+ .regular, .medium, .strong, .em), typography.body.md (+ .regular, .medium, .strong, .em), typography.code, inherit.

// ✅ Correct
<IressText element="h1">Page Title</IressText>
<IressText>Body paragraph text</IressText>
<IressText textStyle="typography.body.sm.strong">Small bold label</IressText>

// ❌ Wrong — raw HTML elements lose IDS typography
<h1>Page Title</h1>
<p style={{ fontFamily: 'Inter', fontSize: '14px' }}>Text</p>

CSS Variables in Custom Styles

This is the recommended approach for any custom styling beyond what IDS component props provide.

Using Panda CSS? If your project uses Panda CSS, use the @iress-oss/ids-theme-preset package instead of manually referencing CSS variables. It provides a Panda CSS preset with the full IDS token system, giving you type-safe token usage via Panda's css() function, utilities, and recipes. See references/theme-preset.md for setup.

In CSS / SCSS

.custom-card {
  /* Colour tokens */
  background: var(--colour-neutral-10);
  border: 1px solid var(--colour-neutral-30);
  color: var(--colour-neutral-90);

  /* Spacing tokens */
  padding: var(--spacing-4);
  gap: var(--spacing-2);

  /* Radius tokens */
  border-radius: var(--radius-3);

  /* Typography tokens (composite shorthand) */
  font: var(--typography-body-md-regular);
}

In CSS-in-JS / Inline Styles

import { cssVars } from '@iress-oss/ids-tokens';

// cssVars gives you the same var() references, but type-safe in JS
<div
  style={{
    background: cssVars.colour.neutral[10],
    border: `1px solid ${cssVars.colour.neutral[30]}`,
    color: cssVars.colour.neutral[90],
    padding: cssVars.spacing[4],
    gap: cssVars.spacing[2],
    borderRadius: cssVars.radius[3],
  }}
>
  Custom card
</div>;

CSS Variable Naming Convention

Variables in tokens/build/css-vars.css follow this pattern:

--{category}-{path}

Examples:

  • --colour-primary-fill
  • --spacing-4
  • --radius-1
  • --typography-heading-1 (shorthand)
  • --typography-heading-_1-fontSize (decomposed, underscore prefix before token name)
Note: Theme files define --iress-{category}-{path} override variables that are referenced as fallback defaults inside the css-vars.css public variables. Use the --{category}-{path} public variables in your own CSS — never the --iress-* theme overrides directly.

Common Mistakes

1. Hardcoded Values Instead of Tokens

// ❌ Wrong
<div style={{ background: '#F5F6F8', padding: '16px', borderRadius: '12px' }}>

// ✅ Correct
<IressStack bg="colour.neutral.20" p="spacing.4" borderRadius="radius.3">

2. Using Raw HTML Elements

// ❌ Wrong — loses IDS typography and theming
<h2>Section Title</h2>
<p>Body text</p>

// ✅ Correct — uses IDS tokens automatically
<IressText element="h2">Section Title</IressText>
<IressText>Body text</IressText>

3. Recreating Component Styling

// ❌ Wrong — manually styling a button
<button style={{
  background: '#003271',
  color: '#FFFFFF',
  borderRadius: '4px',
  padding: '8px 16px'
}}>Submit</button>

// ✅ Correct — IDS handles all styling via mode
<IressButton mode="primary">Submit</IressButton>

4. Using Wrong Colour Semantic

// ❌ Wrong — using primary fill for background
<IressStack bg="colour.primary.fill">Content</IressStack>

// ✅ Correct — use surface variants for backgrounds
<IressStack bg="colour.primary.surface">Content</IressStack>

5. Non-Existent Token Values

// ❌ Wrong — spacing 9 doesn't exist
<IressStack gap="spacing.9">...</IressStack>

// ✅ Correct — use 8 or 10
<IressStack gap="spacing.8">...</IressStack>

Responsive Patterns

Layout components accept responsive objects for spacing props:

// Responsive gap: 2 on mobile, 4 on tablet, 6 on desktop
<IressStack gap={{ base: 'spacing.2', md: 'spacing.4', lg: 'spacing.6' }}>
  ...
</IressStack>

// Or use aliases
<IressStack gap={{ base: 'sm', md: 'md', lg: 'lg' }}>
  ...
</IressStack>

// Hide on small screens
<IressStack hideBelow="md">Desktop only</IressStack>

Decision Table: Component Props vs CSS Variables vs cssVars

SituationUse
Spacing on IDS layout componentsProps: gap, p, m
Colours on IDS componentsProps: bg, color
Custom CSS / SCSSCSS variables (var(--colour-*), var(--spacing-*), etc.)
Inline styles / CSS-in-JScssVars object (cssVars.colour.neutral[10])
Custom CSS with Panda CSS@iress-oss/ids-theme-preset preset
Theming / overridesCSS variables on custom properties
Internal theme editorsmapTokensToCssVariables() helper

General Rule: Prefer component props when available. For custom styling, use CSS variables in stylesheets or cssVars in JavaScript. Only use mapTokensToCssVariables / convertReferencesToVariables for internal tooling like theme editors.

Common Mistakes to Avoid

For the full list of common anti-patterns (disabled buttons, redundant textStyle, legacy slot attributes, raw HTML, hardcoded values), read the Common Mistakes guide at node_modules/@iress-oss/ids-components/.ai/guides/foundations-common-mistakes.md (requires @iress-oss/ids-components to be installed).

Complete Token Reference

Every available colour, spacing, radius, and typography token with CSS variable names and default values. See references/token-reference.md.

Theming

How themes override tokens via CSS variables, scoped theming, and guidance for AI agents. See references/theming.md.

Cross-References

For styling props guides, package references, and links to component-level documentation, see references/cross-references.md. These require @iress-oss/ids-components to be installed.

平台分布

Codex

38.66%
按下载量换算102

Claude

28.99%
按下载量换算77

Cursor

17.7%
按下载量换算47

Gemini CLI

8.71%
按下载量换算23

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills