Agent skill
angular-best-practices
Angular 21 development with modern best practices including signals, standalone components, reactive patterns, and accessibility. Use when creating Angular components, services, templates, or performing any Angular frontend development work. Covers TypeScript strict typing, signal-based state management, reactive forms, lazy loading, ng-icon setup, and Tailwind styling.
Install this agent skill to your Project
npx add-skill https://github.com/Boise-State-Development/agentcore-public-stack/tree/main/.claude/skills/angualar-best-practices
SKILL.md
Angular 21 Best Practices
TypeScript
- Use strict type checking
- Prefer type inference when type is obvious
- Avoid
any; useunknownwhen 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()andoutput()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
classbindings instead ofngClass - Use
stylebindings instead ofngStyle - For external templates/styles, use paths relative to the component TS file
- Do NOT use
@HostBinding/@HostListener— use thehostobject 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
mutateon signals — useupdateorsetinstead
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:
paramsreturnsundefined→ loader doesn't run, status becomes'idle'- Use
abortSignalto cancel in-flight requests - Check
hasValue()before accessingvalue()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
NgOptimizedImagefor all static images NgOptimizedImagedoes 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
version
Bump the monorepo version using SemVer. Use when creating releases, updating the VERSION file, or syncing version across package manifests.
cdk-infrastructure
AWS CDK infrastructure development with TypeScript. Use when creating or modifying CDK stacks, constructs, DynamoDB tables, ECS/Fargate services, Lambda functions, S3 buckets, networking, IAM roles, or any CloudFormation resources. Covers configuration patterns, cross-stack references via SSM, naming conventions, and Bedrock AgentCore integration.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, Angular components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
tailwind-ui
Tailwind CSS v4.1 best practices with WCAG 2.1 AA accessibility, theming, and dark mode support. Use when working with HTML, CSS, styling components, accessibility (a11y), WCAG compliance, color contrast, focus states, screen readers, theming, light mode, dark mode, or building accessible UI patterns like buttons, forms, cards, and navigation. Complements the angular-best-practices skill for Angular frontends.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
Didn't find tool you were looking for?