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
Inline TS rules into AGENTS.md, allow some of the tools (#259)
Context:
https://prisma-company.slack.com/archives/C058YK1BRPC/p1774522552653279
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated development tooling configuration to support expanded build,
test, and linting command workflows.
* Enhanced type safety guidelines and shell environment requirements for
development consistency.
* Removed deprecated configuration rule file.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Copy file name to clipboardExpand all lines: AGENTS.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,12 +30,37 @@ Welcome. This is a contract‑first, agent‑friendly data layer.
30
30
## Golden Rules
31
31
32
32
-**Node.js version**: Use the shell's Node. Do not run nvm/fnm or any version switcher. Source of truth is root `package.json``engines.node`. If the shell's version is wrong or commands fail, report that the shell is misconfigured and the user should configure their environment to satisfy `engines.node`.
33
-
- Use pnpm and local scripts (not ad‑hoc `tsc`, `jest`): `.cursor/rules/use-correct-tools.mdc`
33
+
- Use `pnpm` not `npm`!
34
+
- The source of truth for the required Node version is the root `package.json``engines.node` field.
35
+
- Never use `npx`
36
+
- If the shell's `node -v` does not satisfy that, or Node/pnpm commands fail due to version, report:
37
+
"Your shell is misconfigured for this repo. Configure your environment so that `node`
38
+
resolves to a version that satisfies the root package.json engines.node (e.g. set your
39
+
default Node in your version manager, or use Volta)."
40
+
- We use turborepo to build, generally. `pnpm build` scripts are available in each package which delegate to turborepo
41
+
- If you change exported types in a workspace package consumed by other packages/examples, run that package's `pnpm build` to refresh `dist/*.d.mts` declarations before validating downstream TypeScript usage.
42
+
- When you want to typecheck, use the local `pnpm typecheck` scripts instead of writing `tsc` commands from scratch
43
+
- When you want to test, use the local `pnpm test` scripts. For coverage, use `pnpm test:coverage` (all packages) or `pnpm coverage:packages` (packages only, excludes examples)
44
+
- Use arktype instead of zod
45
+
- Never add file extensions to imports in TypeScript
46
+
- Don't add comments if avoidable, prefer code which expresses its intent
47
+
- Don't add exports for backwards compatibility unless requested to do so
48
+
- Always write tests before creating or modifying implementation
49
+
- Do not reexport things from one file in another, except in the `exports/` folders
34
50
- Don't branch on target; use adapters: `.cursor/rules/no-target-branches.mdc`
- Keep docs current (READMEs, rules, links): `.cursor/rules/doc-maintenance.mdc`
37
53
- Prefer links to canonical docs over long comments
38
54
55
+
## Typesafety rules
56
+
- Never use `any` type
57
+
- Never use `@ts-expect-error` outside of negative type tests
58
+
- Never use `@ts-nocheck`
59
+
- Never suppress biome lints
60
+
- Try to minimize type casts. Instead, prefer explicit types that would make type casts unnecessary. If type cast is unavoidable, try to minimize its scope — never cast
61
+
entire object/class when casting one property would suffice.
62
+
-`as unknown as SomeOtherType` type cast should be used only as a last resort and should always be accompanied by a comment explaining why it is necessary.
0 commit comments