Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
boise-state-development avatar

Angular Best Practices

  • 738 installs
  • 15 repo stars
  • Updated August 3, 2026
  • boise-state-development/agentcore-public-stack

angular-best-practices is a Claude Code frontend skill that generates Angular 21 components, services, and templates using signals, standalone defaults, OnPush, and strict TypeScript for developers building modern Angula

About

angular-best-practices is an agentcore-public-stack skill for Angular 21 development with signals, standalone components, reactive patterns, and accessibility baked in. It enforces strict TypeScript (avoid any, prefer unknown), signal-based state, reactive forms, lazy loading, ng-icon setup, and Tailwind styling. Standalone components are the default in Angular v20+, so the skill omits redundant standalone: true flags and favors OnPush change detection. Developers reach for angular-best-practices when scaffolding Angular UI without manually cross-checking current framework conventions.

  • Enforces strict TypeScript with type inference and unknown over any
  • Mandates standalone components, OnPush change detection, input/output signals, and computed()
  • Recommends reactive forms, class/style bindings, relative paths, and host object over legacy decorators
  • Signal-based state management rules including pure transformations and avoiding mutate()
  • Covers accessibility, lazy loading, ng-icon, and Tailwind integration patterns

Angular Best Practices by the numbers

  • 738 all-time installs (skills.sh)
  • Ranked #471 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/boise-state-development/agentcore-public-stack --skill angular-best-practices

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs738
repo stars15
Security audit3 / 3 scanners passed
Last updatedAugust 3, 2026
Repositoryboise-state-development/agentcore-public-stack

How do you scaffold Angular 21 signals components correctly?

Generate Angular 21 components, services, and templates that follow current signals, standalone, OnPush, and reactive best practices without manual rule lookup.

Who is it for?

Frontend developers shipping Angular 21 apps who want signal-based, standalone, OnPush components without looking up current style rules.

Skip if: Legacy NgModule-only Angular codebases or backends with no Angular frontend work.

When should I use this skill?

User creates Angular components, services, templates, reactive forms, or asks for signals, standalone, or OnPush patterns.

What you get

Standalone Angular components, services, templates, reactive forms, lazy-loaded routes, and ng-icon configurations aligned to Angular 21 conventions.

  • Standalone components
  • Typed services
  • Reactive form templates

By the numbers

  • Documents Angular 21 conventions with standalone default from v20+

Files

SKILL.mdMarkdownGitHub ↗

Angular 21 Best Practices

TypeScript

  • Use strict type checking
  • Prefer type inference when type is obvious
  • Avoid any; use unknown when type is uncertain

Components

  • Always use standalone components (do NOT set standalone: true — it's the default in v20+)
  • Set changeDetection: ChangeDetectionStrategy.OnPush
  • Use input() and output() functions instead of decorators
  • Use computed() for derived state
  • Keep components small and single-responsibility
  • Prefer inline templates for small components
  • Use Reactive forms over Template-driven
  • Use class bindings instead of ngClass
  • Use style bindings instead of ngStyle
  • For external templates/styles, use paths relative to the component TS file
  • Do NOT use @HostBinding/@HostListener — use the host object in the decorator instead

State Management with Signals

  • Use signals for local component state
  • Use computed() for derived state
  • Keep state transformations pure and predictable
  • Do NOT use mutate on signals — use update or set instead

For complex derived state patterns, see references/signal-patterns.md.

Resources (Async Data)

Use resource() for async data fetching with signals:

const userResource = resource({
  params: () => ({ id: userId() }),
  loader: ({ params, abortSignal }) => fetch(`/api/users/${params.id}`, { signal: abortSignal }),
});

const userName = computed(() => userResource.hasValue() ? userResource.value().name : undefined);

Key resource patterns:

  • params returns undefined → loader doesn't run, status becomes 'idle'
  • Use abortSignal to cancel in-flight requests
  • Check hasValue() before accessing value() to handle loading/error states
  • Status values: 'idle', 'loading', 'reloading', 'resolved', 'error', 'local'

Templates

  • Use native control flow: @if, @for, @switch (NOT *ngIf, *ngFor, *ngSwitch)
  • Use async pipe for observables
  • Keep templates simple — no complex logic
  • Do NOT use arrow functions in templates (not supported)
  • Do NOT assume globals like new Date() are available

Services

  • Single responsibility per service
  • Use providedIn: 'root' for singletons
  • Use inject() function instead of constructor injection
@Injectable({ providedIn: 'root' })
export class UserService {
  private readonly http = inject(HttpClient);
}

Routing

  • Implement lazy loading for feature routes:
export const routes: Routes = [
  {
    path: 'admin',
    loadComponent: () => import('./admin/admin.page').then(m => m.AdminPage),
  },
];

File Naming

  • Routable view components: file-name.page.ts, file-name.page.html, file-name.page.css
  • Regular components: file-name.component.ts
  • Services: file-name.service.ts

Icons (ng-icon)

import { NgIcon, provideIcons } from '@ng-icons/core';
import { heroSparkles, heroTrash } from '@ng-icons/heroicons/outline';

@Component({
  selector: 'app-example',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [NgIcon],
  providers: [provideIcons({ heroSparkles, heroTrash })],
  template: `<ng-icon name="heroSparkles" />`,
})
export class ExampleComponent {}

Images

  • Use NgOptimizedImage for all static images
  • NgOptimizedImage does NOT work for inline base64 images

Styling

  • Use Tailwind 4.1 for CSS (see tailwind skill if available)
  • Angular CDK is available when needed

Accessibility

  • MUST pass all AXE checks
  • MUST meet WCAG AA minimums: focus management, color contrast, ARIA attributes

Related skills

How it compares

Use angular-best-practices for opinionated Angular 21 scaffolding; reach for generic TypeScript skills when the stack is not Angular.

FAQ

Does angular-best-practices use NgModules or standalone?

angular-best-practices always uses standalone components and does not set standalone: true because that flag is the default in Angular v20 and later.

Which Angular 21 patterns does the skill enforce?

angular-best-practices enforces signal-based state, OnPush change detection, strict TypeScript typing, reactive forms, lazy loading, ng-icon setup, Tailwind styling, and accessibility requirements.

Is Angular Best Practices safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.