docs(examples): improve AI-agent consumability of coding/ examples#701
Conversation
Agent-Logs-Url: https://github.com/ClickHouse/clickhouse-js/sessions/0ae7e4c8-4ad0-4fa2-8957-490fd70c0d40 Co-authored-by: peter-leonov-ch <209667683+peter-leonov-ch@users.noreply.github.com>
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@copilot resolve the merge conflicts in this pull request |
Merged |
There was a problem hiding this comment.
Pull request overview
This PR improves the top-of-file documentation headers across the Node and Web coding examples so each script is easier to discover, understand, and adapt (including by AI-agent skill retrieval), without changing runtime behavior.
Changes:
- Added/expanded concise “what this demonstrates / when to use it” headers across
examples/node/codingandexamples/web/coding. - Replaced the bare “taken from issue link” header in
insert_from_select.ts(and its duplicate inexamples/node/performance/) with a descriptive explanation of theINSERT … SELECT+AggregateFunctionpattern. - Removed a misleading cross-platform note from the Web-only
async_insert.tsheader.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| examples/web/coding/session_id_and_temporary_tables.ts | Adds a clearer header explaining session_id usage and notes the Web-specific UUID source. |
| examples/web/coding/select_json_with_metadata.ts | Refines the JSDoc to explain the JSON envelope and when to use ResponseJSON<Row>. |
| examples/web/coding/select_json_each_row.ts | Updates JSDoc to mention rows.json<T>() and references streaming examples. |
| examples/web/coding/insert_into_different_db.ts | Adds a header explaining fully-qualified database.table usage with a non-default client DB. |
| examples/web/coding/insert_from_select.ts | Replaces the issue-only header with a description of the INSERT ... SELECT + aggregate-state pattern. |
| examples/web/coding/insert_decimals.ts | Adds guidance on string-based decimal IO and toString usage to avoid precision loss. |
| examples/web/coding/default_format_setting.ts | Adds a header explaining default_format usage with client.exec and ResultSet. |
| examples/web/coding/async_insert.ts | Removes a misleading statement about working with both Node and Web clients from a Web example. |
| examples/web/coding/array_json_each_row.ts | Adds a header describing JSONEachRow insert/select with arrays of objects. |
| examples/node/performance/insert_from_select.ts | Syncs the improved descriptive header for the aggregate-state INSERT ... SELECT example. |
| examples/node/coding/session_id_and_temporary_tables.ts | Adds a clearer header explaining session_id for temporary tables + load balancer caveats. |
| examples/node/coding/select_json_with_metadata.ts | Refines the JSDoc to explain the JSON envelope and when to use ResponseJSON<Row>. |
| examples/node/coding/select_json_each_row.ts | Updates JSDoc to mention rows.json<T>() and points to the node streaming example. |
| examples/node/coding/insert_into_different_db.ts | Adds a header explaining fully-qualified database.table usage with a non-default client DB. |
| examples/node/coding/insert_from_select.ts | Replaces the issue-only header with a description of the INSERT ... SELECT + aggregate-state pattern. |
| examples/node/coding/insert_decimals.ts | Adds guidance on string-based decimal IO and toString usage to avoid precision loss. |
| examples/node/coding/default_format_setting.ts | Adds a header explaining default_format usage with client.exec and ResultSet. |
| examples/node/coding/array_json_each_row.ts | Adds a header describing JSONEachRow insert/select with arrays of objects. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/ClickHouse/clickhouse-js/sessions/5e005788-6a73-482a-ace1-fe0cbf78b314 Co-authored-by: peter-leonov-ch <209667683+peter-leonov-ch@users.noreply.github.com>
|
@copilot apply PR review comments. |
…t_json_each_row Agent-Logs-Url: https://github.com/ClickHouse/clickhouse-js/sessions/3539fc35-272d-4316-8e2c-817f1a3f2e56 Co-authored-by: peter-leonov-ch <209667683+peter-leonov-ch@users.noreply.github.com>
Addressed the reviewer's note on |
…mance Agent-Logs-Url: https://github.com/ClickHouse/clickhouse-js/sessions/855ff54d-26dd-4819-a9f0-19c2ab1712f0 Co-authored-by: peter-leonov-ch <209667683+peter-leonov-ch@users.noreply.github.com>
`AGENTS.md` had drifted from reality after PRs #662–#712: it claimed `examples/web` has no `performance/` folder, pointed at a placeholder docs path, and said nothing about the `skills/` directory or the `.claude/skills/setup/` skill that replaced `copilot-setup-steps.yml`. ## Summary - **Examples › `performance/`** — drop the "no `performance/` folder under `examples/web`" claim; #701 added one for browser-safe streaming. - **Log-message docs guidance** — point at the real `docs/` layout from #677 (`docs/socket_hang_up_econnreset.md`, `docs/howto/`) instead of a fictional `docs/example-log-message.md`. The example URL in the snippet now also resolves to a real page (`docs/socket_hang_up_econnreset.md`). - **New `Skills` section** — documents the repo-root `skills/` directory (#681, #682, #702): `client-node`'s `prepack` ships it via `@clickhouse/client`, the `agents.skills` field of `packages/client-node/package.json` declares which skills are discoverable, and the `Skills E2E` workflow (`.github/workflows/e2e-skills.yml`, backed by `tests/e2e/skills/check.js`) asserts the packaged tarball contains the declared skills. Routes contributors to `.claude/skills/setup/SKILL.md` (#705) instead of re-introducing `copilot-setup-steps.yml`. - **`agents.skills` manifest** — adds `clickhouse-js-node-coding` alongside `clickhouse-js-node-troubleshooting` so both shipped skills are discoverable to downstream tooling. `tests/e2e/skills/check.js` is extended to verify both skills land in the packaged `@clickhouse/client` tarball. - **New `Embedded docs` section** — surfaces `docs/` as the preferred home for pages linked from log messages. - **CHANGELOG guidance** — aligns with the PR template: entry goes in the PR description and is folded into `CHANGELOG.md` at release time. Documentation refresh plus a small manifest/test change to make the second shipped skill discoverable. ## Checklist - [x] A human-readable description of the changes was provided to include in CHANGELOG --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: peter-leonov-ch <209667683+peter-leonov-ch@users.noreply.github.com> Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com>
examples/web/performance/and portednode/performance/select_streaming_json_each_row.tsasweb/performance/select_streaming_json_each_row.tsusing the WebResultSet.stream()(ReadableStream<Row[]>) consumed viagetReader()(no Node-only APIs)web/coding/select_json_each_row.tsto point at the new web streaming example instead of the Node oneexamples/README.md: addedweb/performance/to the directory tree, reworded the "no web performance folder" note, and added a Web column to theperformance/table with the new entrynpm run typecheckandnpm run lintpass cleanly inexamples/web