Agent Skillsmgechev/skillgrade › angular-modern-apis

angular-modern-apis

GitHub

规定Angular组件必须使用信号输入、inject依赖注入及内置控制流,取代旧式装饰器和语法。

examples/angular-modern/SKILL.md mgechev/skillgrade

Trigger Scenarios

编写或重构Angular组件代码 检查Angular代码是否符合现代API规范

Install

npx skills add mgechev/skillgrade --skill angular-modern-apis -g -y
More Options

Non-standard path

npx skills add https://github.com/mgechev/skillgrade/tree/main/examples/angular-modern -g -y

Use without installing

npx skills use mgechev/skillgrade@angular-modern-apis

指定 Agent (Claude Code)

npx skills add mgechev/skillgrade --skill angular-modern-apis -a claude-code -g -y

安装 repo 全部 skill

npx skills add mgechev/skillgrade --all -g -y

预览 repo 内 skill

npx skills add mgechev/skillgrade --list

SKILL.md

Frontmatter
{
    "name": "angular-modern-apis",
    "description": "Guidelines for using modern Angular APIs (signals, inject, control flow)"
}

Angular Modern APIs

This skill describes the mandatory coding standards for Angular components in our codebase.

Rules

All Angular components must follow these rules:

  1. Use signal-based inputs — Use input() and output() instead of @Input() and @Output() decorators
  2. Use inject() for DI — Use inject() function instead of constructor parameter injection
  3. Use built-in control flow — Use @if, @for, @switch instead of *ngIf, *ngFor, *ngSwitch

Examples

Signal inputs (correct)

import { Component, input, output } from '@angular/core';

@Component({ ... })
export class UserProfileComponent {
  name = input.required<string>();
  age = input(0);
  saved = output<void>();
}

inject() for DI (correct)

import { Component, inject } from '@angular/core';
import { UserService } from './user.service';

@Component({ ... })
export class UserProfileComponent {
  private userService = inject(UserService);
}

Built-in control flow (correct)

@if (user()) {
  <h1>{{ user().name }}</h1>
} @else {
  <p>No user found</p>
}

@for (item of items(); track item.id) {
  <li>{{ item.name }}</li>
}

Version History

  • c7d6435 Current 2026-07-19 09:27

Same Skill Collection

skills/skillgrade-graders/SKILL.md
skills/skillgrade-setup/SKILL.md

Metadata

Files
0
Version
ed90fbc
Hash
a6bc2acf
Indexed
2026-07-19 09:27

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 04:27
浙ICP备14020137号-1 $bản đồ khách truy cập$