web-worker-patterns: Command for Claude Code

.claude/commands/review-pr.md

review-pr is a command for Claude Code from damiansire/web-worker-patterns. It costs 37 tokens per session (1,189 once invoked), scanned A, original, MIT.

A command for reviewing a pull request, which is a proposed code change, or the current branch diff. It checks functional behavior, with special attention to Web Workers and communication between background code and the page.

In plain words
What is it for?
Use it to inspect a pull request or current branch for correctness, performance, concurrency, and maintainability problems. It reads every changed file and gives a verdict using a review rubric.
Why use it?
It helps find bugs that style checks may miss, such as race conditions, mismatched messages, transferred data becoming unusable, or Workers that never stop. It reports only issues that can affect the software.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument; mentions AGENTS.md.

This is damiansire/web-worker-patterns's own configuration. It tells Claude Code how to work on web-worker-patterns itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything web-worker-patterns configures →

Reuse

Borrowing it

Nothing to install: this file belongs to damiansire/web-worker-patterns. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/damiansire/web-worker-patterns/main/.claude/commands/review-pr.md
Clone the repo
git clone --depth 1 https://github.com/damiansire/web-worker-patterns

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for review-pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/damiansire/web-worker-patterns/review-pr/github.svg)](https://agentmods.dev/commands/damiansire/web-worker-patterns/review-pr)
Your own site
<a href="https://agentmods.dev/commands/damiansire/web-worker-patterns/review-pr"><img src="https://agentmods.dev/badge/commands/damiansire/web-worker-patterns/review-pr/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for review-pr

Your own site · 80×15
<a href="https://agentmods.dev/commands/damiansire/web-worker-patterns/review-pr"><img src="https://agentmods.dev/badge/commands/damiansire/web-worker-patterns/review-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,189 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.01189
Opus 5.5 $0.00015 $0.00476
Sonnet 5.5 $0.00007 $0.00238
Haiku 4.5 $0.00004 $0.00119

Measured 1mo ago against content hash c1e9f14e2db4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

review-pr scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/review-pr.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Revisar PR: $1

Revisá el pull request indicado buscando solo problemas funcionales: correctitud, performance, concurrencia y mantenibilidad. Ignorá los nits de estilo que no impactan el comportamiento (de eso ya se ocupan Prettier y lint:boundaries).

El número de PR viene como argumento. Si está vacío, buscá un PR abierto en la rama actual.

1. Traer el contexto del PR

  • gh pr view <número> --json title,body,headRefName,baseRefName,files,additions,deletions
  • gh pr diff <número> para el diff completo.
  • Leé cada archivo tocado del diff: no lo hojees.

2. Áreas de foco

Evaluá el diff contra estas categorías. Reportá solo lo que tenga impacto funcional real. La fila de Web Workers es propia de este repo y es la que más importa acá.

Categoría Qué buscar
Web Workers Race conditions; protocolo de postMessage mal tipado o desincronizado (mensajes sin discriminante, respuestas sin correlación); ownership de Transferable (un ArrayBuffer transferido queda detached del lado emisor); SharedArrayBuffer/Atomics sin los headers COOP/COEP o sin fallback; workers/MessagePort que no se terminan (terminate()/close()) → leaks.
Regla de oro / capas core/ importando algo de themes/ (va en un solo sentido). La lógica de workers debe vivir en core/domain/workers/, nunca en un theme.
Estado y ciclo de vida El estado debe sobrevivir al cambio de theme (un worker corriendo sigue). Estado mutable a nivel módulo; limpieza faltante en ngOnDestroy.
Bugs de lógica Off-by-one, condiciones invertidas, código inalcanzable, fallas silenciosas.
Type safety Casts inseguros, huecos en la discriminación de uniones de mensajes, fugas de any, genéricos incorrectos.
Performance Ráfagas de postMessage que disparan N reconciliaciones (drená por frame / coalescing por scope); copias innecesarias donde corresponde transferir; O(n²) evitable.
Contratos de API Cambios de comportamiento silenciosos en el contrato de mensajes shared; manejo de errores incorrecto en los bordes worker↔main.
Cobertura de tests ¿Los tests ejercitan de verdad los paths que cambiaron? La lógica pura del worker (*.worker.logic.ts) debe testearse sin Worker real (jsdom no los soporta).
i18n Si se sumó contenido, ¿está en public/i18n/es.json (único idioma registrado hoy, ver availableLangs en app.config.ts) y es neutral (sin chrome de theme)?

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed c1e9f14e2db4
  2. 2mo ago First seen · 72 lines · 37 tokens per session scan A f304112f969c

Subscribe to this mod's changes

review-pr is a command published in the GitHub repository damiansire/web-worker-patterns (173 stars, last pushed 11d ago), licensed MIT. It adds 37 tokens to every session and 1,189 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.