Skip to content

Commit c6f742f

Browse files
stepankuzmingithub-actions[bot]
authored andcommitted
Update CLAUDE.md (internal-9018)
GitOrigin-RevId: 240182a4550f5dcb86f64996d45bea219c74a5a5
1 parent 68a3d51 commit c6f742f

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This is the Mapbox GL JS repository
2+
3+
Include all info from the @CLAUDE.md file.

CLAUDE.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Mapbox GL JS is a JavaScript library for interactive, customizable vector maps o
88

99
## Workflow
1010
- Make changes as concise as possible, ensure they are minimal and fully justified
11+
- Read and understand relevant files before proposing code edits. If the user references a specific file/path, inspect it before explaining or proposing fixes.
12+
- Understand WHY code exists before changing it. GL JS handles browser quirks, performance hacks, and WebGL state subtleties. Non-obvious patterns often exist for a reason—check git blame when in doubt.
13+
- Avoid over-engineering. Only make changes that are directly requested or clearly necessary.
14+
- Don't add features, refactor code, or make "improvements" beyond what was asked
15+
- Don't create helpers or abstractions until you see repetition
16+
- Straightforward repetition beats unclear abstraction
1117
- Always run `npm run tsc` and `npm run lint` when you're done making a series of code changes
1218
- Run `npm run codegen` if you modify style properties or the style specification (regenerates style code, struct arrays, and TypeScript types)
1319
- Run `npm run test-typings` after modifying public API types or the style specification
@@ -130,10 +136,11 @@ test/
130136
- Always use named exports, default exports are forbidden
131137
- Modules export classes or functions (no namespace objects)
132138
- JSDoc comments for all public APIs
133-
- Don't use `!.` for non-null assertions
134-
- Don't use `?.` or `??` operators for optional chaining
135-
- No async/await - use Promises instead
139+
- Don't use `!.` for non-null assertions (hides potential null issues)
140+
- Don't use `?.` or `??` operators (hides null handling, harder to debug)
141+
- No async/await - use Promises instead (keeps control flow explicit)
136142
- Use `assert` for invariants
143+
- Break complex expressions into named variables, especially WebGL math
137144

138145
## TypeScript
139146

0 commit comments

Comments
 (0)