r2-web: Instructions file for Codex

AGENTS.md

r2-web AGENTS.md is an instructions file for Codex, OpenCode from vikiboss/r2-web. It costs 1,644 tokens per session, scanned A, original, MIT.

A repository instruction guide for R2 Web, a browser-based file manager for Cloudflare R2 storage. It describes the project structure, common tasks, startup commands, and where to change features such as uploads, translations, and styles.

In plain words
What is it for?
Use it when changing R2 file operations, image compression, multilingual text, themes, buttons, or other listed parts of the web app.
Why use it?
It gives a coding agent a quick map of an unfamiliar codebase instead of making it search every file. It also records how to start the application and where related code lives.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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 r2-web AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/vikiboss/r2-web/agents-md"><img src="https://agentmods.dev/badge/instructions/vikiboss/r2-web/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,644 This file is loaded in full into every session.
When invoked 1,644 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.01644 $0.01644
Opus 5.5 $0.00658 $0.00658
Sonnet 5.5 $0.00329 $0.00329
Haiku 4.5 $0.00164 $0.00164

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

Security

Grade A, and why

r2-web 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 · 138 lines

How it starts

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

AGENTS.md

本文档为本仓库提供开发指南。

项目速览

R2 Web — 纯客户端 Cloudflare R2 存储桶文件管理器,零构建、零框架、零后端。

核心特性 文件上传、目录浏览、文件预览、文件操作、图片压缩、PWA、多语言(zh/zh_TW/en/ja)、浅色/深色主题、多选批量操作。

快速启动

npx serve src
# 或
python3 -m http.server 5500 --directory src

代码地图

快速定位表

任务 文件
修改文件名模板逻辑 src/js/utils.js — applyFilenameTemplate
修改图片压缩逻辑 src/js/upload-manager.js — compressFile
添加 i18n 文案 src/js/i18n.js — const I18N
修改按钮样式 src/css/components.css — .btn
添加设计 Token src/css/tokens.css
修改 R2 API 操作 src/js/r2-client.js
修改文件浏览逻辑 src/js/file-explorer.js
修改上传管理逻辑 src/js/upload-manager.js
多选批量操作逻辑 src/js/file-explorer.js — toggleSelect / selectAll / clearSelection

工具函数列表

以下函数定义在 src/js/utils.js,供各模块导入:

  • t(key, vars) — i18n 翻译(来自 src/js/i18n.js)
  • applyFilenameTemplate(tpl, file) — 文件名模板处理,占位符:[name]、[ext]、[hash:N]、[date:FORMAT]、[timestamp]、[uuid]、/
  • compressFile(file, config, onStatus) — 图片压缩(定义在 upload-manager.js)
    • PNG 特殊处理:直接优化缓冲区,不重新编码
    • 自适应逻辑:压缩后更大则使用原文件

项目结构

r2-web/
├── readme.md          — 项目说明、使用指南
├── package.json       — 依赖声明(仅用于类型提示)
├── jsconfig.json      — JSDoc 类型检查配置
└── src/               — 源码目录(即部署目录)
     ├── index.html    — 应用外壳、import map、对话框模板
     ├── main.js       — 入口(仅 new App())
     ├── manifest.json — PWA 配置
     ├── style.css     — 样式主入口(仅导入 css 子目录)
     ├── js/           — 业务逻辑模块
     │    ├── app.js              — 主协调器
     │    ├── config-manager.js   — 配置持久化、Base64 分享
     │    ├── r2-client.js        — S3 API 客户端
     │    ├── ui-manager.js       — 主题、Toast、对话框、Tooltip
     │    ├── file-explorer.js    — 目录导航、排序、分页、缩略图
     │    ├── upload-manager.js   — 上传、文件名模板、图片压缩
     │    ├── file-preview.js     — 图片/视频/音频/文本预览
     │    ├── file-operations.js  — 重命名、复制、移动、删除
     │    ├── i18n.js             — 多语言(zh/zh_TW/en/ja)
     │    ├── constants.js        — 常量
     │    └── utils.js            — 工具函数
     └── css/          — 样式模块(CSS Layers)
          ├── reset.css       — CSS Reset
          ├── tokens.css      — 设计 Token(定义所有变量)
          ├── base.css        — 全局基础样式
          ├── layout.css      — 布局容器
          ├── components.css  — 通用 UI 组件
          ├── utilities.css   — 工具类
          └── animations.css  — 动画与过渡

Read the full file on GitHub · 138 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 First seen · 138 lines · 1,644 tokens per session scan A 6af8912ebac4

Subscribe to this mod's changes

r2-web AGENTS.md is an instructions file published in the GitHub repository vikiboss/r2-web (498 stars, last pushed 1mo ago), licensed MIT. It adds 1,644 tokens to every session, about $0.0066 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-09-16.

Related

r2-web AGENTS.md compared with instructions from other repositories

r2-web AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
r2-web AGENTS.mdvikiboss/r2-webInstructions file4981mo agoMITA1,644Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,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