angular-state
Use when designing a store or state service in an Angular app, choosing between signals, RxJS, and NgRx, modeling state shape, writing selectors/derived…
Skill by CreativeCodersTeam
Chalk Labs
Need help deploying angular-state?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/creativecodersteam-angular-state
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/angular-state
What's inside
- Skill name
angular-state- Description
- Use when designing a store or state service in an Angular app, choosing between signals, RxJS, and NgRx, modeling state shape, writing selectors/derived state, optimizing change detection, handling optimistic updates and concurrency conflicts, persisting/hydrating state, or troubleshooting over-fetching and re-render performance.
- License
- Apache-2.0
- Instructions
- 108 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- concurrency-control.md · references/
SKILL.md (first lines)
# Angular Reactive Data & State Best Practices
## When to Use
- Designing or restructuring a store, state service, or facade (the client analogue of a data layer)
- Choosing a state approach: signals, RxJS services, NgRx Store, or NgRx Component Store
- Modeling state shape, normalizing collections, or keeping state immutable
- Writing selectors / derived state, or troubleshooting over-fetching, redundant requests, and re-render performance
- Implementing optimistic updates and handling server-side concurrency conflicts
- Persisting and hydrating state (localStorage/sessionStorage) with versioning
## Store / State-Container Design
- Keep stores **focused and cohesive** — one feature's state per store, not a single god-store.
- Treat state as the **single source of truth**; components read from it and dispatch changes, they don't hold duplicate copies.
- Use **constructor/`inject()`** for dependencies (HTTP services, config).
- Expose **read-only** views (`signal.asReadonly()`, `Observable`) and mutate only through explicit methods/actions.
- **Pick the narrowest tool:**
| State | Use |
|-------|-----|
| Local component view state | `signal()` / `computed()` in the component |
| Feature state shared across a routed area | a `providedIn`-scoped service exposing signals or `BehaviorSubject` |
| Feature state, signal-first, with less boilerplate than the full Redux flow | **NgRx SignalStore** (`signalStore`, `withState`/`withComputed`/`withMethods`) |
| Complex, app-wide, multi-source state with strict traceability | **NgRx Store** (actions/reducers/selectors/effects) |
| Local, self-contained reactive workflows | **NgRx Component Store** |
## Async Data: `resource()` / `httpResource()`
For **reactive reads** (load-on-signal-change), prefer the resource APIs over hand-rolled `subscribe`/`toSignal` plumbing. They expose `value`, `status`, `error`, and `isLoading` as signals and auto-cancel superseded requests when their reactive params change.
- **`resource()`** — wraps any async loader (a `Promise`-returning function); the `request`/`params` signal drives reloads. Use for non-HTTP or custom async sources.
- **`rxResource()`** — same, but the loader returns an `Observable` (integrates an existing RxJS service).
- **`httpResource()`** — declarative, signal-driven `HttpClient` GET; returns `HttpResourceRef` whose `value` is a signal. Use for reactive reads that depend on signals.
```typescript
export class OrderDetail {
readonly id = input.required<number>();
// refetches whenever id() changes; exposes value()/isLoading()/error()
readonly order = httpResource<Order>(() => `/api/orders/${this.id()}`);
}
```
Keep using **`HttpClient`** directly for commands/mutations (POST/PUT/DELETE), streaming, and interceptor-heavy flows — resources are for reactive reads, not write operations.
## State Shape (Model) Design
- Use stable identifiers (`id`) and **normalize** collections (`Record<id, Entity>` + `id[]`) instead of nested arrays when items are referenced in multiple places.
- Keep state **immutable** — replace, don't mutate (`signal.update(s => ({ ...s, ... }))`); enable `readonly` types.
- Model relationships by id reference, not by embedding mutable copies.
- Keep derived data **out** of stored state — compute it (see Selectors).
## Performance
- Use `ChangeDetectionStrategy.OnPush` everywhere; prefer **signals** so views update only when read values change.
- In `@for`, always provide `track` (and `trackBy` in legacy `*ngFor`) to avoid re-rendering unchanged rows.
- Derive with **memoized** `computed()` / NgRx selectors instead of recomputing in templates.
- **Avoid over-fetching:** dedupe in-flight requests (`shareReplay({ bufferSize: 1, refCount: true })`), cache reads, and load only the fields/pages you need (pagination with page/size).
- Use `async` pipe or `toSignal()` rather than manual `subscribe` to prevent leaks and redundant change detection.
- **Zoneless change detection** (`provideZonelessChangeDetection()`, stable since v20.2, default for new apps since v21) removes Zone.js and updates the view only from signal reads, `markForCheck`, and async pipe — the end state of a signal-first app; new v21+ apps start zoneless. For existing apps adopt it deliberately: ensure state flows through signals/`OnPush`, test in staging, and don't flip a large production app in one step.
## Persistence & Hydration
- The client has no schema migrations, but persisted state **does** have a shape that evolves. Version persisted blobs (`{ version, data }`) and migrate or discard on mismatch when hydrating.
- Persist deliberately (localStorage/sessionStorage/IndexedDB) — only what must survive reloads, never large or sensitive data.
- Hydrate at startup (e.g. in a `provideAppInitializer`) and guard against malformed/stale payloads.
## Selectors & Derived State
- Compute derived values with `computed()` (signals) or memoized selectors (NgRx); don't store what you can derive.
- For **writable** derived state that resets when its source changes, use **`linkedSignal()`** (e.g. a selected-item signal that defaults from a list but can be overridden) instead of syncing with an `effect()`.
- Compose selectors from smaller selectors; keep them pure.
- For RxJS-derived data, choose operators deliberately (`map`, `filter`, `combineLatest`, `switchMap` for cancel-previous, `exhaustMap` to ignore-while-busy, `concatMap` to queue).
## Updates & Concurrency
- Update state **immutably**; batch related changes into one update/action.
- Prefer **optimistic updates** for snappy UX, with rollback on failure.
- Implement concurrency control for multi-user scenarios (see below).
- Use cancellation-aware operators (`switchMap`) so superseded requests don't clobber newer state.
### Optimistic Updates & Concurrency
See [concurrency-control.md](./references/concurrency-control.md) for optimistic-update-with-rollback, ETag/`If-Match` version tokens, and handling `409 Conflict` responses.
## Security
- **Never store secrets or sensitive personal data in client state or localStorage** — it is fully visible to the user and to any XSS payload.
- Treat all server data as untrusted for rendering; rely on Angular's built-in sanitization and avoid `bypassSecurityTrust*` unless unavoidable.
- Scope per-user state and clear it on logout (don't leak one user's cached data to the next).
## Testing
- Test stores/services by asserting emitted state after actions — assert **behavior/output**, not internal fields.
- Use marble testing (`TestScheduler`) for non-trivial RxJS operator chains.
- Mock HTTP with `provideHttpClient()` + `provideHttpClientTesting()` and inject `HttpTestingController`; mock dependencies with spies.
- For NgRx, test reducers as pure functions, selectors with `projector`, and effects with `provideMockActions`.
- Use the `angular-tester` skill for generating unit tests after state changes.
## Related Skills
- **[angular-fundamentals](../angular-fundamentals/SKILL.md)** — DI scopes for stores, typed config, signals, and `DestroyRef` teardown used in state code
- **[angular-tester](../angular-tester/SKILL.md)** — Generates unit tests for stores, selectors, and effects (marble testing, HttpTestingController)
- **[angular-components](../angular-components/SKILL.md)** — Consumes state via signals/async pipe; wires HTTP and interceptors
- **[angular-reviewer](../angular-reviewer/SKILL.md)** — Reviews state/data code for performance and correctness issues
- **[angular-package-manager](../angular-package-manager/SKILL.md)** — Adds RxJS, NgRx, or component-store packages
- **[angular-dev](../angular-dev/SKILL.md)** — Gated end-to-end implementation workflow that invokes this skill as a mandatory bindingFrom CreativeCodersTeam/ai-store, Apache-2.0.
More from CreativeCodersTeam/ai-store
- 0.570score
code-design
CreativeCodersTeam
Use only when explicitly requested by name — "code-design", "code design", "/code-design", "/cc-ai-dev:code-design" — or when another skill or a…
SkillAFreshness: AClaude Code +9 - 0.544score
dep-pr-cleanup
CreativeCodersTeam
Use when the user wants to clean up or consolidate the open pull requests of dependency bots such as Dependabot or Mend Renovate — finding bot PRs made…
SkillAFreshness: AClaude Code +9 - 0.529score
angular-reviewer
CreativeCodersTeam
Use only when a structured Angular code review is explicitly requested by name — "angular-reviewer", "angular code review", or "angular review" — on an…
SkillBFreshness: BClaude Code +9 - 0.529score
implement-dev-plan
CreativeCodersTeam
Use only when explicitly requested by name — "implement-dev-plan", "implement dev plan", "/implement-dev-plan", "/cc-ai-dev:implement-dev-plan", "run…
SkillBFreshness: BClaude Code +9 - 0.529score
angular-dev
CreativeCodersTeam
Use only when the user themselves explicitly requests it by name — "angular-dev", "angular dev", "/angular-dev", "/cc-ai-angular:angular-dev" — for the gated…
SkillBFreshness: BClaude Code +9 - 0.529score
angular-library-builder
CreativeCodersTeam
Use when asked to create an Angular library, build an Angular client SDK, wrap a REST API or OpenAPI/Swagger spec in a typed Angular service, or generate a…
SkillBFreshness: BClaude Code +9 - 0.529score
claude-md-downstream
CreativeCodersTeam
Use only when explicitly requested by name — "claude-md-downstream", "/claude-md-downstream", "/cc-ai-dev:claude-md-downstream", "run claude-md-downstream" —…
SkillBFreshness: BClaude Code +9 - 0.529score
create-dev-plan
CreativeCodersTeam
Use only when explicitly requested by name — "create-dev-plan", "create dev plan", "/create-dev-plan", "/cc-ai-dev:create-dev-plan", "start create-dev-plan" —…
SkillBFreshness: BClaude Code +9 - 0.529score
diagnose-bug
CreativeCodersTeam
Use only when explicitly requested by name — "diagnose-bug", "diagnose bug", "/diagnose-bug", "/cc-ai-dev:diagnose-bug", "run diagnose-bug" — or when another…
SkillBFreshness: BClaude Code +9 - 0.529score
angular-components
CreativeCodersTeam
Use when creating Angular components, templates, or feature folders, configuring the router or lazy-loaded routes, building reactive or template-driven forms…
SkillBFreshness: BClaude Code +9 - 0.529score
angular-tsdoc
CreativeCodersTeam
Use when writing or reviewing TSDoc/JSDoc comments on Angular/TypeScript code — public APIs, exported library symbols, component inputs/outputs — or when doc…
SkillBFreshness: BClaude Code +9 - 0.529score
auto-loop
CreativeCodersTeam
Use only when explicitly requested by name — "auto-loop", "auto loop", "/auto-loop", "/cc-ai-dev:auto-loop", "run auto-loop" — to run one goal as an…
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 28, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/CreativeCodersTeam/ai-store
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from CreativeCodersTeam
- 0.570score
code-design
CreativeCodersTeam
Use only when explicitly requested by name — "code-design", "code design", "/code-design", "/cc-ai-dev:code-design" — or when another skill or a…
SkillAFreshness: AClaude Code +9 - 0.544score
dep-pr-cleanup
CreativeCodersTeam
Use when the user wants to clean up or consolidate the open pull requests of dependency bots such as Dependabot or Mend Renovate — finding bot PRs made…
SkillAFreshness: AClaude Code +9 - 0.529score
auto-loop
CreativeCodersTeam
Use only when explicitly requested by name — "auto-loop", "auto loop", "/auto-loop", "/cc-ai-dev:auto-loop", "run auto-loop" — to run one goal as an…
SkillBFreshness: BClaude Code +9 - 0.529score
angular-dev
CreativeCodersTeam
Use only when the user themselves explicitly requests it by name — "angular-dev", "angular dev", "/angular-dev", "/cc-ai-angular:angular-dev" — for the gated…
SkillBFreshness: BClaude Code +9 - 0.529score
angular-components
CreativeCodersTeam
Use when creating Angular components, templates, or feature folders, configuring the router or lazy-loaded routes, building reactive or template-driven forms…
SkillBFreshness: BClaude Code +9 - 0.529score
angular-reviewer
CreativeCodersTeam
Use only when a structured Angular code review is explicitly requested by name — "angular-reviewer", "angular code review", or "angular review" — on an…
SkillBFreshness: BClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get angular-state running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
angular-state skill. Agent Mart. https://agentmart.dev/skills/creativecodersteam-angular-state (last updated 2026-10-24)