agentleFS
software-mansionsoftware-mansion/react-native-audio-api/.claude/skills/post-work-checks/SKILL.md

post-work-checks

Skill864 starsChanged 7 days agoMITView on GitHub

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", "pnpm test", "pnpm lint", "validate", "validate:fast", "validate:full".

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run these checks after any code change and before opening a PR.

    line 16
  2. Very specific:

    When: after any change to common/cpp/audioapi/core/, dsp/, or utils/ C++ files.

    line 119
  3. Very specific:

    When: after any change to C++ files or TypeScript files in src/.

    line 127
  4. Very specific:

    When: only when you modify one of those enums or any file that maps event names across C++/Kotlin/TypeScript.

    line 144

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Post-Work Checks

Run these checks after any code change and before opening a PR.


Quick Reference — Local Validation Tiers

CI runs each changed package's check and test scripts (ci.yml). The library's test runs Jest and only the C++ suites whose paths your changes touch (run-tests.sh affected: smoke for common/cpp/, graph for graph code); outside pull requests it runs all of them. CI also builds the example app for Android and iOS when native code changes (native-build.yml). Use validate.sh locally for the same checks before pushing:

pnpm validate:fast          # CI parity — always run before opening a PR
pnpm validate:cpp           # C++ smoke
pnpm validate:cpp-extended  # C++ extended (all categories)
pnpm validate:android       # Android native build (requires ANDROID_HOME)
pnpm validate:ios           # iOS native build (macOS only)
pnpm validate:full          # --fast with every C++ suite + --android + --ios

Equivalent: ./scripts/validate.sh --fast (etc.)

Which tier to run

Changed pathsMinimum 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 pnpm validate:cpp-extended or pnpm --filter react-native-audio-api test:cpp:extended -- graph.


Quick Reference — Individual Commands

pnpm check                   # build every package, then its `check`, as CI runs it
pnpm test                    # every package's `test` (library: Jest + affected C++ suites)
pnpm format                  # auto-fix all formatting
pnpm lint                    # lint all workspaces
pnpm typecheck               # TypeScript type checking
pnpm --filter react-native-audio-api check:enums   # only if a mirrored enum touched

What lefthook Runs Automatically

Hooks run when lefthook is installed (lefthook install).

Pre-commit (every git commit)

HookCommand
Format checkpnpm format:check (JS/TS via oxfmt, C++ via clang-format, Kotlin via ktlint)
Lintpnpm lint (JS/TS via oxlint with type-aware rules, C++, Kotlin)
Type checkpnpm typecheck (only when staged files match *.{js,ts,jsx,tsx})
Commit messagecommitlint

If a hook fails, the commit is aborted. Fix the issue and re-commit — do NOT use --no-verify.

pnpm lint runs oxlint from each package directory with that package's own .oxlintrc.json (apps/common-app has one), while editors apply the stricter root .oxlintrc.json (tsdoc/syntax, import/consistent-type-specifier-style as errors). To see what the editor reports, run pnpm exec oxlint -c .oxlintrc.json <path> from the root. oxfmt's jsdoc: true rewraps comments to 80 columns and can split a code span across lines (tsdoc-code-span-missing-delimiter); reword so the span doesn't land on a line break, then re-run oxfmt and check. Vendored files need an ignore in both the root and the package config.

There is no pre-push hook — pnpm validate:fast (and native/C++ extended tiers) are run manually before opening a PR. Native builds (validate:android, validate:ios, validate:full) and extended C++ (validate:cpp-extended) are never run by lefthook.


What Must Be Run Manually

These are not covered by lefthook:

CI-parity gate (before opening a PR)

pnpm validate:fast

Native compile checks (when platform code changes)

pnpm validate:android   # pnpm --filter … build:android (~3–4 min)
pnpm validate:ios       # pnpm --filter … build:ios (macOS only)
pnpm validate:full      # --fast with every C++ suite + --android + --ios

Autolinking registers workspace packages under their real packages/ path (apps/common-app/scripts/dependencies.js follows the node_modules symlink), so Gradle and CocoaPods build local edits in packages/react-native-audio-api/ directly.

Extended graph (when graph / audio-thread code changes)

pnpm validate:cpp-extended       # all extended categories
# or: pnpm --filter react-native-audio-api test:cpp:extended -- graph

C++ tests only

pnpm validate:cpp                                            # smoke via validate.sh
pnpm --filter react-native-audio-api test:cpp           # smoke
pnpm --filter react-native-audio-api test:cpp:full      # smoke + all extended

When: after any change to common/cpp/audioapi/core/, dsp/, or utils/ C++ files. Prefer smoke for a fast C++-only loop; see common/cpp/test/TESTING.md. Run pnpm validate:fast before opening a PR.

Library unit tests (JS + C++)

pnpm test   # from monorepo root — runs test:js + test:cpp

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 pnpm validate:fast before opening a PR.

Native enum sync check

pnpm --filter react-native-audio-api check:enums

Runs packages/react-native-audio-api/scripts/check-enum-sync.sh, which compares every enum mirrored from C++: into Kotlin (AudioEvent, RecorderState, crossing JNI) and into TypeScript (FileFormat, FileDirectory, BitDepth, IOSAudioQuality from AudioFileProperties.h, crossing JSI). Both cross as plain ints, so entry order and values are the contract: an entry without an initializer counts as previous + 1, which is also how a Kotlin ordinal counts. Names are compared ignoring case and underscores, since the languages name entries differently by convention. An enum the script finds no entries for fails the check. Add a new pair to the MIRRORED_ENUMS table at the top of the script.

When: only when you modify one of those enums 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:

# TypeScript/JavaScript
pnpm --filter react-native-audio-api lint:js
pnpm --filter react-native-audio-api format:js

# Shared C++
pnpm --filter react-native-audio-api format:common
pnpm --filter react-native-audio-api lint:cpp

# Android
pnpm --filter react-native-audio-api format:android:cpp
pnpm --filter react-native-audio-api format:android:kotlin
pnpm --filter react-native-audio-api lint:kotlin

# iOS
pnpm --filter react-native-audio-api format:ios
pnpm --filter react-native-audio-api lint:ios

Recommended Order

Later steps may surface issues caused by earlier ones — run in this order:

  1. pnpm format — fix formatting first (removes noise from lint)
  2. pnpm lint — catch remaining code issues
  3. pnpm typecheck — catch TypeScript errors
  4. pnpm validate:fast — full CI-parity gate (or pnpm test / test:cpp for a quick local loop; always run --fast before opening a PR)
  5. pnpm validate:cpp-extended — when graph / audio-thread code changed
  6. pnpm validate:android / pnpm validate:ios / pnpm validate:full — when native code or build files changed (see decision table above)

Maintenance: see maintenance.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.