Skip to content

Commit 6af20ca

Browse files
Rename rowbinary-parser skill to a read+write codec; split docs and source by direction (#921)
The `@clickhouse/rowbinary` skill/package gained a writer (and now uses the new type parser), so it's no longer a parser-only skill. This reshapes it into a read+write **codec** and reorganizes both the source tree and the skill docs by direction. ## What changed - **Renamed the skill** `clickhouse-js-node-rowbinary-parser` → `clickhouse-js-node-rowbinary` (dir, SKILL.md frontmatter, package metadata, the two workflow files, the `release` skill, and root/skills docs). The npm package name stays `@clickhouse/rowbinary`. - **Split `src/` by direction**: readers → `src/readers/`, writers → `src/writers/`, and dropped the now-redundant `_writer` suffix (`integers_writer.ts` → `writers/integers.ts`). Subpath exports now reflect the folders (`@clickhouse/rowbinary/readers/<type>`, `/writers/<type>`); the root export and the new `./writer` barrel are unchanged. - **Split the skill doc** `SKILL.md` (which had grown large) into a lean router plus two self-contained sides — `reader.md` and `writer.md` — since a task normally needs only one direction. SKILL.md keeps the format gate, the pick-your-side router, and the cross-cutting principles; each side holds its own decisions, guidance, and per-type reference table. - **Tightened `writer.md` to the intended layering** `SKILL.md → writer.md → source file with JSDoc`: each paragraph keeps the judgment (when/why) and points at the exact `src/writers/<file>.ts`, with mechanics living in (descriptive) JSDoc. A per-paragraph verification pass corrected a few claims (Sink is caller-supplied state; hoisted offsets must sync back to `sink.pos`; all date writers floor; `DateTime64` floors on the JS ms number). ## Verification - Typecheck clean; **724/724 tests pass**; `npm run build` emits the new `dist/readers` / `dist/writers` layout and both barrels resolve. - The first commit is a **pure rename** (193 files, 0 content changes) so the relocation reviews at a glance; subsequent commits carry the content. ## Notes / follow-ups - Subpath imports are a **breaking change** for anyone importing `@clickhouse/rowbinary/<type>` (now `/readers/<type>`), but this rides along in the already-pending, unreleased `0.2.0` (npm latest is `0.1.2`) that also introduces the whole writer surface — so **no extra version bump**. - Not yet done: a CHANGELOG `0.2.0` note documenting the rename + moved subpaths. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b8c65ad commit 6af20ca

201 files changed

Lines changed: 711 additions & 557 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/release/SKILL.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ description: >
99
of the packages: `@clickhouse/client` (Node.js), `@clickhouse/client-web`
1010
(Web), `@clickhouse/client-common` (deprecated, rarely released), the
1111
standalone `@clickhouse/datatype-parser` (the type parser, under
12-
`packages/datatype-parser`), or `@clickhouse/rowbinary` (the RowBinary parser
13-
skill/package, under `skills/clickhouse-js-node-rowbinary-parser`). The agent
12+
`packages/datatype-parser`), or `@clickhouse/rowbinary` (the RowBinary codec
13+
skill/package, under `skills/clickhouse-js-node-rowbinary`). The agent
1414
drives the GitHub Actions workflows (`gh workflow run`), watches CI, pauses at
1515
the human-judgment points (PR review, the approval gate, GitHub Release text),
1616
and hands the deployment-approval link back to the human. Do NOT use this for
@@ -32,8 +32,8 @@ This skill is the source of truth for the release process. It supersedes the old
3232
- `@clickhouse/client-common`**deprecated**, effectively frozen; only cut a
3333
final standalone release if explicitly asked.
3434
- `@clickhouse/datatype-parser` — standalone type parser (`packages/datatype-parser`)
35-
- `@clickhouse/rowbinary` — standalone RowBinary parser skill/package
36-
(`skills/clickhouse-js-node-rowbinary-parser`)
35+
- `@clickhouse/rowbinary` — standalone RowBinary codec skill/package
36+
(`skills/clickhouse-js-node-rowbinary`)
3737

3838
The flow forks into two families — **workspace client packages** (client /
3939
client-web / client-common) and **standalone packages** (datatype-parser /
@@ -56,7 +56,7 @@ This skill is the source of truth for the release process. It supersedes the old
5656
> - `@clickhouse/client-web``publish-client-web.yml`
5757
> - `@clickhouse/client-common``publish-client-common.yml`
5858
> - `@clickhouse/datatype-parser``publish-datatype-parser.yml`
59-
> - `@clickhouse/rowbinary``publish-skill-rowbinary-parser.yml`
59+
> - `@clickhouse/rowbinary``publish-skill-rowbinary.yml`
6060
>
6161
> Each client workflow has two triggers: an automatic `head` publish on push to
6262
> `release` and a manual `latest` publish via `workflow_dispatch`. The standalone
@@ -233,13 +233,13 @@ beta** for them.
233233
Edit the version in the package's `package.json` (these have **no** `src/version.ts`):
234234

235235
- `@clickhouse/datatype-parser``packages/datatype-parser/package.json`
236-
- `@clickhouse/rowbinary``skills/clickhouse-js-node-rowbinary-parser/package.json`
236+
- `@clickhouse/rowbinary``skills/clickhouse-js-node-rowbinary/package.json`
237237

238238
Do this in a normal PR to `main`, together with the relevant entry in **that
239239
package's own** `CHANGELOG.md` (verify the changelog as in Part A, Step 1):
240240

241241
- `@clickhouse/datatype-parser``packages/datatype-parser/CHANGELOG.md`
242-
- `@clickhouse/rowbinary``skills/clickhouse-js-node-rowbinary-parser/CHANGELOG.md`
242+
- `@clickhouse/rowbinary``skills/clickhouse-js-node-rowbinary/CHANGELOG.md`
243243

244244
Merge it.
245245

@@ -257,8 +257,8 @@ Dispatch the package's own publish workflow from the `release` branch. These tak
257257
```bash
258258
# type parser:
259259
gh workflow run publish-datatype-parser.yml --ref release
260-
# rowbinary parser skill/package:
261-
gh workflow run publish-skill-rowbinary-parser.yml --ref release
260+
# rowbinary codec skill/package:
261+
gh workflow run publish-skill-rowbinary.yml --ref release
262262
```
263263

264264
Each workflow builds, packs + smoke-tests the tarball, publishes it to `latest`
@@ -280,7 +280,7 @@ gh run watch <run-id>
280280
Same as Part A, Step 6, using the standalone tag (`datatype-parser-v<ver>` /
281281
`rowbinary-v<ver>`) and the notes from that package's own `CHANGELOG.md`
282282
(`packages/datatype-parser/CHANGELOG.md` or
283-
`skills/clickhouse-js-node-rowbinary-parser/CHANGELOG.md`). No `--title`, no
283+
`skills/clickhouse-js-node-rowbinary/CHANGELOG.md`). No `--title`, no
284284
`--prerelease`. Backfill any missing releases.
285285

286286
---
@@ -300,7 +300,7 @@ Same as Part A, Step 6, using the standalone tag (`datatype-parser-v<ver>` /
300300

301301
1. Bump version in the package's `package.json` + its own `CHANGELOG.md` via a PR to `main` → merge.
302302
2. `gh pr create --base release --head main` → review → merge.
303-
3. `gh workflow run publish-datatype-parser.yml --ref release` (or `publish-skill-rowbinary-parser.yml`) → **approve**, watch.
303+
3. `gh workflow run publish-datatype-parser.yml --ref release` (or `publish-skill-rowbinary.yml`) → **approve**, watch.
304304
4. `gh release create <…-v…-tag> --notes-file <changelog-section>`; backfill.
305305

306306
**Always:** per package · each package has its **own** `CHANGELOG.md` (root is frozen) · `release` is protected (fix via `main`) · every publish needs `npm-publish` approval · `head` betas are untracked · GitHub Release notes come from the package's `CHANGELOG.md` with no explicit `--title`.

.github/workflows/publish-skill-rowbinary-parser.yml renamed to .github/workflows/publish-skill-rowbinary.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: "publish: rowbinary parser"
1+
name: "publish: rowbinary"
22

33
# Independent publish + release for the standalone @clickhouse/rowbinary
4-
# package (the RowBinary parser skill). Like the per-package client publish
4+
# package (the RowBinary codec skill). Like the per-package client publish
55
# workflows (publish-client*.yml), it carries its own version in
6-
# skills/clickhouse-js-node-rowbinary-parser/package.json and ships on its own
6+
# skills/clickhouse-js-node-rowbinary/package.json and ships on its own
77
# cadence. Triggered manually, and — like those workflows — must be dispatched from
88
# the `release` branch: the npm-publish environment is protected so only that
99
# branch may deploy (the repo's human-in-the-loop release gate). Dispatches from
@@ -49,7 +49,7 @@ jobs:
4949
id-token: write # Required for npm OIDC authentication and provenance
5050
defaults:
5151
run:
52-
working-directory: skills/clickhouse-js-node-rowbinary-parser
52+
working-directory: skills/clickhouse-js-node-rowbinary
5353
outputs:
5454
version: ${{ steps.version.outputs.version }}
5555
steps:
@@ -97,7 +97,7 @@ jobs:
9797
# expose their parsers, from the exact artifact we are about to publish.
9898
node --input-type=module -e "
9999
import * as rb from '@clickhouse/rowbinary';
100-
import * as ints from '@clickhouse/rowbinary/integers';
100+
import * as ints from '@clickhouse/rowbinary/readers/integers';
101101
if (typeof rb.readRows !== 'function') throw new Error('readRows missing from main export');
102102
if (typeof ints.readUInt8 !== 'function') throw new Error('readUInt8 missing from subpath export');
103103
console.log('OK: packed tarball imports cleanly');
@@ -181,7 +181,7 @@ jobs:
181181
# expose their parsers to a downstream consumer.
182182
node --input-type=module -e "
183183
import * as rb from '@clickhouse/rowbinary';
184-
import * as ints from '@clickhouse/rowbinary/integers';
184+
import * as ints from '@clickhouse/rowbinary/readers/integers';
185185
if (typeof rb.readRows !== 'function') throw new Error('readRows missing from main export');
186186
if (typeof ints.readUInt8 !== 'function') throw new Error('readUInt8 missing from subpath export');
187187
console.log('OK: @clickhouse/rowbinary@${PUBLISHED_VERSION} imports cleanly');

.github/workflows/tests-skill-rowbinary-parser.yml renamed to .github/workflows/tests-skill-rowbinary.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "skill: rowbinary parser"
1+
name: "skill: rowbinary"
22

33
permissions: {}
44
on:
@@ -7,15 +7,15 @@ on:
77
branches:
88
- main
99
paths:
10-
- .github/workflows/tests-skill-rowbinary-parser.yml
11-
- skills/clickhouse-js-node-rowbinary-parser/**
10+
- .github/workflows/tests-skill-rowbinary.yml
11+
- skills/clickhouse-js-node-rowbinary/**
1212
# The skill depends on @clickhouse/datatype-parser; rerun against local
1313
# parser changes so a parser regression cannot pass this suite unnoticed.
1414
- packages/datatype-parser/**
1515
pull_request:
1616
paths:
17-
- .github/workflows/tests-skill-rowbinary-parser.yml
18-
- skills/clickhouse-js-node-rowbinary-parser/**
17+
- .github/workflows/tests-skill-rowbinary.yml
18+
- skills/clickhouse-js-node-rowbinary/**
1919
- packages/datatype-parser/**
2020

2121
concurrency:
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ubuntu-latest
3737
defaults:
3838
run:
39-
working-directory: skills/clickhouse-js-node-rowbinary-parser
39+
working-directory: skills/clickhouse-js-node-rowbinary
4040
steps:
4141
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4242

@@ -69,7 +69,7 @@ jobs:
6969
runs-on: ubuntu-latest
7070
defaults:
7171
run:
72-
working-directory: skills/clickhouse-js-node-rowbinary-parser
72+
working-directory: skills/clickhouse-js-node-rowbinary
7373
strategy:
7474
fail-fast: false
7575
matrix:

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This root file holds repo-wide guidance. Folder-specific guidance lives in neste
77
- [`packages/AGENTS.md`](packages/AGENTS.md) — client source packages: log-message conventions, package structure, and intentional node/web duplication.
88
- [`examples/AGENTS.md`](examples/AGENTS.md) — the example corpus layout and conventions.
99
- [`skills/AGENTS.md`](skills/AGENTS.md) — shipped agent skills and how they are declared.
10-
- [`skills/clickhouse-js-node-rowbinary-parser/AGENTS.md`](skills/clickhouse-js-node-rowbinary-parser/AGENTS.md)`@clickhouse/rowbinary` reader/writer conventions (tests, no defensive validation).
10+
- [`skills/clickhouse-js-node-rowbinary/AGENTS.md`](skills/clickhouse-js-node-rowbinary/AGENTS.md)`@clickhouse/rowbinary` reader/writer conventions (tests, no defensive validation).
1111
- [`docs/AGENTS.md`](docs/AGENTS.md) — embedded troubleshooting / how-to pages.
1212
- [`tests/clickhouse-test-runner/AGENTS.md`](tests/clickhouse-test-runner/AGENTS.md) — the upstream SQL test harness and allowlist strategy.
1313

@@ -34,7 +34,7 @@ For every pull request review, make sure to provide an evaluation of the followi
3434
- `@clickhouse/client-web`[`packages/client-web/CHANGELOG.md`](packages/client-web/CHANGELOG.md)
3535
- `@clickhouse/client-common` (deprecated) → [`packages/client-common/CHANGELOG.md`](packages/client-common/CHANGELOG.md)
3636
- `@clickhouse/datatype-parser`[`packages/datatype-parser/CHANGELOG.md`](packages/datatype-parser/CHANGELOG.md)
37-
- `@clickhouse/rowbinary`[`skills/clickhouse-js-node-rowbinary-parser/CHANGELOG.md`](skills/clickhouse-js-node-rowbinary-parser/CHANGELOG.md)
37+
- `@clickhouse/rowbinary`[`skills/clickhouse-js-node-rowbinary/CHANGELOG.md`](skills/clickhouse-js-node-rowbinary/CHANGELOG.md)
3838

3939
A change to shared code that is bundled into both clients (the common module) affects **both** `@clickhouse/client` and `@clickhouse/client-web`, so update both of their changelogs. Follow the existing format exactly:
4040
- Entries go under the **top-most version heading** of that package's changelog. If the most recent `# x.y.z` heading corresponds to an **already-released** version (check `git tag`), open a **new** top-level `# x.y.z` heading that matches the unreleased version in that package's `package.json`; otherwise append to the existing top heading.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Each package keeps its own changelog:
118118
- `@clickhouse/client-web`[`packages/client-web/CHANGELOG.md`](./packages/client-web/CHANGELOG.md)
119119
- `@clickhouse/client-common` (deprecated) — [`packages/client-common/CHANGELOG.md`](./packages/client-common/CHANGELOG.md)
120120
- `@clickhouse/datatype-parser`[`packages/datatype-parser/CHANGELOG.md`](./packages/datatype-parser/CHANGELOG.md)
121-
- `@clickhouse/rowbinary`[`skills/clickhouse-js-node-rowbinary-parser/CHANGELOG.md`](./skills/clickhouse-js-node-rowbinary-parser/CHANGELOG.md)
121+
- `@clickhouse/rowbinary`[`skills/clickhouse-js-node-rowbinary/CHANGELOG.md`](./skills/clickhouse-js-node-rowbinary/CHANGELOG.md)
122122

123123
History through `@clickhouse/client` 1.23.0 lives in the now-frozen repository-wide [`CHANGELOG.md`](./CHANGELOG.md).
124124

packages/client-node/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
"path": "./skills/clickhouse-js-node-troubleshooting"
3636
},
3737
{
38-
"name": "clickhouse-js-node-rowbinary-parser",
39-
"path": "./skills/clickhouse-js-node-rowbinary-parser"
38+
"name": "clickhouse-js-node-rowbinary",
39+
"path": "./skills/clickhouse-js-node-rowbinary"
4040
}
4141
]
4242
},
4343
"scripts": {
4444
"pack": "npm pack",
45-
"prepack": "rm -rf skills && cp ../../README.md ../../LICENSE . && cp -r ../../skills . && RBP=skills/clickhouse-js-node-rowbinary-parser && rm -rf $RBP/tests $RBP/node_modules $RBP/dist $RBP/package.json $RBP/package-lock.json $RBP/tsconfig.json $RBP/tsconfig.build.json $RBP/vitest.config.ts $RBP/.gitignore $RBP/LICENSE $RBP/eval_result*.md",
45+
"prepack": "rm -rf skills && cp ../../README.md ../../LICENSE . && cp -r ../../skills . && RBP=skills/clickhouse-js-node-rowbinary && rm -rf $RBP/tests $RBP/node_modules $RBP/dist $RBP/package.json $RBP/package-lock.json $RBP/tsconfig.json $RBP/tsconfig.build.json $RBP/vitest.config.ts $RBP/.gitignore $RBP/LICENSE $RBP/eval_result*.md",
4646
"typecheck": "tsc --noEmit",
4747
"lint": "eslint --max-warnings=0 .",
4848
"lint:fix": "eslint . --fix",

skills/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Recommendations for AI agents — `skills/`
22

3-
Guidance for the shipped agent skills. See the [repo-root `AGENTS.md`](../AGENTS.md) for cross-cutting guidance. The `@clickhouse/rowbinary` skill has its own [`clickhouse-js-node-rowbinary-parser/AGENTS.md`](clickhouse-js-node-rowbinary-parser/AGENTS.md).
3+
Guidance for the shipped agent skills. See the [repo-root `AGENTS.md`](../AGENTS.md) for cross-cutting guidance. The `@clickhouse/rowbinary` skill has its own [`clickhouse-js-node-rowbinary/AGENTS.md`](clickhouse-js-node-rowbinary/AGENTS.md).
44

55
- Each shipped skill must also be listed in the `agents.skills` array of
66
[`packages/client-node/package.json`](../packages/client-node/package.json) so downstream tooling can
File renamed without changes.

skills/clickhouse-js-node-rowbinary-parser/AGENTS.md renamed to skills/clickhouse-js-node-rowbinary/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Recommendations for AI agents — `@clickhouse/rowbinary`
22

3-
Guidance for the [`clickhouse-js-node-rowbinary-parser`](.) package (the RowBinary parser library and agent skill). See the [repo-root `AGENTS.md`](../../AGENTS.md) for cross-cutting guidance.
3+
Guidance for the [`clickhouse-js-node-rowbinary`](.) package (the RowBinary codec library and agent skill). See the [repo-root `AGENTS.md`](../../AGENTS.md) for cross-cutting guidance.
44

55
This package has a symmetric reader/writer codebase.
66

File renamed without changes.

0 commit comments

Comments
 (0)