entity-conventions

Defines conventions for building route-based entity edit panels and stores in Angular admin apps.

1|Updated Jan 14, 2024
One-click install
npx skills add https://github.com/Eyhenij/rt-tools --skill entity-conventions-eyhenij
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: entity-conventions
Source: https://github.com/Eyhenij/rt-tools/tree/main/.claude/skills/entity-conventions
Command: npx skills add https://github.com/Eyhenij/rt-tools --skill entity-conventions-eyhenij

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When building admin panels that create or edit records, teams often diverge on how asides open, how mutations are handled, and how stores respond. This rule standardizes entity editing across an Angular workspace so every panel and store follows the same architecture. ## Core Features & Use Cases - Route-based aside panels: Edit panels open via a route in the ro outlet using a shared RtRouteAsideComponent<T> base, surviving reloads and staying linkable. - Standardized mutation flow: Saving goes through runMutation, mutations must emit a value or error, and success triggers a list re-read before closing. - Entity store conventions: Stores extend a shared list-store base, answer with streams instead of booleans, and use entity-generic names like save, remove, load. - Use Case: When adding a new admin section with a create/edit panel, load this rule to wire the route, base class, guard on all four closing paths, and store correctly the first time. ## Quick Start Load the entity-conventions rule before editing any admin store or panel that creates or edits a record.

Frequently Asked Questions about entity-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an entity edit panel in an Angular admin app?

Open the panel via a route in the `ro` auxiliary outlet and inherit from the shared `RtRouteAsideComponent<T>` base. Hand the base your mutation stream through `runMutation`, which manages busy state, error clearing, success toast, and closing.

How should an Angular store handle save mutations?

The store answers with a stream: success is an emitted value, refusal is a stream error, never a boolean. A mutation ends with a re-read of the list, not with the sent request, so the UI never shows stale data.

Why does my Angular aside panel freeze after saving?

The mutation stream must emit a value or an error; an empty stream freezes the panel forever because the base waits for one or the other. If a stream can complete empty, handle it with `defaultIfEmpty`.

How do I guard unsaved changes when closing an Angular aside?

Set the guard on all four closing paths: the header button, the footer button, a click outside the panel, and the Esc key. Checking only one path lets Esc bypass what the button catches.

Why does router.navigate fail to close an auxiliary outlet panel?

Absolute navigation commands change only the primary branch, leaving the `ro` outlet in the address, and the router silently rejects the navigation. Leave the panel through the base's `openRelated` transition instead.