You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,9 +83,16 @@ To see all development ports, refer to the index.html of `apps/dev-launchpad/pub
83
83
- NEVER try-catch-all, NEVER void a promise, and NEVER .catch(console.error) (or similar). In most cases you don't actually need to be asynchronous, especially when UI is involved (instead, use a loading indicator! eg. our <Button> component already takes an async callback for onClick and sets its loading state accordingly — if whatever component doesn't do that, update the component instead). If you really do need things to be asynchronous, use `runAsynchronously` or `runAsynchronouslyWithAlert` instead as it deals with error logging.
84
84
- WHENEVER you create hover transitions, avoid hover-enter transitions, and just use hover-exit transitions. For example, `transition-colors hover:transition-none`.
85
85
- Any environment variables you create should be prefixed with `STACK_` (or NEXT_PUBLIC_STACK_ if they are public). This ensures that their changes are picked up by Turborepo (and helps readability).
86
+
- NEVER just silently use fallback values or whatever when you don't know how to fix type errors. If there is a state that should never happen because of higher-level logic, and the type system doesn't represent that, either update the types or throw an error. Stuff like `?? 0` or `?? ""` is often code smell when `?? throwErr("this should never happen because XYZ")` would be better.
86
87
- Code defensively. Prefer `?? throwErr(...)` over non-null assertions, with good error messages explicitly stating the assumption that must've been violated for the error to be thrown.
87
88
- Try to avoid the `any` type. Whenever you need to use `any`, leave a comment explaining why you're using it (optimally it explains why the type system fails here, and how you can be certain that any errors in that code path would still be flagged at compile-, test-, or runtime).
88
89
- Don't use Date.now() for measuring elapsed (real) time, instead use `performance.now()`
90
+
- Use urlString`` or encodeURIComponent() instead of normal string interpolation for URLs, for consistency even if it's not strictly necessary.
91
+
- When making config updates, use path notation (`{ "path.to.field": my-value }`) to avoid overwriting sibling properties
92
+
- IMPORTANT: Any assumption you make should either be validated through type system (preferred), assertions, or tests. Optimally, two out of three.
93
+
- If there is an external browser tool connected, use it to test changes you make to the frontend when possible.
94
+
- Whenever you update an SDK implementation in `sdks/implementations`, make sure to update the specs accordingly in `sdks/specs` such that if you reimplemented the entire SDK from the specs again, you would get the same implementation. (For example, if the specs are not precise enough to describe a change you made, make the specs more precise.)
95
+
- When building internal tools for Stack Auth developers (eg. internal interfaces like the WAL info log etc.): Make the interfaces look very concise, assume the user is a pro-user. This only applies to internal tools that are used primarily by Stack Auth developers.
89
96
90
97
### Code-related
91
98
- Use ES6 maps instead of records wherever you can.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,8 +43,9 @@ For vibecoding, it can help to have multiple parallel copies of the codebase ope
43
43
```sh
44
44
# ~/.bash_profile, ~/.bashrc, ~/.zprofile, ~/.zshrc, ~/.zshenv, etc.
45
45
# note that different coding agents use a different shell in a different mode (login, non-login, interactive, non-interactive, etc.); from my experimentation, as of 2025-10-17 on a Mac, Cursor uses non-interactive zsh (requiring ~/.zshenv), whereas Codex uses a non-interactive login bash (requiring ~/.bash_profile). It's easiest to just add these lines of code to all of your shell configs.
46
-
eval"$(direnv hook <bash|zsh>)"
47
-
eval"$(direnv export<bash|zsh>)"
46
+
# also, make sure to use the correct path to the direnv binary; for example, on a Mac with Homebrew installed, it is /opt/homebrew/bin/direnv
47
+
eval"$(/path/to/direnv hook <bash|zsh>)"
48
+
eval"$(/path/to/direnv export<bash|zsh>)"
48
49
```
49
50
3. Now, create a `.envrc` file in the root of Stack Auth's codebase with the following content:
Copy file name to clipboardExpand all lines: README.md
+1-48Lines changed: 1 addition & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,8 +34,6 @@ We support Next.js, React, and JavaScript frontends, along with any backend that
34
34
-[Requirements](#requirements)
35
35
-[Setup](#setup)
36
36
-[Useful commands](#useful-commands)
37
-
-[Chat with the codebase](#chat-with-the-codebase)
38
-
-[Architecture overview](#architecture-overview)
39
37
-[❤ Contributors](#-contributors)
40
38
41
39
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -142,7 +140,7 @@ pnpm restart-deps
142
140
pnpm dev
143
141
144
142
# In a different terminal, run tests in watch mode
145
-
pnpm test
143
+
pnpm test# useful: --no-watch (disables watch mode) and --bail 1 (stops after the first failure)
146
144
```
147
145
148
146
You can now open the dev launchpad at [http://localhost:8100](http://localhost:8100). From there, you can navigate to the dashboard at [http://localhost:8101](http://localhost:8101), API on port 8102, demo on port 8103, docs on port 8104, Inbucket (e-mails) on port 8105, and Prisma Studio on port 8106. See the dev launchpad for a list of all running services.
@@ -196,51 +194,6 @@ pnpm verify-data-integrity: Verify the integrity of the data in the database by
196
194
197
195
Note: When working with AI, you should keep a terminal tab with the dev server open so the AI can run queries against it.
198
196
199
-
### Chat with the codebase
200
-
201
-
Storia trained an [AI on our codebase](https://sage.storia.ai/stack-auth) that can answer questions about using and contributing to Stack Auth.
0 commit comments