gpt_image_playground AGENTS.md

gpt_image_playground AGENTS.md is an instructions file for Codex, OpenCode from CookSleep/gpt_image_playground. It costs 2,131 tokens per session, scanned A, original, MIT.

A coding guide for a React and TypeScript image-playground application built with Vite, a frontend build tool.

In plain words
What is it for?
Use it when developing features, running the app, building it, formatting code, or testing changes in the src directory.
Why use it?
It sets clear rules for simple implementations, project structure, commands, formatting, and tests so changes fit the existing codebase.

Instructions file for CodexOpenCode

About the project

GPT Image Playground is a web application for generating and editing images through the OpenAI gpt-image-2 API and compatible image providers. Users can create images from text, edit them with reference images and masks, and manage their history and settings locally. The catalogue includes an instruction for working with the application.

CookSleep/gpt_image_playground · 3,611 stars · on GitHub

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/cooksleep/gpt_image_playground/agents-md
Clone the repo
git clone --depth 1 https://github.com/CookSleep/gpt_image_playground

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/cooksleep/gpt_image_playground/agents-md.svg)](https://agentmods.dev/instructions/cooksleep/gpt_image_playground/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/cooksleep/gpt_image_playground/agents-md"><img src="https://agentmods.dev/badge/instructions/cooksleep/gpt_image_playground/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,131 This file is loaded in full into every session.
When invoked 2,131 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.02131 $0.02131
Opus 5 $0.01066 $0.01066
Sonnet 5 $0.00426 $0.00426
Haiku 4.5 $0.00213 $0.00213

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

Security

Grade A, and why

gpt_image_playground 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 · 189 lines

How it starts

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

Agent Instructions for gpt-image-playground

本文件定义 AI 编码助手在此仓库中应遵循的工作方式。

项目概况

  • React 19 + Vite + TypeScript 前端应用,使用 Zustand 状态管理、Tailwind CSS 样式。
  • 源码在 src/,构建产物由 Vite 生成,不要手动编辑 dist/
  • 包管理器为 npm(有 package-lock.json),不要使用 yarn 或 pnpm。

常用命令

操作 命令
安装依赖 npm install
开发服务器 npm run dev
构建 npm run build
运行测试 npm test
监听测试 npm run test:watch
  • 测试使用 Vitest,已有多个 *.test.ts 文件。
  • 不要新增 lint/formatter 配置文件,除非明确要求。

代码风格(强制)

简单优先

写出能工作的最简代码。少抽象、少包装。有疑问就内联。

  • 不要为单次使用的 1-5 行逻辑创建独立函数,直接内联。
  • 函数只有在多处调用逻辑非平凡时才值得提取。
  • 不要引入项目中不存在的设计模式或架构层。

完整实现

  • 不要留 // TODO: implement later// ... 或 stub 函数。
  • 如果不确定某个细节,给出完整的最佳猜测实现。错误但完整的代码优于正确但残缺的骨架。

跟随现有风格

这是最高优先级规则。修改文件时,遵循该文件及周围代码的已有风格。

格式

  • 2 空格缩进
  • 单引号'hello')。
  • 无分号
  • 箭头函数始终加括号:(x) => x
  • 行宽不做硬性限制,但尽量保持可读。

TypeScript

  • 使用 ESM import,const 优先,永远不用 var
  • Target ES2020(见 tsconfig.json)。
  • 优先早返回,避免深层嵌套和 else 链。
  • 尽量避免 any;需要时保持局部化。
  • 利用类型推断,不写多余的类型注解。
  • 共享类型放 src/types.ts,局部类型放文件顶部。

命名

  • PascalCase:组件、类型、接口。
  • camelCase:函数、变量、参数。
  • UPPER_SNAKE_CASE:模块级常量。
  • 文件名小写驼峰:apiProfiles.tsmaskPreprocess.ts
  • 局部变量优先短名:ctxelmsgidxoptserr。多词名仅在单词不够清晰时使用。

解构

避免无必要的解构。优先点号访问以保留上下文。

// 好
profile.baseUrl
opts.settings

// 避免
const { baseUrl } = profile
const { settings } = opts

例外:React 组件 props、hooks 返回值、函数参数解构是可以的。

控制流

// 好:早返回
function getPreset(name: string) {
  if (!name) return defaultPreset
  return presets.find((p) => p.name === name)
}

// 避免:多余的 else
function getPreset(name: string) {
  if (!name) return defaultPreset
  else return presets.find((p) => p.name === name)
}

变量

优先 const,用三元或早返回代替 let 重赋值。

// 好
const params = hasInputImages
  ? { ...baseParams, image: inputImages }
  : baseParams

// 避免
let params
if (hasInputImages) params = { ...baseParams, image: inputImages }
else params = baseParams

Read the full file on GitHub · 189 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 · 189 lines · 2,131 tokens per session scan A b98d4035fcd6

Subscribe to this mod's changes

gpt_image_playground AGENTS.md is an instructions file published in the GitHub repository CookSleep/gpt_image_playground (3,611 stars, last pushed today), licensed MIT. It adds 2,131 tokens to every session, about $0.0107 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.