xops-cli: Instructions file for Codex

AGENTS.md

xops-cli AGENTS.md is an instructions file for Codex, OpenCode from wentf9/xops-cli. It costs 1,624 tokens per session, scanned A, original, MIT.

A set of development instructions for the xops-cli project, a command-line tool written in Go.

In plain words
What is it for?
Use it when adding or fixing xops-cli code, updating documentation, writing tests, or preparing commits and CI changes.
Why use it?
It gives contributors shared rules for safe resource handling, error reporting, concurrency, network timeouts, Git changes, and required tests.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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 xops-cli AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/wentf9/xops-cli/agents-md"><img src="https://agentmods.dev/badge/instructions/wentf9/xops-cli/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,624 This file is loaded in full into every session.
When invoked 1,624 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.01624 $0.01624
Opus 5.5 $0.00650 $0.00650
Sonnet 5.5 $0.00325 $0.00325
Haiku 4.5 $0.00162 $0.00162

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

Security

Grade A, and why

xops-cli 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 15d 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 · 61 lines

How it starts

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

AI 助手开发协作指南 (AGENTS.md)

0. 优先级与工作模式

  • 接受任何开发任务前,先说明:用户目标、相关模块、已定位的源文件、预计更改范围、验证方法、仍需确认的事实。
  • 调查 / 文档生成:默认只读,不修改源码/配置,不运行可能创建凭据、执行远程命令或修改主机的操作。
  • 开发:先提交简短影响分析;跨越两个以上子系统(core/ssh, core/mcp, pkg/config, pkg/credential, internal/mcphost, pkg/playbook, cmd)或触及持久化/授权/协议/兼容性时,先给方案并明确验收门槛。
  • 禁止凭名称猜测模块职责、编造函数、编造测试结果;重要事实附 路径:符号,必要时附准确行号。无法确认时写「待验证」。
  • 先阅读 docs/development/governance/architecture-map.md 的导航与与任务有关的已有设计,再精确阅读被修改代码;不强制每次通读全部文档。

1. 不可破坏的包边界

  • cmd/:Cobra 命令注册、参数解析、表现层与 CLI 组合根;不在此创建第二套 SSH/SFTP、配置持久化或 MCP 策略引擎。
  • pkg/config/:配置 Repository 是持久变更边界,Provider 提供版本一致的读取视图;已有事务/冲突/持久性语义不可绕过。
  • pkg/credential/ 与 internal/credentialfile/:凭据服务、引用和离线凭据持久化;禁止将明文写回遗留字段、日志或错误。
  • pkg/adapter/、internal/sshenv/、internal/mcphost/:将应用配置、认证、运行环境和策略装配到 core/;不得在 core 中重新引入 CLI 依赖。
  • core/ssh/、core/sftp/:唯一共享 SSH/SFTP 执行与传输能力;新能力优先在现有入口中扩展。
  • core/mcp/{ports,sshexec,state,guardrail,runtime,transfer,tunnel}:协议契约、执行后端、状态准入、护栏、运行时与任务生命周期各有边界;不可因为“调用更简单”绕开 permit、binding、policy 或 snapshot。
  • pkg/playbook/:编排、步骤结果、重试政策;不能自行再实现一套 SSH 远程执行器。
  • core/** 的所有代码、测试与 fixture 不得 import cmd/**、pkg/** 或根 internal/**;不得依赖外部 xops-mcp 消费者。参见 core/README.md 和 docs/development/shared-core-decoupling.md。

2. 开发底线

  • Go 1.26+;保留 Go 缩写规范(ID、URL、SSH、CLI、SFTP、TCP);遵守 gofmt 与仓库 golangci-lint v2。
  • 任何连接、文件、租约、会话、goroutine 和取消函数必须标明谁拥有、何时释放;优先用 defer,但借用资源不应随意 Close。不要关闭调用方持有的输入输出流。
  • 网络与并发操作必须有有界生命周期;取消需要使等待/子协程最终终止。需要同步的共享状态明确采用何种锁/通道/不可变快照策略,禁止数据竞争和锁反转。
  • 错误用 %w / errors.Is / errors.As 保留语义;远程命令执行区分 not_started、completed、unknown;未知结果不自动重试。
  • 禁止隐式放宽 SSH 主机信任、鉴权、MCP 风险分级、HTTP Token/Origin/Host 校验、路径保护、审批、审计或传输任务授权绑定。
  • 不为解决局部问题新增与既有实现平行的管理器、wrapper 或类型别名。确需新抽象时,说明替代什么、消除什么复杂性、何处调用、如何验证。
  • 不顺带做无关格式化/重命名/大范围移动。历史文档与协议 fixture 不得因“看起来旧”而直接覆盖。

3. 每次变更的固定交付

  • 变更前:目标与非目标;具体源码/符号;拥有职责的包;受影响调用方;兼容与安全风险;拟执行的测试。
  • 变更后:修改摘要;行为对照;实际运行的测试及结果;未运行项目及理由;剩余风险。只有当变更影响 CLI/MCP 对外契约或实际设计时更新相关文档(中英文公开文档均需同步)。
  • 修复 bug 原则上添加能复现旧问题的回归测试;修改高风险路径需要边界情况与取消/错误路径测试。若确不能测,明确记录原因及替代证据。
  • 不将 go build ./...、go test ./...、lint、交叉编译、native 平台执行等同。构建≠原生平台测试,lint≠回归测试。不要宣称未执行的步骤通过。

Read the full file on GitHub · 61 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. 15d ago Changed · +11 lines · +682 tokens per session b431e777ce7b
  2. 2mo ago First seen · 50 lines · 942 tokens per session scan A c6ceb0f01004

Subscribe to this mod's changes

xops-cli AGENTS.md is an instructions file published in the GitHub repository wentf9/xops-cli (21 stars, last pushed yesterday), licensed MIT. It adds 1,624 tokens to every session, about $0.0065 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-31.

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,461 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

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,750 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens