| name | post-work-checks |
| description | Ordered quality gate checklist to run after every code change in react-native-audio-api. Covers formatting, linting, type checking, C++ tests, JS tests, enum sync validation, and tiered local validation (validate.sh) for native builds CI does not run. Documents what lefthook pre-commit hooks run automatically vs what must be run manually. Use at the end of any implementation task before opening a PR. Trigger phrases: "post-work", "before PR", "before commit", "check quality", "run linter", "run tests", "format code", "lefthook", "pre-commit", "yarn test", "yarn lint", "validate", "validate:fast", "validate:full".
|
Skill: Post-Work Checks
Run these checks after any code change and before opening a PR.
Quick Reference — Local Validation Tiers
CI always runs the fast tier (format, lint, typecheck, enum sync, TS build, C++ + JS tests). Graph tests run in a separate path-filtered workflow (graph-tests.yml). CI does not build Android Gradle, iOS pods, or example apps. Use validate.sh locally to close that gap:
yarn validate:fast
yarn validate:graph
yarn validate:android
yarn validate:ios
yarn validate:full
Equivalent: ./scripts/validate.sh --fast (etc.)
Which tier to run
| Changed paths | Minimum validation |
|---|
src/, types only | --fast |
common/cpp/core/, dsp/, utils/ | --fast |
common/cpp/HostObjects/ | --fast + --android + --ios |
android/src/main/cpp/ or java/ | --fast + --android |
ios/audioapi/ | --fast + --ios |
CMakeLists.txt, build.gradle, podspec | --full |
Graph changes under common/cpp/audioapi/core/utils/graph/ → also run yarn validate:graph.
Quick Reference — Individual Commands
yarn format
yarn lint
yarn typecheck
yarn test
yarn check-audio-enum-sync
What lefthook Runs Automatically
Hooks run when lefthook is installed (lefthook install).
Pre-commit (every git commit)
| Hook | Command |
|---|
| Format check | yarn format:check (JS via Prettier, C++ via clang-format, Kotlin via ktlint) |
| Lint | yarn lint (JS/TS + C++ + Kotlin) |
| Type check | yarn typecheck (only when staged files match *.{js,ts,jsx,tsx}) |
| Commit message | commitlint |
If a hook fails, the commit is aborted. Fix the issue and re-commit — do NOT use --no-verify.
There is no pre-push hook — yarn validate:fast (and native/graph tiers) are run manually before opening a PR. Native builds (validate:android, validate:ios, validate:full) and graph tests (validate:graph) are never run by lefthook.
What Must Be Run Manually
These are not covered by lefthook:
CI-parity gate (before opening a PR)
yarn validate:fast
Native compile checks (when platform code changes)
yarn validate:android
yarn validate:ios
yarn validate:full
The Gradle project resolves through the node_modules/react-native-audio-api workspace symlink, so local edits in packages/react-native-audio-api/ are picked up.
Graph tests (when graph / audio-thread code changes)
yarn validate:graph
C++ tests only
yarn workspace react-native-audio-api run test:cpp
When: after any change to common/cpp/audioapi/core/, dsp/, or utils/ C++ files. Prefer this for a fast C++-only loop without running Jest; run yarn validate:fast before opening a PR.
Library unit tests (JS + C++)
yarn test
When: after any change to C++ files or TypeScript files in src/. Prefer this for a quick local test loop covering both TS and C++ logic; run yarn validate:fast before opening a PR.
AudioEvent enum sync check
yarn check-audio-enum-sync
When: only when you modify the AudioEvent enum or any file that maps event names across C++/Kotlin/TypeScript. Skip this step if you already ran validate:fast (it includes enum sync).
Per-Language Commands
These scripts live on the react-native-audio-api workspace. From the monorepo root:
yarn workspace react-native-audio-api lint:js
yarn workspace react-native-audio-api format:js
yarn workspace react-native-audio-api format:common
yarn workspace react-native-audio-api lint:cpp
yarn workspace react-native-audio-api format:android:cpp
yarn workspace react-native-audio-api format:android:kotlin
yarn workspace react-native-audio-api lint:kotlin
yarn workspace react-native-audio-api format:ios
yarn workspace react-native-audio-api lint:ios
Recommended Order
Later steps may surface issues caused by earlier ones — run in this order:
yarn format — fix formatting first (removes noise from lint)
yarn lint — catch remaining code issues
yarn typecheck — catch TypeScript errors
yarn validate:fast — full CI-parity gate (or yarn test / test:cpp for a quick local loop; always run --fast before opening a PR)
yarn validate:graph — when graph / audio-thread code changed
yarn validate:android / yarn validate:ios / yarn validate:full — when native code or build files changed (see decision table above)
Maintenance: see maintenance.md.