Angular Standalone Features and State Architecture
Build Angular standalone features with lazy routes, scoped state, safe RxJS flows, and targeted tests.
Before & after
Same prompt, same agent — the only difference is the skill.
For state management in a growing Angular app, you have a few options: - Services with RxJS BehaviorSubjects for simpler needs - NgRx for complex, large-scale state - NgRx Signals for a more modern approach - Component state for local concerns NgRx is powerful but adds boilerplate, so it's best when you have genuinely complex state. For simpler apps, services with observables may be enough. Consider how much shared state you have and how complex the flows are before adding a library. What does your app's state look like?
Angular 17+ state. The decision that matters first: do you actually need NgRx, or a signal store? Adding NgRx to state that didn't need it is the most common Angular over-engineering. THE TEST Shared across many unrelated components + complex async flows + you need time-travel/devtools → NgRx. Mostly local or simple shared state → signals + a service. Don't reach for the store. IF IT'S NgRx — the standalone, modern setup provideStore() in app.config.ts (standalone — no NgModule) Feature state with createFeature + createReducer Effects for the async: createEffect handling the API calls, so components dispatch and read, never fetch. Selectors memoized, so the template re-renders only on real change. IF IT'S SIGNALS — the lighter path A signal-based store service: signal() for state, computed() for derived values, exposed as readonly. No actions, no reducers, no boilerplate — and it integrates with the template's change detection natively. THE RxJS RULE EITHER WAY Async stays in effects or the service, never in components. A component that subscribes directly leaks and re-fetches; one that reads a signal or selector doesn't. PERFORMANCE OnPush change detection everywhere, and signals or memoized selectors so a change to one slice doesn't re-render the tree. Tell me how much of your state is genuinely shared vs. local, and I'll tell you which of the two to build — and scaffold it.
About this skill
Your Angular feature works until navigation duplicates a request, a late response overwrites newer results, or a supposedly lazy screen lands in the initial bundle. This skill builds and reviews standalone Angular features around explicit routing, state ownership, and observable lifetimes.
What it does
- Creates standalone components with explicit imports, typed templates, and deliberate loading, empty, and error states.
- Chooses local signals, a feature service, or NgRx according to who owns and shares the state.
- Implements lazy routes, functional guards, and correctly scoped dependency providers.
- Matches RxJS operators to cancellation, ordering, and duplicate-submission requirements.
- Writes focused tests for request races, navigation, failures, and state transitions.
- Diagnoses eager imports, duplicate subscriptions, and expensive rendering before recommending performance changes.
What you get
Implementation code or a focused patch, with provider placement, state and concurrency decisions, and relevant test cases. Performance findings distinguish measured results from changes that still need verification.
Best for
Angular developers building standalone features, integrating NgRx, debugging reactive flows, or reviewing production applications.
SKILL.md preview
---
name: angular-standalone-features-and-state-architecture
description: >-
Builds and reviews Angular standalone features using explicit route and provider boundaries, state ownership, RxJS concurrency rules, and targeted tests. Use when the user says "build a standalone Angular feature", "lazy-load this route", "set up an NgRx feature store", "should this be a signal or an observable?", "my search keeps showing old results", "my component makes duplicate HTTP requests", or "my Angular bundle keeps getting bigger".
---
# Angular Standalone Features and State Architecture
… (sign up to view the full skill)More development skills
View all Development skills →Frontend Component UX and Accessibility Review
Severity-ranked fixes with code for UI components: states, keyboard, focus, ARIA, touch targets, contrast, and responsive breakage.
Three.js Click-to-Learn 3D Game Builder
Build click-to-learn 3D games in Three.js: TSL materials, reliable object picking, and an accessible quiz overlay fed by content data.
shadcn/ui Component Building and Theming
Build, theme, and debug shadcn/ui components the way the library is designed to work, with Tailwind v3 and v4 theming handled correctly.
Design-Matched SEO Pages and Graded Site Audit
Add about, team, or testimonial pages that match your site's design, with unique meta, canonicals, and JSON-LD, plus a graded audit.