es-toolkit
toss/es-toolkit/CLAUDE.md
Instructions for AI assistants working on es-toolkit. This is a global project with users speaking various languages. When producing non-code output (explanations, reviews, reports), respond in the user's preferred language.
CLAUDE.md11k starsChanged 7 months ago
What's in it
- CLAUDE.md
- Language
- Quick Reference
- Structure
- Design Principles
- Coding Conventions
- New Function Checklist
# CLAUDE.md
Instructions for AI assistants working on es-toolkit.
## Language
This is a global project with users speaking various languages. When producing non-code output (explanations, reviews, reports), respond in the user's preferred language.
## Quick Reference
```bash
corepack enable && yarn install # Setup
yarn vitest run # Tests
yarn vitest run src/array/chunk # Test specific function
yarn lint # ESLint
tsc --noEmit # Typecheck
```
## Structure
```
src/{category}/{fn}.ts # Implementation (array, bigint, function, math, object, predicate, promise, set, string, util, error, map)
src/{category}/{fn}.spec.ts # Tests (vitest)
src/compat/{category}/{fn}.ts # Lodash-compatible variant
tests/types/compat.spec-d.ts # Type tests against @types/lodash (yarn workspace type-tests test)
docs/reference/{category}/{fn}.md # English
docs/ko/reference/{category}/{fn}.md # Korean
docs/ja/reference/{category}/{fn}.md # Japanese
docs/zh_hans/reference/{category}/{fn}.md # Chinese
```
## Design Principles
- **Performance**: Must match or beat lodash.
- **Simplicity**: Simplest interface for the 85% use case. No complex options.
- **Don't implement**: Functions replaceable by modern JS (`Array.isArray`, `Number.isNaN`, `Math.min`), or TC39 Stage 3+ proposals.
- **es-toolkit vs compat**: `es-toolkit` is the strict, opinionated API. `es-toolkit/compat` matches lodash behavior exactly for migration. Compat is feature-complete — no new functions are being added. Only behavior inconsistency fixes against lodash are accepted.
- **What we accept**: New functions need an accepted [discussion](https://github.com/toss/es-toolkit/discussions/new?category=ideas) first, performance work needs benchmark results, and refactoring-only changes are not accepted. See [`.github/CONTRIBUTING.md`](./.github/CONTRIBUTING.md#41-what-we-accept).
## Coding Conventions
- `for` loops over `reduce` (local mutation is fine)
- Built-in JS over custom helpers (`Array.isArray()`, not `isArray()`)
- Type params: `T` elements, `K` keys, `E` errors
- `readonly T[]` for array params that aren't mutated
- Detailed JSDoc with `@template`, `@param`, `@returns`, `@throws`, `@example`
## New Function Checklist
1. `src/{category}/{fn}.ts` — Implementation
2. `src/{category}/{fn}.spec.ts` — Tests
3. Re-export in `src/{category}/index.ts` and `src/index.ts`
4. Docs in all 4 languages (see `docs/CLAUDE.md` for templates)
More agent context in toss/es-toolkit
8 other files this repository gives its agents.
AGENTS.md
CLAUDE.md
Skill
- compat-review.claude/skills/compat-review/SKILL.md
- issue-label.claude/skills/issue-label/SKILL.md
- issue-review.claude/skills/issue-review/SKILL.md
- pr-review.claude/skills/pr-review/SKILL.md
- pr-triage.claude/skills/pr-triage/SKILL.md
- release.claude/skills/release/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

