Dot Ui Angular Standards 标志

Dot Ui Angular Standards

组织
dotCMS
dot-ui-angular-standards

适用于 core-web Nx 工作区的 dotCMS Angular 编码规范。core-web/ 下的任何前端工作都使用此技能——编写或编辑组件、服务、存储、指令、管道、守卫、模板、SCSS 文件或 Jest 规范;审查前端差异;搭建新的 UI;或回答“在这个代码库中,Angular 里的 X 应该怎么做”。出现以下任一内容时也触发:`standalone: true`、`changeDetection`、`ChangeDetectionStrategy`、`ng new`/`ng generate`/`ng serve`/`ng build`/`ng test`、`angular.json`、Karma、`@ngneat/spectator`、core-web 中的 `npm run`/`yarn`、装饰器中的内联 `template:` 或 `styles:`、`*ngIf`/`*ngFor`、`ngClass`/`ngStyle`、`@Input()`/`@Output()` 装饰器、`@HostBinding`/`@HostListener`、`destroy$`/`takeUntil`、构造函数注入、`dot-icon`、PrimeIcons,或“添加图标”。当工作在此代码库中时,此技能优先于随附的 `angular-developer` 技能中的通用 Angular 和 Angular CLI 指南。

Add to TypingMind

概览

发布者dotCMS
代码仓库core
技能名称dot-ui-angular-standards
星标数
971
复刻数
487
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 dotCMS 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Dot Ui Angular Standards AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/dotCMS/core/tree/main/.claude/skills/dot-ui-angular-standards
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dotCMS/core.git /tmp/core
mkdir -p .claude/skills
cp -r /tmp/core/.claude/skills/dot-ui-angular-standards .claude/skills/dot-ui-angular-standards
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Dot Ui Angular Standards,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Dot Ui Angular Standards。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Dot Ui Angular Standards 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

dotCMS Angular Standards (core-web)

Precedence. This skill overrides the vendored angular-developer skill for all work in this repository. That skill is upstream, generic Angular guidance: it assumes ng CLI, angular.json, Karma, and a greenfield app. None of those apply here. Where the two disagree, this skill wins. Use angular-developer only for framework concepts it explains better (signals semantics, DI resolution, routing APIs) — never for its tooling, project-creation, or standalone/changeDetection advice.

That skill is vendored byte-for-byte from upstream Angular and must never be hand-edited — new dotCMS rules belong here instead. See .agents/skills/angular-developer/PROVENANCE.md for its upstream source and re-sync procedure.

Source of truth

docs/frontend/ANGULAR_STANDARDS.md is the single source of truth for Angular work in this repository. Read it before writing or reviewing Angular code.

It has siblings — load the one your task needs, or docs/frontend/README.md (the index) if you are unsure:

TaskDoc
Component structure, file layout, data flowCOMPONENT_ARCHITECTURE.md
Feature state — NgRx Signal Store, rxMethod, patchStateSTATE_MANAGEMENT.md
Tailwind, PrimeNG theme, BEM, SCSSSTYLING_STANDARDS.md
Strict types, as const, # privateTYPESCRIPT_STANDARDS.md
Writing tests — Spectator, Jest, byTestIdTESTING_FRONTEND.md
Reviewing tests — violation checklistTESTING_REVIEW_RULES.md
GlobalStore breadcrumb trailBREADCRUMBS.md

This file is deliberately not a copy of it. It carries only:

  1. the trigger (so it fires automatically when you touch frontend code),
  2. the precedence declaration over the vendored angular-developer skill, and
  3. the rules where upstream actively tells you to do the wrong thing here, so the correction is in front of you at the moment you would otherwise follow upstream.

Everything else — full rationale, examples, and the rules upstream already gets right — lives in the doc. If this file and the doc ever disagree, the doc wins and this file is the bug. When a standard changes, change it in the doc; only touch this file if the change is one upstream contradicts.

Workspace facts

  • Nx monorepo rooted at core-web/. There is no angular.json — the workspace is driven by nx.json.
  • Angular 22.x, PrimeNG 21.x, Tailwind 4.x, NgRx Signals 21.x, Jest 30, TypeScript 6, Node 22.22.3+.
  • Package manager: pnpm (see packageManager in core-web/package.json).
  • core-web/package.json is the source of truth for versions. Read it; never hardcode or assume a patch version.

Non-negotiables

1. Never write standalone: true

Standalone is the Angular default. The property is forbidden in decorators here. Remove it when you see it in a file you are already editing.

2. Never set changeDetection on a new component

OnPush is the framework default as of Angular v22 (docs), so an explicit ChangeDetectionStrategy.OnPush is redundant noise.

Components explicitly marked ChangeDetectionStrategy.Eager (the opt-in eager mode, renamed from Default in v22) opted in deliberately — leave them alone. Do not convert Eager to OnPush when touching a file for unrelated work.

3. Build, test, and serve through pnpm nx — never ng

There is no Angular CLI workspace here. Never yarn, never npm.

TaskCommand (run from core-web/)
Install depspnpm install
Serve the UIpnpm nx run dotcms-ui:serve
Test a projectpnpm nx run dotcms-ui:test
Build a projectpnpm nx build dotcms-ui
Scaffold codeNx generators (pnpm nx g …) — see the nx-generate skill

4. Testing is Jest 30 + @openng/spectator

  • Never @ngneat/spectator — the workspace has fully migrated (0 occurrences remain). Never Karma, never Vitest.
  • Select with byTestId and put data-testid on the elements you assert against.
  • Set inputs with spectator.setInput(). Never assign to component properties directly.
  • Mock stores in componentProviders, not providers.

5. Three files per component — .ts + .html + .scss

Inline template: and inline styles: in the decorator are forbidden. Reference the files with templateUrl and styleUrls (plural — matching docs/frontend/ANGULAR_STANDARDS.md and the dominant convention in the workspace).

6. Reuse before creating

Before creating a new component, in this order:

  1. Check dotCMS's own components — core-web/libs/ui (@dotcms/ui) and the existing feature libs.
  2. Check PrimeNG.
  3. Only then create a new component — and say in the PR why neither of the above fit.

7. Every component that renders data handles all four states

loading, empty, error, loaded — explicitly. Never leave a blank render path. If a template has no branch for a state, that state is a bug.

8. Error handling is mandatory

No silent failures. No unguarded .subscribe(). No empty catchError. Handle the error in the service with catchError, surface a user-facing error state in the component, and log the diagnostic detail.

9. Icons are Material Symbols

html
<span class="material-symbols-outlined">drag_indicator</span>

The icon name goes in the element's text content, not in the class. Fonts are self-hosted via core-web/libs/dotcms-scss/shared/_material-symbols-outlined.scss.

  • Existing PrimeIcons (pi pi-*) stay as they are — do not mass-migrate them.
  • PrimeNG's internal icons are a theming concern and out of scope.
  • Do not use the deprecated dot-icon component.

10. dotCMS-specific naming

These differ from stock Angular convention, so upstream will not tell you about them:

RuleDoDon't
Signals$mySignal ($ prefix)mySignal, mySignal$
ObservablesmyObservable$ ($ suffix)$myObservable
Selectorsdot- prefixanything else

Covered in full by the doc — read it, do not rely on this file

docs/frontend/ANGULAR_STANDARDS.md is authoritative for everything below. Upstream Angular guidance already agrees with us on these, so they are not restated here and this file must not grow a second copy of them:

  • Subscription teardown — inject(DestroyRef) + takeUntilDestroyed(); the legacy destroy$ pattern is not for new work and is not to be mass-migrated.
  • Signal Forms first — new forms use @angular/forms/signals; existing Reactive Forms stay.
  • TypeScript 6 — the transitional "ignoreDeprecations": "6.0" flag; new code must not rely on it.
  • Standard modern Angular API — input() / output() over decorators, inject() over constructor injection, @if / @for (with track) / @switch over *ngIf / *ngFor / *ngSwitch, [class.x] / [style.x] over ngClass / ngStyle, and host bindings in the host: { … } object over @HostBinding / @HostListener.

Before you finish

  • No standalone: true and no changeDetection added
  • Any Eager component you touched is still Eager
  • Three files exist for each new component; no inline template or styles
  • Loading, empty, error, and loaded paths all render something
  • Every stream is torn down with takeUntilDestroyed(destroyRef); every failure path is handled
  • Specs use @openng/spectator, byTestId, and setInput()
  • Verified with pnpm nx run <project>:test and pnpm nx run <project>:lint — not ng

常见问题

Dot Ui Angular Standards AI 技能有什么作用?

适用于 core-web Nx 工作区的 dotCMS Angular 编码规范。core-web/ 下的任何前端工作都使用此技能——编写或编辑组件、服务、存储、指令、管道、守卫、模板、SCSS 文件或 Jest 规范;审查前端差异;搭建新的 UI;或回答“在这个代码库中,Angular 里的 X 应该怎么做”。出现以下任一内容时也触发:`standalone: true`、`changeDetection`、`ChangeDetectionStrategy`、`ng new`/`ng generate`/`ng serve`/`ng build`/`ng test`、`angular.json`、Karma、`@ngneat/spectator`、core-web 中的 `npm run`/`yarn`、装饰器中的内联 `template:` 或 `styles:`、`*ngIf`/`*ngFor`、`ngClass`/`ngStyle`、`@Input()`/`@Output()` 装饰器、`@HostBinding`/`@HostListener`、`destroy$`/`takeUntil`、构造函数注入、`dot-icon`、PrimeIcons,或“添加图标”。当工作在此代码库中时,此技能优先于随附的 `angular-developer` 技能中的通用 Angu...

为什么在 TypingMind 中使用 Dot Ui Angular Standards?

因为您只需安装一次,就能搭配任何模型使用。Dot Ui Angular Standards 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Dot Ui Angular Standards?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/dotCMS/core/tree/main/.claude/skills/dot-ui-angular-standards。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Dot Ui Angular Standards?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Dot Ui Angular Standards 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Dot Ui Angular Standards 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Dot Ui Angular Standards AI 技能免费吗?

dotCMS 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇