Logo Component Inventory

Component Inventory

Tổ chức
staple-lab
component-inventory

Use when building or updating the design system's catalogue site and its machine-readable registry - component gallery, auto-extracted props tables, token explorer, lifecycle/status board, adoption metrics, a11y and test status, and the generated AGENTS.md that gives AI coding agents the same source of truth. Triggers on "design system docs", "component inventory", "storybook alternative", "props table", "catalogue".

Add to TypingMind

Tổng quan

Nhà phát hànhstaple-lab
Kho mãdesign-system-skills
Tên kỹ năngcomponent-inventory
Sao
7
Bản fork
0
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được staple-lab công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Component Inventory trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/staple-lab/design-system-skills/tree/main/plugins/design-system/skills/component-inventory
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/staple-lab/design-system-skills.git /tmp/design-system-skills
mkdir -p .claude/skills
cp -r /tmp/design-system-skills/plugins/design-system/skills/component-inventory .claude/skills/component-inventory
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Component Inventory trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Component Inventory ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Component Inventory với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Component inventory

The inventory is the design system's catalogue — the page a developer opens to answer "does this already exist, what is it called, and how do I use it". Storybook is the workbench (isolated development, interaction testing); the inventory is the shop window. Teams that run both use them for different jobs; teams that run one usually want this one.

References worth copying from: Atlassian Design System (the props tables and the do/don't pairs), Shopify Polaris (guidance quality and content standards), Vercel Geist (density, keyboard navigation, restraint), Adobe Spectrum (the accessibility documentation depth).

The registry is the product

source of truth  →  .design-system/registry.json  →  ┬→ inventory site
(code + tokens)      (generated, never hand-written)  ├→ AGENTS.md (AI contract)
                                                      ├→ lint rule data
                                                      └→ adoption + coverage reports

Docs drift from code because they are written twice. Generate the registry from the source, then everything downstream is a view. If a fact appears in the site but not in the registry, you built it wrong.

What is generated versus authored:

FieldSource
props (name, type, default, required, description)react-docgen-typescript over the real types
tokens consumedstatic scan of the component's styles
test + a11y statuslast Vitest/axe run (--reporter=json)
lint violationslast ESLint run
bundle sizebuild output per entry
adoption / usage countscan of consuming code
status, since, description, do/don't, guidanceauthored in the component's .meta.ts — judgement cannot be extracted

The build script is ${CLAUDE_PLUGIN_ROOT}/templates/registry/build-registry.mjs; the schema is registry.schema.json.

What every component page must show

This is the bar. Anything less and people go read the source instead — which is fine once and fatal at scale.

  1. Live examples, per variant and per state, with the code visible and copyable. Interactive, not screenshots.

    "Live" means the real component is mounted on the page — not a syntax-highlighted string of what it would look like. This is the difference between a catalogue and a list, and it is the one thing readers actually come for: a props table tells them the API exists, a rendered Button tells them what they are getting. The mechanism is a <Name>.examples.tsx beside each component, which the site eagerly globs (components/*/*.examples.tsx) and renders; the meta file's code string is the caption, not the example. Ship a component without that file and its page silently degrades to dead code blocks — silently, because nothing fails, so it survives review and lands looking finished.

    Treat a stable or beta component with no .examples.tsx as a build failure, the same way an empty a11y section is. ds-component-author owns writing the file; the inventory's job is to notice when it is missing rather than to render a placeholder and move on.

  2. Complete props table — name, resolved TypeScript type, default, required, description, deprecation notice. Auto-extracted, so it cannot be wrong.

  3. Anatomy — the named parts of a compound component, so Dialog.Footer is discoverable without reading the exports.

  4. Keyboard map — every key, in a table. The most-consulted section of any good design system's docs, and the most commonly missing.

  5. Accessibility notes — the roles and ARIA the component provides, what the consumer still owes (an accessible name for icon-only usage), and known limitations. State them; a documented gap is a decision, an undocumented one is a surprise.

  6. Do / don't pairs, rendered side by side. The single highest-signal piece of guidance you can write — it takes ten seconds to absorb and prevents the misuse that a paragraph of prose does not.

  7. Status badge — draft / beta / stable / deprecated, plus the version it landed in and, for deprecations, the migration.

  8. Tokens consumed — links back to the token explorer.

  9. Test + a11y status — the actual last-run result, with the count of behavioural tests and the axe verdict. Not a claim, a number.

  10. Adoption — where it is used, and what unmigrated hand-rolled equivalents still exist.

System-level pages

  • Foundations — colour (every ramp with its measured contrast ratios against the surfaces it is used on), type scale rendered at real size, spacing, radius, elevation, motion with playable examples.
  • Token explorer — searchable and filterable by tier, with copy-to-clipboard of the token name and the var(). Theme and density switchers apply live to the whole site, which is also the fastest way to spot a component that never got dark-mode treatment.
  • Status board — every component in one table: status, test coverage, a11y, bundle size, adoption. This is the page a design system lead opens on Monday, and it is what turns "we should improve the system" into a ranked list.
  • Getting started — install, theme setup, the first component, and the escape-hatch policy.
  • Patterns and Content — starter pages for cross-component judgement: forms wiring and validation timing, the three kinds of empty state, field- vs page-level errors, the skeleton-vs-spinner rule; and voice, action labels, the error-message pattern, a terminology table. These two pages are authored, not generated — the one deliberate exception to the registry rule, because a decision that spans components ("validate on blur, not keystroke") has no single source file to be extracted from. The template ships them as editable starter guidance in the site source, and each page's intro says so, so nobody waits for a generator to update them.
  • Contribution — how a component graduates draft → stable, who reviews, what the bar is. A system with no gate becomes a junk drawer within a year.

Search

Make it good, and make it keyboard-first (/ or ⌘K). Index component names, prop names, token names, and synonyms — someone looking for "dropdown" must find Select and Menu, and someone typing "modal" must find Dialog. The synonym list is authored in the meta file and is worth ten minutes of thought per component: failed search is the main reason people build a duplicate.

The AI contract — AGENTS.md

Generate it from the registry. This is what stops agents inventing component names and hardcoding hexes, and it is the cheapest quality win in the whole system:

markdown
# Design system: @acme/ui

Import from `@acme/ui`. Never from `@acme/ui/dist/*` or from the primitives directly.

## Rules
- Semantic tokens only: `var(--ds-color-bg-accent)`. Never a raw hex, never `--ds-color-accent-600` (primitive tier).
- Spacing comes from the scale: `var(--ds-space-4)`. Never a raw px value.
- Every interactive element needs a visible `:focus-visible` ring.
- Icon-only buttons require `aria-label` (the type will reject them otherwise).

## Components (24 stable, 3 beta)
| Component | Status | Use for | Don't use for | Props |
|---|---|---|---|---|
| Button | stable | Actions the user takes | Navigation — use Link | variant, size, loading, startIcon, … |
| Dialog | stable | Focused tasks needing a decision | Non-blocking messages — use Toast | open, onOpenChange, … |

## Tokens
Full list: `tokens/dist/tokens.json`. Semantic tier only in components.

Keep it generated and short. A 4,000-line AGENTS.md is skimmed by agents the same way it is by humans. Link out to the registry JSON for the exhaustive data — an agent can read it on demand, and it is the same file the site renders.

The registry build emits llms.txt alongside AGENTS.md — same data, the llms.txt convention, for the tools that look for that filename instead. Two filenames, one generator; never author either by hand.

For agents that speak MCP, ${CLAUDE_PLUGIN_ROOT}/templates/mcp/server.mjs (dependency-free Node, wired as npm run mcp — see ${CLAUDE_PLUGIN_ROOT}/templates/mcp/README.md) serves the registry and tokens live with four tools: search_components, get_component, search_tokens, get_guidelines. The division of labour: AGENTS.md is the ambient contract that costs nothing to have in context, the MCP server is the on-demand one — an agent queries for exactly the component it is writing against and gets current data, instead of a stale snapshot of everything.

Building the site

Template: ${CLAUDE_PLUGIN_ROOT}/templates/inventory/ — a Vite + React app that reads registry.json and tokens.json, styled entirely with the system's own tokens. That last part is deliberate: the docs site is the system's first consumer, so a token that does not work shows up here first, and dogfooding is not optional if you want to find these problems before your users do.

The site's own styles are authored against the default --ds- var prefix (in src/inventory.css and src/pages.tsx). If the project sets a different tokens.prefix in design-system.config.json, rewrite the prefix in the copied site files at scaffold time — a mechanical sed 's/--ds-/--<prefix>-/g', nothing more. That is the only prefix-sensitive copy step: the registry scanner and the token data read the prefix from the config and the generated tokens.json, so they follow automatically.

Deploy on merge to main. Documentation that requires a local dev server gets read by the person who wrote it and nobody else.

Keeping it honest

  • Regenerate the registry in CI, and fail the build if it differs from the committed one. That single check is what makes "the docs are always current" true rather than aspirational.
  • Fail the build on a stable component with no examples, no do/don't, or an empty a11y section. The bar has to be mechanical or it moves.
  • Track failed searches if you can. They are a direct list of what people expected to exist — the best roadmap input available.
  • Review deprecations quarterly. A deprecation with no removal date is a permanent fixture, and consumers learn to ignore the badge.

Câu hỏi thường gặp

Kỹ năng AI Component Inventory làm được gì?

Use when building or updating the design system's catalogue site and its machine-readable registry - component gallery, auto-extracted props tables, token explorer, lifecycle/status board, adoption metrics, a11y and test status, and the generated AGENTS.md that gives AI coding agents the same source of truth. Triggers on "design system docs", "component inventory", "storybook alternative", "props table", "catalogue".

Vì sao nên dùng Component Inventory trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Component Inventory là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Component Inventory trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/staple-lab/design-system-skills/tree/main/plugins/design-system/skills/component-inventory. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Component Inventory?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Component Inventory với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Component Inventory với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Component Inventory có miễn phí không?

Có. Kỹ năng này được staple-lab phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇