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 skills/loopdive/js2/analyze-watnpx skills add loopdive/js2 --skill analyze-watgit clone --depth 1 https://github.com/loopdive/js2What 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.00050 | $0.00751 |
| Opus 5 | $0.00025 | $0.00376 |
| Sonnet 5 | $0.00010 | $0.00150 |
| Haiku 4.5 | $0.00005 | $0.00075 |
Grade A, and why
analyze-wat 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Analyze WAT Output
Compile a source file to WAT and analyze the output for codegen inefficiencies.
When to use
- After implementing a codegen change, to verify the output is clean
- When investigating performance issues
- When creating optimization issues from real compiler output
Steps
- Compile the source to WAT:
node --input-type=module -e "
import { compile } from './scripts/compiler-bundle.mjs';
import fs from 'fs';
const src = fs.readFileSync('SOURCE_FILE', 'utf8');
const result = compile(src, { fileName: 'test.ts', emitWat: true });
if (!result.success) { console.log('ERRORS:', result.errors.slice(0,5).map(e => e.message).join('\n')); process.exit(1); }
fs.writeFileSync('/tmp/output.wat', result.wat);
console.log('WAT:', result.wat.length, 'chars | Binary:', result.binary.length, 'bytes');
"
- Check for known inefficiency patterns:
| Pattern | How to detect | Severity |
|---|---|---|
| Duplicate locals | Same (local $name appearing twice with different types |
Medium — bloats binary |
| Infinity guard on constant modulo | f64.abs + f64.const Infinity + f64.eq near f64.div/f64.trunc |
High — 10 extra instructions per % |
| Dead drops | local.tee N followed later by drop with no intervening use |
Medium — wasted stack ops |
| TDZ flags unused | (local $__tdz_ that are set to 1 but never checked |
Low — extra locals |
| String concat chains | Multiple consecutive call $concat_import |
Medium — N-1 intermediate strings |
| If-chain → br_table candidate | Same local.get + f64.const N + f64.eq + if repeated 3+ times |
High — O(n) vs O(1) |
| f64↔i32 roundtrip | f64.convert_i32_s immediately followed by i32.trunc_sat_f64_s |
High — pure waste |
| Redundant null guards | ref.is_null + if on provably non-null values (literals, new, struct.new) |
Medium — unnecessary branches |
- For each pattern found, note:
- Source line that produced it
- WAT line numbers
- How many instructions could be saved
- Which codegen file to fix
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.
- 2d ago First seen · 65 lines · 50 tokens per session scan A f7f16a537307
analyze-wat is a skill published in the GitHub repository loopdive/js2 (59 stars, last pushed 2d ago), licensed Apache-2.0. It adds 50 tokens to every session and 751 once invoked, about $0.0003 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 skills, from other repositories
migrate-oxfmt
Guide for migrating a project from Prettier or Biome to Oxfmt. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's formatter from Prettier or Biome to Oxfmt.
migrate-oxlint
Guide for migrating a project from ESLint to Oxlint. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's linter from ESLint to Oxlint.
insta-snapshots
Guide for working with and updating insta snapshot tests in Oxc without terminal interaction.
performance-lint-rules
Performance review guidance for Oxc linter rule implementations. Use only when reviewing Rust rule code under crates/oxclinter/src/rules/ or when explicitly auditing those rules for performance improvements.
oxc-docs
Comprehensive reference for the JavaScript Oxidation Compiler (Oxc) — a collection of high-performance JavaScript tools written in Rust. Covers parser design (lexer, AST, parser, errors, semantic analysis), architecture (parser, linter, test infrastructure, AST tools), ECMAScript specification and grammar, performance…
babel-docs
Babel 7.x/8.x — plugins, presets, config, @babel/core, parser, traverse, types, CLI, preset-env.