zx84 AGENTS.md

zx84 AGENTS.md is an instructions file for Codex, OpenCode from damieng-zx/zx84. It costs 3,847 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.

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/damieng-zx/zx84/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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,847 This file is loaded in full into every session.
When invoked 3,847 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.1 $0.03847 $0.03847
Opus 5 $0.01924 $0.01924
Sonnet 5 $0.00769 $0.00769
Haiku 4.5 $0.00385 $0.00385

Measured 5d ago against content hash f3f964851205, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 5d 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 · 219 lines

How it starts

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

ZX84 — Codex Guidelines

Architecture

The codebase is layered "machines as hardware, components as chips" — see docs/re-architecture.md for the full rationale and 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). 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). 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 · 219 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. 5d 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 (3 stars, last pushed 2d ago), licensed MIT. It adds 3,847 tokens to every session, about $0.0192 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.