data-safety-auditor

Detects data loss risks in Vue 3, Pinia, IndexedDB, and PouchDB applications with remediation guidance.

688|85|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/ananddtyagi/cc-marketplace --skill data-safety-auditor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-safety-auditor
Source: https://github.com/ananddtyagi/cc-marketplace/tree/main/plugins/claude-dev-infrastructure/skills/data-safety-auditor
Command: npx skills add https://github.com/ananddtyagi/cc-marketplace --skill data-safety-auditor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Client-side web apps that persist data in IndexedDB, LocalForage, and PouchDB can silently lose user data through quota exhaustion, Safari ITP expiration, sync conflicts, and hydration race conditions. This Skill audits source code to find these risks before they cause production data loss.

Core Features & Use Cases

  • Risk Detection Across Six Categories: Scans for storage quota issues, Safari ITP 7-day expiration, LocalForage race conditions, PouchDB sync conflicts, Pinia hydration races, and missing data integrity checks, each rated CRITICAL through LOW severity.
  • Deployment Gating and Reporting: Generates console, JSON, Markdown, and HTML reports, and blocks deployment when CRITICAL findings exist, making it suitable for CI/CD pipelines.
  • Test Generation: Produces missing persistence, quota-failure, and offline-sync test cases based on detected gaps.
  • Use Case: Before releasing a Vue 3 + Pinia + PouchDB app, run a full audit on the src directory to catch unhandled QuotaExceededError, missing conflict resolution, and absent hydration guards, then apply the suggested code fixes.

Quick Start

Ask the assistant to run a data safety audit on your Vue app's source directory and report any critical or high severity data loss risks.

Frequently Asked Questions about data-safety-auditor

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

FAQPage Schema
How do I audit a Vue app for data loss risks?

Run the DataSafetyAuditor's auditVueApp method against your source directory. It scans JavaScript, TypeScript, and Vue files with six detectors covering quota, Safari ITP, Pinia hydration, PouchDB sync, LocalForage, and data integrity, then returns severity-rated findings.

How to detect PouchDB sync conflicts in code?

The PouchDBSyncDetector flags missing conflict detection when reads lack { conflicts: true }, missing resolution strategies, absent sync error handlers, and disabled sync. It suggests code patterns like checking doc._conflicts and adding .on('error') handlers.

Does Safari delete IndexedDB data after 7 days?

Yes, Safari's Intelligent Tracking Prevention can evict website data after 7 days without user interaction. The SafariITPDetector flags projects using IndexedDB that lack Safari detection and ITP mitigations such as forced server sync every 3 days.

Can this audit run in a CI/CD pipeline?

Yes, the auditor supports CI/CD integration. Run the audit, check report.hasBlockers() or whether any CRITICAL findings exist, and exit with a non-zero code to block deployment until critical data safety issues are resolved.

Why does Pinia state render before persisted data loads?

This is a hydration race condition: components mount before pinia-plugin-persistedstate restores state from storage. The fix is adding an isHydrated flag set in the afterRestore hook and gating rendering or fetches on it, which the PiniaHydrationDetector checks for.