fec-browser-storage
Installation
SKILL.md
Browser storage
Purpose
Choose the appropriate client storage solution based on data size, security requirements, and lifecycle.
Procedure
- First determine the data sensitivity, volume, life cycle, whether it needs to be spread across tabs, and whether it needs to be sent with the request.
- Use localStorage for a small amount of non-sensitive preferences; use sessionStorage for tab-level temporary data; use IndexedDB for large amounts of structured data or offline caching; prioritize httpOnly cookies for authentication status.
- Encapsulate unified key prefix, JSON parse/stringify, exception handling, expiration cleanup and quota protection.
- Sensitive data is processed according to security rules, and plain text tokens, passwords, and credit card information are not put into storage that can be read by JS.
- Review privacy mode, storage quotas, sanitization policies, and cross-browser compatibility.
Detailed reference
Load references/storage-patterns.md when it comes to storage selection tables, localStorage/sessionStorage wrappers, IndexedDB examples, cookie helpers, and sensitive data rules.