opencode-gpt-imagegen AGENTS.md

opencode-gpt-imagegen AGENTS.md is an instructions file for Codex, OpenCode from yuji-hatakeyama/opencode-gpt-imagegen. It costs 1,107 tokens per session, scanned A, original, MIT.

Repository instructions for an OpenCode plugin that generates images through an image-generation backend. They describe its TypeScript structure, image input and output handling, build command, and tests.

In plain words
What is it for?
Installing dependencies, building the plugin bundle, handling reference images and generated files, and running end-to-end checks.
Why use it?
They tell agents how to build and package the plugin correctly while preserving reference-image handling and non-overwriting output behavior.

Instructions file for CodexOpenCode

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

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/yuji-hatakeyama/opencode-gpt-imagegen/agents-md
Clone the repo
git clone --depth 1 https://github.com/yuji-hatakeyama/opencode-gpt-imagegen

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 opencode-gpt-imagegen AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/yuji-hatakeyama/opencode-gpt-imagegen/agents-md.svg)](https://agentmods.dev/instructions/yuji-hatakeyama/opencode-gpt-imagegen/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/yuji-hatakeyama/opencode-gpt-imagegen/agents-md"><img src="https://agentmods.dev/badge/instructions/yuji-hatakeyama/opencode-gpt-imagegen/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,107 This file is loaded in full into every session.
When invoked 1,107 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.01107 $0.01107
Opus 5 $0.00553 $0.00553
Sonnet 5 $0.00221 $0.00221
Haiku 4.5 $0.00111 $0.00111

Measured 6d ago against content hash 1ae84d83f9be, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

opencode-gpt-imagegen 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 6d 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 · 40 lines

How it starts

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

AGENTS.md

Project Shape

  • Bun is the package manager/runtime; use bun install --frozen-lockfile with the committed bun.lock.
  • The plugin entry is src/index.ts (plugin wiring + tool schema); helpers live in role-based modules — src/types.ts (shared types), src/auth.ts (auth resolution), src/input-image.ts (reference image reading), src/output-image.ts (non-overwriting save + message), src/codex.ts (Codex backend call + SSE parsing).
  • bun run build bundles src into a single self-contained dist/index.js via bun build --target node --format esm --packages external (dependencies, including the @opencode-ai/plugin peer dep, stay external). Bundling avoids the extensionless relative imports tsc would emit, which native Node ESM cannot resolve. No .d.ts is published — the plugin is loaded by OpenCode at runtime, not imported as a typed library.
  • dist/ is ignored locally but is the publish artifact (just index.js). Run bun run build before inspecting package output.
  • bunfig.toml enforces install.minimumReleaseAge = 604800 (1 week): newly published versions are filtered out by bun install / bun add / bun outdated.

Commands

  • Tests are split by kind: tests/unit/ (helper-module unit tests) and tests/e2e/ (one file per auth path, e.g. subscription.test.ts).
  • bun run typecheck runs tsc --noEmit over src and tests.
  • bunx biome ci . is the CI formatter/linter check.
  • bun run check runs biome check --write .; it may modify files.
  • bun run test runs bun test tests/unit — unit tests only, and is what CI uses. (A bare bun test would also discover the e2e files under tests/e2e/ and try to run them for real, so prefer the script.)
  • bun run test:e2e_subscription sets OPENCODE_MODEL=openai/gpt-5.5 and runs tests/e2e/subscription.test.ts (ChatGPT subscription / OAuth path). It can take minutes because it calls opencode run and generates real images. The future API-key path gets its own test:e2e_apikey script + tests/e2e/apikey.test.ts.
  • Each e2e path is its own script (its own bun test process), which also avoids the unit-test process.env leak into the single-process e2e opencode spawn.
  • CI runs bun run typecheck, bunx biome ci ., and bun run test. The e2e suites are not run in CI's default checks (they need real auth + generations); they are invoked separately via their test:e2e_* scripts.

Read the full file on GitHub · 40 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. 6d ago First seen · 40 lines · 1,107 tokens per session scan A 1ae84d83f9be

Subscribe to this mod's changes

opencode-gpt-imagegen AGENTS.md is an instructions file published in the GitHub repository yuji-hatakeyama/opencode-gpt-imagegen (75 stars, last pushed yesterday), licensed MIT. It adds 1,107 tokens to every session, about $0.0055 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.

Related

Other instructions, from other repositories