Opencode-Howto: Instructions file for Codex

AGENTS.md

Opencode-Howto AGENTS.md is an instructions file for Codex, OpenCode from leihuang830102-hash/Opencode-Howto. It costs 2,790 tokens per session, scanned A, original, MIT.

Project instructions for maintaining and building an OpenCode training guide, including its development setup, tests, formatting checks, and EPUB ebook build.

In plain words
What is it for?
Setting up the project, running tests and coverage checks, formatting and linting Python scripts, and generating an EPUB from Markdown files.
Why use it?
It records the commands and conventions needed to work on the project consistently, including creating a Python virtual environment and validating documentation.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

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

Reuse

Borrowing it

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

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 Opencode-Howto AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/leihuang830102-hash/opencode-howto/agents-md"><img src="https://agentmods.dev/badge/instructions/leihuang830102-hash/opencode-howto/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,790 This file is loaded in full into every session.
When invoked 2,790 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.02790 $0.02790
Opus 5.5 $0.01116 $0.01116
Sonnet 5.5 $0.00558 $0.00558
Haiku 4.5 $0.00279 $0.00279

Measured 2mo ago against content hash 1b72f28f1af8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Opencode-Howto 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 2mo 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 · 399 lines

How it starts

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

AGENTS.md

OpenCode Howto 项目的开发规范。

项目说明:本项目基于上游 Claude Code Howto (claude-howto-zh-cn-main) 创建,旨在为公司内部 AI 开发团队提供 OpenCode 培训指南。详见 PROJECT_OVERVIEW.md

构建命令

开发环境设置

# 创建虚拟环境并安装依赖
cd claude-howto-zh-cn-main
uv venv
uv pip install -r scripts/requirements-dev.txt

EPUB 构建

# 构建 EPUB 电子书
uv run scripts/build_epub.py

# 带参数构建
uv run scripts/build_epub.py --root . --output output.epub --verbose

# 构建选项
# --root, -r      Markdown 文件根目录
# --output, -o    输出 EPUB 文件路径
# --verbose, -v   启用详细日志
# --timeout       API 请求超时(秒)
# --max-concurrent 最大并发请求数

测试命令

运行测试

# 运行所有测试
uv run pytest scripts/tests/ -v

# 运行测试并生成覆盖率报告
uv run pytest scripts/tests/ -v --tb=short --cov=scripts --cov-report=term-missing

# 运行单个测试文件
uv run pytest scripts/tests/test_validate_localization.py -v

# 运行单个测试函数
uv run pytest scripts/tests/test_validate_localization.py::test_validate_markdown_links_detects_missing_file -v

# 安静模式(仅显示失败)
uv run pytest scripts/tests/ -q

# 运行特定标记的测试
uv run pytest scripts/tests/ -m "not slow"

代码质量检查

Lint 和格式化

# Ruff 格式检查
uv run ruff format --check scripts/

# Ruff 格式化(自动修复)
uv run ruff format scripts/

# Ruff lint 检查
uv run ruff check scripts/

# Ruff lint(自动修复)
uv run ruff check --fix scripts/

# 安全扫描
uv run bandit -c scripts/pyproject.toml -r scripts/ --exclude scripts/tests/

# 本地化验证
uv run python scripts/validate_localization.py

Pre-commit Hooks

# 安装 pre-commit hooks
pre-commit install

# 手动运行所有检查
pre-commit run --all-files

项目结构

D:\Users\Administrator\opencode\Opencode-Howto\
├── PROJECT_OVERVIEW.md           # 项目概要文档
├── AGENTS.md                     # 本文件(开发规范)
├── OpenCode Howto 项目描述(面向AI开发).docx  # 需求文档
└── claude-howto-zh-cn-main/      # 上游参考项目(Claude Code 中文指南)
    ├── scripts/                    # Python 脚本
    │   ├── build_epub.py          # EPUB 构建脚本
    │   ├── validate_localization.py # 本地化验证
    │   ├── pyproject.toml         # Python 项目配置
    │   ├── requirements.txt       # 生产依赖
    │   ├── requirements-dev.txt   # 开发依赖
    │   └── tests/                 # 测试目录
    ├── 01-slash-commands/         # Slash commands 文档
    ├── 02-memory/                 # Memory 文档
    ├── 03-skills/                 # Skills 文档和模板
    ├── 04-subagents/              # Subagents 文档
    ├── 05-mcp/                    # MCP 配置示例
    ├── 06-hooks/                  # Hooks 文档
    ├── 07-plugins/                # Plugins 文档
    ├── 08-checkpoints/            # Checkpoints 文档
    ├── 09-advanced-features/      # 高级功能文档
    ├── 10-cli/                    # CLI 文档
    └── .github/workflows/         # CI/CD 配置

Read the full file on GitHub · 399 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. 2mo ago First seen · 399 lines · 2,790 tokens per session scan A 1b72f28f1af8

Subscribe to this mod's changes

Opencode-Howto AGENTS.md is an instructions file published in the GitHub repository leihuang830102-hash/Opencode-Howto (5 stars, last pushed 6mo ago), licensed MIT. It adds 2,790 tokens to every session, about $0.0112 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

Opencode-Howto AGENTS.md compared with instructions from other repositories

Opencode-Howto AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Opencode-Howto AGENTS.mdleihuang830102-hash/Opencode-HowtoInstructions file56mo agoMITA2,790Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file275k3d agoMITA4,313Codex, OpenCode