create-after-interceptor

Generates a Glyvio SimpleAfterInterceptor class for post-save side effects on database entities.

1|Updated Jun 11, 2026
One-click install
npx skills add https://github.com/devena/glyvio-forge --skill create-after-interceptor-devena
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-after-interceptor
Source: https://github.com/devena/glyvio-forge/tree/main/claude/skills/create-after-interceptor
Command: npx skills add https://github.com/devena/glyvio-forge --skill create-after-interceptor-devena

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing post-save hooks in a Glyvio plugin requires knowing the exact interceptor decorator, read-only value semantics, synchronous server DB APIs, and registration conventions. This Skill generates a correctly typed and registered SimpleAfterInterceptor so side effects like notifications, audit logs, or external service calls run after an entity is committed. ## Core Features & Use Cases - Interceptor Generation: Creates a TypeScript class extending glyvio_core.SimpleAfterInterceptor with the @AfterInterceptor decorator, unique listener ID, and priority. - Change Detection Patterns: Provides blueprint code for field-level modification tracking via value.isModified() and getOriginalValue(). - Registration & Validation: Adds the export line to src/index.ts and guides build verification while explaining root tsc false positives for server code. - Use Case: When a Tag entity's color field changes, generate an interceptor that creates a system notification via entityService.saveEntityWithoutPermission after the save commits. ## Quick Start Ask the agent to create an after interceptor for a specific Glyvio entity, providing the entity name, a unique listener ID, and the side-effect logic to run after save.

Frequently Asked Questions about create-after-interceptor

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

FAQPage Schema
How do I create a post-save interceptor in a Glyvio plugin?▼

Create a class extending glyvio_core.SimpleAfterInterceptor decorated with @AfterInterceptor specifying the entity, a unique listener id, and priority. Implement handleAfter with your side-effect logic, then register it with an export line in src/index.ts.

What is the difference between BeforeInterceptor and AfterInterceptor in Glyvio?▼

BeforeInterceptor receives a mutable value and runs before the save, making it right for modifying the entity's own fields in a single write. AfterInterceptor runs after the transaction commits with a read-only value, suited for side effects like notifications or external calls.

Why does tsc report Promise type errors on Glyvio server interceptor code?▼

Root tsc --noEmit uses app-layer types where QueryBuilder and Entity methods return Promises, but server code builds against server types where these methods are synchronous. These errors are false positives; the webpack server build resolves types correctly.

Can I modify the intercepted entity inside handleAfter?▼

No. The value parameter is Readonly, so mutating it is a compiler error. To change fields on the same entity, use a @BeforeInterceptor instead, whose value is mutable and included in the original save.

Should I wrap Glyvio interceptor logic in try-catch?▼

Only if the user explicitly requests error suppression. By default, let errors bubble up so the server can handle failures and perform necessary database transaction rollbacks.