con un clic
tuyaopen-code-check
>-
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
>-
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
| name | tuyaopen/code-check |
| description | >- |
SDK root: All
$OPEN_SDK_PYTHON tools/check_format.pycommands must be run from the TuyaOpen SDK root ($OPEN_SDK_ROOT). The bundledcheck_files.pyscript resolves the SDK root automatically via$OPEN_SDK_ROOTor by walking upward for.clang-format.
tools/check_format.py validates C/C++ files (.c, .cpp, .h, .hpp, .cc, .cxx) against three rules:
.clang-format at the repo root (LLVM-based style with 4-space indent).@file, @brief, and @copyright (must include current year + "All Rights Reserved").Paths listed in .clang-format-ignore are excluded (third-party libraries: cJSON, FlashDB, lwip, coreMQTT, etc.).
clang-format must be installed. It is included in the system dependencies (sudo apt-get install clang-format). If missing, the format check will be skipped with a warning.
All commands must be run from the SDK root ($OPEN_SDK_ROOT, where .clang-format lives).
$OPEN_SDK_PYTHON tools/check_format.py --debug --files path/to/file.c path/to/file.h
Supports glob patterns: --files "src/tal_system/**/*.c"
$OPEN_SDK_PYTHON tools/check_format.py --debug --dir src/tal_system/
$OPEN_SDK_PYTHON tools/check_format.py --debug
When --debug is used without --files or --dir, it scans the current working directory recursively for all C/C++ files.
Checks files modified relative to a base branch (uses git diff):
$OPEN_SDK_PYTHON tools/check_format.py # default: --base master
$OPEN_SDK_PYTHON tools/check_format.py --base main # custom base branch
Add -v to any mode for detailed information:
$OPEN_SDK_PYTHON tools/check_format.py --debug --files foo.c -v
--files and --dir require --debug flag — they are ignored in PR mode..clang-format.0 = all checks pass, 1 = errors found.When editing C/C++ files in this repo:
$OPEN_SDK_PYTHON .agents/skills/tuyaopen/code-check/scripts/check_files.py <changed_files>
Or directly: $OPEN_SDK_PYTHON tools/check_format.py --debug --files <changed_files>clang-format -style=file -i <file> to auto-fix, then re-check.Before committing or pushing code, verify that no sensitive information is included:
UUID, AuthKey, TUYA_OPENSDK_UUID, TUYA_OPENSDK_AUTHKEY — must use placeholder values (e.g. "your_uuid_here"), never real credentials.TUYA_PRODUCT_ID — use a placeholder or a development-only PID.When generating or modifying code that involves tuya_config.h or similar credential files:
"your_uuid_here", "your_authkey_here".Every .c and .h file must start with a /** comment block containing @file, @brief, @version, @date, and @copyright:
/**
* @file filename.c
* @brief Brief description in English
* @version 1.0
* @date YYYY-MM-DD
* @copyright Copyright (c) 2025 Tuya Inc. All Rights Reserved.
*/
@copyright format: Copyright (c) <start_year>[-<end_year>] <holder> All Rights Reserved. — the year must include the current year (either as start or end year). This is enforced as an error by check_format.py.
.clang-format-ignore ExcludesThe following third-party paths are excluded from formatting checks:
src/libcjson/cJSON
src/tal_kv/FlashDB
src/tal_kv/littlefs
src/common/backoffAlgorithm
src/liblwip/lwip-2.1.2
src/libhttp/coreHTTP
src/libmqtt/coreMQTT
src/common/qrcode
Do not modify these third-party files for formatting. If you add new third-party code, add its path to .clang-format-ignore.
.clang-format config at SDK root defines the full formatting rules (LLVM-based, 4-space indent, brace after control statement, etc.)Build and compile TuyaOpen projects, select build configurations, edit Kconfig options, clean artifacts, and run Linux ELF binaries. Use when the user mentions compiling, building, tos.py build, config choice, menuconfig, Kconfig, build error, or running a project. 项目编译、构建、编译配置、清理编译、编译错误、menuconfig、Kconfig。
Create new TuyaOpen projects and platforms, manage build configurations, update platform dependencies, and use tos.py subcommands. Use when the user mentions creating a project, tos.py new, saving or choosing a config, tos.py update, or general tos.py usage. 创建项目、新建工程、配置管理、保存配置、选择配置、更新依赖。
Send commands to the TuyaOpen device serial CLI (tal_cli) over UART and capture responses. Use when the user wants to run CLI commands on a connected T5AI, ESP32, T2, T3, or LN882H board — such as sys_reset, kv_dump, fs_ls, or custom registered commands — without opening a foreground monitor. Auto-discovers the USB serial port and platform baud rate. 设备CLI命令、串口命令、tal_cli、kv_dump、sys_reset、串口调试。
Decode a TuyaOpen firmware crash dump (PC, LR, stack pointers) to source file:line by invoking the right per-platform `addr2line` against the debug ELF. Use when the user pastes a panic log / hard-fault dump containing raw hex code addresses (e.g. "PC: 0x021d8e96"). Covers T5AI (BK7258, ARM Cortex-M), ESP32/S3 (Xtensa), T2, T3, LN882H — each ships its own toolchain inside the TuyaOpen tree. 固件崩溃解码、panic、hard fault、PC/LR地址解析、addr2line。
Agent-friendly non-blocking serial log capture for TuyaOpen devices. Runs tos.py monitor in the background, writes logs to file, and lets the agent tail or stop it at any time. Use when the agent needs to capture device logs without blocking, run a debug session, or monitor UART output during a build-flash-analyze loop. 后台串口日志、非阻塞监控、设备日志捕获、agent日志分析。
Automated build-flash-monitor-analyze development loop for TuyaOpen devices. Covers log analysis, error patterns, CLI testing, and iterative debugging. Use when the user mentions dev loop, automated testing, log analysis, debug cycle, iterative development, or CI loop. 开发闭环、自动化测试、日志分析、调试循环、迭代开发。