Skip to content

oberconcejo/VS-CODE / .agents/skills/angular-developer

angular-developer

Verified

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

FileKindSize
SKILL.mdskill md10.8 KB
references/angular-animations.mdmarkdown3.9 KB
references/angular-aria.mdmarkdown12.3 KB
references/cli.mdmarkdown3.6 KB
references/component-harnesses.mdmarkdown2.8 KB
references/component-styling.mdmarkdown2.5 KB
references/components.mdmarkdown3.3 KB
references/creating-services.mdmarkdown2.6 KB
references/data-resolvers.mdmarkdown1.5 KB
references/define-routes.mdmarkdown1.7 KB
references/defining-providers.mdmarkdown2.2 KB
references/di-fundamentals.mdmarkdown3.5 KB
references/e2e-testing.mdmarkdown1.9 KB
references/effects.mdmarkdown2.7 KB
references/hierarchical-injectors.mdmarkdown2.0 KB
references/host-elements.mdmarkdown2.1 KB
references/injection-context.mdmarkdown1.9 KB
references/inputs.mdmarkdown2.4 KB
references/linked-signal.mdmarkdown2.5 KB
references/loading-strategies.mdmarkdown1.4 KB
references/mcp.mdmarkdown4.0 KB
references/navigate-to-routes.mdmarkdown1.6 KB
references/outputs.mdmarkdown2.5 KB
references/reactive-forms.mdmarkdown3.5 KB
references/rendering-strategies.mdmarkdown1.8 KB
references/resource.mdmarkdown2.7 KB
references/route-animations.mdmarkdown1.6 KB
references/route-guards.mdmarkdown1.4 KB
references/router-lifecycle.mdmarkdown1.5 KB
references/router-testing.mdmarkdown3.8 KB
references/show-routes-with-outlets.mdmarkdown1.6 KB
references/signal-forms.mdmarkdown23.6 KB
references/signals-overview.mdmarkdown2.8 KB
references/tailwind-css.mdmarkdown1.8 KB
references/template-driven-forms.mdmarkdown3.7 KB
references/testing-fundamentals.mdmarkdown2.6 KB

references/signals-overview.md

View on GitHub
# Angular Signals Overview

Signals are the foundation of reactivity in modern Angular applications. A **signal** is a wrapper around a value that notifies interested consumers when that value changes.

## Writable Signals (`signal`)

Use `signal()` to create state that can be directly updated.

```ts
import {signal} from '@angular/core';

// Create a writable signal
const count = signal(0);

// Read the value (always requires calling the getter function)
console.log(count());

// Update the value directly
count.set(3);

// Update based on the previous value
count.update((value) => value + 1);
```

### Exposing as Readonly

When exposing state from a service, it is a best practice to expose a readonly version to prevent external mutation.

```ts
private readonly _count = signal(0);
// Consumers can read this, but cannot call .set() or .update()
readonly count = this._count.asReadonly();
```

## Computed Signals (`computed`)

Use `computed()` to create read-only signals that derive their value from other signals.

- **Lazily Evaluated**: The derivation function doesn't run until the computed signal is read.
- **Memoized**: The result is cached. It only recalculates when one of the signals it depends on changes.
- **Dynamic Dependencies**: Only the signals _actually read_ during the derivation are tracked.

```ts
import {signal, computed} from '@angular/core';

const count = signal(0);
const doubleCount = computed(() => count() * 2);

// doubleCount automatically updates when count changes.
```

## Reactive Contexts

A **reactive context** is a runtime state where Angular monitors signal reads to establish a dependency.

Angular automatically enters a reactive context when evaluating:

- `computed` signals
- `effect` callbacks
- `linkedSignal` computations
- Component templates

### Untracked Reads (`untracked`)

If you need to read a signal inside a reactive context _without_ creating a dependency (so that the context doesn't re-run when the signal changes), use `untracked()`.

```ts
import {effect, untracked} from '@angular/core';

effect(() => {
  // This effect only runs when currentUser changes.
  // It does NOT run when counter changes, even though counter is read here.
  console.log(`User: ${currentUser()}, Count: ${untracked(counter)}`);
});
```

### Async Operations in Reactive Contexts

The reactive context is only active for **synchronous** code. Signal reads after an `await` will not be tracked. **Always read signals before asynchronous boundaries.**

```ts
// Incorrect: theme() is not tracked because it is read after await
effect(async () => {
  const data = await fetchUserData();
  console.log(theme());
});

// Correct: Read the signal before the await
effect(async () => {
  const currentTheme = theme();
  const data = await fetchUserData();
  console.log(currentTheme);
});
```
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 319kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 319kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 319kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 196kUpdated Claude CodeCodexVerifiedInstall