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
c7d6435
Hash
a6bc2acf
Indexed
2026-07-19 09:27

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-21 07:34
浙ICP备14020137号-1 $Map of visitor$