The role of this file is to describe common mistakes and confusion points that agents might encounter as they work in this codebase. If you ever encounter something in this project that surprises you, please alert the developer working with you and indicate that this is the case in the AGENTS.md file to help prevent future agents from having the same issue.
- Don't add unnecessary comments that don't add value. Only add comments if they explain something that isn't obvious from the code.
- Use jsdoc comments for public APIs that end up being published to npm.
-
Always use devbox to run commands. Don't run commands in a sandboxed environment.
-
When running any commands append
devbox run --before. For example if you want to run lintdevbox run -- pnpm run lint -
You can run
lint,test,check-typesandbuildcommands using pnpm directly. -
If you want to run
lint,test,check-typesandbuildcommands for a specific package, you can runpnpm --filter <package> run lint,pnpm --filter <package> run test,pnpm --filter <package> run check-typesandpnpm --filter <package> run buildrespectively. -
Make sure you run formatting check using
pnpm run format:checkand format usingpnpm run format:writeat the end of your work. -
Always verify your work by running type checking, linting, testing and formatting check commands.
NOTE:
- DON'T run
pnpm devorpnpm startto start a dev server, always assume dev server is running.
- This app has no users yet, make whatever changes you need without worrying about users or data or migrations.
- Docs content under
apps/docs/contentcan get out of date so whenever you make changes to the SDK, you should see if you need to update the docs. - Running repo-wide tasks in parallel can trigger a flaky lint failure in
packages/stripewhere ESLint tries to read a temporarytsup.config.bundled_*.mjsfile whiletsupis creating/removing it. Ifpnpm run lintfails withENOENTfor that file during concurrent verification, rerun lint on its own after the build-related tasks finish. - Editor/LSP diagnostics in example apps can sometimes claim
@better-webhook/coreis missing exported types even when the workspace package exports them correctly; if that happens, verify againstpackages/core/dist/index.d.tsand repo typecheck output before making API changes based only on the editor error.