override-rules: Instructions file for Codex

AGENTS.md

override-rules AGENTS.md is an instructions file for Codex, OpenCode from powerfullz/override-rules. It costs 4,493 tokens per session, scanned A, original, MIT.

A project guide for AI agents and contributors working on a TypeScript project that generates JavaScript and YAML output. It explains the source layout, build process, code style, and contribution rules.

In plain words
What is it for?
Use it when changing TypeScript source, rebuilding JavaScript or YAML artifacts, formatting or linting code, and preparing focused commits or pull requests.
Why use it?
It prevents changes from being made directly to generated files, where they would be overwritten. It also explains which commands regenerate and check the project outputs.

Instructions file for CodexOpenCode

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

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { buildFeatureFlags } from "../../src/args/parse";.

Reuse

Borrowing it

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

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 override-rules AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/powerfullz/override-rules/agents-md"><img src="https://agentmods.dev/badge/instructions/powerfullz/override-rules/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,493 This file is loaded in full into every session.
When invoked 4,493 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.04493 $0.04493
Opus 5.5 $0.01797 $0.01797
Sonnet 5.5 $0.00899 $0.00899
Haiku 4.5 $0.00449 $0.00449

Measured yesterday against content hash 684633ee712d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

override-rules 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 yesterday.

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 · 334 lines

How it starts

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

AGENTS.md — AI Agent 与贡献者指南

本文件面向两类读者:

  • 协助人类开发者修改本项目的 AI Agent;
  • 第一次参与本项目的贡献者。

目标:让你快速知道改哪里、怎么验证、什么绝对不能碰。

深入阅读:


0. 速查

npm install

# 日常修改后
npm run format
npm run lint:fix
npm test

# 生成构建产物(build + generate,不包含测试和 lint)
npm run artifacts

提交前建议跑一遍:

npm run format:check && npm run lint && npm run typecheck && npm test && npm run artifacts

1. 这是什么

本项目为 Mihomo/Clash 订阅覆写工具:读取上游订阅的代理节点,按落地/非落地、国家/地区、低倍率、Tailscale 等维度分类,再生成代理组、分流规则、DNS、TUN 等配置。

项目同时产出两种形式:

形式 入口 特点
JS 动态覆写 src/main.ts → convert.js / convert.min.js 主推方式;运行时读取真实节点,支持 URL 参数
静态 YAML 覆写 scripts/yaml_generator/generator.ts → yamls/*.yaml 备用方式;用假节点穷举参数组合,适合不能执行 JS 的客户端

两种形式共享 src/catalog/ 与 src/builders/ 的逻辑,区别只在数据来源和过滤方式。详见 docs/ARCHITECTURE.md。


2. 项目规则

规则 说明
只改源码 行为修改必须落在 src/、scripts/yaml_generator/、tests/ 或文档中
不碰构建产物 convert.js、convert.min.js、yamls/ 均由脚本生成,且已被 .gitignore 忽略。不要编辑,也不要提交
不碰发布分支 dist、preview 由 GitHub Actions 生成,禁止向它们提交、合并或手动推送
不要合并两份 TypeScript typescript-native(TS 7)与 typescript(TS 6)并存是刻意设计,详见第 8 节
保持文档同步 新增或修改 URL 参数、代理组行为、构建命令时,同步更新对应文档,详见第 9 节
发布需授权 版本发布仅限 powerfullz 本人或其授权的 Agent,详见第 11 节

3. 架构与目录

核心数据流:

$arguments
  → buildFeatureFlags()      // src/args
  → analyzeNodes()           // src/analysis
  → buildBaseLists()         // src/builders/selectors.ts
  → buildProxyGroups()       // src/builders/proxy-groups.ts
  → assembleConfig()         // src/builders/config.ts

文件分为「声明式数据 / 构建逻辑 / 最终组装」三层结构:

路径 职责
src/main.ts JS 覆写入口;读取 $arguments、编排流程、暴露 globalThis.main
src/args/ URL 参数解析;默认值的唯一来源是 schema.ts
src/analysis/ 节点分类:落地/非落地、国家/地区、低倍率、Tailscale
src/builders/ 纯构建函数:候选列表、代理组、规则、DNS、TUN、最终配置
src/catalog/ 声明式数据:组名、图标、国家元数据、服务组、规则集、DNS 常量
src/domain/ 代理组工厂;字段顺序与空候选兜底集中在此
src/types/ 按域拆分的类型定义:args / proxy / clash
src/utils/ 无业务状态的通用工具函数
ruleset/ 项目自维护的规则列表(如 TikTok、E-Hentai、SteamFix)
scripts/build.mjs 用 esbuild 打包 convert.js 与压缩版 convert.min.js
scripts/yaml_generator/generator.ts 用 fake_proxies.json 穷举生成 yamls/,固定启用 regex=true
tests/ 与 src/ 目录对应的单元测试
docs/ 架构、自定义与贡献文档

Read the full file on GitHub · 334 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. yesterday Changed · +282 lines · +3,295 tokens per session 684633ee712d
  2. 17d ago Changed · +1 lines · +38 tokens per session 8ecb33004e6c
  3. 1mo ago Changed · +5 lines · +253 tokens per session 7468ea43e68f
  4. 2mo ago First seen · 46 lines · 907 tokens per session scan A 8f77ffe6c98d

Subscribe to this mod's changes

override-rules AGENTS.md is an instructions file published in the GitHub repository powerfullz/override-rules (628 stars, last pushed yesterday), licensed MIT. It adds 4,493 tokens to every session, about $0.0180 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-30.

Related

override-rules AGENTS.md compared with instructions from other repositories

override-rules AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
override-rules AGENTS.mdpowerfullz/override-rulesInstructions file628yesterdayMITA4,493Codex, 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