MiniAgent: Instructions file for Codex

AGENTS.md

MiniAgent AGENTS.md is an instructions file for Codex, OpenCode from ZhuLinsen/MiniAgent. It costs 1,898 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for MiniAgent, a small Python command-line framework for building AI agents. The project emphasizes readable code, visible tool calls, and using shell commands for actions.

In plain words
What is it for?
Use them when developing or testing MiniAgent, changing its agent loop or command-line interface, or learning how text-based and function-based tool calls are implemented.
Why use it?
They explain the project structure and its design rules, helping an agent make changes without adding unnecessary tools, dependencies, or hidden behavior.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/zhulinsen/miniagent/agents-md"><img src="https://agentmods.dev/badge/instructions/zhulinsen/miniagent/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,898 This file is loaded in full into every session.
When invoked 1,898 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.01898 $0.01898
Opus 5.5 $0.00759 $0.00759
Sonnet 5.5 $0.00380 $0.00380
Haiku 4.5 $0.00190 $0.00190

Measured 19d ago against content hash 45dce42cebb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

MiniAgent 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 19d 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 · 85 lines

How it starts

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

AGENTS.md — MiniAgent 开发与审查约束

每次 Codex 运行必读

这是本仓库 AI 协作规则的唯一真源。进入本仓库开发、审查、修复或继续旧任务时,先读取本文件和受影响的现有代码;在其他工作目录操作 MiniAgent 时也应先读取本文件。用户明确指令优先。

每次变更都要落实四项原则:核心简单、DSH 常用能力、易用美观、便于传播。它们用于取舍、实现、测试和交付,不是宣传口号。CLAUDE.md 只链接本文件,不维护第二份规则。

项目定位与能力目标

MiniAgent 是以插件为核心的轻量 Python Agent Harness。目标是用容易读懂的小内核覆盖 DSH 常用 Agent 场景:模型调用、工具循环、Context/Service、插件生命周期与清理、事件、Skills、MCP 和可恢复会话。

能力必须有可运行示例、测试或真实任务证据。未逐项验证时,不宣称“已实现 DSH 大部分功能”、完整兼容或稳定发布。完整 Fiber 树、HMR、市场、Web 管理台等按实际需求单独评估,避免为对标数量扩大内核。

四项设计原则

核心简单

  • 内核只负责 Agent 循环、插件/服务生命周期、统一工具入口与必要运行守卫。模型协议交给 any-llm,传输交给官方 SDK。
  • 优先复用现有函数和配置入口。修复问题先补缺失边界,避免新建平行实现或引入通用框架。
  • CLI、连接配置、显示、低频工具及专题集成放在外围;新能力优先作为插件组合。插件和 Shell 是可信代码,权限检查不等于沙箱。
  • 易读比少几行更重要。禁止压行、藏逻辑、删安全检查或把代码挪到统计之外来满足预算。
  • 四文件核心目标 500–700 物理行;全部官方包 Python 目标 2000–2800 行,超过 3000 行须在 PR 解释差额和迁移计划。现有总量超标是待解决问题,不能改口径宣称完成。
  • 运行 python scripts/source_stats.py,分别报告 core、runtime mechanisms、全部包代码的变更前后差额。脚本定义统计边界,不复制另一套计数实现。

DSH 常用能力

  • 用 Context/Service、依赖声明和插件清理解决实际 Agent 任务;响应式依赖与可替换 Loop 按独立需求评估,不作为原生 API 精简的前置条件。新增生命周期行为必须说明等待、激活、失活、恢复和异常回滚。
  • 默认优先稳定和显式语义;兼容性变化要说明迁移路径。运行中的任务禁止生命周期变更。
  • 工具仍经 Schema、Policy 和 Skill 检查;会话保留原记录,不重放未知副作用。新能力不得破坏这些守卫。
  • 自定义插件/Loop 的责任和可信边界必须写清楚,不把 Mock 或菜单选项当作真实远端兼容验收。

易用美观

  • 首次成功路径要短:少量清晰选择即可配置模型并开始任务。自动化保持无交互,报错给出可执行提示。
  • 复用 Rich 和既有 CLI 组件;菜单名称、编号、对齐、错误/成功状态保持一致,减少重复标题和冗长日志。不为简单交互新增大型 UI 依赖。
  • 显示内容有界;非 TTY/NO_COLOR 输出可读。秘密不进入日志、报告或连接 JSON;无系统凭据库时明确告知仅在当前进程保留。
  • 用户可见流程改变时验证首次使用、取消、失败降级、模型切换及旧配置行为中受影响的路径。

便于传播

  • README 只保留定位、短快速开始、核心入口和最小示例;详细边界、排障、协议与迁移放 docs/ 专题文档。
  • 中英文 README 同步评估;不更新其中一份时说明原因。截图、Demo 和性能数字必须可复现,标注版本、环境与局限。
  • 每个能力优先提供一条容易复制的命令或一个短示例;使用明确占位符,不写死密钥、模型 ID、用户路径、端口或环境差异。
  • 推广用语服从证据:alpha、剩余目标和未覆盖平台写清楚,不承诺“能力无限”或未经验证的产品等价。

目录边界与真源

  • miniagent/agent.py、harness.py、llm.py、tools/registry.py:四文件核心;以统计脚本清单为准。
  • policy.py、plugins.py、session.py:外围运行机制;连接配置在 connections.py,CLI 在 cli.py / cli_runtime.py。
  • extensions/:可选集成;旧文本 API、系统工具与编排器保存在 codex/legacy-pre-harness 历史分支,原生版不重新引入,迁移见 docs/legacy-migration.md。
  • tests/:确定性回归与显式 opt-in live 测试;scripts/:验证与构建;docs/:专题说明;.claude/reviews/:本地审查产物。
  • 以可执行代码、脚本和工作流为准,发现相关文档漂移要顺手修正。AGENTS.md 不复制完整架构或过期实现。

Read the full file on GitHub · 85 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. 19d ago Changed · +41 tokens per session 45dce42cebb1
  2. 20d ago Changed · -88 lines · -176 tokens per session 8744474da03d
  3. 2mo ago First seen · 173 lines · 2,033 tokens per session scan A fd2b6662b8ed

Subscribe to this mod's changes

MiniAgent AGENTS.md is an instructions file published in the GitHub repository ZhuLinsen/MiniAgent (215 stars, last pushed 19d ago), licensed Apache-2.0. It adds 1,898 tokens to every session, about $0.0076 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

MiniAgent AGENTS.md compared with instructions from other repositories

MiniAgent AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
MiniAgent AGENTS.mdZhuLinsen/MiniAgentInstructions file21519d agoApache-2.0A1,898Codex, 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