agentleFS
7878/xiaozhi-esp32/AGENTS.md

xiaozhi-esp32

AGENTS.md33k starsChanged 4 months agoMITView on GitHub

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 the ESP-IDF release/v6.1 branch when possible. The minimum supported SDK is ESP-IDF v6.0.1. IDF 5.x is not supported. Read the closest existing implementation before adding a new one. Prefer the narrowest owning layer; do not put board-specific behavior into core modules. Board selection is a coupled chain: config.json -> scripts/build.py -> main/Kconfig.projbuild -> main/CMakeLists.txt ->…

Trending

More talk lately.about the whole repository

Dec 2025: 2 mentionsJan 2026: 2 mentionsFeb 2026: 1 mentionMar 2026: 2 mentionsApr 2026: 2 mentionsMay 2026: 5 mentionsJun 2026: 5 mentionsJul 2026: 2 mentionsAug 2026: 6 mentionsSep 2026: 4 mentionsOct 2026: 10 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the 78/xiaozhi-esp32 repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about 78/xiaozhi-esp32

The biggest 5 of 60 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 60

Talked about on GitHub, YouTube, the web and Bluesky (60 times).

On GitHub · 41

36 more on GitHub

On YouTube · 12

7 more on YouTube

On the web · 4

On Bluesky · 3

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Use the ESP-IDF release/v6.1 branch when possible.

    line 7
  2. Distinctive:

    Read the closest existing implementation before adding a new one.

    line 23
  3. Distinctive:

    Never alter an existing board's pins to support different hardware.

    line 29
  4. Distinctive:

    Treat camera, backlight, display, LED, battery, and similar capabilities as optional.

    line 31
  5. Distinctive:

    Do not block the main event loop or audio tasks.

    line 34
  6. Very specific:

    Keep shared message semantics in Protocol.

    line 35
  7. Very specific:

    Do not manually edit generated/vendor output: build/, releases/, managed_components/, components/, sdkconfig*, main/assets/lang_config.h, …

    line 38
  8. Very specific:

    When adding a board or variant, update every relevant link in that chain.

    line 47
  9. Distinctive:

    Always report what was tested and what still needs physical hardware.

    line 82
  10. Distinctive:

    Keep detailed or fast-changing information in those files, not here.

    line 93

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 the ESP-IDF release/v6.1 branch when possible. The minimum supported SDK is ESP-IDF v6.0.1. IDF 5.x is not supported.

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.

Boards and Configuration

Board selection is a coupled chain:

config.json -> scripts/build.py -> main/Kconfig.projbuild -> main/CMakeLists.txt -> board source and config.h.

When adding a board or variant, update every relevant link in that chain. Include a unique board identity, correct chip target, flash/partition settings, exactly one DECLARE_BOARD, and board documentation. Follow docs/custom-board.md.

Commands

Source the intended ESP-IDF environment first:

source /path/to/esp-idf/export.sh
idf.py --version
# Discover exact board and variant names
python3 scripts/build.py --list-boards

# Canonical variant build
python3 scripts/build.py <board-directory> --name <variant-name>

# Host-side build tests
python3 -m unittest discover -s scripts/tests -v

# Format/check touched files
clang-format -i <files>
clang-format --dry-run -Werror <files>

The build script changes local sdkconfig and build state. Do not assume the build directory still represents a previous target.

Validation

  • Board-only change: build affected variants and smoke-test changed hardware.
  • Core, common-board, audio, protocol, display, dependency, Kconfig, or CMake change: run host tests and build representative affected chip/network paths.
  • Protocol changes: verify WebSocket and MQTT/UDP when shared behavior changes.
  • Audio changes: verify capture, playback, wake/VAD, interruption, reconnect, and applicable AEC modes.
  • UI/assets changes: verify applicable no-display/OLED/LVGL paths and partition size.
  • Always report what was tested and what still needs physical hardware. A successful build is not hardware validation.

Authoritative Documentation

  • Overview and SDK policy: README.md
  • Board guide: docs/custom-board.md
  • Audio design: main/audio/README.md
  • Code style: docs/code_style.md
  • Protocols: docs/websocket.md, docs/mqtt-udp.md, docs/mcp-protocol.md
  • CI matrix: .github/workflows/build.yml

Keep detailed or fast-changing information in those files, not here. Add a nested AGENTS.md only when a subsystem needs specialized instructions.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.