infinite-canvas: Instructions file for Codex

AGENTS.md

infinite-canvas AGENTS.md is an instructions file for Codex, OpenCode from basketikun/infinite-canvas. It costs 2,960 tokens per session, scanned A, original, MIT.

Project instructions for AI coding agents working on the infinite-canvas application. They describe the project’s coding principles, front-end tools, file locations, and canvas interface conventions.

In plain words
What is it for?
Use them when modifying the application, especially its Vite and React front end, shared state, routes, services, or canvas-related pages and components.
Why use it?
They give an automated coding assistant local rules to follow before changing the project. This reduces unnecessary rewrites, misplaced files, and changes that conflict with the existing structure.

Instructions file for CodexOpenCode

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

This is basketikun/infinite-canvas's own configuration. It tells Codex and OpenCode how to work on infinite-canvas 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 infinite-canvas configures →

About the project

infinite-canvas is an open-source visual workspace for AI image creation, combining an infinite canvas with image generation, reference-image editing, video generation, chat-based assistance, prompt storage, asset management, and multi-agent workflows. It is for exploring and iterating on visual concepts through a graphical creative process, with access to OpenAI-compatible model services. The catalogue contains skills, an MCP integration, and an instruction for working with the project.

basketikun/infinite-canvas · 6,139 stars · on GitHub · canvas.best

Reuse

Borrowing it

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

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 infinite-canvas AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/basketikun/infinite-canvas/agents-md.svg)](https://agentmods.dev/instructions/basketikun/infinite-canvas/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/basketikun/infinite-canvas/agents-md"><img src="https://agentmods.dev/badge/instructions/basketikun/infinite-canvas/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,960 This file is loaded in full into every session.
When invoked 2,960 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.02960 $0.02960
Opus 5 $0.01480 $0.01480
Sonnet 5 $0.00592 $0.00592
Haiku 4.5 $0.00296 $0.00296

Measured 7d ago against content hash 156fbe6cf377, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

infinite-canvas 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 7d 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 · 99 lines

How it starts

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

AGENTS.md

本文档用于约束本项目中的 AI / 自动化开发行为。开发时优先遵循本文件,其次遵循用户当前消息。

基本原则

  • 先读现有代码,再动手修改,优先沿用项目已有结构和写法。
  • 写代码保持最少行数,能简单实现就不要引入复杂抽象。
  • 标准格式、协议、解析、压缩、加密、日期等通用能力优先使用成熟稳定的库,不要手写底层实现,除非用户明确要求或项目已有实现必须沿用。
  • 不要为了“兼容更多场景”写大量分支,只实现当前明确需要的功能。
  • 项目尚未上线,不需要兼容旧数据;本地存储结构调整时直接按新设计修改,不写旧字段兼容或数据迁移兜底,除非用户明确要求。
  • 每次写完代码,不需要检查语法,不需要执行构建,用户会自己做。
  • 不要改无关文件,不要顺手重构。
  • 如果工作区已有用户改动,不要回滚,不要覆盖;只在必要范围内追加修改。

反复提醒沉淀

  • 如果开发过程中总是遇到某个问题,或者用户反复提醒同一个注意事项,需要把该注意事项补充到本文件。
  • 补充时写成明确、可执行的规则,避免只写模糊描述。
  • 新规则应放到最相关的章节;找不到合适章节时放到“项目注意事项”。

前端规范

  • 前端使用 Vite、React、React Router、TypeScript、Ant Design、Tailwind、Zustand。
  • 编写 Ant Design 相关代码时,参考 https://ant.design/llms-full.txt 理解组件 API、示例和设计规范,并优先结合项目当前 antd 版本与既有写法。
  • 外部服务请求统一放在 web/src/services/api/,由浏览器前端直连,不假设存在项目后端。
  • 全局或跨页面状态优先放在 web/src/stores/
  • 已经放在全局 store 或全局 hook 中的状态/动作,组件需要时直接使用对应 store/hook,不要为了“纯组件”层层透传 props;避免一个组件传递过多参数。
  • 全局组件、全局常量、全局配置等全局性质的内容不要作为 props 或参数层层传递;哪里需要就在哪里直接从对应全局入口获取。
  • 多个页面重复出现的 UI 副作用动作,例如复制文本并提示、下载并提示、统一确认弹窗,优先抽成 web/src/hooks/ 下的全局 hook;不要放进 store,除非它确实是需要共享/订阅的状态。
  • 路由页面放在 web/src/pages/,页面布局放在 web/src/layouts/,路由配置放在 web/src/router.tsx
  • 画布页面放在 web/src/pages/canvas/,画布组件放在 web/src/components/canvas/,画布状态放在 web/src/stores/canvas/,画布工具函数放在 web/src/lib/canvas/
  • 页面按目录组织,例如 web/src/pages/image/index.tsx;页面里只有一个主业务组件时直接写在对应页面入口中,不要单独拆 Manager 组件再传一堆 props。
  • 不要新增只做简单转发的组件,例如只 return <X>{children}</X> 或只换个名字透传 props;直接在使用处使用真实组件或把逻辑写进当前文件。
  • 页面私有 hook 放在对应页面目录下,例如 admin/assets/use-admin-assets.ts;只有多个页面真实复用的 hook 才放到外层 hooks/
  • 管理后台页面私有组件放到各自页面目录的 components/ 下,例如 admin/assets/components/admin/prompts/components/;不要为了单页面使用放到 admin/components/ 共享目录。
  • 管理后台主题、背景、卡片阴影、表格配色等统一在 web/src/lib/app-theme.tsAppProviders 或必要的全局 CSS 作用域中配置;页面私有组件不要自己写 dark ? ... 主题分支。
  • Ant Design 的 Dropdown、Menu、Select、Cascader、TreeSelect 等弹层背景、悬停态和选中态颜色统一通过 web/src/lib/app-theme.ts 的全局 Alias Token 与组件 Token 配置;不要在业务组件内为单个弹层覆盖颜色。
  • 组件优先使用函数组件和现有 hooks,不新增大型状态管理方案。
  • UI 图标优先使用 lucide-react 或项目已经使用的 Ant Design 图标。
  • 页面文案保持中文。
  • 不要在组件里堆太多无关逻辑;复杂逻辑优先抽成同目录工具函数或小组件。
  • 样式优先由组件自己管理;组件私有样式优先使用 Tailwind className 或少量内联 style,不要为单个组件新增大量全局 CSS。
  • 全局 CSS 只放基础变量、全局重置、跨页面通用样式和少量第三方组件必要覆盖;不要在 globals.css 堆页面私有样式。
  • 代码尽量短小直接,少拆不必要组件,少做多层 props 传递,避免为了抽象堆出更多代码。
  • 前端业务数据需要浏览器本地持久化时,默认使用 localforagelocalStorage 只用于极小的简单配置,不要用来保存业务列表、生成记录、图片、base64 或大 JSON。

Read the full file on GitHub · 99 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. 7d ago First seen · 99 lines · 2,960 tokens per session scan A 156fbe6cf377

Subscribe to this mod's changes

infinite-canvas AGENTS.md is an instructions file published in the GitHub repository basketikun/infinite-canvas (6,139 stars, last pushed 3d ago), licensed MIT. It adds 2,960 tokens to every session, about $0.0148 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

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens