Angular Developer
Angular (Google)OfficialCreated by Google LLCDistributed by Angular (Google)
- Skill
- Tool integration
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Angular Developer skill assists in building and maintaining Angular applications. It provides structured guidance on project scaffolding, component architecture, state management with signals, HTTP communication, and accessibility. It emphasizes the use of the Angular CLI for consistency and mandates build verification to ensure code quality. The skill covers modern Angular features including signal-based reactivity, deferrable views, and headless accessibility components via Angular Aria.
What it does
- Generates boilerplate code for components, services, and routes using the Angular CLI.
- Provides architectural advice on state management using signals, linked signals, and resources.
- Offers guidance on implementing accessible UI patterns using Angular Aria directives.
- Advises on modern rendering strategies including SSR, prerendering, and hydration.
- Ensures code quality by requiring build verification after generation.
- Recommends modern naming conventions and styling approaches like Tailwind CSS.
When to use it
- When scaffolding a new Angular project or adding new features to an existing one.
- When needing to implement complex state management or asynchronous data fetching.
- When building accessible custom components like accordions, listboxes, or comboboxes.
- When refactoring older code to modern Angular standards or migrating to newer versions.
- When troubleshooting build errors or optimizing component performance.
Advantages
- Promotes consistency by enforcing Angular CLI usage and standard naming conventions.
- Reduces technical debt by prioritizing modern signal-based reactivity and form management.
- Improves accessibility by integrating headless ARIA patterns.
- Ensures functional reliability through mandatory build verification steps.
- Provides context-aware guidance based on the specific Angular version of the project.
Usage examples
- “Create a new Angular component for a user profile with signal-based inputs.”
- The agent generates the component structure using the Angular CLI, implementing signal-based inputs as per the latest framework standards.
- “How do I implement an accessible accordion in my Angular application?”
- The agent provides the necessary imports from the Angular Aria package and demonstrates the correct HTML structure using the required directives.
- “Help me refactor my legacy animation code to the modern approach.”
- The agent analyzes the project version and provides a guide on transitioning to native CSS animations using the recommended enter and leave classes.
- “What is the best way to fetch data in a component using signals?”
- The agent explains the use of the resource API for asynchronous data fetching and provides a code example for integrating it into the component.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/angular/angular-developer/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip angular-developer.zip -d .agents/skills
Documentation by Google LLC
Angular Developer Guidelines
Always analyze the project's Angular version before providing guidance, as best practices and available features can vary significantly between versions. If creating a new project with Angular CLI, do not specify a version unless prompted by the user.
When generating code, follow Angular's style guide and best practices for maintainability and performance. Use the Angular CLI for scaffolding components, services, directives, pipes, and routes to ensure consistency.
Once you finish generating code, run
ng buildto ensure there are no build errors. If there are errors, analyze the error messages and fix them before proceeding. Do not skip this step, as it is critical for ensuring the generated code is correct and functional.
Creating New Projects
If no guidelines are provided by the user, here are some default rules to follow when creating a new Angular project:
Use the latest stable version of Angular unless the user specifies otherwise.
Use Signal Forms for form management in new projects (stable in Angular v22 and newer) Find out more.
Execution Rules for ng new:
When asked to create a new Angular project, you must determine the correct execution command by following these strict steps:
Step 1: Check for an explicit user version.
IF the user requests a specific version (e.g., Angular 15), bypass local installations and strictly use
npx.Command:
npx @angular/cli@<requested_version> new <project-name>
Step 2: Check for an existing Angular installation.
IF no specific version is requested, run
ng versionin the terminal to check if the Angular CLI is already installed on the system.IF the command succeeds and returns an installed version, use the local/global installation directly.
Command:
ng new <project-name>
Step 3: Fallback to Latest.
IF no specific version is requested AND the
ng versioncommand fails (indicating no Angular installation exists), you must usenpxto fetch the latest version.Command:
npx @angular/cli@latest new <project-name>
Components
When working with Angular components, consult the following references based on the task:
Fundamentals: Anatomy, metadata, core concepts, self-closing tags, and template control flow (@if, @for, @switch). Read components.md
Inputs: Signal-based inputs, transforms, and model inputs. Read inputs.md
Outputs: Signal-based outputs and custom event best practices. Read outputs.md
Host Elements: Host bindings and attribute injection. Read host-elements.md
Naming Conventions: Modern Angular v20+ naming style ("Intent over Role") for files, components, services, directives, pipes, and models. Read naming-conventions.md
Queries and Content Projection: Signal-based view and content queries (viewChild, viewChildren, contentChild, contentChildren) and content projection with
<ng-content>slots and fallback content. Read queries-and-projection.mdDeferrable Views: Lazy loading, code splitting, triggers, prefetching, loading states, SSR, and layout stability with
@defer. Read deferrable-views.md
If you require deeper documentation not found in the references above, read the documentation at https://angular.dev/guide/components.
Reactivity and Data Management
When managing state and data reactivity, use Angular Signals and consult the following references:
Signals Overview: Core signal concepts (
signal,computed), reactive contexts, anduntracked. Read signals-overview.mdDependent State (
linkedSignal): Creating writable state linked to source signals. Read linked-signal.mdAsync Reactivity (
resource): Fetching asynchronous data directly into signal state. Read resource.mdSide Effects (
effect): Logging, third-party DOM manipulation (afterRenderEffect), and when NOT to use effects. Read effects.md
HTTP Communication
When communicating with backend services, use Angular HTTP APIs and consult the following reference:
HTTP Client and Resources:
provideHttpClient,HttpClient, interceptors, andhttpResource. Read http-client.md
Forms
In most cases for new apps, prefer signal forms. When making a forms decision, analyze the project and consider the following guidelines:
If the application is using v22 or newer and this is a new form, prefer Signal Forms.
For older applications or when working with existing forms, use the appropriate form type that matches the applications current form strategy.
Signal Forms: Use signals for form state management. Read signal-forms.md
Template-driven forms: Use for simple forms. Read template-driven-forms.md
Reactive forms: Use for complex forms. Read reactive-forms.md
Dependency Injection
When implementing dependency injection in Angular, follow these guidelines:
Fundamentals: Overview of Dependency Injection, services, and the
inject()function. Read di-fundamentals.mdCreating and Using Services: Creating services, the
providedIn: 'root'option, and injecting into components or other services. Read creating-services.mdDefining Dependency Providers: Automatic vs manual provision,
InjectionToken,useClass,useValue,useFactory, and scopes. Read defining-providers.mdInjection Context: Where
inject()is allowed,runInInjectionContext, andassertInInjectionContext. Read injection-context.mdHierarchical Injectors: The
EnvironmentInjectorvsElementInjector, resolution rules, modifiers (optional,skipSelf), andprovidersvsviewProviders. Read hierarchical-injectors.md
Pipes
When formatting values in templates, creating custom pipes, or reusing pipe-like logic in TypeScript, consult the following reference. Prefer pipes in templates; outside templates, avoid injecting pipe classes just to call transform().
Pipes: Built-in pipe imports, custom pipe naming and implementation, pure vs impure pipes, and TypeScript reuse patterns using standalone formatting functions or extracted plain functions. Read pipes.md
Angular Aria
When building accessible custom components for any of the following patterns: Accordion, Listbox, Combobox, Menu, Tabs, Toolbar, Tree, Grid, consult the following reference:
Angular Aria Components: Building headless, accessible components (Accordion, Listbox, Combobox, Menu, Tabs, Toolbar, Tree, Grid) and styling ARIA attributes. Read angular-aria.md
Routing
When implementing navigation in Angular, consult the following references:
Define Routes: URL paths, static vs dynamic segments, wildcards, and redirects. Read define-routes.md
Route Loading Strategies: Eager vs lazy loading, and context-aware loading. Read loading-strategies.md
Show Routes with Outlets: Using
<router-outlet>, nested outlets, and named outlets. Read show-routes-with-outlets.mdNavigate to Routes: Declarative navigation with
RouterLinkand programmatic navigation withRouter. Read navigate-to-routes.mdControl Route Access with Guards: Implementing
CanActivate,CanMatch, and other guards for security. Read route-guards.mdData Resolvers: Pre-fetching data before route activation with
ResolveFn. Read data-resolvers.mdRouter Lifecycle and Events: Chronological order of navigation events and debugging. Read router-lifecycle.md
Rendering Strategies: Choosing between CSR, SSG (prerendering), and SSR. Read rendering-strategies.md
Server and Hybrid Rendering: Implementing server routes, prerendering, hydration, server-compatible code, and request data in an SSR-configured app. Read server-side-rendering.md
Route Transition Animations: Enabling and customizing the View Transitions API. Read route-animations.md
If you require deeper documentation or more context, visit the official Angular Routing guide.
Styling and Animations
When implementing styling and animations in Angular, consult the following references:
Using Tailwind CSS with Angular: Integrating Tailwind CSS into Angular projects. Read tailwind-css.md
Angular Animations: Using native CSS (recommended) or the legacy DSL for dynamic effects. Read angular-animations.md
Styling components: Best practices for component styles and encapsulation. Read component-styling.md
Testing
When writing or updating tests, consult the following references based on the task:
Fundamentals: Best practices for unit testing (Vitest), async patterns, and
TestBed. Read testing-fundamentals.mdComponent Harnesses: Standard patterns for robust component interaction. Read component-harnesses.md
Router Testing: Using
RouterTestingHarnessfor reliable navigation tests. Read router-testing.mdEnd-to-End (E2E) Testing: Setting up and running E2E tests. Read e2e-testing.md
Tooling
When working with Angular tooling, consult the following references:
Angular CLI: Creating applications, generating code (components, routes, services), serving, and building. Read cli.md
Code Modernization: Automatically refactoring to modern standards using migrations. Read migrations.md
Angular MCP Server: Available tools, configuration, and experimental features. Read mcp.md
Environment Configuration: Strategies for build-time and runtime configuration. Read environment-configuration.md
Files
- ATTRIBUTION.mdAdded by AutoGineer853 B
- SKILL.md11.2 KiB
- references/angular-animations.md3.9 KiB
- references/angular-aria.md18.2 KiB
- references/cli.md3.6 KiB
- references/component-harnesses.md2.7 KiB
- references/component-styling.md2.5 KiB
- references/components.md4.8 KiB
- references/creating-services.md3.2 KiB
- references/data-resolvers.md1.6 KiB
- references/deferrable-views.md2.7 KiB
- references/define-routes.md2.1 KiB
- references/defining-providers.md2.2 KiB
- references/di-fundamentals.md3.4 KiB
- references/e2e-testing.md884 B
- references/effects.md2.7 KiB
- references/environment-configuration.md3.3 KiB
- references/hierarchical-injectors.md2.1 KiB
- references/host-elements.md2.1 KiB
- references/http-client.md5.4 KiB
- references/injection-context.md1.9 KiB
- references/inputs.md2.4 KiB
- references/linked-signal.md3.3 KiB
- references/loading-strategies.md1.5 KiB
- references/mcp.md3.2 KiB
- references/migrations.md2.0 KiB
- references/naming-conventions.md5.4 KiB
- references/navigate-to-routes.md1.6 KiB
- references/outputs.md2.6 KiB
- references/pipes.md3.8 KiB
- references/queries-and-projection.md9.0 KiB
- references/reactive-forms.md3.5 KiB
- references/rendering-strategies.md1.8 KiB
- references/resource.md3.9 KiB
- references/route-animations.md1.6 KiB
- references/route-guards.md1.8 KiB
- references/router-lifecycle.md1.5 KiB
- references/router-testing.md3.7 KiB
- references/server-side-rendering.md4.5 KiB
- references/show-routes-with-outlets.md1.6 KiB
- references/signal-forms.md27.2 KiB
- references/signals-overview.md2.8 KiB
- references/tailwind-css.md1.8 KiB
- references/template-driven-forms.md3.7 KiB
- references/testing-fundamentals.md2.7 KiB
references/queries-and-projection.md
Queries and content projection
Queries give a component access to elements, directives and components in its template or in its projected content. Content projection lets a parent insert markup into slots of a child component.
View queries (viewChild, viewChildren)
View queries search the component's own template. They return readonly signals.
Querying a single element or component (viewChild)
Use viewChild to find the first match. You can query by a template reference variable (string), a component or directive class, or an InjectionToken.
import {Component, ElementRef, viewChild} from '@angular/core';
@Component({
selector: 'app-search-field',
template: `<input #inputField type="text" />`,
})
export class SearchField {
readonly inputEl = viewChild<ElementRef<HTMLInputElement>>('inputField');
focusInput() {
// The value is undefined until the view has been created
this.inputEl()?.nativeElement.focus();
}
}Querying by class: The type is inferred from the class.
readonly datePicker = viewChild(DatePicker); // Signal<DatePicker | undefined>Querying by string: TypeScript cannot infer the type of the matched element. Pass a generic (
viewChild<ElementRef<HTMLInputElement>>('inputField')) or let thereadoption set the type (see below).Required queries:
viewChild.requiredreturns a signal withoutundefinedin its type. Reading it before a result exists throwsNG0951: Child query result is required but no value is available. This happens when it is read in the constructor, or when the matched element sits inside an@ifwhose condition is false. Only use.requiredfor elements that are always rendered.readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputField');
Reading a different token (read)
Use the read option to get something other than the default result from the matched element, such as its ElementRef, a directive on it, or the TemplateRef of an <ng-template>.
import {Component, ElementRef, TemplateRef, viewChild} from '@angular/core';
import {DatePicker} from './date-picker';
@Component({
selector: 'app-empty-state',
imports: [DatePicker],
template: `
<app-date-picker />
<ng-template #emptyTemplate>
<p>No results</p>
</ng-template>
`,
})
export class EmptyState {
readonly datePickerEl = viewChild(DatePicker, {read: ElementRef});
// No generic needed: the type comes from `read`
readonly template = viewChild.required('emptyTemplate', {read: TemplateRef});
}Querying multiple results (viewChildren)
viewChildren returns a signal of a readonly array (Signal<readonly T[]>).
import {Component, computed, input, viewChildren} from '@angular/core';
import {Avatar} from './avatar';
import {User} from './user.model';
@Component({
selector: 'app-user-list',
imports: [Avatar],
template: `
@for (user of users(); track user.id) {
<app-avatar [user]="user" />
}
`,
})
export class UserList {
readonly users = input.required<User[]>();
readonly avatars = viewChildren(Avatar);
readonly avatarCount = computed(() => this.avatars().length);
}When query results update
Query results update when Angular creates or destroys views, for example when an @if condition changes or @for items are added or removed. Nodes added outside Angular templates (Renderer2, innerHTML, third-party libraries) are never matched.
Content queries (contentChild, contentChildren)
Content queries search the content that a parent projects into the component. Use them when consumers provide the children, as in a tab group. A view query would not find projected children.
import {Component, computed, contentChildren} from '@angular/core';
import {Tab} from './tab';
@Component({
selector: 'app-tab-group',
template: `
<div role="tablist">
@for (title of tabTitles(); track $index) {
<button role="tab">{{ title }}</button>
}
</div>
<ng-content />
`,
})
export class TabGroup {
// Tab declares `readonly title = input.required<string>()`
readonly tabs = contentChildren(Tab);
readonly tabTitles = computed(() => this.tabs().map((tab) => tab.title()));
}Usage (the consumer imports both TabGroup and Tab):
<app-tab-group>
<app-tab title="Profile">...</app-tab>
<app-tab title="Settings">...</app-tab>
</app-tab-group>String locators: The template reference variable must be on the projected content, in the parent's template, not in the component's own template. For example,
contentChild<ElementRef>('panelHeader')in a panel component matches<app-panel><h2 #panelHeader>Title</h2></app-panel>.descendantsoption:contentChildsearches all projected content by default.contentChildrenonly matches direct children of the component's host element in the projected content. Pass{descendants: true}to also match items nested inside other elements.readonly items = contentChildren(MenuItem, {descendants: true});Content queries support
.requiredand thereadoption like view queries. The sameNG0951caveat applies: projected content inside a parent's@ifmay be absent.
Content projection
Single-slot projection
A self-closing <ng-content /> projects all children into one location.
<!-- app-button template -->
<button class="btn">
<ng-content />
</button><app-button>Click Me!</app-button>Multi-slot projection
The select attribute of <ng-content> takes a CSS selector. Prefer attribute selectors (e.g. [layout-header]) for slots. An unknown custom element such as <layout-header> fails template compilation with a "not a known element" error, unless it is a real component or the parent declares CUSTOM_ELEMENTS_SCHEMA.
<!-- app-layout template -->
<header>
<ng-content select="[layout-header]" />
</header>
<main>
<ng-content />
</main>
<footer>
<ng-content select="[layout-footer]" />
</footer><app-layout>
<h1 layout-header>My Website Header</h1>
<p>Main content goes here.</p>
<p layout-footer>Copyright Info</p>
</app-layout>Fallback content
Since Angular 18, content placed inside <ng-content> renders when nothing matches the slot.
<!-- app-card template -->
<div class="card-header">
<ng-content select="[card-title]">Default Title</ng-content>
</div>
<div class="card-body">
<ng-content />
</div>Conditional or repeated content
Do not put <ng-content> inside @if, @for, @switch or <ng-template>. The parent always instantiates projected content, even when the slot is not rendered. To render content lazily or several times, have the consumer pass an <ng-template>, query it and render it with NgTemplateOutlet, which must be added to the component's imports.
import {Component, contentChild, signal, TemplateRef} from '@angular/core';
import {NgTemplateOutlet} from '@angular/common';
@Component({
selector: 'app-expandable',
imports: [NgTemplateOutlet],
template: `
<button (click)="expanded.set(!expanded())">Toggle</button>
@if (expanded()) {
<ng-container [ngTemplateOutlet]="content()" />
}
`,
})
export class Expandable {
readonly expanded = signal(false);
readonly content = contentChild.required(TemplateRef);
}<app-expandable>
<ng-template>
<p>Details, only created when expanded.</p>
</ng-template>
</app-expandable>Best Practices
Prefer signal queries: Use
viewChild,viewChildren,contentChildandcontentChildreninstead of the@ViewChild,@ViewChildren,@ContentChildand@ContentChildrendecorators. Migrate existing code withng generate @angular/core:signal-queries-migration(see migrations.md).No
staticoption: Signal queries do not accept{static: true}, which only exists on decorator queries. Passing it is a TypeScript compilation error.Call queries as functions: Queries are signals. Read them with
this.inputEl(), notthis.inputEl.String locators match template reference variables only:
viewChild('myInput')matches<input #myInput>, not an element namedmyInputor a.myInputclass. To match a component or directive, pass its class.Derive state instead of using lifecycle hooks: Instead of reading queries in
ngAfterViewInitorngAfterContentInit, derive state from them withcomputed(). To work with the DOM of a queried element (measuring, calling a third-party library), useafterRenderEffectrather thaneffect, becauseeffectruns before Angular updates the DOM (see effects.md).Host element: To set attributes, classes or styles on the component's own host element, use the
hostproperty in@Componentinstead of injectingElementRef(see host-elements.md).Limit
nativeElementaccess: Keep it for imperative DOM APIs that templates cannot express, such asfocus(), measurements or third-party libraries. Set attributes, classes, styles and text through template bindings.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Google LLC
- Publisher
- Angular (Google) (Official)
- Distributed by
- Angular (Google)
- Source
- angular/skills · angular-developer · commit 9274c6e
- Licence
- MIT License (redistribution allowed)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google LLC or Angular (Google).
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download angular-developer.zip