api-resource-lifecycle
OfficialBuild safer CRUD with cascades, validation, and rollback
Software Engineering#error handling#validation#crud#api lifecycle#cascade delete#orphan prevention#metadata cleanup
Authorawardsapp
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps teams implement reliable CRUD flows for API-backed resources by preventing orphan records, handling cascading deletes correctly, and turning raw database/provider failures into consistent, user-actionable errors.
Core Features & Use Cases
- Cascading deletes (schema-first + manual fallback): Choose
onDelete: "cascade"for parent-child FK relationships, and use transaction-wrapped manual cascades when external API cleanup or cross-reference logic is required. - Validation and error-code conventions: Produce descriptive validation messages and map domain outcomes to the correct tRPC codes (e.g.,
CONFLICTfor duplicates,NOT_FOUNDfor missing resources). - Duplicate detection and robust exception mapping: Rely on DB unique constraints with specific handling for PostgreSQL unique violations (e.g.,
23505), avoiding leaky raw DB errors. - Orphan prevention on external sync: Persist to the database first, then roll back the DB record if the external provider sync fails.
- Replacement hygiene for external keys: When replacing provider keys, clear dependent external skill metadata to avoid stale references and resync issues.
Quick Start
Use the api-resource-lifecycle skill when you need to add or modify delete/remove operations, introduce cascading behavior, implement duplicate detection and validation, or ensure external-provider sync failures roll back cleanly.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: api-resource-lifecycle Download link: https://github.com/awardsapp/tambo-genui/archive/main.zip#api-resource-lifecycle Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.