zx84: Instructions file for Codex

AGENTS.md

zx84 AGENTS.md is an instructions file for Codex, OpenCode from damieng-zx/zx84. It costs 3,872 tokens per session, scanned A, original, MIT.

Project instructions for ZX84, an emulator codebase for several vintage computers and their hardware components.

In plain words
What is it for?
Adding or changing emulated machines, processors, sound and video chips, memory, input, peripherals, and other machine-specific parts.
Why use it?
They explain where each kind of hardware code belongs and set rules that help keep the project’s layers and dependencies organized.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/damieng-zx/zx84/agents-md"><img src="https://agentmods.dev/badge/instructions/damieng-zx/zx84/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,872 This file is loaded in full into every session.
When invoked 3,872 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.03872 $0.03872
Opus 5.5 $0.01549 $0.01549
Sonnet 5.5 $0.00774 $0.00774
Haiku 4.5 $0.00387 $0.00387

Measured today against content hash 7cd05bc03294, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

zx84 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 today.

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 · 220 lines

How it starts

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

ZX84 — Codex Guidelines

You may learn how old hardware works from other open source emulators. You may not copy code from them.

Architecture

The codebase is layered "machines as hardware, components as chips" — see docs/adding-a-machine.md for the new-machine checklist. Dependencies point strictly downward and the boundaries are enforced mechanically (npm run depcheck, zero exceptions).

Layer map

  • src/cores/ — commodity silicon only: chips that shipped in more than one machine (Z80, AY-3-891x, TMS9918A, CRTC 6845, uPD765A, WD179x/1772/1793, Z80 CTC, i8255, MOS 6502, 6522 VIA, Intel 8271, SAA5050). Pure — imports only other cores, src/media/ types, src/utils/. Custom silicon that only ever existed in one machine (the Spectrum's Ferranti ULA, the CPC's Amstrad gate array, the microdrive) is not here — it lives in that machine's folder.
  • src/machines/<name>/ — one folder per machine = a motherboard. Everything specific to that machine: the machine class (extends base-machine.ts), its custom silicon (spectrum/ula.ts, cpc/gate-array.ts), contention.ts, variants/, memory.ts, io.ts (port decode if-chain — hot, load-bearing), keyboard.ts, peripherals/, snapshots/, tape-loader.ts, per-family models.ts helpers, descriptor.ts (pure metadata + factory), services/ (the service surface), and ui/ (Solid contributions — the ONLY machine files allowed to import solid-js and the shell/state layers). A machine folder is an island: it never imports another machine folder, nor UI/state/store/shell.
  • src/machines/machine.ts — the SPI: Machine, MachineServices, the service interfaces (media/roms/tape/disks/snapshots/debug/input/probe), MachineDescriptor + MachineUiCapabilities, MachineHost, MachineEntry.
  • src/machines/base-machine.ts — shared driver loop (frame pacing, turbo pump, audio back-pressure, lifecycle, debug-field storage). Untouched by machines.
  • src/machines/registry.ts — the parts catalog: the only file besides src/models.ts allowed to name every machine. Stays headless-safe.
  • src/media/ — format codecs → neutral models: floppy/ (DskImage, DSK/HFE/SCP/MGT/TRD/SCL, disk-detect.ts, floppy-sound.ts), tape/ (TAP/TZX/CSW deck + .cas), zip.ts. Pure — imports only media + utils.
  • src/shell/ — the host: context.ts (shared machine handle + managers), lifecycle.ts (create/switch/destroy, pause/turbo, stepping, refresh state), media.ts (zip/picker/dispatch/persistence + transport wrappers), settings.ts (SettingsView pump), rom.ts (fetch/cache/persist). Reaches machines only through machine.services and the SPI/registry — never a concrete machine folder.
  • src/state/ — Solid reactive stores (machine, debug, disk, tape, activity, microdrive). Shared flat signal bags; the writers are generic (shell + probe).
  • src/store/ — settings + IndexedDB persistence.
  • src/ui/ — generic UI: panes/ hosts panes and components/ hosts reusable elements. Bind to machine.services and the descriptor's ui capabilities; never import a concrete machine or branch on machine kind. machine-ui.ts is the UI-side manifest mapping a kind → its lazily-imported ui/ contributions (the sole sanctioned exception).
  • src/frame-bridge.ts — the generic per-frame consumer of each machine's FrameProbe; owns presentation policy (LED latch, formatting, diffing).
  • src/managers/ — debug-manager + rom-manager: generic orchestration.
  • src/models.ts — the MachineModel union manifest + leaf helpers (isCpcModel, …). Per-family helpers (is128kClass, isPlusDCapable, …) live in each machine's own models.ts.
  • src/debug/ — machine-agnostic debug tools (BASIC parser) plus per-CPU-family debug substrate in src/debug/<family>/ (z80/: disasm.ts disassembler + service.ts Z80DebugService/z80Cpu(), step-over/out logic, register surface — shared by every Z80 machine; m6502/: the same for the 6502 — used by the BBC Micro). A machine may import its family module — that's substrate, not another machine. Imports only cores, utils, and machine SPI types. These tools take Uint8Array, not ByteReader.
  • src/ocr/ — machine-specific screen OCR engines, each returning neutral text and styling data from display memory.
  • src/display/ — Canvas and WebGL renderers with HQx/xBR upscaling shaders.
  • src/emulator.ts — a thin compatibility shim (re-exports shell + state), retained only because frame-bridge.ts and its module-mock tests still import from it. New code imports from @/shell/* and @/state/* directly.
  • mcp/ — MCP server (persistent Node process; mcp/server.ts entry, tools under mcp/tools/). Binds to state.spec.services; mcp/concrete.ts is the single sanctioned module that narrows to a concrete machine.

Read the full file on GitHub · 220 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. today Changed · -3 lines · -16 tokens per session 7cd05bc03294
  2. 13d ago Changed · -6 tokens per session 52040a0430b3
  3. 1mo ago Changed · +2 lines · +22 tokens per session 19bcfaae464f
  4. 1mo ago Changed · +1 lines · +41 tokens per session 5daa437d6a66
  5. 1mo ago Changed · +1 lines · -16 tokens per session d10c0e5b1a49
  6. 2mo ago First seen · 219 lines · 3,847 tokens per session scan A f3f964851205

Subscribe to this mod's changes

zx84 AGENTS.md is an instructions file published in the GitHub repository damieng-zx/zx84 (7 stars, last pushed 2d ago), licensed MIT. It adds 3,872 tokens to every session, about $0.0155 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

zx84 AGENTS.md compared with instructions from other repositories

zx84 AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
zx84 AGENTS.mddamieng-zx/zx84Instructions file72d agoMITA3,872Codex, 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