state-management

state-management is an agent for Claude Code from SAP/fundamental-ngx. It costs 0 tokens per session (3,395 once invoked), scanned A, original, Apache-2.0.

A guide to managing application state with Angular signals, ordinary properties, and RxJS observables. State is the data an application stores and updates while it runs.

In plain words
What is it for?
Use it to decide when to use signals, update signal values immutably, use effects, derive mutable state, or migrate BehaviorSubject and RxJS patterns.
Why use it?
It helps choose the right storage method and avoid unnecessary reactive tracking or unsafe updates during migrations.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

About the project

Fundamental Library for Angular is an SAP-maintained Angular component library implementing SAP's design system and wrapping UI5 Web Components. Angular developers use its typed UI components and higher-level composites to build SAP-style web interfaces. Catalogue entries provide skills, agents, instructions, and a rule for working with the library.

SAP/fundamental-ngx · 294 stars · on GitHub · sap.github.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/sap/fundamental-ngx/state-management
Clone the repo
git clone --depth 1 https://github.com/SAP/fundamental-ngx

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for state-management

README.md
[![agentmods](https://agentmods.dev/badge/agents/sap/fundamental-ngx/state-management.svg)](https://agentmods.dev/agents/sap/fundamental-ngx/state-management)
Your own site
<a href="https://agentmods.dev/agents/sap/fundamental-ngx/state-management"><img src="https://agentmods.dev/badge/agents/sap/fundamental-ngx/state-management.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,395 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03395
Opus 5 $0.00000 $0.01698
Sonnet 5 $0.00000 $0.00679
Haiku 4.5 $0.00000 $0.00340

Measured 6d ago against content hash e5859a134502, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

state-management scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/state-management.md · 478 lines

How it starts

The opening of the file, as written. The whole thing — 478 lines — stays where its author put it; the contents beside it link to each section on GitHub.

State Management

This document covers state management patterns using Angular signals and migration from RxJS patterns.

Table of Contents


When to Use Signals vs Plain Properties

Core principle: Signals exist to feed Angular's reactive graph. If a value has no reactive consumer, making it a signal adds tracking overhead for no benefit.

Decision Rule

Does anything REACTIVE read this value?
│
├─ YES (template, host binding, computed, effect)
│   └─▶ Use signal()
│
└─ NO (only used in imperative methods, cleanup, caching)
    └─▶ Use plain property

Use signal() when the value drives the UI

// 1. Template reads it
protected readonly count = signal(0);
// <span>{{ count() }}</span>

// 2. Host binding reads it
protected readonly isActive = signal(false);
// host: { '[class.active]': 'isActive()' }

// 3. A computed() derives from it
protected readonly price = signal(100);
protected readonly quantity = signal(2);
protected readonly total = computed(() => this.price() * this.quantity());

// 4. An effect() should re-run when it changes
protected readonly theme = signal<'light' | 'dark'>('light');
// effect(() => { document.body.setAttribute('data-theme', this.theme()); });

Do NOT use signal() for internal bookkeeping

// 1. One-time initialization flag — no reactive consumer
private _initialized = false;

// 2. Cached DOM measurement — used imperatively only
private _cachedRect: DOMRect;

// 3. Subscription/observer reference — just for cleanup
private _resizeObserver: ResizeObserver | null = null;

// 4. Intermediate calculation variable — method-scoped
private _formatValue(raw: number): string {
    const rounded = Math.round(raw * 100) / 100;
    return `${rounded}%`;
}

Read the full file on GitHub · 478 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 478 lines · 0 tokens per session scan A e5859a134502

Subscribe to this mod's changes

state-management is an agent published in the GitHub repository SAP/fundamental-ngx (294 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,395 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.