embedded-constrained-coding
Skill1 starsChanged 49 days agoMITView on GitHub
Write or review code for resource-constrained targets — microcontrollers, on-device mobile/edge inference, or any environment with a hard memory/power/latency budget. Use whenever the target is not a general-purpose server, or the user mentions RAM/flash limits, battery/power budget, quantization, or cross-compilation for an embedded or mobile target. Do not use this for ordinary server/cloud code with no hard resource ceiling.
In this repository32 other files it gives its agents.
- agent-system-designSkill
- api-contract-designSkill
- architecture-designSkill
- architecture-optimizationSkill
- ci-speedupSkill
- code-handoffSkill
- cross-ai-handoffSkill
- crypto-storage-auditSkill
- database-designSkill
- dataset-sourcingSkill
- distributed-debuggerSkill
- freedom-to-operate-analysisSkill
- frontend-architectureSkill
- github-masterSkill
- idea-finderSkill
- ieee-paper-drafterSkill
- memory-leak-hunterSkill
- ml-model-selectionSkill
- ml-security-auditSkill
- mobile-platform-architectureSkill
- observability-designSkill
- patent-drafterSkill
- patent-novelty-evaluatorSkill
- performance-optimizationSkill
- project-scaffoldingSkill
- researcher-evaluatorSkill
- researcherSkill
- safety-compliance-scopingSkill
- scale-refactorSkill
- secure-code-reviewSkill
- slow-query-optimizerSkill
- test-architectSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
If the code quantizes a model or reduces precision to fit the budget, the accuracy/latency tradeoff needs an actual measurement on …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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.
Files
Embedded / Constrained Coding
Server-side code that "should be fine, it's not doing much" is usually fine. The same instinct on a microcontroller or a phone's inference budget is how a demo that worked on a dev board dies in the field. This skill forces the budget to be explicit before code gets written, and checks it was actually respected after.
Step 1 — State the actual budget before writing anything
RAM, flash/storage, power draw, and latency ceiling — as numbers, not "should be small." If the user hasn't stated them, ask or use the documented figures for the stated target (the specific chip's actual SRAM/flash ceiling, the specific device's actual thermal/battery constraints for sustained inference) rather than assuming server-class headroom.
Step 2 — Avoid patterns that are fine on a server and dangerous here
- Dynamic allocation that fragments a constrained heap — repeated alloc/free of varying sizes on a device with no memory compaction will eventually fail even when total free memory looks sufficient. Prefer static allocation or fixed pools where the target supports it.
- Assuming the standard library behaves the same — many embedded toolchains ship cut-down or different-behaving libc equivalents; verify rather than assume.
- Blocking calls inside interrupt handlers or tight real-time loops — a call that's harmless latency on a server can blow a hard deadline or starve the watchdog here.
- Ignoring watchdog timers — any loop or blocking operation that can run long enough to trip the watchdog needs an explicit reset/yield point.
Step 3 — Quantization and precision tradeoffs must be measured, not assumed
If the code quantizes a model or reduces precision to fit the budget, the accuracy/latency tradeoff needs an actual measurement on representative input — "should still be accurate enough" is not a result. State what was measured and on what data.
Step 4 — Verify against the stated budget, don't just estimate
After writing the code, check it against the Step 1 numbers concretely (actual memory profiling on-target or via the toolchain's reporting, actual measured latency/power on the target device or a faithful simulator) — "this should fit" is exactly the assumption that doesn't survive a prototype-to-field transition. If it can't be measured in this environment, say so explicitly rather than presenting an estimate as a verified fit.
Output
State the budget assumed, what was done to fit it, and what was actually measured versus estimated. Flag anything that's an estimate rather than a measurement so it doesn't get treated as verified later.
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
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.

