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.
npx agentmods add commands/damiansire/web-worker-patterns/migrate-examplegit clone --depth 1 https://github.com/damiansire/web-worker-patternsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00030 | $0.01121 |
| Opus 5 | $0.00015 | $0.00561 |
| Sonnet 5 | $0.00006 | $0.00224 |
| Haiku 4.5 | $0.00003 | $0.00112 |
Grade A, and why
migrate-example 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Migrar ejemplo: $1
Codifica el pipeline por-ejemplo que ya repetimos en los ejemplos 04–13. Seguilo en orden;
no saltees el loop de design-review. La regla de oro manda: el dominio se escribe una
vez en core/, la presentación cinco veces en themes/. core/ NUNCA importa de themes/.
0. Encuadre
- Si
$1está vacío, abrísrc/app/core/domain/examples/examples.registry.tsy tomá el primer ejemplo sin migrar (sin@caseen los layouts / sin entrada de contenido). - Mirá el worker legacy correspondiente y decidí el
DemoKind(o si hace falta uno nuevo). - Anotá el plan con
TodoWriteantes de tocar código.
1. Dominio (se escribe UNA vez, en core/)
- Worker neutral: portá el legacy a
core/domain/workers/<id>.worker.ts. Extraé la lógica pura a<id>.worker.logic.tspara poder testearla sin Worker real (jsdom no los soporta). El worker queda como cáscara fina sobre la lógica pura. - Service:
core/services/<algo>-demo.service.ts,@Injectable({ providedIn: 'root' }), estado en signals. Seam de tiempo inyectable (clock/stepDelayMs) para los specs. Requisito duro: el estado sobrevive al cambio de theme (un worker corriendo sigue). - DemoKind: si el ejemplo no encaja en una variante existente, sumá el literal a la
union en
core/domain/examples/example.model.ts. - Registry: entrada en
examples.registry.tsconworkerFactory/sharedWorkerFactoryy los snippets de código neutrales que muestra el code-block. - Test de dominio (antes de UI): spec del
.worker.logic.tsy/o del service con un fake-worker. Si tocaste dominio, hay test que lo cubre.npm testverde.
2. i18n (contenido neutral)
- Agregá
examples.$1.*apublic/i18n/es.json,en.json,pt.json. El contenido educativo es neutral; sólo el chrome de cada theme tiene strings propios.
3. Presentación (se escribe CINCO veces)
- Sumá el
@case '<DemoKind>'en los 5 example-layouts:editorial,dev-tool,narrative,brutalist,full-brutalist. - Cada theme con su visualización propia del concepto: nada de colores/fuentes literales,
siempre tokens semánticos (
--surface,--ink,--accent,--thread-*). El visualizer se resuelve por DI (THREAD_VISUALIZER). - Criterio clave: la visualización enseña el concepto SIN leer el código.
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.
- yesterday First seen · 69 lines · 30 tokens per session scan A e09a253d338a
migrate-example is a command published in the GitHub repository damiansire/web-worker-patterns (175 stars, last pushed 15d ago), licensed MIT. It adds 30 tokens to every session and 1,121 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.
Other commands, from other repositories
create-bucket-docs
Create documentation for a Lingo.dev bucket type using analysis output.
liveblog-down
Stop the local Liveblog dev stack. Data is preserved unless --wipe-data is passed.
session-catchup
Start-of-session rehydration. Reads NEXTSESSION.md + UPDATES.md tail + last 3 ADs, runs drift check on prior verification commands, proposes next move. See session-loop skill.
session-open-loops
Scan unresolved threads across NEXTSESSION.md, UPDATES.md, ledger ADs without follow-up, in-repo TODOs, open PRs, and pending agent tasks. Ranks by urgency. Read-only. See session-loop skill.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.