angular-core — скилл для Claude Code: что делает и как установить
Скилл angular-core учит агента современным паттернам Angular: standalone-компоненты, сигналы вместо хуков, zoneless-режим и встроенный control flow.
MIT 230 установок ★ 678 обновлён 2026-03-28
npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-core -a claude-codeЧто делает angular-core
Скилл задаёт жёсткие правила для Angular-кода: компоненты только standalone, состояние — через signal() и computed(), инжекция — через inject(), никаких ngOnInit и ngOnChanges. Lifecycle-хуки заменяет на effect(), который сам следит за изменениями входных сигналов. Шаблоны пишет на @if, @for, @switch вместо структурных директив.
Включает zoneless-режим: агент добавит provideZonelessChangeDetection() и удалит zone.js из проекта. Без Zone.js Angular полагается на сигналы и OnPush, что ускоряет рендер. RxJS оставляет только для сложных стримов — debounce, race, retry; простые запросы переводит в async/await с firstValueFrom().
Устанавливается через npx skills add с флагом -a claude-code. Скилл ложится в ~/.claude/skills/core/SKILL.md, где агент его подхватывает при старте проекта.
Какие задачи решает
- переписать компонент на standalone и сигналы
- заменить
ngOnInitнаeffect()с отслеживанием входа - настроить zoneless-режим и удалить
zone.js - перевести
*ngIfи*ngForна@ifи@for - вычислить производное состояние через
computed()
Примеры запросов агенту
- Перепиши
UserComponentна standalone с сигналами иinject() - Настрой zoneless — добавь
provideZonelessChangeDetection()и убериzone.js - Замени
ngOnChangesнаeffect(), который следит заuserId()
Как установить angular-core
1Через Skills CLI (Vercel)
npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-core -a claude-code2Вручную: положить файлы
~/.claude/skills/core/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/core/
1Через Skills CLI (Vercel)
npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-core -a codex2Вручную: положить файлы
.agents/skills/core/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-core -a cursor2Вручную: положить файлы
.cursor/skills/core/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Gentleman-Programming/Gentleman-Skills curated/angular/core2Вручную: положить файлы
.github/skills/core/SKILL.md1Через Skills CLI (Vercel)
npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-core -a gemini-cli2Командой платформы
gemini skills install https://github.com/Gentleman-Programming/Gentleman-Skills --path curated/angular/coreВручную: положить файлы
.devin/skills/core/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-core -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы об angular-core
Как установить angular-core в Claude Code?
Запусти npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-core -a claude-code. Скилл встанет в ~/.claude/skills/core/SKILL.md.
Что делает скилл angular-core?
Учит агента писать Angular-код по современным паттернам: standalone-компоненты, сигналы вместо хуков, zoneless-режим, встроенный control flow. Запрещает декораторы @Input, lifecycle-хуки и структурные директивы.
Когда использовать RxJS вместо сигналов?
Скилл оставляет RxJS только для сложных операций: debounce, throttle, race conditions, WebSocket-стримы, retry-логика. Простые запросы и состояние переводит на сигналы и async/await.
Исходный текст
SKILL.md · MIT
---
name: angular-core
description: >
Angular core patterns: standalone components, signals, inject, control flow, zoneless.
Trigger: When creating Angular components, using signals, or setting up zoneless.
metadata:
author: gentleman-programming
version: "1.0"
---
## Standalone Components (REQUIRED)
Components are standalone by default. Do NOT set `standalone: true`.
```typescript
@Component({
selector: 'app-user',
imports: [CommonModule],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `...`
})
export class UserComponent {}
```
---
## Input/Output Functions (REQUIRED)
```typescript
// ✅ ALWAYS: Function-based
readonly user = input.required<User>();
readonly disabled = input(false);
readonly selected = output<User>();
readonly checked = model(false); // Two-way binding
// ❌ NEVER: Decorators
@Input() user: User;
@Output() selected = new EventEmitter<User>();
```
---
## Signals for State (REQUIRED)
```typescript
readonly count = signal(0);
readonly doubled = computed(() => this.count() * 2);
// Update
this.count.set(5);
this.count.update(prev => prev + 1);
// Side effects
effect(() => localStorage.setItem('count', this.count().toString()));
```
---
## NO Lifecycle Hooks (REQUIRED)
Signals replace lifecycle hooks. Do NOT use `ngOnInit`, `ngOnChanges`, `ngOnDestroy`.
```typescript
// ❌ NEVER: Lifecycle hooks
ngOnInit() {
this.loadUser();
}
ngOnChanges(changes: SimpleChanges) {
if (changes['userId']) {
this.loadUser();
}
}
// ✅ ALWAYS: Signals + effect
readonly userId = input.required<string>();
readonly user = signal<User | null>(null);
private userEffect = effect(() => {
// Runs automatically when userId() changes
this.loadUser(this.userId());
});
// ✅ For derived data, use computed
readonly displayName = computed(() => this.user()?.name ?? 'Guest');
```
### When to Use What
| Need | Use |
|------|-----|
| React to input changes | `effect()` watching the input signal |
| Derived/computed state | `computed()` |
| Side effects (API calls, localStorage) | `effect()` |
| Cleanup on destroy | `DestroyRef` + `inject()` |
```typescript
// Cleanup example
private readonly destroyRef = inject(DestroyRef);
constructor() {
const subscription = someObservable$.subscribe();
this.destroyRef.onDestroy(() => subscription.unsubscribe());
}
```
---
## inject() Over Constructor (REQUIRED)
```typescript
// ✅ ALWAYS
private readonly http = inject(HttpClient);
// ❌ NEVER
constructor(private http: HttpClient) {}
```
---
## Native Control Flow (REQUIRED)
```html
@if (loading()) {
<spinner />
} @else {
@for (item of items(); track item.id) {
<item-card [data]="item" />
} @empty {
<p>No items</p>
}
}
@switch (status()) {
@case ('active') { <span>Active</span> }
@default { <span>Unknown</span> }
}
```
---
## RxJS - Only When Needed
Signals are the default. Use RxJS ONLY for complex async operations.
| Use Signals | Use RxJS |
|-------------|----------|
| Component state | Combining multiple streams |
| Derived values | Debounce/throttle |
| Simple async (single API call) | Race conditions |
| Input/Output | WebSockets, real-time |
| | Complex error retry logic |
```typescript
// ✅ Simple API call - use signals
readonly user = signal<User | null>(null);
readonly loading = signal(false);
async loadUser(id: string) {
this.loading.set(true);
this.user.set(await firstValueFrom(this.http.get<User>(`/api/users/${id}`)));
this.loading.set(false);
}
// ✅ Complex stream - use RxJS
readonly searchResults$ = this.searchTerm$.pipe(
debounceTime(300),
distinctUntilChanged(),
switchMap(term => this.http.get<Results>(`/api/search?q=${term}`))
);
// Convert to signal when needed in template
readonly searchResults = toSignal(this.searchResults$, { initialValue: [] });
```
---
## Zoneless Angular (REQUIRED)
Angular is zoneless. Use `provideZonelessChangeDetection()`.
```typescript
bootstrapApplication(AppComponent, {
providers: [provideZonelessChangeDetection()]
});
```
Remove ZoneJS:
```bash
npm uninstall zone.js
```
Remove from `angular.json` polyfills: `zone.js` and `zone.js/testing`.
### Zoneless Requirements
- Use `OnPush` change detection
- Use signals for state (auto-notifies Angular)
- Use `AsyncPipe` for observables
- Use `markForCheck()` when needed
---
## Resources
- https://angular.dev/guide/signals
- https://angular.dev/guide/templates/control-flow
- https://angular.dev/guide/zoneless
© gentleman-programming · MIT · Gentleman-Programming/Gentleman-Skills