logic-state-layer

logic-state-layer is a skill for Claude Code, Codex from AmadeusITGroup/otter. It costs 48 tokens per session (1,525 once invoked), scanned A, original, BSD-3-Clause.

A decision tree for placing application logic in an Angular component, service, or NgRx store. NgRx is a library for managing shared application state.

In plain words
What is it for?
Deciding where to put UI state, reusable behavior, API calls, and shared application data.
Why use it?
It prevents simple component state from gaining unnecessary layers and keeps shared or server-related logic in an appropriate place.

Skill for Claude CodeCodex

Part of the otter plugin — 11 skills, 3 agents, 3 MCP servers shipped together

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 skills/amadeusitgroup/otter/logic-state-layer
Any agent
npx skills add AmadeusITGroup/otter --skill logic-state-layer
Clone the repo
git clone --depth 1 https://github.com/AmadeusITGroup/otter

Made for: Claude Code, Codex.

Or install otter, the plugin that ships this one along with the rest of its 11 skills, 3 agents, 3 MCP servers.

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 logic-state-layer

README.md
[![agentmods](https://agentmods.dev/badge/skills/amadeusitgroup/otter/logic-state-layer.svg)](https://agentmods.dev/skills/amadeusitgroup/otter/logic-state-layer)
Your own site
<a href="https://agentmods.dev/skills/amadeusitgroup/otter/logic-state-layer"><img src="https://agentmods.dev/badge/skills/amadeusitgroup/otter/logic-state-layer.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,525 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 $0.00048 $0.01525
Opus 5 $0.00024 $0.00763
Sonnet 5 $0.00010 $0.00305
Haiku 4.5 $0.00005 $0.00153

Measured 4d ago against content hash 43eb9a349e85, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

logic-state-layer 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 4d 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.

tools/llm/plugins/otter/skills/logic-state-layer/SKILL.md · 160 lines

How it starts

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

Decision tree — logic layer

Returns: component class, service (and its scope), or store.

Walk down and stop at the first match, except where a step tells you to read the next one before concluding. Each step down costs indirection, so earn it.

Step — component-local: does this state die with the component?

TRIGGER  the state is scoped to one component and read by nothing else
         local signals, derived values, event handlers, a form this component owns

RESULT   component class
IMPLEMENT  signal(), computed(), local form wiring — add no service for this
VERIFY     nothing outside the component reads it
           no service or store was created for it

STOP. The layer is decided.
// Search term and pagination are pure UI concerns: nothing outside this
// component reads them, so they need no service and no store.
public readonly searchTerm = signal('');
public readonly currentPage = signal(1);

public readonly displayedItems = computed(() =>
  this.items().slice((this.currentPage() - 1) * this.pageSize(), this.currentPage() * this.pageSize())
);

Step — shared or stateless: is it reused beyond one component?

CRITERION A  behaviour or state shared between components
CRITERION B  stateless and reusable regardless of sharing — a wrapper over a browser
             API, a pure computation, a cross-cutting concern such as logging
CRITERION C  orchestration across several API calls, or reusable pre/post processing

IF none is true -> go to the application-scoped step

IF any is true  -> a service covers it, but a store criterion can still apply on top.
                   Read the application-scoped step before concluding:
                     none of its criteria met -> RESULT: injectable service
                     any of its criteria met  -> RESULT: store for the state, plus a
                                                 service only for what B or C describes

CHOOSE THE SCOPE (service only)
  shared only between a container and its own subcomponents
    -> providers: [] on that container
  shared across unrelated features, and no store criterion applied
    -> providedIn: 'root'

VERIFY  the container injects it; a presenter does not, unless it is a pure
        presentation helper
        it does not select from the store — that selection belongs in the container

STOP once the application-scoped step has been read and returned no store.

Read the full file on GitHub · 160 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. 4d ago First seen · 160 lines · 48 tokens per session scan A 43eb9a349e85

Subscribe to this mod's changes

logic-state-layer is a skill published in the GitHub repository AmadeusITGroup/otter (57 stars, last pushed today), licensed BSD-3-Clause. It adds 48 tokens to every session and 1,525 once invoked, about $0.0002 per session on Opus 5. 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.

Related

Other skills, from other repositories