review-pr

review-pr is a command for Claude Code from damiansire/web-worker-patterns. It costs 37 tokens per session (1,178 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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/damiansire/web-worker-patterns/review-pr
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.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.svg" alt="Measured on agentmods" 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,178 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00037 $0.01178
Opus 5 $0.00018 $0.00589
Sonnet 5 $0.00007 $0.00236
Haiku 4.5 $0.00004 $0.00118

Measured 5d ago against content hash f304112f969c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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án las tres claves (es/en/pt) y son neutrales (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. 5d 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 (175 stars, last pushed 18d ago), licensed MIT. It adds 37 tokens to every session and 1,178 once invoked, about $0.0002 per session on Opus 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.