assigns-audit

Featured

Inspect LiveView socket assigns for memory bloat — missing temporary_assigns, unused assigns, unbounded lists needing streams, memory estimates. Use when LiveView memory grows or you need to add temporary_assigns.

Code & Development 505 stars 35 forks Updated today MIT

Install

View on GitHub

Quality Score: 97/100

Stars 20%
90
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# LiveView Assigns Audit Analyze LiveView socket assigns for memory efficiency, clarity, and best practices. ## Iron Laws - Never Violate These 1. **Use streams for lists > 100 items** - Never store large lists directly in assigns 2. **Use temporary_assigns for transient data** - Flash messages, temp errors, notifications 3. **Preload only needed fields** - Don't store full Ecto schemas when only needing subset 4. **Initialize all assigns in mount** - Never access assigns that might not exist 5. **NEVER modify assigns or code during audit** — this is a read-only diagnostic; report findings only ## Quick Audit Commands ### Extract All Assigns Use Grep to find all `assign(` and `assign_new(` calls in the target LiveView file. ### Find Large Data Patterns Use Grep to find large data patterns: lists stored in assigns (`assign.*\[\]`, `assign.*Repo\.all`) and full schema storage (`assign.*Repo\.get`) in the target file. ## Audit Checklist ### 1. Memory Issues | Pattern | Problem | Solution | |---------|---------|----------| | `assign(:items, Repo.all(...))` | Unbounded list | Use `stream/3` | | `assign(:user, Repo.get!(...))` | Full schema | Select only needed fields | | `assign(:file_data, binary)` | Large binary | Store reference, not data | | Nested preloads | Excessive data | Preload only what's rendered | ### 2. Missing temporary_assigns Should use `temporary_assigns`: - Flash messages - Form errors after submission - One-time notifications - Upload progress ``...

Details

Author
oliver-kriska
Repository
oliver-kriska/claude-elixir-phoenix
Created
5 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Solid

memory-leak-audit

Audit code for memory leaks and disposable issues. Use when reviewing event listeners, DOM handlers, lifecycle callbacks, or fixing leak reports. Covers addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose patterns.

8 Updated today
chapmanjw
AI & Automation Listed

audit

Audit the Claude Code instruction/memory layer — CLAUDE.md, CLAUDE.local.md, .claude/rules/, and auto-memory — against a codified checklist derived from official Claude Code documentation. Use when: 'audit CLAUDE.md', 'memory health', 'audit rules', 'is my CLAUDE.md too long', 'prune instructions', after CLAUDE.md/rules changes or a Claude Code upgrade; actions: audit (default), fix, update, report.

4 Updated today
melodic-software
Code & Development Listed

auditsmith

Use when auditing, reviewing, or assessing an application's codebase — including narrower phrasings like 'review my code', 'is this secure', 'is this production ready', 'why is this slow', 'check my error handling', 'is my LLM integration safe', 'find issues in this repo', or 'what am I missing before launch'. Covers ten areas — UX behavior, code quality, UI, security, LLM/AI usage, performance, testing, dependencies, observability, API contracts. Detects auth/authz gaps, IDOR, injection, secrets, SSRF, prompt injection, race conditions, missing error handling, empty states, N+1 queries, bundle bloat, memory leaks, flaky tests, CVEs, idempotency gaps, missing logging/alerting. Contexts — pre-launch, handover, client delivery, code review, refactor planning. Outputs findings with file:line evidence, severity ranking, and CI/lint rules to prevent regression. Stacks — React, TypeScript, Node, Python, Go, Cloudflare Workers.

1 Updated 4 days ago
opefyre