Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tuya/TuyaOpen-dev-skills --skill tuyaopen-code-check명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| 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.)