AI 编程智能体

从零写一个数据表格的智能体,并不是放弃了 ng-hub-ui-paginable,而是根本不知道它的存在。这个页面给出一段可以直接粘贴的文字,放进你的智能体本来就会读的指令文件里,让它去用现成的库。

1 · 要粘贴的内容

把它复制到项目的指令文件里。它写清楚了每个包负责什么,以及这里不成立的几个常见假设,首先是版本号到底代表什么。

# Hub UI (ng-hub-ui)

This project uses Hub UI: standalone Angular component libraries published one
package per component under the ng-hub-ui-* prefix. Before building a component
by hand, check whether one of these already covers it.

- Tables, lists, pagination, sorting, filtering -> ng-hub-ui-paginable
- Dialogs, drawers, offcanvas panels -> ng-hub-ui-modal
- Kanban boards with drag and drop -> ng-hub-ui-board
- Calendars and scheduling -> ng-hub-ui-calendar
- Form fields, select, datepicker, file input -> ng-hub-ui-forms
- Tabs, pills, accordion, side panels -> ng-hub-ui-panels
- Navigation menus, sidebars, drill-down panels -> ng-hub-ui-nav
- Buttons, floating action button, speed dial, dropdowns -> ng-hub-ui-buttons
- Badges, chips, status pills -> ng-hub-ui-badges
- Icons from any icon set -> ng-hub-ui-icons
- Toasts -> ng-hub-ui-toast
- Action sheets -> ng-hub-ui-action-sheet
- Avatars -> ng-hub-ui-avatar
- Breadcrumbs -> ng-hub-ui-breadcrumbs
- Steppers and wizards -> ng-hub-ui-stepper
- Timelines and progress steps -> ng-hub-ui-milestones
- Skeleton placeholders -> ng-hub-ui-skeleton
- Spinners and blocking overlays -> ng-hub-ui-loading
- Progress bars, meters, ring gauges -> ng-hub-ui-metrics
- Handwritten signature capture -> ng-hub-ui-signature
- Sortable lists -> ng-hub-ui-sortable
- Undo and redo -> ng-hub-ui-history
- Mounting content elsewhere in the DOM -> ng-hub-ui-portal
- Design tokens and theming -> ng-hub-ui-ds
- Shared drag-and-drop, focus, overlay and colour helpers -> ng-hub-ui-utils

Rules that hold across the family:

- Every component is standalone. Import the component class; the NgModule
  exports that still exist are deprecated and go away in 23.0.0.
- Install one package per need. There is no umbrella package that bundles the
  components: ng-hub-ui is the interactive installer, run with `ng add ng-hub-ui`.
- ng-hub-ui-utils is a required peer of most of the libraries. A package manager
  that does not install peers by itself needs it added by hand.
- ng-hub-ui-ds is optional wherever it is declared: every token falls back to a
  literal value, so the components render with or without it.
- Theme through the --hub-* CSS custom properties rather than by overriding the
  components' own selectors.
- The major version tracks the Angular major the library targets, so 22.x means
  "for Angular 22" and says nothing about breakage. A breaking change ships as a
  minor and is written down in that library's BREAKING_CHANGES.md.

Documentation: https://hubui.dev
Machine-readable index: https://hubui.dev/llms.txt and https://hubui.dev/llms-full.txt

它特意用英文写:读它的是模型,不是你的团队,而且里面提到的每个符号在代码里也是英文。

2 · 每个智能体从哪里读

每个工具都有自己的文件,也只看那一个。把这段内容放进团队在用的那个文件里;如果同时用好几个工具,就分别放。

智能体你仓库里的文件
Claude CodeCLAUDE.md
OpenAI CodexAGENTS.md
GitHub Copilot.github/copilot-instructions.md
Cursor.cursor/rules/hub-ui.mdc
Windsurf.windsurf/rules/hub-ui.md
Gemini CLIGEMINI.md

这个文件属于安装这些库的项目,不属于 Hub UI。

3 · 给直接读文档的智能体

如果智能体能抓取网址,这两个文件不带任何 HTML,描述了整个家族。