Audience: This file contains guidance for AI agents contributing to the
ClickHouse/clickhouse-jsrepository itself. It is not intended for downstream projects that depend on@clickhouse/clientor@clickhouse/client-web
This root file holds repo-wide guidance. Folder-specific guidance lives in nested AGENTS.md files next to the code they describe — read the one closest to the files you are editing:
packages/AGENTS.md— client source packages: log-message conventions, package structure, and intentional node/web duplication.examples/AGENTS.md— the example corpus layout and conventions.skills/AGENTS.md— shipped agent skills and how they are declared.skills/clickhouse-js-node-rowbinary/AGENTS.md—@clickhouse/rowbinaryreader/writer conventions (tests, no defensive validation).
docs/AGENTS.md— embedded troubleshooting / how-to pages.tests/clickhouse-test-runner/AGENTS.md— the upstream SQL test harness and allowlist strategy.
The repository ships typescript-language-server as a root devDependency, so after npm install you can start a TypeScript language server with npx typescript-language-server --stdio from the repo root for precise go-to-definition, find-references, hover (signatures and JSDoc, including @deprecated), workspace symbol search, completions, and type diagnostics. Prefer it over text search when resolving symbols or usages across the packages/* workspaces. See .claude/skills/typescript-lsp/SKILL.md for verified capabilities and protocol notes.
For every pull request review, make sure to provide an evaluation of the following aspects:
-
This repository is a client library for ClickHouse, which is a database management system. When reviewing code changes, it is important to consider the security implications of the changes. For example, if the code changes involve handling user input or interacting with external systems, it is important to ensure that the code is secure and does not introduce vulnerabilities such as SQL injection or cross-site scripting (XSS).
-
Additionally, when reviewing code changes, it is important to consider the potential impact on data privacy and compliance with relevant regulations such as GDPR or CCPA. For example, if the code changes involve handling personally identifiable information (PII), it is important to ensure that the code is designed to protect user privacy and comply with relevant regulations.
-
When reviewing code changes, it is important to consider the impact on the API quality and stability. For example, if the code changes involve modifying the library's public API surface (such as exported functions, classes, or types) or adding new public APIs, it is important to ensure that the changes are well-documented and do not break existing functionality for users of the library.
-
When introducing new features, fixing bugs, or making any change to observable behavior or the public API, you must update the changelog of every affected package in the same PR — do not defer it to "release time" or leave it only in the PR description. This satisfies the PR template checklist item ("A human-readable description of the changes was provided to include in CHANGELOG"). Each package keeps its own changelog (the repository-wide
CHANGELOG.mdis frozen — do not add new entries there):@clickhouse/client→packages/client-node/CHANGELOG.md@clickhouse/client-web→packages/client-web/CHANGELOG.md@clickhouse/client-common(deprecated) →packages/client-common/CHANGELOG.md@clickhouse/datatype-parser→packages/datatype-parser/CHANGELOG.md@clickhouse/rowbinary→skills/clickhouse-js-node-rowbinary/CHANGELOG.md
A change to shared code that is bundled into both clients (the common module) affects both
@clickhouse/clientand@clickhouse/client-web, so update both of their changelogs. Follow the existing format exactly:- Entries go under the top-most version heading of that package's changelog. If the most recent
# x.y.zheading corresponds to an already-released version (checkgit tag), open a new top-level# x.y.zheading that matches the unreleased version in that package'spackage.json; otherwise append to the existing top heading. - Group entries under lowercase section headings, reusing the ones already in the file:
## New features,## Improvements,## Bug fixes(and## Migration Notes/## Breaking changeswhen relevant). - Write a concise, human-readable entry, add an example usage when it helps, and end it with a PR reference link, e.g.
([#825])plus a matching[#825]: https://github.com/ClickHouse/clickhouse-js/pull/<n>reference at the bottom of the section. - When a change is Node.js- or Web-only, say so explicitly in the entry (e.g. "(Node.js only)").
- Run
npx prettier --writeon the changelog file(s) you touched before committing.
-
Additionally, make sure that the official documentation is in sync with the changes.