- Worktrees — symlink
deps_allpaths fromtools/get_deps.pyto the primary checkout; replace a symlink and rerunget_deps.pyonly for a different revision. - Code references — boards:
hw/bsp/,docs/reference/boards.rst; classes:src/class/; core/config:src/tusb.h,src/tusb_option.h, each example'ssrc/tusb_config.h; build/deps:tools/build.py,tools/get_deps.py; unit tests:test/unit-test/project.yml.
- C99, 2-space indent, no tabs;
snake_casehelpers,UPPER_CASEmacros,tud_/tuh_public APIs,TU_macros. - No dynamic allocation. Defer ISR work to task context. Use
TU_ASSERT()for error checks; check return values. - Keep headers self-contained with
#if CFG_TUSB_MCUguards. Include order: C stdlib → tusb common → drivers → classes.
- Skill script tests live in
.claude/test/test_*.py. - From agentrc: skills
read-doc,simplify-gate,usb-sniffer,usb-kernel-debug,rtt,etm-trace,target-debug,esp-target-debug; agentschief,pvs-studio,code-writer,code-verifier,finding-verifier,pr-ci-watcher,pr-review-validator; workflowscode-audit,pr-babysit. When one is unavailable, skip the step that needs it. - Driver audit: the
code-auditworkflow withdirs(e.g.src/portable/<vendor>/<driver>) anddimensions:correctness: transfer state machines, endpoint bookkeeping, completion and error paths;ISR safety: work deferred to task context, shared-state races, register access ordering;register use vs datasheet and MCU errata: cross-check the reference manual AND errata sheets via the read-doc skill; if the skill is unavailable treat the document as absent (low confidence, never a web/filesystem substitute); a missing erratum workaround is a finding;style: repo conventions (TU_ASSERT, no dynamic allocation, include order, naming). - Static analysis: the
pvs-studioagent with rules.PVS-Studio/.pvsconfig(never add suppressions) on a board's examples build;raspberry_pi_picomirrors CI,stm32f407discois fastest.
- Keep project workflows in
.claude/workflows/, nested one level at most.
- Build contract:
.claude/skills/build/SKILL.md. Its script resolves a change to boards and builds them;--sharedwritescmake-build/cmake-build-<board>, the dir HIL flashes from, so preserve it. Flash withninja -C cmake-build/cmake-build-<board> <example>-jlinkor-openocd. - ESP-IDF:
. "$IDF_PATH/export.sh"before anything Espressif; verification still goes through the build contract, withidf.py -DBOARD=<board> flash monitorin the example reserved for interactive flash and monitor. - Before submitting:
pre-commit run --all-files(includes unit tests). - For code changes: build the full example set for boards that exercise the changed modules. Add fuzz/HIL coverage for parsers or protocol state machines.
- After board/dependency changes, regenerate docs with
build-doc. - Before committing code changes, verify size impact with
code-size.
- Before opening or updating a PR, follow Build and Validate; use
pre-prwhen workflows are available. - After opening a PR, use
chiefto drive reviews and CI to green. TinyUSBpr-babysitargs:{"pr": <num>, "reviewers": ["codex","copilot","coderabbit"], "autoRun": ["codex","copilot","coderabbit"], "protected": "^test/hil/[^/]+\\.json$"}(protectedexcludes the HIL rig rosters from automated fixes). - The follow-up label is
followup.