Skip to main content

localStorage-patterns

This skill provides a comprehensive guide to localStorage patterns for building resilient web applications with client-side persistence.

Install this skill

or
0/100

Security score

The localStorage-patterns skill was audited on Feb 28, 2026 and we found 34 security issues across 3 threat categories. Review the findings below before installing.

Categories Tested

Security Issues

medium line 191

Template literal with variable interpolation in command context

SourceSKILL.md
191console.log(`Usando ${usedMB} MB de ${quotaMB} MB (${(estimate.usage / estimate.quota * 100).toFixed(1)}%)`);
medium line 200

Template literal with variable interpolation in command context

SourceSKILL.md
200console.log(`- ${key}: ${(size / 1024).toFixed(2)} KB`);
medium line 364

Template literal with variable interpolation in command context

SourceSKILL.md
364const key = `plataforma-b2b_notes_${courseId}`;
medium line 370

Template literal with variable interpolation in command context

SourceSKILL.md
370console.error(`Erro ao salvar notas (${key}):`, error);
medium line 385

Template literal with variable interpolation in command context

SourceSKILL.md
385localStorage.setItem(`plataforma-b2b_notes_${courseId}`, notes); // Pode crashar!
medium line 406

Template literal with variable interpolation in command context

SourceSKILL.md
406const saved = localStorage.getItem(`plataforma-b2b_notes_${courseId}`);
medium line 422

Template literal with variable interpolation in command context

SourceSKILL.md
422localStorage.setItem(`plataforma-b2b_notes_${courseId}`, notes);
medium line 430

Template literal with variable interpolation in command context

SourceSKILL.md
430sessionStorage.setItem(`plataforma-b2b_notes_${courseId}_temp`, notes);
medium line 512

Template literal with variable interpolation in command context

SourceSKILL.md
512console.log(`Usando ${info.usedMB} MB de ${info.quotaMB} MB (${info.percentUsed}%)`);
medium line 536

Template literal with variable interpolation in command context

SourceSKILL.md
536message: `Nota muito grande (${sizeKB} KB). Limite: 50 KB.`
medium line 600

Template literal with variable interpolation in command context

SourceSKILL.md
600console.log(`Removido: ${key} (${ageInDays.toFixed(0)} dias)`);
medium line 604

Template literal with variable interpolation in command context

SourceSKILL.md
604console.warn(`Erro ao processar ${key}:`, error);
medium line 609

Template literal with variable interpolation in command context

SourceSKILL.md
609console.log(`Liberados ${freedKB} KB de armazenamento`);
medium line 666

Template literal with variable interpolation in command context

SourceSKILL.md
666console.log(`Migrado ${key} para v2`);
medium line 672

Template literal with variable interpolation in command context

SourceSKILL.md
672console.error(`Erro ao migrar ${key}:`, error);
medium line 707

Template literal with variable interpolation in command context

SourceSKILL.md
707return `plataforma-b2b_${type}_${identifier}`;
medium line 739

Template literal with variable interpolation in command context

SourceSKILL.md
739this.key = `plataforma-b2b_progress_${courseId}`;
medium line 929

Template literal with variable interpolation in command context

SourceSKILL.md
929const key = `plataforma-b2b_notes_${courseId}`;
medium line 967

Template literal with variable interpolation in command context

SourceSKILL.md
967console.warn(`Nota muito grande: ${(sizeBytes / 1024).toFixed(2)} KB`);
medium line 994

Template literal with variable interpolation in command context

SourceSKILL.md
994sessionStorage.setItem(`${key}_temp`, notes);
medium line 1038

Template literal with variable interpolation in command context

SourceSKILL.md
1038const key = `plataforma-b2b_progress_${courseId}`;
medium line 1056

Template literal with variable interpolation in command context

SourceSKILL.md
1056console.log(`Módulo ${moduleId} já completo`);
medium line 1189

Template literal with variable interpolation in command context

SourceSKILL.md
1189localStorage.setItem(`item_${i}`, data[i]);
medium line 1295

Template literal with variable interpolation in command context

SourceSKILL.md
1295console.log(`Total usado: ${calculateTotalSize()} MB`);
medium line 1310

Template literal with variable interpolation in command context

SourceSKILL.md
1310console.log(`Removido: ${key}`);
medium line 1346

Template literal with variable interpolation in command context

SourceSKILL.md
1346console.log(`✅ ${key} válido`);
medium line 1348

Template literal with variable interpolation in command context

SourceSKILL.md
1348console.error(`❌ ${key} corrompido:`, error);
medium line 1364

Template literal with variable interpolation in command context

SourceSKILL.md
1364console.error(`Erro ao parsear ${key}:`, error);
medium line 1402

Template literal with variable interpolation in command context

SourceSKILL.md
1402notes: (courseId) => `plataforma-b2b_notes_${courseId}`,
medium line 1403

Template literal with variable interpolation in command context

SourceSKILL.md
1403progress: (courseId) => `plataforma-b2b_progress_${courseId}`
medium line 1437

Template literal with variable interpolation in command context

SourceSKILL.md
1437console.log(`Escritas/segundo: ${writeCount}`);
low line 1174

Fetch to external URL

SourceSKILL.md
1174await fetch('/api/auth/login', {
low line 1488

External URL reference

SourceSKILL.md
1488- **[Can I Use - localStorage](https://caniuse.com/namevalue-storage)** - Suporte por browser
low line 1489

External URL reference

SourceSKILL.md
1489- **[Web.dev - Storage Limits](https://web.dev/storage-for-the-web/)** - Limites detalhados
Scanned on Feb 28, 2026
View Security Dashboard
Installation guide →