web-storage
What it does
This skill checks how a web page uses browser storage and makes that code safe from errors. It is for developers whose apps save data in the browser.
When to use it
- ✓When code reads or writes localStorage without error handling.
- ✓When an app saves objects to storage without checking them when it reads them back.
- ✓When sensitive data such as login tokens is kept in the browser's local storage.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/web-storage/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My app crashes in private browsing when it saves settings. Can you make the storage code safe?”
5 new skills a week. 1 minute to read.
How it works
The agent wraps storage reads and writes in error handling and checks serialized data when loading it. It also flags sensitive data that should not be kept in browser storage.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Use Web Storage API safely
localStorage and sessionStorage have a 5–10 MB quota per origin, and any write can throw a QuotaExceededError. Private browsing modes in some browsers disable storage entirely and throw on all writes. Applications that don't handle these errors crash silently, leaving users unable to use the app.
Quick Reference
- Always wrap localStorage access in try/catch — storage can be full or disabled
- Serialize objects with JSON.stringify and validate on read with JSON.parse
- Never store sensitive data (tokens, passwords) in localStorage — use httpOnly cookies
- Use sessionStorage for tab-scoped data that shouldn't persist
Check
Find all localStorage and sessionStorage accesses in this file. Check for missing try/catch, unhandled JSON parsing, and any storage of sensitive data.
Fix
Add try/catch error handling to all Web Storage operations and ensure all object values are properly serialized and deserialized.
Explain
Explain the Web Storage API, its limitations, when to use localStorage vs sessionStorage, and what data should never be stored there.
Code Review
Review scripts, client components, and browser execution paths related to Use Web Storage API safely. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/javascript/web-storage
FAQ
Why does storage cause crashes?
Storage has a size limit, and some private browsing modes turn it off, so writes can throw errors the app must handle.
When is sessionStorage a better choice?
The skill suggests sessionStorage for data that should last only for one browser tab.
What should never go in localStorage?
Tokens and passwords. The skill says to use httpOnly cookies for those instead.
Details
Original description by the author
Use when reviewing scripts, client components, bundles, or runtime behavior related to Use Web Storage API safely. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3084
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.