jyjeanne/ai-setup-forge/soft-delete-implementation

Claude Code and agent skill by jyjeanne/ai-setup-forge

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

To mark records as deleted without physically removing them from the database, allowing for data recovery and audit trails. Use when: When data is valuable or legally required to be retained; When "deleting" a user account or order.

Install

npx vskill@latest install jyjeanne/ai-setup-forge/soft-delete-implementation

SKILL.md

The same SKILL.md was published earlier as jyjeanne/ai-setup-forge/soft-delete-implementation.

Purpose

To mark records as deleted without physically removing them from the database, allowing for data recovery and audit trails.

When to Use

  • When data is valuable or legally required to be retained.
  • When "deleting" a user account or order.

Procedure

  1. Schema Change: Add a deletedAt (timestamp) column to the table. Nullable.
  2. Modify Delete Logic:
  • Instead of DELETE FROM table, perform UPDATE table SET deletedAt = NOW().
  1. Modify Read Logic:
  • Filter queries globally or per-query: WHERE deletedAt IS NULL.
  1. Cascade: Decide how to handle related records (soft delete them too, or just hide them via the parent's status).
  2. Restore: Implement a restore method that sets deletedAt = NULL.

Constraints

  • Unique indexes might conflict (e.g., email must be unique, but a soft-deleted user has the email). Solution: Include deletedAt in the unique index or use partial indexes.
  • Remember to filter soft-deleted records in every select query.

Expected Output

A data access layer that transparently handles soft deletion and filtering, ensuring deleted items don't appear in normal results.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jyjeanne/ai-setup-forge/soft-delete-implementation/badge)](https://verified-skill.com/skills/jyjeanne/ai-setup-forge/soft-delete-implementation)

Something wrong with this skill or its page? Tell us.