ima2-gen: Instructions file for Codex

AGENTS.md

ima2-gen AGENTS.md is an instructions file for Codex, OpenCode from lidge-jun/ima2-gen. It costs 1,773 tokens per session, scanned A, original, MIT.

Project instructions for ima2-gen, a local image-generation studio with a command-line tool and web interface. They describe its supported providers, technology stack, file layout, and server design.

In plain words
What is it for?
Use them to find the relevant server routes, image and video generation code, user-interface files, configuration, and event-streaming code.
Why use it?
They give coding agents enough context to work safely in a project that can create or edit images and generate videos through several services.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

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

Reuse

Borrowing it

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

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 ima2-gen AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/lidge-jun/ima2-gen/agents-md"><img src="https://agentmods.dev/badge/instructions/lidge-jun/ima2-gen/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,773 This file is loaded in full into every session.
When invoked 1,773 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.01773 $0.01773
Opus 5.5 $0.00709 $0.00709
Sonnet 5.5 $0.00355 $0.00355
Haiku 4.5 $0.00177 $0.00177

Measured 1mo ago against content hash dfd8d2ea3825, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ima2-gen 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 1mo 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 · 134 lines

How it starts

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

ima2-gen — AI Context

Contract Value
Node engine >=22
npm toolchain [email protected]
Release Node 24.17.0
CLI entry bin/ima2.js
OpenAI SDK ^7.4.0
Express ^5.1.0

Runtime installation metadata is generated from package.json and .node-version; source TypeScript users must build before running emitted JavaScript.

What This Project Does

Local image generation studio — CLI + 웹 UI

  • GPT OAuth, API Key, Grok, Gemini API, Antigravity CLI 다중 provider 지원
  • 텍스트→이미지, 이미지→이미지(편집), 비디오 생성
  • SSE 멀티플렉싱: 단일 GET /api/events SSE 채널 + async POST (202) 아키텍처
  • 병렬 생성 (최대 12건, 브라우저 연결 포화 없음)

Tech Stack

  • Runtime: Node.js ES Module; package engine is shown in the generated table above
  • Server: Express 5
  • API Client: OpenAI SDK range is rendered in the runtime-install contract above
  • OAuth: openai-oauth (ChatGPT 세션 프록시)
  • Grok: xAI OAuth (device code) 또는 API key, api.x.ai 직접 호출
  • Gemini: Google Generative Language API / Vertex AI
  • Frontend: React + Vite (ui/src, built to ui/dist)
  • SSE: lib/eventBus.ts (ring buffer pub/sub) + routes/events.ts

Project Structure

ima2-gen/
├── bin/                  # CLI entry + subcommands
├── server.ts             # Express bootstrap / static UI serving
├── config.ts             # Runtime config
├── routes/               # API route modules (*.ts source)
│   ├── events.ts         # GET /api/events SSE multiplexing
│   ├── multimode.ts      # Multimode batch (async POST + dual-emit)
│   ├── nodes.ts          # Node mode (async POST + dual-emit)
│   ├── video.ts          # Video generation (async POST + dual-emit)
│   └── ...               # generate, edit, sessions, history, etc.
├── lib/                  # Server helpers (*.ts source)
│   ├── eventBus.ts       # Global pub/sub ring buffer (2000 events)
│   ├── ssePublish.ts     # Cancel-done race guard
│   ├── inflight.ts       # Job lifecycle tracking
│   └── ...               # OAuth, storage, sessions, etc.
├── ui/src/               # React/Vite app source
│   ├── lib/eventChannel.ts  # Singleton EventSource for /api/events
│   ├── lib/sseStreamError.ts # SSE error parser
│   └── store/store*Impl.ts  # Modular Zustand slices
├── ui/dist/              # Built frontend served by server.js
├── site/                 # Astro marketing/docs site (GitHub Pages)
├── integrations/comfyui/ # ComfyUI bridge/custom node
├── structure/            # Current architecture reference docs (00-07)
├── devlog/               # _plan (active), _fin (archived)
├── tests/                # node:test contracts/regressions
└── package.json

Read the full file on GitHub · 134 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. 1mo ago Changed · +20 lines · +361 tokens per session dfd8d2ea3825
  2. 1mo ago Changed · +8 tokens per session 61f0fc75dc99
  3. 1mo ago Changed · +36 tokens per session 98317bc567a7
  4. 2mo ago Changed · +13 lines · +133 tokens per session b1c1759b14f8
  5. 2mo ago First seen · 101 lines · 1,235 tokens per session scan A 672c0f5a08c9

Subscribe to this mod's changes

ima2-gen AGENTS.md is an instructions file published in the GitHub repository lidge-jun/ima2-gen (782 stars, last pushed 1mo ago), licensed MIT. It adds 1,773 tokens to every session, about $0.0071 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-30.

Related

ima2-gen AGENTS.md compared with instructions from other repositories

ima2-gen AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ima2-gen AGENTS.mdlidge-jun/ima2-genInstructions file7821mo agoMITA1,773Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode