voice-edge: Instructions file for Codex

AGENTS.md

voice-edge AGENTS.md is an instructions file for Codex, OpenCode from woniuzfb/voice-edge. It costs 2,937 tokens per session, scanned A, original, MIT.

Repository instructions for a voice application that uses local machine-learning models, speech recognition, text-to-speech, keyboard shortcuts, and several service connections. They require code checks, environment-variable record updates, and self-tests after changes.

In plain words
What is it for?
Guiding changes to the Python application, running Ruff code checks, updating the environment-variable registry, and running the built-in tests.
Why use it?
They define the checks an agent must perform so changes follow the project's rules and do not leave its configuration records or tests out of date.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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 voice-edge AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/woniuzfb/voice-edge/agents-md"><img src="https://agentmods.dev/badge/instructions/woniuzfb/voice-edge/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,937 This file is loaded in full into every session.
When invoked 2,937 The same file — it is already loaded in full.
Security scan A 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.02937 $0.02937
Opus 5.5 $0.01175 $0.01175
Sonnet 5.5 $0.00587 $0.00587
Haiku 4.5 $0.00294 $0.00294

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

Security

Grade A, and why

voice-edge AGENTS.md scanned grade A 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 20d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **配置规则**:遵循 `pyproject.toml` 中的 `[tool.ruff.lint]` 与 Pyright 配置(包含 `E`, `F`, `B`, `ASYNC`, `RUF` 等规则)。不要随意修改该规则集或使用 `# noqa` 逃避校验;调用 `pyright` 时必须严格遵守铁律 9(直接运行 `uv run pyright voice_edge.py`,严禁 Python `subprocess.run(.
AGENTS.md · 141 lines

How it starts

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

AGENTS.md — Voice Edge AI Agent Guidelines

本文档为所有在此代码库上工作的 AI Agent 提供指引与约束规范。在对项目进行任何修改前,请务必完整阅读并严格遵守以下准则。


1. 项目架构概述

  • 单文件核心:核心业务逻辑集中于单个高内聚文件 voice_edge.py。
  • 构建系统:采用标准 hatchling 构建后端,Wheel 打包目标为 voice_edge.py。
  • 命令行入口:
    • MCP 模式:uv run main
    • HTTP 服务模式:uv run main --http
    • 简写别名:ve(uv run ve)
  • 主要能力:本地 MLX 模型推理、流式 Edge-TTS、faster-whisper / Apple Speech 转录、macOS 状态栏 HUD 与全局热键、小爱音箱桥接、OpenCode / OpenRouter / Browser 模型中继。

2. 核心铁律(强制执行)

铁律 1:代码必须经过 Ruff 格式化、Ruff 静态检查与 Pyright 类型检查(Format, Lint & Type Check)

  • 要求:任何对 Python 文件的修改,必须在最终交付前运行并通过 Ruff 格式化、Ruff 静态检查与 Pyright 静态类型检查,确保风格统一且 0 Error / 0 Warning。
  • 执行命令:
    uv run ruff format voice_edge.py
    uv run ruff check voice_edge.py
    # 或者全局检查
    uv run ruff check .
    uv run pyright voice_edge.py
    
  • 配置规则:遵循 pyproject.toml 中的 [tool.ruff.lint] 与 Pyright 配置(包含 E, F, B, ASYNC, RUF 等规则)。不要随意修改该规则集或使用 # noqa 逃避校验;调用 pyright 时必须严格遵守铁律 9(直接运行 uv run pyright voice_edge.py,严禁 Python subprocess.run(..., timeout=...) 套壳或分段调用)。

铁律 2:修改代码后必须同步环境变量登记表(ENV REGISTRY)

  • 机制:voice_edge.py 顶部维护了一份 环境变量登记表 (ENV REGISTRY),汇总了全局 197+ 个环境变量的默认值与定义代码行号。
  • 要求:只要在代码中增删行、重构函数或新增环境变量,必须运行自动修复命令以重新通过 AST 对齐登记表行号:
    uv run main --fix-env-registry
    
  • 输出确认:确保看到输出 ENV REGISTRY updated: ... 或 ENV REGISTRY already current: ...。

铁律 3:必须通过全量自测试(Self-Test)

  • 要求:在交付前,必须运行全量内置自测,确保全部测试用例 100% 通过。
  • 执行命令:
    uv run main --self-test
    
  • 基线要求:不得出现任何 ❌ Self-test failed。

铁律 4:严禁编写低价值或虚假测试(No Pseudo-Tests)

  • 要求:
    • 自测用例必须真实驱动实际生产执行链路(Real Execution Path),对核心业务逻辑具备实质性断言。
    • 严禁伪测试:坚决禁止编写「即使把生产代码的核心修复逻辑删除,测试仍然能通过」的低价值虚假测试。
    • 严禁为了虚增测试数量而仅对静态数据结构做无意义断言,或者构造脱离生产运行状态的孤立 Mock。
    • 严禁真实外部路径、真实文件名与抓包样本值:测试代码(--self-test 与 test/ 下 harness)中不得出现真实主目录、仓库或模型路径(如 /Users/<name>/...),不得使用真实用户文件名 等真实业务/个人文件名,应统一使用 test.pdf、sample_doc.pdf 等纯虚构占位名),也不得直接照搬抓包中的真实动态 ID / 缓存键(如真实的 blob_id、cache_key 等,应使用 /contrib_service/ttl_1d/selftest_blob_0001、00000000-0000-4000-8000-000000000001 等明显的合成测试常量)。需要路径时用 tempfile.mkdtemp() 或虚构的绝对路径常量(如 _SELFTEST_WORKSPACE = "/w/workspace");真机 harness 用 Path(__file__).resolve().parents[1] 定位仓库,状态库与缓存写入临时目录。

Read the full file on GitHub · 141 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. 20d ago Changed · +1 lines · +68 tokens per session 21fb3689a6ae
  2. 26d ago Changed · +6 lines · +279 tokens per session 05905d8b846f
  3. 29d ago Changed · +17 lines · +559 tokens per session adf2a971704d
  4. 1mo ago Changed 00fe6a649062
  5. 1mo ago Changed ac7a27100f16
  6. 1mo ago Changed · +17 lines · +655 tokens per session bc83e9396884
  7. 1mo ago Changed · -8 lines · -97 tokens per session a5c3099c16eb
  8. 1mo ago First seen · 108 lines · 1,473 tokens per session scan A f589c859f82e

Subscribe to this mod's changes

voice-edge AGENTS.md is an instructions file published in the GitHub repository woniuzfb/voice-edge (0 stars, last pushed today), licensed MIT. It adds 2,937 tokens to every session, about $0.0117 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-07.

Related

voice-edge AGENTS.md compared with instructions from other repositories

voice-edge AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
voice-edge AGENTS.mdwoniuzfb/voice-edgeInstructions file0todayMITA2,937Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,951Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,303GitHub Copilot
deno copilot-instructions.mddenoland/denoInstructions file109kyesterdayMITA3,077GitHub Copilot