AI coding agents using the angular-developer skill were observed calling
plain methods inside @for/@if template expressions, for example
items(count) returning a new array on every check. The skill had no
guidance on this.
Add a short rule to SKILL.md and a section to components.md that
recommends computed(), a pure pipe or a child component for expensive
work that would otherwise re-run on every change detection cycle. Signal
reads and cheap calls stay allowed.
Related to #70132
The @boundary/@error template block lets a component catch rendering
and change detection errors in a subtree and show a fallback instead
of leaving the page blank, with a built-in $reset function to retry.
This was not documented anywhere in the angular-developer skill.
Add a callout explaining that `fixture.changeDetectorRef` belongs to the host view, so its `markForCheck()` does not refresh the template of `OnPush` components. Also update the developer skill and AGENTS.md to prefer signals in tests.
Fixes#71293
Add a reference for signal-based queries and content projection to the
angular-developer skill, and mention the topic in the skill description
so agents load it for these tasks.
The reference covers viewChild/viewChildren and contentChild/
contentChildren (including `.required`, `read` and the `descendants`
defaults), when query results update, single and multi-slot projection,
`<ng-content>` fallback content, and rendering content lazily with an
`<ng-template>` and `NgTemplateOutlet`. The best practices call out
mistakes agents often make, such as passing `{static: true}` to signal
queries or using a view query for projected children.
Angular CLI 22.1.0 renamed the MCP devserver tools from
`devserver.start`, `devserver.stop` and `devserver.wait_for_build` to
`devserver_start`, `devserver_stop` and `devserver_wait_for_build` so
that they match the MCP tool name pattern. The AI guide and the
angular-developer skill still listed the dotted names, which no longer
exist in the tool list the server returns.
The route guards guide and the agent skill say guards in an array "are
executed in the order they appear". The router starts every guard in the
array and combines their results by array priority, so asynchronous guards
run concurrently and a later guard can finish, with its side effects,
before an earlier one resolves. Document the actual behavior and warn
against guards that depend on an earlier guard in the same array.
The resolver examples read `toSignal(this.route.data)` and then access
`this.data().user`. Without options `toSignal` returns
`Signal<Data | undefined>`, so the snippet fails to compile under strict
null checks. `ActivatedRoute.data` is backed by a `BehaviorSubject` and
always emits synchronously, so pass `requireSync: true` to get a
`Signal<Data>`.
Also add the missing `@` before the version in the `@angular/cli`
argument of the `ng update` example in the CLI skill reference.
The guide tells the reader to select "Bootstrap the project using
standalone APIs". The schematic offers "Bootstrap the application using
standalone APIs", so the option cannot be found by the name the guide
gives. The other two steps already quote their labels verbatim.
The Angular developer skill repeats the same three steps and carries the
same wrong label, plus an extra comma in the first one.
The signal forms reference of the angular-developer skill contradicted the
implementation in several places, so an agent following it produced code that
does not compile or avoided valid APIs:
- It said `when` only works with `required()`. Every built-in validator accepts
`when` since v22, and the skill even listed a compiler error for it that
no longer exists. Document `when` on the other validators and drop the
wrong pitfall row and recovery section.
- It recommended `<select multiple [formField]>` for `string[]` fields,
including in the Big Form Example, which fails with TS2322 under
strictTemplates. `[formField]` does not support `<select multiple>`, as
the signal forms guide already states. Model multiple choices as one
boolean field per option bound to a checkbox instead.
- The Conditional Validation snippets used names that do not exist
(`disable`, `require`), undefined variables and a test-only injector.
Rewrite them so they compile.