moss: Instructions file for Codex

AGENTS.md

moss AGENTS.md is an instructions file for Codex, OpenCode from D-Robotics/moss. It costs 5,471 tokens per session, scanned C, original, MIT.

Project instructions for Moss, a cross-platform toolkit for building AI-agent applications. It is a TypeScript npm-workspaces monorepo, meaning several related packages are developed in one repository.

In plain words
What is it for?
They guide work on the core contracts, agent runtime, command-line tools, application scaffolding, memory, skills, safety, integrations, and related subsystems.
Why use it?
They define the required package boundaries and dependency direction, reducing the risk that changes create circular or misplaced dependencies.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/d-robotics/moss/agents-md"><img src="https://agentmods.dev/badge/instructions/d-robotics/moss/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5,471 This file is loaded in full into every session.
When invoked 5,471 The same file — it is already loaded in full.
Security scan C 2 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.05471 $0.05471
Opus 5.5 $0.02188 $0.02188
Sonnet 5.5 $0.01094 $0.01094
Haiku 4.5 $0.00547 $0.00547

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

Security

Grade C, and why

moss AGENTS.md scanned grade C with 2 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 12d 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

与敏感读取档(`/etc/shadow`、私钥、`sshd_config`、`authorized_keys`)在 TTY 上确认,headless 拒绝,

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

`runProcessSync`),工具执行路径禁用 `execFileSync` / `execSync`。
AGENTS.md · 205 lines

How it starts

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

AGENTS.md

本文件是 Moss 仓库对所有 coding agent 的项目指令(被 git 跟踪、可审查)。

仓库身份

Moss 是一个精简的跨平台 coding agent harness:TypeScript / ESM 单包仓库(根 package.json, 包名 @rdk-moss/agent,bin 为 dist/cli.js),Node ≥ 22.16.0,运行于 Linux / macOS / Windows。

核心能力(也是唯一应当存在的范围):agent loop、工具框架(src/tools/)、上下文管理 (src/context/)、provider(src/provider/)、安全(src/safety/)、会话 (src/core/session/)、子代理(src/core/subagent/)与 CLI(src/cli/、src/cli-main.ts)、 设备抽象(src/device/ + src/contracts/device.ts + src/tools/device-tools.ts,SSH 连 RDK / Linux 真机,目标是机器人闭环 Goal→…→Deploy→Verify→Repair→Physical Acceptance)。 共享契约在 src/contracts/。

范围变更(2026-09-30 v0.14–v0.20 路线图冻结决策,见 docs/superpowers/plans/2026-09-30-moss-v014-v020-roadmap.md;同日机器人闭环总指令为 更高优先级的产品方向,两线共存):

  • 解冻:MCP 客户端(仅客户端;stdio + streamable HTTP 双传输、工具懒加载、 src/core/mcp/,v0.16)与轻量 skills(SKILL.md 渐进披露、src/core/skills/,v0.16)。
  • 翻案:v0.17 起引入可选全屏 TUI(ink,严格圈禁 src/cli/tui/ 动态 import, 无 TTY 或 --no-tty 回退 readline REPL;REPL 永久保留)。
  • 维持冻结:memory(跨会话自动记忆)/ mesh / observability / orchestration / web-ui / 插件市场。不要重新引入这些子系统。

代码规范(必须遵守)

  • Prettier 负责格式;TypeScript/JavaScript/MJS 文件名用 kebab-case;Node 内置模块用 node: 前缀;仅类型导入用 import type;ESM 相对导入带 .js 后缀。
  • 禁止 any;不要留下未处理的 Promise;跨工具 / provider / CLI 边界的错误转换为 MossError(src/errors.ts)并保留原始 cause;禁止 catch (err: any)。
  • 所有子进程必须经 src/utils/run-process.ts(runProcess / spawnProcess / runProcessSync),工具执行路径禁用 execFileSync / execSync。
  • 新工具必须声明 side-effect 元数据(readonly vs mutating 驱动审批)。
  • 非流式 LLM provider 必须声明 capabilities: { streaming: false }。
  • 面向用户的成功消息必须来自真实结果(probe / exit code / post-condition),不得是固定字符串。
  • 凭据只从 .env 或环境变量读;不硬编码、不写日志、不传给外部服务。

常用命令

命令 用途
npm run build 清理并构建到 dist/
npm run typecheck 全量类型检查
npm run lint / lint:fix ESLint(0 warning)
npm run test 构建 + 运行 test/*.spec.mjs(面向 dist/)
npm run test:filter -- --filter <name> 只跑匹配的 spec(至少匹配 1 个,否则失败)
npm run smoke CLI 冒烟(版本 / 帮助 / PTY 启动)
npm run check format:check + lint + typecheck
npm run verify check + test + smoke,交付前必须绿
npm run bench [-- --task <id> --samples <n>] agent 能力基准(bench/tasks/,DeepSeek 基准模型,结果落 bench/results/,不入库)
npm run bench:ab -- <engine> hard 层 A/B 对照(best-of-n / reasoning-high / model-routing,--samples <n> 可调),输出默认开/关建议
npm run bench:noise -- <label1> <label2> [...] 同 SHA 重复跑聚合成噪声带(bench/results/noise-band.json)
npm run bench:swe -- [--samples N --concurrency K --label L --filter s --eval] SWE-bench Verified 100 实例锁子集(bench/boards/swebench-instances.json):容器内 moss headless 产 patch + 官方 swebench harness 判分;密钥经 MOSS_BENCH_API_KEY
npm run bench:deepswe -- --tasks <dir> [--samples 8] DeepSWE v1.1 同模型 harness 对比(经 Pier;已发布分数在 bench/boards/deepswe-v1.1-harness.json;默认 1 样本,发布口径 8 样本、temperature 1.0、top_p 0.95)
npm run bench:device -- --dry | --target sim | --target real 设备任务成功率(bench/device-tasks/);PASS = Moss 裁决通过且独立探测与证据一致。见 docs/bench/device-bench.md
MOSS_REAL_TERMINALS=1 npm run test:filter -- --filter tui-real-terminals P7 真实终端核对(tmux / GNU screen / Terminal.app,先 build);默认 npm test 不跑,缺终端则 skip。见 docs/cli-parity/tui-real-terminals.md
npm run bench:tui-feel TUI 体感基准(scripts/tui-feel/,PTY + pyte;缺 python/pyte 时跳过)。结果落 bench/results/,不入库

Read the full file on GitHub · 205 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. 12d ago Changed · +5 tokens per session 4cd95caf96cf
  2. 13d ago Changed · +8 lines · +262 tokens per session 54d049088d1c
  3. 14d ago Changed · +18 lines · +911 tokens per session scan A → C 8897c515dcee
  4. 15d ago Changed · +3 lines · +120 tokens per session fa3461cff852
  5. 23d ago Changed · +80 lines · +2,436 tokens per session 5bee2121bce5
  6. 24d ago Changed · +23 lines · +467 tokens per session 2416e2c4833a
  7. 25d ago Changed · +4 lines · +143 tokens per session 0a90006ccf4e
  8. 1mo ago Changed · -103 lines · -3,170 tokens per session fce28a2d3a96
  9. 1mo ago First seen · 172 lines · 4,297 tokens per session scan A c7b49b863fa7

Subscribe to this mod's changes

moss AGENTS.md is an instructions file published in the GitHub repository D-Robotics/moss (143 stars, last pushed 5d ago), licensed MIT. It adds 5,471 tokens to every session, about $0.0219 per session on Opus 5.5. A static security scan graded it C with 2 findings (reaches for credential files, runs shell commands). 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

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 · 9,715 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,581 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens