agent-harness-template AGENTS.md

agent-harness-template AGENTS.md is an instructions file for Codex, OpenCode from Tirefly/agent-harness-template. It costs 2,871 tokens per session, scanned A, original, MIT.

A user-level instruction template that defines how coding agents should behave across projects and computers. It covers language preferences, which instruction file is authoritative, and how shared agent resources are maintained.

In plain words
What is it for?
Setting global agent instructions, defining preferred communication language, managing shared skills, and documenting cross-computer setup conventions.
Why use it?
It gives different coding tools one consistent source of rules and reduces conflicts between duplicate instruction files.

Instructions file for CodexOpenCode

Install

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.

agentmods
npx agentmods add instructions/tirefly/agent-harness-template/agents-md
Clone the repo
git clone --depth 1 https://github.com/Tirefly/agent-harness-template

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 agent-harness-template AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tirefly/agent-harness-template/agents-md.svg)](https://agentmods.dev/instructions/tirefly/agent-harness-template/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tirefly/agent-harness-template/agents-md"><img src="https://agentmods.dev/badge/instructions/tirefly/agent-harness-template/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,871 This file is loaded in full into every session.
When invoked 2,871 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02871 $0.02871
Opus 5 $0.01435 $0.01435
Sonnet 5 $0.00574 $0.00574
Haiku 4.5 $0.00287 $0.00287

Measured 4d ago against content hash ef1605258d84, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-harness-template 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.

AGENTS.md · 109 lines

How it starts

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

用户级 Agent 规范

本文件是跨工作区行为的唯一规范来源(canonical user-level Agent instruction source)。工具特定指令文件与本文件冲突时,先读本文件再作判断。

这是可公开使用的模板:把 <尖括号> 占位替换为你自己的内容,其余结构可直接沿用。

语言偏好

  • 与用户使用中文交流。(按你的语言偏好修改本条目)

全局指令归属

  • ~/.agents/AGENTS.md(即本文件)是唯一规范的用户级 Agent 指令来源。
  • ~/.agents/skills 下的用户级 AgentSkill 资源是唯一规范的用户级技能资源。
  • 工具特定文件(如 ~/.claude/CLAUDE.md~/.codex/AGENTS.md~/.copilot/instructions/*.md)仅为兼容性占位或备份。
  • 各工具的用户级技能目录(如 ~/.claude/skills~/.config/opencode/skills~/.codex/skills)不再维护用户技能副本;需要工具原生加载技能时,配置技能根指向 ~/.agents/skills(如 OpenCode 的 skills.paths)或建立 junction 链接,不得复制技能内容。
  • 协作规则需要变更时,先更新本文件。若工具特定备份仍需等价规则,仅同步简短指针或兼容性说明。
  • 除非用户明确决定停止使用工具特定冗余,否则不要删除备份指令文件。
  • 遇事不决查唯一规范:不确定适用哪条用户级规则时,读本文件并遵循之。

跨电脑部署约定

本文件与 ~/.agents(技能、记忆、原子)设计为跨电脑使用:

  • 各机用户主目录下都存在 ~/.agents,与你的主仓库保持同步(推荐 git clone/pull;网盘或手动拷贝亦可)。
  • 本文件内路径一律使用 ~ 相对写法(~/.agents/...),不写 C:\Users\...E:\... 等本机绝对路径;~ 在各机均指该机用户主目录。工具特定备份同理使用 ~/.claude/...~/.codex/...~/.copilot/...
  • 依赖:各机需安装 git;运行记忆检索脚本需 Python(探测顺序:pythonuv run python → 本机已知绝对路径)。
  • 机器特定差异(引擎安装位置、Python 安装位置等)不得写入本文件;如需记录,写入对应技能文件的本机裁决注释,跨机部署时替换为本机实际值。

用户级 Agent 资源

  • Agent 必须参考并遵循 ~/.agents 下的用户级 Agent 规范与 AgentSkill 资源。
  • 已安装的用户级技能位于 ~/.agents/skills
  • 当工具本地缓存的技能副本与用户级技能同时存在时,优先使用 ~/.agents/skills 下的用户级技能。

技能优先与流程纪律

  • 任何任务开始时,agent 必须先检查是否有相关技能适用,再提出澄清问题、探索文件或采取行动;若某技能可能适用,先调用它再继续。
  • 流程类技能(如 brainstorming、systematic-debugging)优先于实现类技能;用户显式指令、AGENTS.mdCLAUDE.mdGEMINI.md 及直接请求优先于技能指令。
  • 设计、讨论或研究/预研阶段,先使用 Superpowers 工作流;进入计划/设计模式前,在可用时使用 brainstorming/设计工作流。
  • TDD 默认禁止:不使用 test-driven-development 技能(红绿重构/测试先行)。除非用户明确要求该特定任务使用 TDD,否则遵循本文件并跳过该技能。若某技能推荐 TDD 而本文件禁止,遵循本文件并跳过该技能。自动化测试仅在用户明确要求、或既有项目已要求对进行中变更做特定测试更新时添加。
  • 验证偏好:优先编译/构建验证、定向人工检查与项目既有验证方法,而不是为满足某个技能而发明自动化测试套件。

协作纪律

  • 默认批判性审视每条用户消息;若用户的推理、假设、范围、顺序或取舍有问题,直接、清晰、严肃地指出,而不是默默迁就。
  • 明确说明重要假设、风险、边界情况与执行约束。
  • 用户与 agent 明确确认的设计决策、执行约束、术语选择或实现方向,执行期间视为有约束力;有新证据表明其不一致、不安全或不可行时,先停下说明冲突再偏离。
  • 若输入极不合理,直接给出直白尖锐的反馈,尽快重置讨论。

项目初始化排除项

  • 初始化或索引项目时,自动跳过以下文件夹及其内容:
  • .idea.vs.vscode.git
  • BinariesBuildIntermediateSavedDerivedDataCache(含插件子目录下的 Binaries/Intermediate

Read the full file on GitHub · 109 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. 4d ago First seen · 109 lines · 2,871 tokens per session scan A ef1605258d84

Subscribe to this mod's changes

agent-harness-template AGENTS.md is an instructions file published in the GitHub repository Tirefly/agent-harness-template (2 stars, last pushed 9d ago), licensed MIT. It adds 2,871 tokens to every session, about $0.0144 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-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 · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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.

openai/codex · 5,182 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,345 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, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

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.

vercel/next.js · 7,296 tokens