Ram: Instructions file for Codex

AGENTS.md

Ram AGENTS.md is an instructions file for Codex, OpenCode from Hikaru518/Ram. It costs 4,595 tokens per session, scanned A, original, MIT.

Project instructions for a Python service using FastAPI, with rules for dependencies, type checking, linting, formatting, testing, frontend builds, and deployment.

In plain words
What is it for?
Use them when modifying or reviewing the Ram project, especially Python code, the React frontend, tests, or CI-related work.
Why use it?
They give an agent the repository’s expected tools and checks, reducing the chance of changes that fail its quality standards.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/hikaru518/ram/agents-md"><img src="https://agentmods.dev/badge/instructions/hikaru518/ram/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,595 This file is loaded in full into every session.
When invoked 4,595 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.04595 $0.04595
Opus 5.5 $0.01838 $0.01838
Sonnet 5.5 $0.00919 $0.00919
Haiku 4.5 $0.00460 $0.00460

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

Security

Grade A, and why

Ram 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 2mo 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 · 169 lines

How it starts

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

Project Context

1. 技术栈

  • 语言: Python
  • 框架: FastAPI (Starlette)
  • 构建工具: 无(直接运行)
  • 测试框架: pytest + pytest-asyncio (asyncio_mode = "auto") + pytest-cov
  • 静态分析: mypy(strict 模式 + pydantic.mypy 插件)
  • Lint/Format: ruff(统一替代 flake8/isort/black)
  • Git hooks: pre-commit(提交前自动运行 ruff check/format)
  • 其他关键依赖: Pydantic v2, httpx, openai (OpenAI-compatible LLM 客户端), slack-sdk (Slack API 客户端), Alibaba Cloud OOS Python SDK, trafilatura (HTML 正文提取), markdownify (HTML→Markdown 兜底), Tavily CLI (tvly, web_search 工具的外部 CLI 依赖), SQLAlchemy (SQLite ORM,WAL 模式,trace 存储), structlog (JSON 结构化日志), aliyun CLI(部署脚本用于从 OOS 获取密钥,EcsRamRole 认证)
  • Management 前端: React + Vite + TypeScript + Tailwind CSS + shadcn/ui

2. 质量检查命令

  • 类型检查: mypy src/ tests/ management/api/ --no-incremental(strict 模式,tests.* 免除 disallow_untyped_defs)
  • Lint: ruff check src/ tests/ management/api/
  • Format: ruff format src/ tests/ management/api/
  • 测试: .venv/bin/python -m pytest(含覆盖率,fail_under = 82)
  • Management 前端构建: cd management/ui && npm run build(产物输出到 management/ui/dist/,由 Management API StaticFiles 提供)
  • CI: GitHub Actions(.github/workflows/ci.yml),lint → (type-check ∥ test+coverage) 并行
  • 构建: 未配置

3. 关键约束

  • 入口仅通过 Slack Events API(app_mention、interactions、slash commands),所有外部入口必须经过签名校验与事件白名单。GitHub Webhook 端点已移除。
  • 所有持久化数据统一存储在 SQLite(ram.db,WAL 模式):trace 四表(conversations/agent_runs/llm_calls/tool_calls)+ Code Project 四表(projects/channel_bindings/thread_sessions/opencode_calls)。数据库路径通过 RAM_DB_PATH 环境变量配置(默认 data/ram.db)。
  • SQLite 单写者原则:Ram 主服务负责所有写入(trace + Code Project),Management 以只读模式(?mode=ro)访问同一 ram.db 文件。SQLiteTraceRecorder 和 SQLiteCodeProjectStore 共享 SQLAlchemy engine。
  • OpenCode 仅以本机 CLI 方式调用(非云端服务)。通过专用 Code Tool 调用(不在 Bash allowlist 中)。
  • Bash Tool 命令受 allowlist 限制(~/.ram/config.json 的 bash_allowlist 字段),文件不存在时回退到内置默认列表。每次调用重新读取(无缓存),支持运行时修改。
  • 生产密钥仅允许从阿里云 OOS 参数仓库读取。TAVILY_API_KEY 也已纳入 OOS 管理(ram_prod_tavily_api_key),由部署脚本通过 aliyun CLI 获取。
  • LLM 配置通过 ~/.ram/models.json 管理(嵌套格式:provider → models),含 api_key_oos_param(OOS 参数名)、extra_body(provider-specific 扩展参数)、reasoning_field(思维链字段路径)等字段。load_model_config() 负责解析并从 OosSecretProvider 解析 API key,返回 ResolvedModelConfig。AppConfig 不再包含 LLM 字段。
  • Management 仅供开发者通过 SSH 隧道访问(localhost:8001),不设应用层认证。
  • opencode-config 以 Git submodule 引入(config/opencode-config/→ Hikaru518/opencode-config),/ram bind 时删除目标目录已有配置后重新拷贝,确保统一版本。

Read the full file on GitHub · 169 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. 2mo ago First seen · 169 lines · 4,595 tokens per session scan A 43a02a242879

Subscribe to this mod's changes

Ram AGENTS.md is an instructions file published in the GitHub repository Hikaru518/Ram (11 stars, last pushed 7mo ago), licensed MIT. It adds 4,595 tokens to every session, about $0.0184 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

Ram AGENTS.md compared with instructions from other repositories

Ram AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Ram AGENTS.mdHikaru518/RamInstructions file117mo agoMITA4,595Codex, 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