skill-low-level-programming
Skill0 starsChanged 3 months agoMITView on GitHub
Low-level systems programming, C/C++, Rust, Assembly, byte manipulation, memory layout, pointers, bitwise arithmetic, and endianness handling. Use when analyzing or developing low-level systems, WASM memory layouts, binary protocols, memory-mapped I/O, or performance-critical byte buffers.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- core/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- avoid-ai-writingSkill
- c-cpp-systemsSkill
- doubt-driven-developmentSkill
- marketing-copywritingSkill
- mempalace-recallSkill
- mempalaceSkill
- mempalace-taskSkill
- retro-emulation-engineeringSkill
- seo-optimization-and-auditSkill
- skill-ai-mlSkill
- skill-backend-architectSkill
- skill-codebase-onboardingSkill
- skill-code-reviewSkill
- skill-context-engineeringSkill
- skill-creative-designSkill
- skill-data-analysisSkill
- skill-data-scienceSkill
- skill-design-engineeringSkill
- skill-devops-cloudSkill
- skill-emulator-wasmSkill
- skill-frontend-architectSkill
- skill-graph-analyticsSkill
- skill-graphics-webglSkill
- skill-master-orchestratorSkill
- skill-mcp-builderSkill
- skill-monorepo-architectSkill
- skill-osint-engineeringSkill
- skill-plugin-architectureSkill
- skill-qa-engineerSkill
- skill-researchSkill
- skill-resume-tailorSkill
- skill-stealth-scrapingSkill
- skill-system-diagnosticsSkill
- skill-web-architectureSkill
- skill-web-performanceSkill
- spec-driven-developmentSkill
- spec-minerSkill
- wasm-emscriptenSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Always account for byte endianness when reading or transforming binary payloads, ROMs, or raw buffers:
- Distinctive: line 54
When interfacing JavaScript/TypeScript with C/C++ Emscripten or Rust WASM modules:
- Very specific: line 56
Zero-Copy Transfers: Use views directly over Module.HEAPU8.buffer (new Uint8Array(Module.HEAPU8.buffer, ptr, size)).
- Very specific: line 58
Alignment Guarantees: Ensure pointers passed to 32-bit/64-bit typed arrays (HEAP32, HEAPF32, HEAP64) are properly aligned to 4 or 8 bytes …
- Very specific: line 59
Memory Lifecycle (Manual RAII): Every Module._malloc(size) MUST have a guaranteed matching Module._free(ptr) in a finally block to prevent …
- Very specific: line 77
Preallocate Buffers: Never allocate small ArrayBuffers or typed arrays inside hot rendering, audio sampling, or frame-emulation loops.
- Very specific: line 78
Bounds Checking: Always validate buffer length and slice ranges before reading offsets to prevent RangeError: offset is out of bounds.
- Very specific: line 79
DataView for Mixed Heterogeneous Structs: Use DataView with explicit endianness flags (view.getUint32(offset, false /* bigEndian */)) when …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Low-Level Systems Programming Skill
This skill provides expert patterns for memory-safe, high-performance systems programming, binary data parsing, and low-level computing across C/C++, Rust, WebAssembly, and native system boundaries.
1. Endianness & Binary Format Parsing
Always account for byte endianness when reading or transforming binary payloads, ROMs, or raw buffers:
- Big-Endian (BE, Network Byte Order): Most significant byte stored first (
0x80371240->80 37 12 40). Standard for N64.z64, Motorola 68k, MIPS BE. - Byte-Swapped (Middle-Endian / BADC): 16-bit word byte swap (
0x37804012->37 80 40 12). Standard for.v64/ Doctor V64 format. - Little-Endian (LE): Least significant byte stored first (
0x40123780->40 12 37 80). Standard for.n64/ Z64 copier, x86/x64, ARM (default), WASM memory.
Fast In-Place Byte-Swap Routine (JavaScript / TypedArrays)
/**
* Fast 16-bit byte-swapping for .v64 to .z64 normalization
*/
function swap16InPlace(u8: Uint8Array): void {
const len = u8.length - (u8.length % 2);
for (let i = 0; i < len; i += 2) {
const tmp = u8[i];
u8[i] = u8[i + 1];
u8[i + 1] = tmp;
}
}
/**
* Fast 32-bit word-swapping for .n64 to .z64 normalization
*/
function swap32InPlace(u8: Uint8Array): void {
const len = u8.length - (u8.length % 4);
const u32 = new Uint32Array(u8.buffer, u8.byteOffset, len >> 2);
for (let i = 0; i < u32.length; i++) {
const v = u32[i];
u32[i] = ((v & 0xff) << 24) |
((v & 0xff00) << 8) |
((v >> 8) & 0xff00) |
((v >> 24) & 0xff);
}
}2. WebAssembly Memory & Direct Heap Access
When interfacing JavaScript/TypeScript with C/C++ Emscripten or Rust WASM modules:
- Zero-Copy Transfers: Use views directly over
Module.HEAPU8.buffer(new Uint8Array(Module.HEAPU8.buffer, ptr, size)). - Buffer Invalidation Rule: ANY call to
Module._malloc,Module._realloc, or WASM functions that grow memory (memory.grow) invalidates all previousArrayBufferviews. Always re-instantiate typed arrays after allocations or memory growth. - Alignment Guarantees: Ensure pointers passed to 32-bit/64-bit typed arrays (
HEAP32,HEAPF32,HEAP64) are properly aligned to 4 or 8 bytes (ptr % 4 === 0). - Memory Lifecycle (Manual RAII): Every
Module._malloc(size)MUST have a guaranteed matchingModule._free(ptr)in afinallyblock to prevent catastrophic heap leaks.
3. Bitwise Manipulation & Flag Bitmasks
- Bit Extraction:
(value >> bitPosition) & 1 - Bitmask Verification:
(flags & MASK) === MASK - Bit Clearing:
flags &= ~MASK - Bit Setting:
flags |= MASK - Bit Toggling:
flags ^= MASK - Sign Extension (e.g. 16-bit to 32-bit integer):
(val << 16) >> 16 - Clamp to Byte:
val & 0xFF
4. Performance & Memory Safety Invariants
- Preallocate Buffers: Never allocate small
ArrayBuffersor typed arrays inside hot rendering, audio sampling, or frame-emulation loops. Allocate static circular buffers and reuse them. - Bounds Checking: Always validate buffer length and slice ranges before reading offsets to prevent
RangeError: offset is out of bounds. - DataView for Mixed Heterogeneous Structs: Use
DataViewwith explicit endianness flags (view.getUint32(offset, false /* bigEndian */)) when parsing structured headers, rather than relying on host architecture endianness.
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.

