Opencode-Howto 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

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/leihuang830102-hash/opencode-howto/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.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.svg" alt="Measured on agentmods" 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. 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.02790 $0.02790
Opus 5 $0.01395 $0.01395
Sonnet 5 $0.00558 $0.00558
Haiku 4.5 $0.00279 $0.00279

Measured 3d ago against content hash 1b72f28f1af8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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. 3d 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 4mo ago), licensed MIT. It adds 2,790 tokens to every session, about $0.0140 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