entity-hooks

Implement reusable entity lifecycle hooks for create, update, and delete operations.

2|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/yutna/vibe-next-template --skill entity-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: entity-hooks
Source: https://github.com/yutna/vibe-next-template/tree/main/.claude/skills/entity-hooks
Command: npx skills add https://github.com/yutna/vibe-next-template --skill entity-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Entity lifecycle events have historically required boilerplate scattered across repositories and services. This Skill provides reusable patterns for before_save, after_create, and other lifecycle hooks to standardize data normalization, timestamp handling, and side effects.

Core Features & Use Cases

  • BeforeCreate/afterCreate/beforeUpdate/afterUpdate/beforeDelete/afterDelete hooks that normalize data, set default timestamps, and enable side effects.
  • Seamless integration with repository operations to ensure hooks run in the correct order and support transaction-aware workflows.
  • Advanced patterns: conditional hooks, transaction-bound hooks, and cross-service side effects such as analytics or notifications.

Quick Start

Wire up shared entity hooks and invoke them through repository operations to enforce lifecycle behavior across create, update, and delete.

Frequently Asked Questions about entity-hooks

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

FAQPage Schema
How do I implement Rails-style entity lifecycle callbacks in a TypeScript Drizzle ORM project?

You can implement Rails-style entity lifecycle callbacks using reusable before_create, after_update, and before_delete hooks that normalize data and trigger side effects across TypeScript and Drizzle ORM repositories.

What is the best way to manage data normalization and timestamps across Drizzle ORM repositories?

Managing data normalization and timestamps is best handled by wiring shared lifecycle hooks into repository operations, ensuring consistent timestamp handling and data formatting across create and update workflows.

Can I trigger side effects like analytics or notifications within Drizzle ORM database transactions?

Yes, you can trigger cross-service side effects like analytics or notifications within database transactions using conditional hooks and transaction-aware workflows that execute reliably during entity lifecycle events.

Do I need to use Effect-based patterns to manage lifecycle hooks in TypeScript?

Yes, utilizing Effect-based patterns is required to deliver reliable, type-safe lifecycle behavior, ensuring that hooks run in the correct order and support transaction-aware workflows across your entities.

How do I prevent scattered boilerplate when setting up before_save and after_delete hooks?

To prevent scattered boilerplate, apply reusable lifecycle hooks across shared entities and repository operations, standardizing data normalization and side effects instead of duplicating logic across services.

Are conditional entity hooks supported for complex update and delete scenarios?

Conditional entity hooks are supported for complex scenarios, allowing you to enforce lifecycle behavior selectively during create, update, and delete operations based on specific transaction or entity states.