前端设计
- 作者仓库星标 31
- 许可证 MIT
- 作者更新于 实时读取
- 作者仓库 claude-code-onboarding
- 领域
- 设计与多媒体
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 94 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @kumaran-is · MIT
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: angular-spa
description: Angular 21.x SPA development skill with TailwindCSS 4.x and daisyUI 5.5.5. Use when building Ang…
category: 设计与多媒体
runtime: 无特殊运行时
---
# angular-spa 输出预览
## PART A: 任务判断
- 适用问题:视觉内容、演示材料、信息图或设计交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Iron Law / Conventions & Structure / Documentation Sources”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于视觉内容、演示材料、信息图或设计交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Iron Law / Conventions & Structure / Documentation Sources”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Iron Law / Conventions & Structure / Documentation Sources”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: angular-spa
description: Angular 21.x SPA development skill with TailwindCSS 4.x and daisyUI 5.5.5. Use when building Ang…
category: 设计与多媒体
source: kumaran-is/claude-code-onboarding
---
# angular-spa
## 什么时候使用
- 用于组织测试、定位失败并形成修复闭环 适合处理界面、视觉、封面、信息图或演示材料交付,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要额外 API…
- 面向视觉内容、演示材料、信息图或设计交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Iron Law / Conventions & Structure / Documentation Sources」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "angular-spa" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Iron Law / Conventions & Structure / Documentation Sources
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Iron Law
NO ANGULAR CODE WITHOUT READING reference/angular-conventions.md FIRST — conventions, folder structure, and daisyUI token rules are all there
STYLE LAW: Strictly follow https://angular.dev/style-guide for ALL naming, file structure, and code organization. See reference/angular-conventions.md for the quick reference.
ANIMATION LAW: Use @angular/animations for ALL interactive animations. Never raw CSS transitions on stateful elements. See reference/angular-animations.md.
Angular 21.x SPA Development Skill
Tech Stack: Angular 21+, TailwindCSS 4.x, daisyUI 5.5.5
Conventions & Structure
For code conventions, styling rules, design principles, key patterns, folder structure, and common commands, read
reference/angular-conventions.md
Documentation Sources
Before generating code, consult these sources for current syntax and APIs:
| Source | URL / Tool | Purpose |
|---|---|---|
| Angular v21 | angular-cli MCP (ng mcp) |
Workspace-aware help, schematics, builds, best practices |
| Angular v21 | https://angular.dev/assets/context/llms-full.txt |
Static docs bundle — API reference, deprecated features |
| daisyUI v5.5.5 | https://daisyui.com/llms.txt |
Component reference, color system, themes |
| TailwindCSS / RxJS | Context7 MCP |
Latest syntax, utilities, operators |
| Angular + Tailwind official guide | https://angular.dev/guide/tailwind |
Canonical install steps, ng add tailwindcss, build integration |
Cross-check all Angular APIs and CLI flags against fetched docs — do NOT use deprecated or removed features.
For Angular & TypeScript best practices, read reference/angular-best-practices.md
Quick Scaffold — New Angular Project
npx @angular/cli@latest new my-app --style=scss --ssr=false
cd my-app
Do NOT pass --standalone (removed/default since v19). Verify flags against fetched docs.
Before Writing Any UI Code
Before creating or modifying any component template or styles:
- Read
reference/daisyui-v5-components.md— for semantic color tokens and component patterns - Read
reference/tailwind-v4-config.md— for TailwindCSS 4.x setup constraints - Verify token awareness — can you name the color token (
bg-primary,text-base-content), spacing base (4px), and typography approach you will use? - If not → read the reference files before writing any template or style code
- For accessibility: read
reference/accessibility-checklist.mdbefore adding interactive elements
Process
- Understand Requirements — Clarify feature scope, API endpoints, data models, and UI requirements
- Scaffold Structure — Create feature folder under
src/app/features/<feature-name>/ - Generate Component — Read
reference/angular-templates.mdfor templates; create with signals-based state - Create Service — Read
reference/angular-templates.mdfor service template; implement API calls with HttpClient + RxJS - Configure Routes — Add lazy-loaded route using
loadComponentinapp.routes.tsor feature routes - Write Tests — Read
reference/angular-templates.mdfor test templates; write unit tests with zoneless TestBed - Style Component — Use daisyUI components + TailwindCSS utilities; fallback to SCSS with BEM naming
- Verify Build — Run
ng buildto ensure no compilation errors
Reference Files
Detailed patterns are in reference/:
Angular Best Practices & Code Templates
angular-best-practices.md— TypeScript, component, template, state management, services, forms, zoneless, accessibility, and testing best practicesangular-templates.md— Standalone component, service, lazy routes, app.config, interceptor, guard, and test templatesangular-troubleshooting.md— Common errors (NG0908, NullInjectorError, blank screen), CLI commands, and best practices
UI/UX & Design System
tailwind-v4-config.md— TailwindCSS 4.x setup, breaking changes from v3daisyui-v5-components.md— Full component reference, color system, themes, quick setup patternsangular-forms-fields.md— Input fields, select, textarea, checkbox, radio patternsangular-forms-validation.md— Validation patterns, error messages, async validatorsangular-forms-advanced.md— Multi-step forms, dynamic fields, form arraysangular-ui-tables.md— Table and grid patterns with sorting, filtering, paginationangular-ui-lists.md— List, card, and feed UI patternsangular-ui-navigation.md— Navigation, breadcrumbs, tabs, and sidebar patternsangular-ui-feedback-components.md— Toasts, dialogs, themes, error handling, utilitiesaccessibility-checklist.md— WCAG 2.1 AA checklist, ARIA patterns, test protocolangular-aria.md— Angular CDK accessible headless components (FocusTrap, ListKeyManager, LiveAnnouncer, Accordion, Combobox)component-harnesses.md— Angular CDK component harnesses for stable UI testingtesting-vitest.md— Vitest setup, zoneless TestBed, testing Signals and resource(), migration from Karmae2e-cypress.md— Cypress E2E setup, component testing, custom commands, data-cy conventionsmart-dumb-components.md— Smart (container) vs Dumb (presentational) component pattern, decision tree, signal-based examples, hard rules, file location enforcementangular-animations.md— Angular Animations API (animate.enter/animate.leave,trigger(),state(),keyframes(),stagger()), timing standards, animation rulesuser-research.md— Persona templates, journey mapping, usability testing, SUS survey
Anti-Patterns — What to Avoid
Architecture
- NEVER create
NgModule— Angular 21 is fully standalone; all components, pipes, and directives are standalone by default - NEVER call HTTP or business logic directly in a component — delegate to an injectable service
State & Change Detection
- NEVER use
@Input()/@Output()decorators for new code — useinput(),output(), andmodel()signals (Angular 21 standard) - NEVER use
BehaviorSubjectfor component state — usesignal()andcomputed() - NEVER rely on default change detection (
ChangeDetectionStrategy.Default) — always useOnPushwith signals
Templates
- NEVER use
*ngIf,*ngFor,*ngSwitchstructural directives — use@if,@for,@switchcontrol flow (Angular 17+, standard in v21) - NEVER import
CommonModulein standalone components — it is a compatibility shim; import nothing or use control flow syntax
Dependency Injection
- NEVER inject services via constructor parameters — use the
inject()function in Angular 21 - NEVER import
HttpClientModule— useprovideHttpClient()inapp.config.ts(functional API)
Subscriptions & Memory
- NEVER subscribe manually without
takeUntilDestroyed(destroyRef)— memory leaks in long-lived components - NEVER use
ngOnDestroyto unsubscribe — useDestroyRefandtakeUntilDestroyed()instead
DOM & Styling
- NEVER use
document.getElementByIdor direct DOM manipulation — useviewChild()signal or Angular CDK - NEVER use inline
style=""attributes — use TailwindCSS utilities or SCSS
Design Tokens
- NEVER use
style="color: #3B82F6"inline — useclass="text-primary" - NEVER use hardcoded Tailwind primitive color classes like
bg-blue-500— use semanticbg-primary - NEVER use
style="padding: 16px"— useclass="p-4" - NEVER use
style="font-size: 16px"— useclass="text-base"
Error Handling
Build failures (NG0908, NullInjectorError): Read reference/angular-troubleshooting.md for common errors and fixes.
TailwindCSS not applied: Verify .postcssrc.json exists (not postcss.config.js) and global styles use .css (not .scss).
Blank screen on load: Check browser console for lazy-loading errors. Verify route paths and loadComponent imports.
Common Commands
ng serve # Dev server (http://localhost:4200)
ng test --watch=false # Run unit tests once (no watch)
ng test # Run unit tests in watch mode
ng build # Production build
ng lint # ESLint check
ng generate component features/my-feature/my-component --standalone # Scaffold component
ng generate service features/my-feature/my-service # Scaffold service
Design Token System
Full token definitions are in .claude/skills/ui-standards-tokens/reference/ui-design-tokens.md. This section covers Angular-specific usage.
Token Hierarchy (3 Tiers)
Primitive → Semantic → Component
/* Primitive */
--color-blue-500: #3B82F6;
/* Semantic */
--color-primary: var(--color-blue-500);
/* Component */
--button-bg-primary: var(--color-primary);
Never use primitive tokens directly in component CSS. Components reference component tokens; component tokens reference semantic tokens.
daisyUI Token Mapping
| Category | daisyUI / Tailwind classes |
|---|---|
| Colors | bg-primary, text-base-content, bg-base-100/200/300, text-error, bg-success |
| Spacing | p-2 = 8px, p-4 = 16px, p-6 = 24px (4px base scale) |
| Typography | text-sm, text-base, text-lg, font-semibold, font-bold |
| Borders | rounded-sm, rounded-md, rounded-lg, rounded-full, border border-base-300 |
| Shadows | shadow-sm, shadow-md, shadow-xl |
| Motion | transition-all duration-200 |
| Z-index | custom CSS vars: --z-dropdown: 1000, --z-modal: 1050, --z-tooltip: 1070 |
Theme Switching
// theme.service.ts
import { Injectable } from '@angular/core';
@Injectable({ providedIn: 'root' })
export class ThemeService {
setTheme(theme: 'light' | 'dark' | 'custom'): void {
document.documentElement.setAttribute('data-theme', theme);
localStorage.setItem('theme', theme);
}
getTheme(): string {
return localStorage.getItem('theme') ?? 'light';
}
}
daisyUI v5.5.5 uses the data-theme attribute on <html>. All daisyUI semantic classes switch automatically — no additional CSS is needed per component.
Verify
ng serve # Starts at http://localhost:4200 — no errors in terminal
ng test --watch=false # All unit tests pass
ng build # Exit code 0, no NG build errors
npx ng lint # Zero lint violations
- App serves without console errors
- All Vitest unit tests pass (>90% coverage enforced)
- Production build completes successfully
- No TypeScript errors (
tsc --noEmit) - Shared components in
shared/components/have zeroinject()calls (dumb rule) - Service-injecting components live in
pages/orfeatures/(smart rule)
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核