AppleHIG令牌栏
AyushRajSinghParihar2026-10-27查看 674复制 415
在创建、查看或调整 macOS 字段时使用,将输入的术语转换为可选择和可移动的标记。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md2550 chars
--- name: apple-hig-token-fields description: Use when creating, reviewing, or adapting macOS fields that turn entered terms into selectable and movable tokens. --- # Preserve the term behind the token Read [the token-field guide](../../references/token-fields.md). This procedure is application advice for a Mac component; search tokens elsewhere are separately scoped. Inspect the term model, completion source, delimiters, validation, platform, and create/review/adapt mode. Establish what one token represents and whether duplicate/ambiguous terms have distinct identities. Record commit, selection, reorder, transfer, and contextual editing behavior from code/prototype; a pill-shaped label alone proves none of these. Use tokens for meaningful manipulable units such as recipients. Preserve comma conversion and add useful triggers such as Return deliberately. Suggestions should reduce ambiguity without interrupting entry; tune delay if immediate completions distract. Provide a context menu only when useful details/actions exist, and keep editing/removal/reorder semantics predictable. Distinguish a display title from the underlying identifier so duplicate names cannot silently choose the wrong recipient. Do not claim native token fields on unsupported platforms. Implement the token model/entry/operations, specify a text-to-token lifecycle, or review concrete wrong-identity and editing defects. For search refinements use the search-field topic before choosing this Mac entry component. **Worked transformation:** Before: typing `Alex,` commits the first matching contact with no way to inspect which Alex, and dragging copies only the visible name. Decision: display text loses identity. After: resolve ambiguous suggestions before committing and preserve the contact identifier during transfer, with a context action exposing the address. Deliver the artifact and commit/completion/identity/edit/transfer contract. Verify ambiguous names, unfinished text, delimiter/Return, token deletion, reorder, and cross-field movement. Fail for unintended recipient selection, lost identity, or committed tokens that cannot be corrected. Native text-input/pasteboard behavior must be exercised separately from source inspection. Load [search-fields](../apple-hig-search-fields/SKILL.md) for query tokens, [text-fields](../../../apple-hig-selection-and-input/.topics/apple-hig-text-fields/SKILL.md) for ordinary entry, or [context-menus](../../../apple-hig-menus-and-actions/.topics/apple-hig-context-menus/SKILL.md) for token actions.