cascade-deletes

Delete conversations and related records with deterministic cascade utilities.

7|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/planetaryescape/blah.chat --skill cascade-deletes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cascade-deletes
Source: https://github.com/planetaryescape/blah.chat/tree/main/.claude/skills/cascade-deletes
Command: npx skills add https://github.com/planetaryescape/blah.chat --skill cascade-deletes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Normalized data models often require manual, error-prone cascade deletions to maintain referential integrity. This Skill provides a deterministic approach to removing a conversation and all related data across junctions, messages, files, and dependent records, preventing orphaned data and inconsistent states.

Core Features & Use Cases

  • Automatic cleanup: Deletes related records across junction tables (e.g., projectConversations, conversationParticipants) and dependent entities (messages, attachments, toolCalls, sources) when a parent is removed.
  • Safe delete strategy: Applies a defined order (children → parents) and supports nullifying associations for reusability of files and memories.
  • Configurable scope: Allows optional deletion of messages and/or the conversation and includes GDPR-like data disposal patterns for user data.

Quick Start

Invoke cascadeDeleteConversation(ctx, conversationId) within a mutation to cleanly remove a conversation and all related data. Use the function from packages/backend/convex/lib/utils/cascade.ts to ensure deterministic, index-backed lookups.

Frequently Asked Questions about cascade-deletes

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

FAQPage Schema
How do I safely cascade delete related records across junction tables without leaving orphaned data?

Cascade deleting conversation data safely involves removing children before parents and cleaning up junction entries to ensure no orphaned records remain. Deterministic, index-backed queries enforce atomic referential integrity across all dependent entities.

What is the correct delete order for cascade removing messages, attachments, and junction table associations?

The correct delete order processes children first, including toolCalls, sources, and attachments, then cleans up junction table associations, optionally deletes messages, and finally removes the parent conversation to maintain data integrity.

Can I nullify file and memory associations during a backend cascade delete instead of permanently removing them?

Yes, the cascade delete strategy supports nullifying associations for files and memories instead of permanently deleting them. This allows reusability of files and memories while still removing the parent conversation and its direct dependent records.

Does this Convex cascade deletion approach support GDPR-like data disposal for user records?

Yes, the Convex cascade deletion approach includes configurable scope options and GDPR-like data disposal patterns for user data. It allows optional deletion of messages and conversations to meet specific data privacy requirements.

What is the best way to automate atomic deletion of a conversation and all its related data in a normalized schema?

The best way to automate atomic deletion of a conversation in a normalized schema is using backend cascade utilities. This consolidates the removal of dependent records, bookmarks, shares, and tool calls through deterministic, index-backed lookups.