GravionLabs/elysion / .agents/skills/ng-implementation
ng-implementation
VerifiedAngular 21+ implementation and review rules (standalone, signals, DI, forms). Use when writing or changing Angular code.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.7 KB |
| references/component.md | markdown | 1.4 KB |
| references/mcp.md | markdown | 2.3 KB |
| references/signal-store.md | markdown | 982 B |
| references/version-notes.md | markdown | 3.0 KB |
references/version-notes.md
View on GitHub# Version-sensitive Angular APIs
<!-- Derived from Google's Angular skill. Copyright 2026 Google LLC, MIT License. -->
Non-obvious or experimental APIs. For anything else, use the Angular MCP server or angular.dev.
## `linkedSignal` vs `computed` vs `effect`
- `computed`: strictly derived, read-only
- `linkedSignal`: derived default, but user can `.set()` it; resets when the source changes
- Never use `effect` to copy one state into another — use `computed` or `linkedSignal`
- Keep a still-valid selection on source change: `linkedSignal({ source, computation: (next, previous) => ... })`
## `resource` (experimental)
- `resource({ params: () => ({...}), loader: async ({ params, abortSignal }) => ... })` — the option is `params`, not `request`
- Always pass `abortSignal` to `fetch`
- Signals: `value()`, `hasValue()`, `isLoading()`, `error()`, `status()` (`idle|loading|resolved|error|reloading|local`); `.reload()` re-runs; `value.set()` makes status `local`
- With `HttpClient` (and interceptors) prefer `httpResource`
## Signal Forms (opt-in, `@angular/forms/signals`)
- Never import `FormControl`/`FormGroup`/`FormBuilder` alongside it; there is no builder
- Initial values must not be `null`/`undefined` (`''`, `0`)
- A field is a function: call it for state — `form.field().valid()`, `form().invalid()`. Exception: `form.items.length` (no parentheses)
- Rule callbacks take a context: `({ value }) => ...`, `({ state }) => state.touched()`; `applyWhen(path, condition, schemaFn)` needs 3 args; `applyEach(path, (item) => ...)` takes one
- No `[value]`, `min`, `max`, `readonly` attributes with `[formField]` — use `min()`, `max()`, `readonly()` rules
- `submit(form, async () => ...)` — the callback must be async
- `validateAsync` requires `onError`; its `params` is `({ value }) => value()`
- Checkboxes bind to `boolean` only; there is no `FormState` — use `FieldState`
- Nested `@for`: no `$parent.$index`, use `let outerIndex = $index`
## Angular Aria (`@angular/aria`)
- Install first: `npm install @angular/aria`
- Headless: you supply HTML and CSS; style via `[aria-expanded]`, `[aria-selected]`, `[aria-disabled]`, `[aria-current="page"]`
- Entry points: `@angular/aria/accordion|listbox|combobox|menu|tabs|toolbar|tree` (Grid also supported)
- Use the `ng*` directives instead of native `<select>` for these patterns
- Lazy-render heavy panels with `ngAccordionContent` / `ngTabContent` inside `ng-template`
## Functional route guards
- `CanActivateFn`, `CanActivateChildFn`, `CanDeactivateFn`, `CanMatchFn`; use `inject()` inside
- Return `boolean`, `UrlTree` or `RedirectCommand` (or Observable/Promise of those); `canMatch: false` lets the router try other routes
- Client guards are not security — verify on the server
## Testing (Vitest, v21+)
- `ng new` configures Vitest; Jest is for v20 and earlier
- Standalone component: `TestBed.configureTestingModule({ imports: [MyComponent] })`
- Signal effects need `TestBed.flushEffects()`; code that calls `inject()` needs `TestBed.runInInjectionContext`
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |