OneJS AGENTS.md

Project guidance for OneJS, which runs React and TypeScript user interfaces inside Unity and displays them through Unity's UI Toolkit rather than a web browser.

In plain words
What is it for?
Use it to set up OneJS in a Unity scene, initialise its project files, and decide how code should cross between C# and TypeScript.
Why use it?
It explains the required Unity and Node.js versions, installation method, and boundary between native Unity code and JavaScript.

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/singtaa/onejs/agents-md
Clone the repo
git clone --depth 1 https://github.com/Singtaa/OneJS

Made for: Codex, OpenCode.

Per session 3,400 This file is loaded in full into every session.
When invoked 3,400 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.03400 $0.03400
Opus 5 $0.01700 $0.01700
Sonnet 5 $0.00680 $0.00680
Haiku 4.5 $0.00340 $0.00340

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

Security

Grade A, and why

OneJS 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 · 180 lines

How it starts

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

OneJS v3: Agent Guide

Before adding anything that crosses between C# and JavaScript, read DESIGN.md. It states what belongs on each side, the four rules a wrapper has to satisfy, and why an interpreter on native makes it a portability question rather than a performance one.

Condensed facts for AI agents working with OneJS. Full documentation: https://onejs.com/docs

OneJS runs React 19 + TypeScript UIs inside Unity. TSX compiles with esbuild into a single bundle that the JSRunner component executes through QuickJS (or the browser's own JS engine on WebGL), rendering through UI Toolkit. No webview, no DOM.

Requirements

  • Unity 6000.3+ (Unity 6.3)
  • Node.js 18+ on the dev machine

Install

Package Manager: + > Add package from git URL:

https://github.com/Singtaa/OneJS.git

Or clone into Assets: git clone https://github.com/Singtaa/OneJS.git. Package id: com.singtaa.onejs. No other Unity packages or scoped registries required.

Project setup

  1. Add the JSRunner component to a GameObject in a saved scene.
  2. Click Initialize Project in its inspector. This creates, next to the scene:
{SceneDir}/{SceneName}/{GameObjectName}/
├── ~/                      # TS/TSX source (the ~ suffix keeps Unity from importing it)
│   ├── index.tsx           # entry point
│   ├── package.json, tsconfig.json, esbuild.config.mjs
│   └── styles/main.uss, types/global.d.ts, AGENTS.md, .gitignore
├── PanelSettings.asset     # project marker - the one mandatory JSRunner field
├── UIDocument.uxml
├── app.js.txt              # built bundle (esbuild writes ../app.js.txt)
└── app.js.map.txt

then runs npm install and npm run build automatically.

Alternative: skip the button and just enter Play mode. On first play, JSRunnerAutoWatch auto-creates and assigns PanelSettings, scaffolds missing files, runs npm install + npm run build in the background, and starts the watcher. The first run takes a moment while packages install.

Read the full file on GitHub · 180 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 · 180 lines · 3,400 tokens per session scan A 30538275f0fe

Subscribe to this mod's changes

OneJS AGENTS.md is an instructions file published in the GitHub repository Singtaa/OneJS (347 stars, last pushed 3d ago), licensed MIT. It adds 3,400 tokens to every session, about $0.0170 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.