agentwork: Instructions file for Codex

AGENTS.md

agentwork AGENTS.md is an instructions file for Codex, OpenCode from zhagqn/agentwork. It costs 919 tokens per session, scanned C, original, MIT.

A repository guide for coding agents, stored in an AGENTS.md file. It explains the project’s rules, safety checks, startup documents, and suggested work steps.

In plain words
What is it for?
Use it to guide agents through planning, execution, review, and commits while following project-specific file-reading, language, temporary-file, and Git rules.
Why use it?
It gives an agent the project context and boundaries before work begins, helping avoid unsafe commands, missed documents, and inconsistent changes.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/zhagqn/agentwork/agents-md"><img src="https://agentmods.dev/badge/instructions/zhagqn/agentwork/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 919 This file is loaded in full into every session.
When invoked 919 The same file — it is already loaded in full.
Security scan C 1 finding. 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.00919 $0.00919
Opus 5.5 $0.00368 $0.00368
Sonnet 5.5 $0.00184 $0.00184
Haiku 4.5 $0.00092 $0.00092

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

Security

Grade C, and why

agentwork AGENTS.md scanned grade C with 1 finding 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- `rm -rf`、`git push --force`、`git reset --hard`、数据库删除/重建
AGENTS.md · 58 lines

What it actually says

AGENTS.md

本项目使用 agentwork 作为工作流基础层。

本仓库协作规范集中在 .shared/,此文件为启动时必读的引导规则。

启动入口仅承载稳定入口和长期约束;当前任务上下文写入 .shared/case/*.md,并且只在显式引用时加载。

核心安全约束(必须遵守)

高风险操作前必须确认:

  • rm -rf、git push --force、git reset --hard、数据库删除/重建
  • 执行前说明风险 → 给替代方案 → 确认用户意图

自引入错误可直接修复:语法错误、格式问题、编译错误。

启动必读

  1. .shared/constraints/coding-style.md
  2. .shared/constraints/destructive-operations.md
  3. .shared/INDEX.md

基本规则

  • 默认使用简体中文沟通
  • 仅在用户明确要求或必须原样输出代码/命令时使用其他语言
  • 高风险操作必须确认
  • 不自动加载 .shared/case/*
  • 不要预读全部 .shared/project/*.md;当任务涉及具体项目或目录时,先根据 .shared/project/index.md 读取对应的轻量 project 文档
  • 当第一次确定将读取或修改的目标路径后,必须立即对照 .shared/project/index.md 的读取映射;若命中条目,先读取对应 project/*.md 再继续工作;若目标路径扩大,重新对照一次
  • 预览未知或可能很大的命令输出时,优先使用 .shared/scripts/command-preview.sh -- COMMAND ...,避免直接把大段输出送入上下文
  • 临时工件统一写入 .tmp/
  • 可选工具默认不预装,按项目约定单独引入
  • Git index(staged 区)是用户的提交和 review 边界;未经明确要求,不改变 staged 区
  • 优先写项目级配置,避免污染全局配置
  • 新建、修改或审查用户界面时,先读 .shared/constraints/frontend-design.md;需要选择设计基底或借鉴参考时,再读 .shared/patterns/design-reference.md;纯需求讨论和非 UI 任务不加载。
  • 文档任务按需使用 anydoc(详见 .shared/skills/anydoc/SKILL.md):默认提供能力规则,运行时依赖在项目级延迟安装,扫描 PDF 的 hosted OCR 需单独授权。
  • 调研任务按需使用 research(详见 .shared/skills/research/SKILL.md):默认提供能力规则,它是唯一研究入口并自行选择最窄 provider;Exa、Octocode 等 remote provider 仍需单独安装,默认不预装、不写凭据、不改平台 MCP 配置。
  • source repo 的安装入口:install-bootstrap.py、install-tool.py

工作流起步建议

  • 需求不清晰、边界模糊:先 /brain
  • 已有方向、需要整理成可执行规格:先 /spec
  • 开始做当前批次工作:用 /exec
  • 一轮工作完成后:先 /audit,再决定是否 /commit

复杂任务

  • 当任务涉及多步骤/跨文件/需要调研时,参考:.shared/patterns/case-workflow.md
  • 如需确认跨平台(Codex / Claude / OpenCode / Cursor / Pi / dsh)能力边界、资料可信度与冲突回退流程,参考:.shared/patterns/platform-adapter.md

代码导航默认策略

  • 处理当前项目内的代码任务时,优先遵循:.shared/patterns/semantic-navigation.md
  • 对 definition / references / symbols / rename-preview / diagnostics 这类语义查询,助手应默认使用对应语义导航能力
  • 路径默认使用当前项目内的相对路径,不写用户目录或绝对工程路径示例
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. 3d ago Changed · +3 tokens per session 74e90b02d4b3
  2. 1mo ago Changed · +2 tokens per session 361e2f5ed528
  3. 1mo ago Changed · +1 lines · +57 tokens per session 68ab277167df
  4. 1mo ago Changed · -1 lines · +50 tokens per session 6072a27734be
  5. 1mo ago Changed · +1 lines · +52 tokens per session 1df1619e3b31
  6. 2mo ago Changed · +3 tokens per session 25391faafcc3
  7. 2mo ago Changed · +2 tokens per session 8dcde1807ce6
  8. 2mo ago First seen · 57 lines · 750 tokens per session scan C befefd2d9ded

Subscribe to this mod's changes

agentwork AGENTS.md is an instructions file published in the GitHub repository zhagqn/agentwork (90 stars, last pushed 3d ago), licensed MIT. It adds 919 tokens to every session, about $0.0037 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

agentwork AGENTS.md compared with instructions from other repositories

agentwork AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agentwork AGENTS.mdzhagqn/agentworkInstructions file903d agoMITC919Codex, 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