AddThisFeature

Archive and Restore

Soft-delete, so 'delete' isn't forever.

moderate Data & Content

What it adds

Archive records instead of destroying them, with a way to restore.

What your agent is told to do

4
  1. 1

    Add an archived flag/timestamp rather than deleting rows.

  2. 2

    Exclude archived records from every default query — a missed scope is a data leak into the wrong list.

  3. 3

    Give users an archive view and a restore action.

  4. 4

    Decide whether archived records are eventually purged, and implement that deliberately.

Edge cases it handles

5
  • Archiving a parent must define what happens to its children — cascade, orphan, or block.
  • Unique constraints often conflict with soft-delete: an archived record can block reusing its name or email. Decide and handle it.
  • Archived records must be excluded from counts, exports, and usage limits.
  • Restoring must be safe if the parent is gone.
  • Genuinely permanent deletion must still exist, for GDPR requests if nothing else.

Definition of done

7
  • Archived records are excluded from every default query.
  • They're excluded from counts, exports, and limits.
  • Users can view and restore archived records.
  • Uniqueness conflicts with archived rows are handled.
  • A true hard-delete path exists for compliance.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.