xiaozhi-esp32 AGENTS.md

xiaozhi-esp32 AGENTS.md is an instructions file for Codex, OpenCode from 78/xiaozhi-esp32. It costs 1,079 tokens per session, scanned A, original, MIT.

Project instructions for XiaoZhi, an ESP-IDF C/C++ firmware project for voice-assistant devices. They describe its hardware boards, audio, displays, network connections, build choices, and main code areas.

In plain words
What is it for?
Use them when adding or changing device behavior, board support, audio or display features, network protocols, configuration, or firmware builds.
Why use it?
They give the coding agent the project's architecture and required development rules, reducing the risk of changing the wrong board implementation or using the wrong build setup.

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/78/xiaozhi-esp32/agents-md
Clone the repo
git clone --depth 1 https://github.com/78/xiaozhi-esp32

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 xiaozhi-esp32 AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/78/xiaozhi-esp32/agents-md.svg)](https://agentmods.dev/instructions/78/xiaozhi-esp32/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/78/xiaozhi-esp32/agents-md"><img src="https://agentmods.dev/badge/instructions/78/xiaozhi-esp32/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,079 This file is loaded in full into every session.
When invoked 1,079 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.01079 $0.01079
Opus 5 $0.00540 $0.00540
Sonnet 5 $0.00216 $0.00216
Haiku 4.5 $0.00108 $0.00108

Measured 4d ago against content hash b8b4a28987b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

xiaozhi-esp32 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 4d 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 · 95 lines

How it starts

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

AGENTS.md

Project

XiaoZhi is an ESP-IDF C/C++ voice-assistant firmware supporting many chips, boards, displays, audio devices, and network transports. A build selects exactly one board implementation.

Use ESP-IDF v6.0.2 when possible. IDF 5.5.x is retained only for documented legacy boards.

Architecture

  • main/application.*: main event loop, protocol lifecycle, and high-level behavior.
  • main/device_state_machine.*: legal runtime state transitions.
  • main/boards/common/: board interfaces and reusable hardware/network helpers.
  • main/boards/**/: board-specific pins, initialization, and build variants.
  • main/audio/: codecs, audio tasks, engines, wake words, and queues.
  • main/protocols/: transport-neutral API plus WebSocket and MQTT/UDP.
  • main/display/ and main/led/: reusable UI implementations.
  • main/mcp_server.*: common device-side MCP tools and dispatch.
  • main/Kconfig.projbuild: board and feature configuration.
  • main/CMakeLists.txt: source, board, locale, font, and asset selection.
  • scripts/build.py: canonical board/variant build entry point.

Read the closest existing implementation before adding a new one. Prefer the narrowest owning layer; do not put board-specific behavior into core modules.

Required Rules

  • Preserve unrelated worktree changes and keep patches focused.
  • A build must export exactly one board factory through DECLARE_BOARD(...).
  • Never alter an existing board's pins to support different hardware. Add a uniquely named board or release variant; board identity affects OTA compatibility.
  • Core code depends on Board interfaces, never a concrete board class or board config.h.
  • Treat camera, backlight, display, LED, battery, and similar capabilities as optional.
  • Change runtime state through Application::SetDeviceState() and the state machine.
  • Callbacks may run outside the main task. Schedule application mutations with Application::Schedule() or event bits.
  • Do not block the main event loop or audio tasks. Avoid unbounded queues and repeated large allocations in audio paths.
  • Keep shared message semantics in Protocol; verify both transports when changing its contract.
  • Validate network input and preserve cJSON ownership. NVS keys are persistent API and require migration when changed.
  • Guard target-specific features with Kconfig/component rules. Do not assume every target has PSRAM or S3/P4 resources.
  • Do not manually edit generated/vendor output: build/, releases/, managed_components/, components/, sdkconfig*, main/assets/lang_config.h, or generated mmap headers.
  • Format only touched C/C++ files with the repository .clang-format; avoid unrelated mass formatting.

Read the full file on GitHub · 95 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. 4d ago First seen · 95 lines · 1,079 tokens per session scan A b8b4a28987b9

Subscribe to this mod's changes

xiaozhi-esp32 AGENTS.md is an instructions file published in the GitHub repository 78/xiaozhi-esp32 (29,582 stars, last pushed 4d ago), licensed MIT. It adds 1,079 tokens to every session, about $0.0054 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-30.

Related

Other instructions, from other repositories

FastLED GEMINI.md

Gemini CLI instructions for FastLED/FastLED, a project described as: The FastLED library for colored LED animation on Arduino. Please direct questions/requests for help to the FastLED Reddit community: http://fastled.io/r We'd like to use github "issues" just for tracking library bugs / enhancements.

FastLED/FastLED · 9 tokens

mdb-esp32-cashless AGENTS.md

Instructions for nodestark/mdb-esp32-cashless, covering vmflow — agent context, 1. mqtt rpc — real-time device control, 2. supabase rest — data & credits, 3. agent playbooks and notes.

nodestark/mdb-esp32-cashless · 1,570 tokens

ROS AGENTS.md

Instructions for lawliet206/ROS, covering agents.md, 项目是什么, 环境版本(不可随意升级/降级), 目录结构(catkin 工作空间根 = 仓库根) and 重要 launch 与脚本(命名与参数以代码为准,改文档必须同步).

lawliet206/ROS · 1,724 tokens

p3a AGENTS.md

AGENTS.md instructions for fabkury/p3a: You are a highly proficient embedded systems developer with expertise in ESP-IDF and ESP32-P4. The project is p3a, a Wi-Fi pixel art player. When using idf.py, activate the ESP-IDF v5.5.4 environment with . C:\Espressif\tools\Microsoft.v5.5.4.PowerShellprofile.ps1, then set…

fabkury/p3a · 173 tokens

tamaclaude CLAUDE.md

Instructions for thaitop/tamaclaude, covering claude.md, what this is, where a reason goes, data flow and commands.

thaitop/tamaclaude · 6,350 tokens

arduino-skills GEMINI.md

Instructions for wedsamuel1230/arduino-skills: The shared source of truth is skills/. Load only the specialist skill and references needed for the request. Preserve the board intake, ordered constexpr int declarations, C/C++ embedded-first orientation, and explicit hardware evidence gates.

wedsamuel1230/arduino-skills · 94 tokens