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.
npx agentmods add commands/chayuto/ws-esp32-s3-cam/safe-devgit clone --depth 1 https://github.com/chayuto/ws-ESP32-S3-CAMWrote 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.
[](https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/safe-dev)<a href="https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/safe-dev"><img src="https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/safe-dev.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01376 |
| Opus 5 | $0.00000 | $0.00688 |
| Sonnet 5 | $0.00000 | $0.00275 |
| Haiku 4.5 | $0.00000 | $0.00138 |
Grade A, and why
safe-dev 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Safe feature-dev loop for ESP32-S3 cry-detect-01
Use this flow when adding a new subsystem (new task, new driver, new Kconfig symbol). Every crash we've had in this project came from skipping one of these checks. Usage: /safe-dev <what-you're-adding>.
Principle: change one thing, verify, then change the next
The ESP32-S3 + native USB-JTAG makes iteration slow because:
- Every serial-monitor open briefly toggles DTR/RTS → chip resets
- A bootloop takes ≥5 s per cycle; multi-feature breakage is hard to bisect
- Assert/panic backtraces require addr2line — only useful if you saved the .elf from the exact build that crashed
So: add one subsystem, flash, verify, commit, then add the next.
Pre-flash checklist
Before every flash, tick these:
-
New Kconfig enabled? Check if it changes stack sizes / requires companion symbols.
CONFIG_FREERTOS_USE_TRACE_FACILITY=y→ adds per-TCB bookkeeping; bump small task stacksCONFIG_FATFS_LFN_HEAP=y→fopenof long names consumes extra heap; SD open can slow- Any new driver component (e.g.
driver/temperature_sensor.h) → often pulls in event-loop handlers; do NOT install inside another driver's callback
-
New task? Start it with 6 KB stack minimum unless you have a reason to go smaller. Add to WDT if it runs > 1 Hz. Pin to core 0 (Wi-Fi/lwIP on 0; model inference on 1).
-
New callback on event loop? Anything in
esp_event_loop_run_taskcontext must be non-blocking. Do not:- call
fopen/fwrite/SD I/O - take long-held mutexes (sd_logger, metrics, etc.)
- call into
sd_logger_ntp_sync_markerwhich opens+closes files
Instead: signal a worker task via a queue/semaphore.
- call
-
New mutex? Write down the lock order on paper. This project has mutexes in
sd_logger,web_ui,event_recorder,metrics_logger,noise_floor. A handler that takes two of them in the wrong order will deadlock. -
New heap allocation > 1 KB? Use
heap_caps_malloc(n, MALLOC_CAP_SPIRAM)not stack, not internal RAM. Our internal DRAM is ~250 KB and every task competes. -
Feature flag in Kconfig? Add an
CONFIG_CRY_<X>_ENABLEDsymbol defaulting OFF until verified. That way rollback issedone line, not revert five files.
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.
- 5d ago First seen · 78 lines · 0 tokens per session scan A de791bc5d097
safe-dev is a command published in the GitHub repository chayuto/ws-ESP32-S3-CAM (5 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,376 tokens. 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.
Other commands, from other repositories
review-firmware
Run embedded firmware code review (memory safety, ISR, RTOS, C/C++ UB).
power-budget
Calculate power budget for the current embedded project.
bom
Generate or analyze Bill of Materials from KiCad project.
debug
Start GDB debug session with OpenOCD or probe-rs.
flash
Build and flash firmware to target device (ESP-IDF or PlatformIO).
fix_board
Automatically diagnose and fix PlatformIO board upload/monitor issues.