8051-mcu-debug
Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers, UART, or startup failures
Use when integrating or debugging heatshrink embedded compression — encoder/decoder sink/poll/finish loops, window/lookahead sz2, HSER/HSDR codes, or static vs dynamic alloc
$ npx -y skills add easyzoom/aix-skills --skill heatshrink-integration --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/heatshrink-integrationContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when integrating or debugging heatshrink embedded compression — encoder/decoder sink/poll/finish loops, window/lookahead sz2, HSER/HSDR codes, or static vs dynamic alloc
name: heatshrink-integration description: Use when integrating or debugging heatshrink embedded compression — encoder/decoder sink/poll/finish loops, window/lookahead sz2, HSER/HSDR codes, or static vs dynamic alloc
Use this skill to integrate heatshrink (`github.com/atomicobject/heatshrink`) by fixing memory budget, `window_sz2`/`lookahead_sz2` sizes, the sink/poll/finish streaming loop, and decompression safety. Compression bugs usually come from mismatched encoder/decoder settings, an unfinished poll loop, or output buffers that are too small.
Use this skill when:
Do not use this skill for general archive formats like gzip/zip unless heatshrink is specifically involved.
Ask for:
1. Match settings across the boundary. Decoder `expansion_buffer_sz2` and `lookahead_sz2` must match the encoder's `window_sz2`/`lookahead_sz2`. Under static alloc, both sides must share the same `HEATSHRINK_STATIC_WINDOW_BITS`/`HEATSHRINK_STATIC_LOOKAHEAD_BITS`.
2. Choose the allocation model. Dynamic: `heatshrink_encoder_alloc(window_sz2, lookahead_sz2)` / `heatshrink_decoder_alloc(input_buffer_size, expansion_buffer_sz2, lookahead_sz2)`, freed with `*_free`. Static: set `HEATSHRINK_DYNAMIC_ALLOC 0` in `heatshrink_config.h` and use a stack/BSS instance, `*_reset` before reuse.
3. Drive the streaming loop correctly. Feed with `heatshrink_encoder_sink`/`heatshrink_decoder_sink` (check `*input_size` for bytes consumed; re-sink the remainder). Then loop `*_poll` until it returns `HSER_POLL_EMPTY`/`HSDR_POLL_EMPTY` before sinking more.
4. Flush at end of stream. After the last input, call `heatshrink_encoder_finish`/`heatshrink_decoder_finish`; while it returns `HSER_FINISH_MORE`/`HSDR_FINISH_MORE`, keep calling `*_poll` to drain output. Done is `HSER_FINISH_DONE`/`HSDR_FINISH_DONE`. Call `*_reset` before reusing the instance for a new stream.
5. Validate data integrity. Pair compression with CRC/hash when corruption matters. heatshrink carries no checksum or length header and does not reliably detect corrupt or truncated input, so integrity must be checked externally.
6. Test worst case. Some data expands; do not assume size savings. Size the output buffer/store for expansion, not just the compressed happy path.
Before claiming heatshrink works:
User:
用 heatshrink 压缩资源,设备端解压出来缺尾巴。
Agent:
1. Asks for `window_sz2`/`lookahead_sz2`, decoder `input_buffer_size`/`expansion_buffer_sz2`, chunk sizes, and whether `heatshrink_decoder_finish` is called. 2. Checks that `*_poll` loops until `HSDR_POLL_EMPTY` and that `finish` is drained until `HSDR_FINISH_DONE` (the missing tail is almost always an undrained finish loop). 3. Verifies round-trip and truncated-input behavior, and that `heatshrink_decoder_reset` runs before reusing the instance.
AIX Skills is a public collection of Agent Skills, templates, and references for building repeatable AI workflows.
Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers, UART, or startup failures
Use when integrating, evaluating, configuring, or debugging Avem embedded C framework modules, event-driven components, drivers, middleware, or application…
Use when integrating or debugging Li-ion charger/fuel gauge ICs (BQ24295, BQ27441, MAX17048) over I2C, covering charge start, watchdog host mode, NTC/JEITA…
Use when integrating, designing, or debugging BLE GATT services, characteristics, descriptors, MTU, notifications, indications, pairing, connection parameters,…
Use when debugging embedded bootloaders, application jumps, vector table offsets, firmware upgrade flow, OTA state, image validation, rollback, or boot…
Use when integrating, porting, configuring, or debugging CAN bus libraries, CANBus-Triple, MCP2515, CAN frames, bit timing, filters, or embedded automotive…