Angular logo

Angular

Community
ericrisco
angular

Use when building, refactoring, or debugging Angular (v20/21+): standalone components, signals, zoneless change detection, @if/@for/@defer control flow, inject() DI, resource()/httpResource(), RxJS interop, NgRx SignalStore, ng CLI. NOT React (that is react), NOT Next.js (that is nextjs), NOT a TypeScript language question (that is typescript).

Overview

Publisherericrisco
Repositoryrsc-harness
Skill nameangular
Stars
239
Forks
24
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ericrisco on GitHub. Read the source before you install it.

Installation

Install the Angular AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ericrisco/rsc-harness/tree/main/skills/angular
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ericrisco/rsc-harness.git /tmp/rsc-harness
mkdir -p .claude/skills
cp -r /tmp/rsc-harness/skills/angular .claude/skills/angular
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Angular in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Angular on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Angular is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Angular — Standalone, Signals, Zoneless (Angular 20/21+)

Build Angular the way it ships in 2026: standalone components, signals as the reactivity model, zoneless change detection, built-in control flow, and inject() DI. Treat NgModules, *ngFor, and @Input() decorators as legacy you only touch to migrate.

Not this skill

AngularJS (1.x) is out of scope entirely — this skill is Angular 2+ only and the APIs do not map. Route elsewhere for React → ../react/SKILL.md; Next.js App Router → ../nextjs/SKILL.md; Vue/Nuxt, Svelte, SolidJS, Astro → ../vue-nuxt/SKILL.md, ../svelte/SKILL.md, ../solid-js/SKILL.md, ../astro/SKILL.md; a pure TypeScript language question (generics, narrowing, tsconfig) with no Angular dimension → ../typescript/SKILL.md; a standalone NestJS API → ../nestjs/SKILL.md; a generic Node service → ../nodejs/SKILL.md; cross-framework Playwright e2e strategy → ../testing-web/SKILL.md / ../e2e-testing/SKILL.md. Angular Universal SSR and Angular's own ng test (Vitest) setup stay here.

Decide first

SituationDo thisWhy
Greenfield app / new featureZoneless + signals + standalone by default. ng new (Angular 21) already excludes Zone.js.The defaults shipped stable in v20-v21; fight them and you write more code that the framework now does for you.
Brownfield NgModule + decorator appMigrate incrementally with the schematics in references/migration.md (NgModule→standalone, control flow, decorator→signal inputs, Zone.js→zoneless, Karma→Vitest); do not rewrite. Keep Zone.js until you flip it on purpose.A working app that uses *ngIf is not a bug. Churn introduces risk for no user value.
"View not updating" complaintJump to the change-detection section: signal not read in template, OnPush without a signal, or stale Zone.js assumption.Zoneless means a mutation that no signal observes will never repaint — the fix is structural, not a detectChanges() call.

The modern baseline

No NgModules. Bootstrap a standalone root component and configure providers in app.config.ts.

typescript
// main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { App } from './app/app';
import { appConfig } from './app/app.config';

bootstrapApplication(App, appConfig);
typescript
// app/app.config.ts
import { ApplicationConfig, provideZonelessChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
import { provideHttpClient, withFetch } from '@angular/common/http';
import { routes } from './app.routes';

export const appConfig: ApplicationConfig = {
  providers: [
    provideZonelessChangeDetection(), // no Zone.js; CD driven by signals + events
    provideRouter(routes),
    provideHttpClient(withFetch()),
  ],
};
  • Rule: one bootstrapApplication call, providers in app.config.ts. Why: NgModule bootstrap (platformBrowserDynamic().bootstrapModule(AppModule)) is the legacy path — more files, slower to reason about.
  • Rule: components are standalone by default (the standalone flag is implied in v20+; do not write standalone: true in new code, and never write standalone: false). Why: standalone is the framework default now; the flag is noise.

Bad → Good

typescript
// Bad — NgModule wiring for a single component
@NgModule({ declarations: [UserCard], imports: [CommonModule], exports: [UserCard] })
export class UserCardModule {}

// Good — standalone component imports only what it uses
@Component({
  selector: 'app-user-card',
  imports: [DatePipe],
  template: `<p>{{ joined() | date }}</p>`,
})
export class UserCard {
  joined = input.required<Date>();
}

Signals as the reactivity model

signal() holds state, computed() derives it, effect() runs side effects, linkedSignal() resets writable state when a source changes.

typescript
import { signal, computed, effect, linkedSignal } from '@angular/core';

const qty = signal(1);
const price = signal(9.99);
const total = computed(() => qty() * price());        // derived — recomputes lazily
const draftQty = linkedSignal(() => qty());            // writable, resets when qty changes

effect(() => console.log('total changed:', total())); // side effect ONLY (logging, DOM, sync)
  • Rule: derive with computed(), never with effect(). Why: an effect() that writes a signal to "compute" a value creates a hidden dependency graph that loops or fires extra times — computed() is pull-based and memoized.
  • Rule: effect() is for side effects (logging, localStorage, imperative DOM, 3rd-party libs), not for keeping two signals in sync. Why: synced state belongs in computed() or linkedSignal().

Component I/O is signal-based: input(), input.required(), output(), model() for two-way.

Bad → Good

typescript
// Bad — decorator I/O, mutable, no type-safety on required
@Input() userId!: string;
@Output() saved = new EventEmitter<User>();

// Good — signal inputs/outputs
userId = input.required<string>();          // read as userId()
saved = output<User>();                     // emit with saved.emit(user)
name = model('');                           // two-way: [(name)]="..."

Templates: built-in control flow

Use @if / @for / @switch / @defer. The legacy *ngIf / *ngFor / *ngSwitch structural directives are deprecated.

html
@if (user(); as u) {
  <h1>{{ u.name }}</h1>
} @else {
  <app-spinner />
}

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

@defer (on viewport) {
  <app-heavy-chart [data]="rows()" />
} @placeholder {
  <div class="skeleton"></div>
}
  • Rule: every @for must declare track. Why: it is required syntax (the template won't compile without it) and it controls DOM reuse — track item.id over track $index when items have stable identity, or the DOM thrashes on reorder.
  • Rule: reach for @defer to lazy-load heavy sub-trees and enable incremental hydration. Why: it ships less JS up front without manual loadComponent plumbing.

Bad → Good

html
<!-- Bad — legacy structural directive, no tracking -->
<li *ngFor="let item of items">{{ item.label }}</li>

<!-- Good — built-in control flow with track -->
@for (item of items(); track item.id) { <li>{{ item.label }}</li> }

Data fetching

Default to signal-based resources; reach for HttpClient + RxJS only when you need streams, cancellation, or operator composition.

typescript
import { httpResource } from '@angular/common/http';
import { resource } from '@angular/core';

// httpResource — declarative GET wired to HttpClient; reactive to its URL signal
users = httpResource<User[]>(() => `/api/users?team=${this.team()}`);
// template: @if (users.isLoading()) {…} @else { @for (u of users.value(); track u.id) {…} }
// users.error()  -> error signal;  users.reload() -> refetch

// resource — any async loader (not just HTTP)
profile = resource({
  params: () => ({ id: this.userId() }),
  loader: ({ params }) => fetchProfile(params.id),
});
  • Rule: httpResource()/resource() give you value(), isLoading(), error(), reload() for free — prefer them over a manual subscribe that you have to clean up. Why: less boilerplate, no leak, refetches automatically when its source signals change.
  • Rule: when you genuinely need a stream (websocket, debounced search, retry/switchMap), keep HttpClient + RxJS and bridge to a signal with toSignal(). Why: signals are not streams; do not fake backpressure with effects. references/signals-rxjs.md has the signals-vs-RxJS decision matrix, toSignal/toObservable interop recipes, effect pitfalls (infinite loops, untracked reads), and takeUntilDestroyed.

DI & services

typescript
@Injectable({ providedIn: 'root' })
export class UserApi {
  private http = inject(HttpClient);          // field initializer — no constructor needed
  list = () => this.http.get<User[]>('/api/users');
}
  • Rule: inject with inject(), not constructor parameters. Why: inject() works in field initializers and composes into plain functions (guards, factories); constructor DI is the legacy ergonomic.
  • Rule: providedIn: 'root' for app-wide singletons. Why: tree-shakable — unused services drop from the bundle.
  • Rule: HTTP cross-cutting concerns are functional interceptors: provideHttpClient(withInterceptors([authInterceptor])). Why: class interceptors with HTTP_INTERCEPTORS are the older multi-provider pattern.

Routing

typescript
// app.routes.ts
export const routes: Routes = [
  { path: 'users', loadComponent: () => import('./users/users-list').then(m => m.UsersList) },
  { path: 'users/:id', loadComponent: () => import('./users/user-detail').then(m => m.UserDetail),
    canActivate: [authGuard] },
];

export const authGuard: CanActivateFn = () => inject(AuthService).isLoggedIn();

Enable route-bound signal inputs with withComponentInputBinding() in provideRouter, then read route params as signal inputs:

typescript
provideRouter(routes, withComponentInputBinding());
// in UserDetail: id = input.required<string>();  // bound from the :id segment
  • Rule: lazy-load routes with loadComponent (or loadChildren with a routes array). Why: smaller initial bundle, no NgModule needed.
  • Rule: guards/resolvers are functions (CanActivateFn, ResolveFn) using inject(). Why: class-based guards are deprecated.

State

  • Local/feature state → a signal service (@Injectable holding signal/computed). Simple, no library.
  • App-wide state → NgRx SignalStore (signalStore, withState, withComputed, withMethods, withProps) — signals-native, pairs cleanly with resource().
typescript
export const CartStore = signalStore(
  { providedIn: 'root' },
  withState({ items: [] as Item[] }),
  withComputed(({ items }) => ({ count: computed(() => items().length) })),
  withMethods((store) => ({ add: (i: Item) => patchState(store, s => ({ items: [...s.items, i] })) })),
);
  • Note: Signal Forms is experimental (prototype since Angular 21.0.0-next.2). For production forms use reactive/typed forms (FormGroup/FormControl with typed values). Why: do not ship a prototype API to users.

CLI workflow

bash
ng new my-app                  # Angular 21: zoneless + standalone + Vitest by default
ng generate component user-card # standalone by default; no --standalone flag needed
ng generate service user-api
ng build                       # production build
ng test                        # Vitest (default runner in v21; Karma is deprecated)
ng update @angular/core @angular/cli  # version bumps + automated migrations

Testing

Use Vitest + TestBed. Provide zoneless CD in tests and set signal inputs via componentRef.

typescript
import { TestBed } from '@angular/core/testing';
import { provideZonelessChangeDetection } from '@angular/core';

it('renders the user name', async () => {
  TestBed.configureTestingModule({
    providers: [provideZonelessChangeDetection()],
  });
  const fixture = TestBed.createComponent(UserCard);
  fixture.componentRef.setInput('joined', new Date('2026-01-01'));
  await fixture.whenStable();                       // not detectChanges() — let CD settle
  expect(fixture.nativeElement.textContent).toContain('2026');
});
  • Rule: set signal inputs with fixture.componentRef.setInput('name', value), never by poking the instance field. Why: setInput flows through the input pipeline and marks the view dirty.
  • Rule: prefer await fixture.whenStable() over manual detectChanges() loops under zoneless. Why: it waits for the scheduler to flush instead of forcing a single synchronous pass.

Anti-patterns

BadWhy it's wrongGood
@NgModule in new codeStandalone is the default; modules add ceremony and slow analysisStandalone component with an imports: [] array
*ngIf / *ngFor / *ngSwitchLegacy structural directives; deprecated@if / @for (… ; track id) / @switch
@Input() / @Output() decoratorsNo required-input safety, not signal-reactiveinput() / input.required() / output() / model()
effect(() => this.total.set(a()*b()))Effect-to-derive-state loops and double-firestotal = computed(() => a()*b())
@for without trackWon't compile; if forced, DOM thrashes on reordertrack item.id (stable identity)
subscribe() in a component with no teardownMemory leak; runs after the view is destroyedtoSignal() or takeUntilDestroyed()
ChangeDetectorRef.detectChanges() to "fix" a stale viewMasks the real cause under zonelessRead the value through a signal so CD tracks it
Nested subscribe() inside subscribe()Callback pyramid, lost cancellationswitchMap/concatMap, one subscription
Constructor DI only (constructor(private x: X))Legacy ergonomic; can't compose into functionsprivate x = inject(X)

scripts/verify.sh is a heuristic copy-banlist lint — it greps your Angular sources for the banned patterns above. It is a hint, not a compiler.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Angular AI skill do?

Use when building, refactoring, or debugging Angular (v20/21+): standalone components, signals, zoneless change detection, @if/@for/@defer control flow, inject() DI, resource()/httpResource(), RxJS interop, NgRx SignalStore, ng CLI. NOT React (that is react), NOT Next.js (that is nextjs), NOT a TypeScript language question (that is typescript).

Why use Angular on TypingMind?

Because you install it once and use it with any model. Angular is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Angular in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ericrisco/rsc-harness/tree/main/skills/angular. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Angular?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Angular?

As many as you like. As long as a model supports skills, you can use Angular with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Angular AI skill free?

Yes. It is published on GitHub by ericrisco under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇