audit-columns-pattern

Applies and reviews createdAt, updatedAt, createdBy, updatedBy, and deletedAt columns in database schemas.

Updated Jul 27, 2026
One-click install
npx skills add https://github.com/arayaroma/ether --skill audit-columns-pattern-arayaroma
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: audit-columns-pattern
Source: https://github.com/arayaroma/ether/tree/main/skills/audit-columns-pattern
Command: npx skills add https://github.com/arayaroma/ether --skill audit-columns-pattern-arayaroma

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Schemas often ship without row-level audit metadata, so teams cannot answer who created or last modified a record without replaying request logs. This Skill checks new and existing tables for the standard audit column pattern and distinguishes mutable domain rows from immutable event rows. ## Core Features & Use Cases - Schema auditing: Classifies every model as a mutable domain row or immutable event/log row, then reports gaps in createdAt, updatedAt, createdBy, and updatedBy as a structured table. - New table guidance: Applies the standard five-column pattern when creating models in Prisma, SQL, or any ORM, with correct nullability and Prisma directives like @updatedAt. - Soft-delete judgment: Advises when deletedAt is a real product requirement versus cargo-culted, avoiding permanent WHERE deletedAt IS NULL filters. - Use Case: Before adding a new Orders table in a Prisma schema, use this Skill to confirm it needs createdAt/updatedAt plus nullable createdBy/updatedBy actor FKs, while a webhook-events table gets createdAt only. ## Quick Start Review my Prisma schema for missing audit columns and tell me which tables need createdAt, updatedAt, createdBy, or updatedBy.

Frequently Asked Questions about audit-columns-pattern

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

FAQPage Schema
How do I add audit columns to a Prisma schema?▼

Add createdAt DateTime with @default(now()) and updatedAt DateTime with @updatedAt, which Prisma maintains automatically on every write. createdBy and updatedBy actor foreign keys must be passed explicitly by the service on each write, since Prisma has no auto-fill for them.

Which tables need createdAt and updatedAt audit columns?▼

Mutable domain rows that users create and later edit or delete need the full pattern: createdAt, updatedAt, and nullable createdBy/updatedBy actor references. Immutable event or log rows written once, such as audit-log entries or webhook events, should get createdAt only.

When should I use soft delete with a deletedAt column?▼

Add deletedAt only when the product genuinely needs recoverable deletes or hidden-but-retained rows for reporting, such as voided financial transactions. Otherwise a hard delete is simpler and avoids requiring a WHERE deletedAt IS NULL filter on every query forever.

What is the difference between row-level audit columns and an audit log table?▼

Row-level columns like updatedBy record who owns the current state of a record, while a request-level audit log captures the history of every request that touched it. The two are complementary, and small apps often build the log but skip the row-level columns.

Why is adding updatedAt to an immutable event table a mistake?▼

An immutable row written once and never updated should carry createdAt only. Adding updatedAt or updatedBy implies a write path that should not exist and misrepresents the table's intended behavior to future developers.