ble
免费Bluetooth context for the Megahub project. Use when working on BLE GATT server, Classic Bluetooth HID host, Web Bluetooth API integration, btremote library, connection handling, or any Bluetooth-related firmware code.
中文简介正在准备中。当前显示原文说明。
Code formatting and linting context for the Megahub project. Use when writing or reviewing code in C++ or JavaScript, or when running format/lint checks. Describes tool commands, style conventions, and when to apply them.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
| Layer | Tool | Config file | Purpose |
|---|---|---|---|
| C++ | clang-format | /.clang-format | Code formatting |
| C++ | cppcheck | — (run manually) | Static analysis |
| JS/CSS | Prettier | /frontend/prettier.config.js | Code formatting |
| JS | ESLint v9 | /frontend/eslint.config.js | Bug detection |
| Pre-commit | lefthook | /lefthook.yml | Runs all checks on staged files |
frontend/)npm run lint # ESLint check (errors and warnings)
npm run lint:fix # ESLint auto-fix where possible
npm run format # Prettier — write formatted output
npm run format:check # Prettier — check only (no writes)
# Format a single file in-place
clang-format -i lib/megahub/src/megahub.cpp
# Check all lib and src files without modifying
find lib src -name "*.cpp" -o -name "*.h" | xargs clang-format --dry-run --Werror
# Static analysis
cppcheck --enable=warning,performance,portability \
--suppress=missingInclude \
--suppress=unusedFunction \
--suppress=ctuOneDefinitionRuleViolation \
--inline-suppr \
--error-exitcode=1 \
--quiet \
lib/btremote lib/commands lib/configuration lib/hubwebserver \
lib/i2csync lib/imu lib/inputdevices lib/logging lib/lpfuart \
lib/megahub lib/portstatus lib/statusmonitor \
src/
npm run format then npm run lint from frontend/clang-format -i on the modified filesbrew install lefthook # macOS
lefthook install # registers the git hooks
After this, every git commit automatically checks:
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Bluetooth context for the Megahub project. Use when working on BLE GATT server, Classic Bluetooth HID host, Web Bluetooth API integration, btremote library, connection handling, or any Bluetooth-related firmware code.
中文简介正在准备中。当前显示原文说明。
Blockly visual programming context for the Megahub project. Use when adding, modifying, or debugging custom Blockly blocks, the Lua code generator, the toolbox, block colors, or the BLOCKS.md documentation generation script.
中文简介正在准备中。当前显示原文说明。
Documentation structure and maintenance rules for the Megahub project. Use whenever making user-facing changes — adding features, changing behavior, fixing hardware compatibility, or modifying configuration. Describes which files to update, the README structure, and writing style.
中文简介正在准备中。当前显示原文说明。
Core firmware context for the Megahub ESP32 project. Use when working on PlatformIO configuration, build scripts, library structure, main.cpp, or general ESP32 firmware development. Covers build system, project structure, common pitfalls, and debugging.
中文简介正在准备中。当前显示原文说明。
Frontend development context for the Megahub project. Use when working on the web-based IDE, Vite build system, Blockly visual programming, Web Bluetooth API integration, JavaScript frontend code, CSS/styles, UI components, or anything in the /frontend/ directory.
中文简介正在准备中。当前显示原文说明。
LEGO Powered Up protocol context for the Megahub project. Use when working on LEGO device communication, lpfuart library, UART parsing, motor control, sensor modes, device initialization, or debugging UART noise/corruption issues.
中文简介正在准备中。当前显示原文说明。