agentsclimarketplace

Ngrx feature scaffold

Skill Solonnikov/agent-skills/skills/ngrx-feature-scaffold

Public collection of agent skills — reusable capabilities, prompts, and workflows for Claude Code and other agentic coding tools.

Install
npx -y skills add Solonnikov/agent-skills --skill ngrx-feature-scaffold

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Scaffolds a complete NgRx feature module (actions, reducer, effects, selectors, facade, models, tests) using modern Angular patterns. Use when adding a new feature slice to an Angular + NgRx app, standardizing existing ad-hoc state code, or bootstrapping state for a new library in an Nx monorepo.

SKILL.md

3.8 KB, as published. Nobody here has run it

NgRx Feature Scaffold

Generate a coherent NgRx feature slice that follows current best practices:

  • createActionGroup with event-style action names
  • Reducer + typed state interface + feature key constant
  • createFeatureSelector + composed selectors
  • Effects using exhaustMap / switchMap / concatMap appropriately
  • Facade as the single component-facing API
  • Colocated .spec.ts tests for reducer, selectors, and facade

When to use

  • Adding a new feature slice to an Angular + NgRx app.
  • Bootstrapping state in a new Nx library.
  • Replacing ad-hoc services-as-state with proper NgRx.
  • Standardizing an existing feature that has drifted from the pattern.

Before you start

Ask (or derive from context) the following — defaults in square brackets:

  1. Feature name — kebab-case (e.g. user-profile). Used for folder and action source.
  2. Feature key — usually the same word in camelCase (e.g. userProfile). Used as the reducer key.
  3. State shape — what fields does this feature own? (entity? list? flags?)
  4. Data source — HTTP, WebSocket, both? Which service will effects call?
  5. Framework version — [@ngrx/* 16+ for createActionGroup]. If older, fall back to createAction + union types.

Authoring workflow

  1. Create the +state/ folder inside the feature's lib/app.
  2. Write files in this order — each one drives the next:
    1. <feature>.models.ts — state interface + domain types
    2. <feature>.actions.tscreateActionGroup with one event per use case
    3. <feature>.reducer.ts — feature key, initial state, createReducer with on(...) handlers
    4. <feature>.selectors.ts — feature selector + composed selectors
    5. <feature>.effects.ts — one effect per async event, calls services via inject()
    6. <feature>.facade.ts — exposes observables + dispatch methods
  3. Register the reducer and effects in the lib/app module.
  4. Write colocated .spec.ts for reducer, selectors, and facade (see references).
  5. Verify: build passes, tests pass, DevTools shows dispatched actions.

Non-negotiable rules

  • One facade is the only thing components inject. Components never import the store, actions, or selectors directly.
  • Actions are events, not commands'Load User Success', not 'Set User'.
  • Reducers are pure — no side effects, no service calls, no Date.now() hidden inside.
  • Effects use higher-order operators deliberately:
    • exhaustMap for idempotent one-shot loads (avoid duplicate in-flight).
    • switchMap for user-driven queries (cancel previous).
    • concatMap for writes that must preserve order.
    • Never nested subscribe().
  • Selectors are composed, not recomputed in components.
  • Every async op has loading + error flags in state (or a generic RequestStatus discriminant).
  • providedIn: 'root' for the facade — singletons, no manual provider arrays.

References

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.