wafermap: Instructions file for Codex

AGENTS.md

wafermap AGENTS.md is an instructions file for Codex, OpenCode from wafertools/wafermap. It costs 4,622 tokens per session, scanned A, original, MIT.

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions Codex.

This is wafertools/wafermap's own configuration. It tells Codex and OpenCode how to work on wafermap 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 wafermap configures →

Reuse

Borrowing it

Nothing to install: this file belongs to wafertools/wafermap. 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/wafertools/wafermap/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/wafertools/wafermap

Made for: Codex, OpenCode.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wafertools/wafermap/agents-md/github.svg)](https://agentmods.dev/instructions/wafertools/wafermap/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/wafertools/wafermap/agents-md"><img src="https://agentmods.dev/badge/instructions/wafertools/wafermap/agents-md/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 wafermap AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/wafertools/wafermap/agents-md"><img src="https://agentmods.dev/badge/instructions/wafertools/wafermap/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,622 This file is loaded in full into every session.
When invoked 4,622 The same file — it is already loaded in full.
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.04622 $0.04622
Opus 5.5 $0.01849 $0.01849
Sonnet 5.5 $0.00924 $0.00924
Haiku 4.5 $0.00462 $0.00462

Measured 19d ago against content hash ba3039e9608f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 19d 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 · 258 lines

How it starts

The opening of the file, as written. The whole thing — 258 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/wafermap — buildWaferMap(), registerBinColorScheme() / registerValueColorScheme(). Pure, no DOM, server-safe.
  • @wafertools/wafermap/render — renderWaferMap(), renderWaferGallery(). Needs the DOM.
  • @wafertools/wafermap/stats — analyzeWaferMap(), analyzeWaferLot(). Pure analysis.
  • @wafertools/wafermap/worker — createWafermapWorker() for off-main-thread builds.

Default path: buildWaferMap() once when data loads, then renderWaferMap() for a single wafer or renderWaferGallery() for several.

There is no low-level drawing pipeline, chart-data builder or region builder to reach for. The library draws through the renderers, and every figure it shows (yield, bin counts, region yield, per-test statistics, capability) comes back from analyzeWaferMap() / analyzeWaferLot().

If the only way to do something is to rebuild one of those pieces, that is a library gap worth reporting, not a pattern to build on.

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.
  • Bins and test values must be numbers, and verdicts booleans. Every parser — CSV, JSON, a spreadsheet export — hands you "1", and "1" is not pass bin 1. buildWaferMap never converts them: each is treated as missing and reported as input-values-not-numbers (severity 'error'), so those dies have no bin or no value and a build that "works" can be mostly empty — read the warnings. Convert with Number() at parse time.
  • passBins and ringCount are set once, on buildWaferMap, and travel on the result. Neither is an option on analyzeWaferMap, analyzeWaferLot, renderWaferMap or renderWaferGallery — passing one there is a type error in TypeScript, and in JavaScript it is ignored with an analysis-option-corrected warning while the real value is read from the map. passBins decides both the yield number and the wording of its label, so set it from the actual test program: do not assume [1], and never re-default to [1] downstream — read result.passBins.
  • 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.
  • 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 · 258 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. 19d ago Changed · +1 tokens per session ba3039e9608f
  2. 25d ago Changed e4f8f8b899ad
  3. 26d ago Changed · +3 lines · +71 tokens per session 0a34c952f76d
  4. 1mo ago Changed · +6 lines · +157 tokens per session 37f7e58afcf4
  5. 1mo ago Changed · +36 tokens per session 800c862d67e2
  6. 1mo ago Changed b166f68d4dff
  7. 1mo ago Changed · +9 tokens per session 460283e2c70e
  8. 1mo ago Changed · -10 lines · -160 tokens per session 70b598e2e2a1
  9. 1mo ago Changed · +11 lines · +246 tokens per session 5e54c894d1b8
  10. 1mo ago First seen · 248 lines · 4,262 tokens per session scan A 996b772d79fb

Subscribe to this mod's changes

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

Related

wafermap AGENTS.md compared with instructions from other repositories

wafermap AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
wafermap AGENTS.mdwafertools/wafermapInstructions file83d agoMITA4,622Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode ai-customization.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA1,907GitHub Copilot