agentleFS
ClickHouseClickHouse/clickhouse-js/examples/AGENTS.md

clickhouse-js / examples

AGENTS.md331 starsChanged 33 days agoApache-2.0View on GitHub

Guidance for the example corpus. See the repo-root AGENTS.md for cross-cutting guidance. The examples directory is being refactored to be AI-agent-friendly. The goals of the refactor are: 1. Examples should be runnable right away, with no manual edits required to get them working against a local ClickHouse instance (use docker-compose up from the repo root for the default setup). 2. Examples are organized by client flavor and tailored to the corresponding runtime: - examples/node — examples for the Node.js client…

The file

Files
AGENTS.md

Recommendations for AI agents — examples/

Guidance for the example corpus. See the repo-root AGENTS.md for cross-cutting guidance.

The examples directory is being refactored to be AI-agent-friendly. The goals of the refactor are:

  1. Examples should be runnable right away, with no manual edits required to get them working against a local ClickHouse instance (use docker-compose up from the repo root for the default setup).
  2. Examples are organized by client flavor and tailored to the corresponding runtime:
    • examples/node — examples for the Node.js client (@clickhouse/client). These may freely use Node.js-only APIs (file streams, TLS, http, node:* built-ins, etc.) and import Node built-ins using the node: prefix (e.g., node:fs, node:path, node:stream).
    • examples/web — examples for the Web client (@clickhouse/client-web). These must only use Web-platform APIs (e.g., globalThis.crypto.randomUUID() instead of Node's crypto module) and must not depend on Node.js-only modules.
  3. examples/node and examples/web are independent npm packages, each with its own package.json, tsconfig.json, and ESLint config. Keep dependencies and configuration scoped to the relevant subpackage.
  4. General-purpose scenarios (configuration, ping, inserts, selects, parameters, sessions, etc.) should exist in both subdirectories where applicable, with the only differences being the import statement and any platform-specific adjustments. Examples that rely on Node.js-only APIs live only under examples/node.
  5. Within each subpackage, examples are split into intent-driven use-case folders so each folder can back a focused AI agent skill:
    • coding/ — day-to-day client API usage (configure, ping, basic insert/select, parameter binding, sessions, data types, custom JSON).
    • performance/ — async inserts, streaming with backpressure, file/Parquet streams, progress streaming, server-side bulk moves. Mostly Node-only; examples/web/performance/ exists for the few perf scenarios that work in the browser (e.g. streaming JSONEachRow).
    • troubleshooting/ — cancellation, timeouts, long-running query progress, server error surfaces, number-precision pitfalls.
    • security/ — TLS, RBAC, SQL-injection-safe parameter binding.
    • schema-and-deployments/ — CREATE TABLE examples for each deployment shape and deployment-shaped connection strings.
  6. A small number of examples are intentionally duplicated across folders so each folder is a self-contained skill corpus. Each duplicated example has one primary location; the secondary copies are excluded from the Vitest runner via the per-package vitest.config.ts. When you edit a duplicated example, update all copies. The current duplicates and their primary locations are listed in examples/README.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.