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 skills add wedsamuel1230/arduino-skills --skill non-blocking-patternsgit clone --depth 1 https://github.com/wedsamuel1230/arduino-skillsWrote 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/skills/wedsamuel1230/arduino-skills/non-blocking-patterns)<a href="https://agentmods.dev/skills/wedsamuel1230/arduino-skills/non-blocking-patterns"><img src="https://agentmods.dev/badge/skills/wedsamuel1230/arduino-skills/non-blocking-patterns/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.
<a href="https://agentmods.dev/skills/wedsamuel1230/arduino-skills/non-blocking-patterns"><img src="https://agentmods.dev/badge/skills/wedsamuel1230/arduino-skills/non-blocking-patterns.svg" alt="Reviewed on agentmods" width="80" 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.00049 | $0.00610 |
| Opus 5 | $0.00024 | $0.00305 |
| Sonnet 5 | $0.00010 | $0.00122 |
| Haiku 4.5 | $0.00005 | $0.00061 |
Grade A, and why
non-blocking-patterns 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 12d 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 — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Non-Blocking Patterns
Keep the main loop responsive and make timing behavior testable. Prefer C/C++ patterns that can be compiled for the exact board; use Python only for relevant test or log analysis tooling.
Intake
Record board/core version, task periods, deadlines, maximum work duration, input bounce, serial/network behavior, watchdog policy, interrupt constraints, and the safety response for missed deadlines.
Process
- List each periodic or event-driven task with period, deadline, and worst-case work. Identify any blocking library call.
- Replace long
delay()calls with unsigned wrap-safe elapsed checks such asif (static_cast<unsigned long>(now - last) >= period). Use hardware timers or RTOS tasks only when board and framework support is confirmed. - Model multi-step work as an explicit state machine with bounded transitions; do not hide waits inside a helper.
- Debounce inputs using a stable-state timer or event filter, not a blocking pause. Bound serial parsing, network retries, and sensor conversion waits.
- Define watchdog feeding, output inhibit, timeout, and recovery behavior.
- Measure loop latency and task jitter under representative logging, radio, storage, and actuator load.
Anti-rationalization
| Shortcut | Response |
|---|---|
| "A shorter delay is fine." | It is still blocking; show the deadline and replace it. |
| "The loop is fast on USB." | Measure with the actual radio, storage, and actuator load. |
| "The enum makes it a state machine." | Require timed transitions, explicit entry/exit, and timeout behavior. |
| "The watchdog can be fed everywhere." | Define ownership and fail-safe behavior; do not mask a stuck task. |
"millis() never wraps." |
Use unsigned subtraction and test the wrap boundary. |
Verification
- No unbounded blocking call remains in the time-critical path without a documented reason and timeout.
- Debounce, wraparound, timeout, and missed-deadline cases have tests.
- Exact-target compile proof and timing/serial evidence are separate.
- Outputs enter a safe state when a task, sensor, or communication path times out.
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.
- 12d ago First seen · 60 lines · 49 tokens per session scan A ab8eb995c86b
non-blocking-patterns is a skill published in the GitHub repository wedsamuel1230/arduino-skills (21 stars, last pushed 22d ago), licensed MIT. It adds 49 tokens to every session and 610 once invoked, about $0.0002 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.
Other skills, from other repositories
gke-ai-troubleshooting-tpu-dynamic-slices-monitoring
Monitors, troubleshoots, and manages GKE TPU Dynamic Slices custom resources. Use when checking TPU slice lifecycle states, troubleshooting slice provisioning failures, validating single-slice or multi-slice (JobSet) workload manifests, or safely patching stuck finalizers and disabling the slice controller. Don't use…
gke-ai-troubleshooting-tpu-vbar-oom
Diagnoses and prevents vbarcontrolagent segfaults, out-of-memory (OOM) errors, and TPU device initialization failures on TPU v6e nodes in GKE caused by race conditions during TPU device resets or high-frequency metrics polling. Use when troubleshooting vbarcontrolagent crashes, memory cgroup OOMs in serial console…
analyze-kernel-bottleneck
Systematically identify whether a GPU kernel is compute-bound, memory-bound, or latency-bound using roofline analysis, occupancy calculations, compute/load ratio per tile, and SASS instruction inspection. Produces a decision matrix for optimization strategy selection (cp.async, warp interleaving, tiling…
mcubuddy
Use when debugging MCU firmware or boards with McuBuddy, including probe, boot, HardFault, peripheral, register, memory, ELF/SVD, RTOS, RTT/UART, Keil, GDB, pyOCD, J-Link, ST-Link, or CMSIS-DAP work.
cleverence-mslx
A guide for editing Cleverence Mobile SMARTS configuration files used by handheld warehouse and shop terminals. Each .mslx file describes a workflow as a sequence of actions connected like a directed graph.
fpga-hardware-design-and-review-guide
Comprehensive FPGA hardware design guide based on real-world project experience. Covers pipeline architecture, timing optimization, SystemVerilog coding patterns, CDC handling, and practical debugging techniques. Use this skill when: (1) designing FPGA modules with timing constraints, (2) implementing video processing…