Rules for all AI agents working on rt-claw. Read CLAUDE.md first for build, style, and commit conventions.
- OSAL boundary: code in
claw/must only includeclaw_os.h— never include FreeRTOS or RT-Thread headers directly. - Minimal change: modify only what is necessary. Do not refactor, add comments, or "improve" unrelated code.
- No backward compatibility: prefer breaking changes over shims. Remove dead code, do not deprecate.
- Build before commit: ensure the change compiles on at least one platform.
- Run checks:
scripts/check-patch.sh --stagedmust pass before committing.
- Platform-independent logic goes in
claw/. - RTOS-specific code goes in
osal/<rtos>/. - Hardware drivers go in
drivers/<subsystem>/<vendor>/, headers ininclude/drivers/<subsystem>/<vendor>/. - Platform BSP code goes in
platform/<board>/. - Shared platform helpers go in
platform/common/<vendor>/. - New services go in
claw/services/<name>/. - Never put application logic in
platform/orosal/.
- C99 only. No C++ in core code.
- No dynamic memory allocation in OSAL layer — use static buffers or pool from
claw_config.h. - Config macros follow
CLAW_<SUBSYSTEM>_<PARAM>naming ininclude/claw/claw_config.h. - Every new
.c/.hfile needs the MIT SPDX license header.
- Format:
subsystem: description— see CLAUDE.md for prefix list. - Every commit must have
Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>. - Do not add any AI/Claude co-author lines.
- One logical change per commit.
- Never commit API keys, tokens, passwords, or any credentials to the repository.
- Secrets belong in
sdkconfig(gitignored), environment variables, or local config files excluded by.gitignore. - If a file contains secrets, ensure it is listed in
.gitignorebefore staging. - When reviewing staged changes (
git diff --cached), check for hardcoded keys — reject the commit if any are found.
- Add unit test frameworks, CI/CD pipelines, or automation without explicit request.
- Modify files under
vendor/— these are git submodules. - Use
//comments in C code. - Create
.mddocumentation files unless explicitly asked. - Guess or fabricate API behavior — read the source first.
- Commit files containing plaintext secrets (API keys, app IDs, tokens, etc.).