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.
npx agentmods add instructions/hikaru518/ram/agents-mdgit clone --depth 1 https://github.com/Hikaru518/RamWrote 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.
[](https://agentmods.dev/instructions/hikaru518/ram/agents-md)<a href="https://agentmods.dev/instructions/hikaru518/ram/agents-md"><img src="https://agentmods.dev/badge/instructions/hikaru518/ram/agents-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.04595 | $0.04595 |
| Opus 5 | $0.02298 | $0.02298 |
| Sonnet 5 | $0.00919 | $0.00919 |
| Haiku 4.5 | $0.00460 | $0.00460 |
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 4d 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.
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时删除目标目录已有配置后重新拷贝,确保统一版本。
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.
- 4d ago First seen · 169 lines · 4,595 tokens per session scan A 43a02a242879
Ram AGENTS.md is an instructions file published in the GitHub repository Hikaru518/Ram (11 stars, last pushed 5mo ago), licensed MIT. It adds 4,595 tokens to every session, about $0.0230 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.
Other instructions, from other repositories
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).
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.
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.
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.
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).
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.