wafermap AGENTS.md

Usage rules for wafermap, a JavaScript library that turns semiconductor chip test data into maps showing results across a silicon wafer. The instructions cover map building, display rendering, statistics, and background-worker support.

In plain words
What is it for?
Building, displaying, and analyzing wafer maps and lots, choosing the right library entry point, and moving map construction off the main browser thread when needed.
Why use it?
They help prevent maps that look correct but contain incorrect data, which could lead to wrong manufacturing or yield decisions. The rules identify which library entry points need a browser page and which can run without one.

Instructions file for CodexOpenCode

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 instructions/wafertools/wafermap/agents-md
Clone the repo
git clone --depth 1 https://github.com/wafertools/wafermap

Made for: Codex, OpenCode.

Per session 2,904 This file is loaded in full into every session.
When invoked 2,904 The same file — it is already loaded in full.
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.02904 $0.02904
Opus 5 $0.01452 $0.01452
Sonnet 5 $0.00581 $0.00581
Haiku 4.5 $0.00290 $0.00290

Measured 2d ago against content hash 74fc7de236d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

wafermap AGENTS.md 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.

AGENTS.md · 182 lines

How it starts

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

wafermap — rules for AI coding agents

Guidance for AI tools (Claude Code, Codex, Copilot, Cursor, …) writing code that uses @wafertools/wafermap. Paste the rules below into your project's own agent config so they are loaded whenever the agent works on wafer map code.

This library renders semiconductor wafer maps. Its output drives yield calls, lot dispositions and process changes, so a plot that is plausibly but silently wrong is the expensive failure — worse than one that throws. Most rules here exist because the obvious-looking code produces exactly that.

wafermap — usage rules

@wafertools/wafermap renders wafer maps from semiconductor die test data. Wrong-but-plausible output drives real yield and lot decisions, so prefer failing loudly over guessing.

Entry points

  • @wafertools/wafermapbuildWaferMap(), geometry, registerColorScheme(). Pure, no DOM, server-safe.
  • @wafertools/wafermap/renderrenderWaferMap(), renderWaferGallery(), toCanvas(). Needs the DOM.
  • @wafertools/wafermap/statsanalyzeWaferMap(), analyzeWaferLot(). Pure analysis.
  • @wafertools/wafermap/workercreateWafermapWorker() for off-main-thread builds.

Default path: buildWaferMap() once when data loads, then renderWaferMap() for a single wafer or renderWaferGallery() for several. Reach for toCanvas()/buildView() only when you need the low-level pipeline — they give up the toolbar and every UI correctness guarantee that comes with it.

Traps that produce silently wrong maps

  • Never die.hbin ?? 0 or die.sbin ?? 0. A missing bin is not bin 0 — it is no-data, and must render grey. Defaulting to 0 invents a bin and changes the yield number. Leave the field absent.
  • x and y are prober step positions (integers), not millimetres. Pass them through unchanged; dieConfig.width/height convert to physical units. Do not pre-multiply. The geometry inputs are waferConfig (type WaferConfig) and dieConfig (type DieConfig) — both optional, both inferred when omitted.
  • passBins decides both the yield number and the wording of its label. Set it from the actual test program. Do not assume [1].
  • testValues is keyed by test number, e.g. { 1050: 0.42 } — not a positional array. activeTest likewise takes a test number (1050), not an index.
  • Functional tests (testType: 'F') have no measured value. Read their verdicts only via getTestPassStatus(die, testNumber, def); never read die.testPass directly and never interpret a 0/1 in testValues. A missing verdict is no-data, never a fail.
  • Show users die.x / die.y only. Never surface internal display or transformed coordinates in tooltips, labels or reports, whatever the rotation or flip state.
  • A die with test results is always fully on the wafer. A prober only steps to sites that fit. Never recompute a partial flag by testing die corners against the wafer circle — that manufactures fake partial dies which are then greyed out and dropped from yield. A die outside the wafer means the geometry is wrong.
  • Check result.warnings and summary.stats.warnings. Both carry WaferWarning{ code, message, severity }. Branch on code, never on the prose. The two differ in shape and the difference throws: result.warnings is required and always an array ([] when clean), but summary.stats.warnings is optional and is undefined when there is nothing to report. Write summary.stats.warnings?.length — a bare summary.stats.warnings.length is a TypeError on every clean wafer, which is most of them, so it will pass your testing and fail in production. Geometry advisories are severity 'error': they mean dies may be drawn in the wrong place. The renderers surface these themselves in a toolbar indicator, so do NOT hand-roll a second display — pass warnings: { display: false, onWarning } if the app has its own notification UI. (result.inference.warnings is a deprecated string mirror; do not use it.)
  • Give the container a resolved height. renderWaferMap fills its container. A bare block-flow <div> is fine — it grows to the canvas. The real failure is a flex/grid child whose ancestors never resolve a height: it stays 0-tall and the map is invisible. The library detects exactly that case after layout settles and console.warns with the fix, so read the console before debugging further. Either give the container a real CSS height, or pass { height: 600 } in the render options and the library will size it for you.

Read the full file on GitHub · 182 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. 2d ago First seen · 182 lines · 2,904 tokens per session scan A 74fc7de236d4

Subscribe to this mod's changes

wafermap AGENTS.md is an instructions file published in the GitHub repository wafertools/wafermap (5 stars, last pushed 5d ago), licensed MIT. It adds 2,904 tokens to every session, about $0.0145 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-31.