clickhouse-js / packages
AGENTS.md331 starsChanged 33 days agoApache-2.0View on GitHub
Guidance for the client source packages. See the repo-root AGENTS.md for cross-cutting guidance (code intelligence, code-review expectations, changelog rules). The source packages here are: - client-common — platform-agnostic shared code (config, query-param formatting, multipart assembly, URL handling, result sets, etc.). It must not depend on Node.js-only or Web-only APIs. The published @clickhouse/client-common package is deprecated: client-node and client-web no longer depend on it and instead bundle its sources via the src/common symlink (client-node/src/common and client-web/src/common both point to client-common/src), importing…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- examples/AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- skills/clickhouse-js-node-rowbinary/AGENTS.mdAGENTS.md
- fix-release-prSkill
- releaseSkill
- setupSkill
- typescript-lspSkill
- clickhouse-js-node-codingSkill
- clickhouse-js-node-rowbinarySkill
- clickhouse-js-node-troubleshootingSkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
When adding log messages, make sure to use eager log level checks to avoid unnecessary calculations for log messages that will not be …
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Recommendations for AI agents — packages/
Guidance for the client source packages. See the repo-root AGENTS.md for cross-cutting guidance (code intelligence, code-review expectations, changelog rules).
Log messages
When adding log messages, make sure to use eager log level checks to avoid unnecessary calculations for log messages that will not be emitted. For example:
if (log_level <= ClickHouseLogLevel.WARN) { log_writer.warn({ message: "Example log message", }); }When adding new log messages with suggestions for users, make sure to create a unique documentation page under the
docs/directory (usedocs/howto/for task-style guides; seedocs/socket_hang_up_econnreset.mdas a reference) with a detailed explanation of the issue and how to resolve it. Then, include a link to that documentation page in the log message. For example:if (some_condition) { log_writer.warn({ message: "Example log message with suggestions for users. For more information, see https://github.com/ClickHouse/clickhouse-js/blob/main/docs/socket_hang_up_econnreset.md", }); }
Package structure and code duplication
The source packages here are:
client-common— platform-agnostic shared code (config, query-param formatting, multipart assembly, URL handling, result sets, etc.). It must not depend on Node.js-only or Web-only APIs. The published@clickhouse/client-commonpackage is deprecated:client-nodeandclient-webno longer depend on it and instead bundle its sources via thesrc/commonsymlink (client-node/src/commonandclient-web/src/commonboth point toclient-common/src), importing from it with relative paths (e.g../common/index).client-node(@clickhouse/client) — the Node.js client.client-web(@clickhouse/client-web) — the Web/edge client.
client-node and client-web are slated to be separated into fully independent packages. Because
of that, some logic is intentionally duplicated between the two connection implementations
(client-node/src/connection/node_base_connection.ts and
client-web/src/connection/web_connection.ts) rather than hoisted into client-common — for
example the per-request use_multipart_params resolution and the param_* multipart-part assembly
loop. Do not flag this node/web duplication as something to consolidate, and prefer keeping each
client self-contained over adding shared helpers that only exist to remove the duplication. Genuinely
platform-agnostic primitives (like buildMultipartBody) still belong in client-common.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

