plooc-integration
Skill36 starsChanged 5 months agoMITView on GitHub
Use when integrating, refactoring, or debugging PLOOC object-oriented C - def_class encapsulation, private_member protection, vtable dispatch, or inheritance-style structs
In this repository75 other files it gives its agents.
- 8051-mcu-debugSkill
- avem-integrationSkill
- battery-charger-fuel-gauge-integrationSkill
- ble-gatt-integrationSkill
- bootloader-debugSkill
- canbus-integrationSkill
- canopen-integrationSkill
- cellular-at-modem-integrationSkill
- cmbacktrace-integrationSkill
- cmsis-dsp-integrationSkill
- cortex-m-debugSkill
- cortex-r5-debugSkill
- crc-checksum-integrationSkill
- easylogger-integrationSkill
- embedded-app-example-libsSkill
- embedded-buffer-queue-libsSkill
- embedded-data-parsing-libsSkill
- embedded-debug-entrySkill
- embedded-fault-debugSkill
- embedded-framework-libsSkill
- embedded-input-libsSkill
- embedded-library-entrySkill
- embedded-linux-login-debugSkill
- embedded-peripheral-bringupSkill
- embedded-serial-log-debugSkill
- embedded-state-machine-libsSkill
- embedded-timing-libsSkill
- epd-integrationSkill
- esp-idf-integrationSkill
- fatfs-integrationSkill
- flashdb-integrationSkill
- freemodbus-integrationSkill
- freertos-kernel-debugSkill
- freertos-plus-tcp-integrationSkill
- gnss-gps-integrationSkill
- hardware-interface-debugSkill
- heatshrink-integrationSkill
- letter-shell-integrationSkill
- littlefs-integrationSkill
- low-power-debugSkill
- lvgl-integrationSkill
- lwip-integrationSkill
- mbedtls-integrationSkill
- mcuboot-integrationSkill
- mcu-flashing-debugSkill
- micro-ecc-integrationSkill
- miniz-integrationSkill
- mqtt-embedded-integrationSkill
- nanopb-integrationSkill
- nrf-connect-sdk-integrationSkill
- nr-micro-shell-integrationSkill
- openocd-jlink-stlink-debugSkill
- openthread-integrationSkill
- ota-update-integrationSkill
- power-management-integrationSkill
- qspi-xip-flash-debugSkill
- readme-writingSkill
- riscv-mcu-debugSkill
- rtos-debugSkill
- rt-thread-integrationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Distinctive: line 20
Do not use this skill for simple drivers where plain C structs and functions are clearer.
- Very specific: line 38
Use dcl_class(foo_t) / declare_class(foo_t) (expands to typedef struct foo_t foo_t;), then def_class(foo_t, ...) ...
- Very specific: line 44
Use class_internal(ptObj, ptThis, foo_t) to obtain the typed ptThis, and the #define this (*ptThis) convention for member access.
- Distinctive: line 64
Before claiming PLOOC integration works:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
PLOOC Integration
Overview
Use this skill when PLOOC (Protected Low-overhead Object-Oriented Programming with ANSI-C, by GorgonMeducer) is used to structure embedded C code. PLOOC mimics classes with masked structures: outside the class .c file, private_member/protected_member regions appear as an opaque byte array, so the real work is getting the per-file __<NAME>_CLASS_IMPLEMENT/__<NAME>_CLASS_INHERIT__ guards, member visibility, and vtable/interface dispatch correct. Apply it only where object-style boundaries reduce real complexity.
When To Use
Use this skill when:
- The user mentions PLOOC,
def_class/end_def_class,private_member/protected_member/public_member,implement()-style inheritance, or vtable-based dispatch (def_interface) in embedded C. - A legacy driver/module is being wrapped into an encapsulated class with
plooc_class.h. - The issue involves the masked-struct layout, the
__..._CLASS_IMPLEMENTguard,__OOC_DEBUG__, initialization order, object lifetime, or callback/vtable dispatch.
Do not use this skill for simple drivers where plain C structs and functions are clearer.
First Questions
Ask for:
- PLOOC version (
private_method()/protected_method()/public_method()were added in v4.6.4) and target compiler. - C standard: PLOOC needs ANSI-C99; C90 requires
__OOC_DEBUG__(private-member protection is disabled in that mode); overload/_Genericfeatures need C11. - Which template is selected:
__PLOOC_CLASS_USE_STRICT_TEMPLATE__(strict), simple, simple_c90, or black_box. - Module being refactored and whether it uses single or multiple inheritance (
implement()). - Memory policy: static objects vs
__new_class()/__free_class()/__plooc_malloc_align().
Integration Checklist
- Set up the header guard pattern.
In the class header, map the module macro to the framework macro before including
plooc_class.h, e.g.#if defined(__BYTE_QUEUE_CLASS_IMPLEMENT) # define __PLOOC_CLASS_IMPLEMENT__ #elif defined(__BYTE_QUEUE_CLASS_INHERIT__) # define __PLOOC_CLASS_INHERIT__ #endif. - Declare then define the class.
Use
dcl_class(foo_t)/declare_class(foo_t)(expands totypedef struct foo_t foo_t;), thendef_class(foo_t, ...)...end_def_class(foo_t). Group members withpublic_member(...),protected_member(...),private_member(...)(any order allowed). - Define the implement macro in exactly one
.cfile. The class.cdoes#define __BYTE_QUEUE_CLASS_IMPLEMENTbefore#include "./byte_queue.h", so only that file sees real private members; every other translation unit sees the masked byte array. - Access
thisinside methods correctly. Useclass_internal(ptObj, ptThis, foo_t)to obtain the typedptThis, and the#define this (*ptThis)convention for member access. Mark unused args withPLOOC_UNUSED_PARAM. - Handle inheritance explicitly.
Embed a base with
implement(base_t)in the deriveddef_class; the framework generates ause_as__<base>member for the embedded base. Define__<NAME>_CLASS_INHERIT__in a consumer that only needs to read the base's protected members. Access base functionality by passing the address of theuse_as__<base>member to the base-class functions. - Keep dispatch inspectable.
Define vtables with
def_interface(i_foo_t)...end_def_interface(i_foo_t)and a single const interface instance; verify each function pointer is assigned.
Common Failures
- Forgetting
#define __<NAME>_CLASS_IMPLEMENTin the class.c, so the implementation only sees the opaque mask and member access fails to compile. - Defining the implement macro in more than one file, breaking encapsulation.
- Mismatched template selection: header uses
__PLOOC_CLASS_USE_STRICT_TEMPLATE__but a consumer includes with a different template, corrupting struct layout. - C90 or non-C99 toolchain without
__OOC_DEBUG__, so masked structs do not size correctly. implement(base_t)omitted, so nouse_as__<base>member is generated and base-class functions cannot be reached from the derived object.- Private members invisible in the debugger because
__OOC_DEBUG__is not defined for the debug build. - Missing include order:
plooc.h/plooc_class.h(and<stdlib.h>for__new_class) not reachable on the include path.
Verification
Before claiming PLOOC integration works:
- State the PLOOC version, C standard, and which class template (
strict/simple/black_box) is used. - Confirm the header maps
__<NAME>_CLASS_IMPLEMENT/__<NAME>_CLASS_INHERIT__before includingplooc_class.h, and the implement macro is defined in exactly one.c. - Confirm
sizeof(foo_t)is identical inside and outside the implementing file (mask size matches real struct). - Confirm methods resolve
thisviaclass_internal(...)and every vtable pointer in thedef_interfaceinstance is set. - Confirm private members are visible in GDB with
__OOC_DEBUG__in the debug build, and old behavior is preserved for the migrated module.
Example
User:
想用 PLOOC 重构几个传感器驱动。Agent:
- Asks the PLOOC version, C standard, and whether the sensors share a base class needing
implement(). - Migrates one sensor family:
dcl_class/def_classwithprivate_member/public_member, sets__<NAME>_CLASS_IMPLEMENTin one.c, exposes ops viadef_interface. - Verifies
sizeofmask consistency, vtable wiring, and that private members are inspectable under__OOC_DEBUG__.
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.

