diff --git a/.agents/skills/ship-it/SKILL.md b/.agents/skills/ship-it/SKILL.md new file mode 100644 index 0000000..fa80e2b --- /dev/null +++ b/.agents/skills/ship-it/SKILL.md @@ -0,0 +1,31 @@ +--- +name: ship-it +description: "Creates a GitHub PR using jj and gh. Use when asked to ship, create a PR, or push changes." +--- + +# Ship It + +Reviews and ships the current changes as a GitHub PR. + +## Workflow + +1. Gather context: + - Run `jj status` to see current status + - Run `jj diff -f main` to see the diff from main + - Run `jj log -r main::` to see commits from main + +2. **Review the changes** before proceeding: + - Code quality and best practices + - Potential bugs or issues + - Performance considerations + - Memory safety (leaks, double-frees, proper use of `errdefer`) + - Test coverage + + Use the repository's AGENTS.md for guidance on style and conventions. If you find any issues, stop and report them to the user instead of creating the PR. + +3. Add commit description if empty with an appropriate commit message using `jj describe -m "Commit description"` +4. Create a new empty change using `jj new` +5. Push the change to upstream using `jj git push -c @-` +6. Get the autogenerated bookmark name (should be something like `push-*`) using `jj bookmark list -r 'main+::'` +7. Create a PR using the GitHub CLI (`gh pr create`) +8. Enable auto-merge with `gh pr merge --auto --squash` diff --git a/.claude/commands/create-pr.md b/.claude/commands/create-pr.md deleted file mode 100644 index e902131..0000000 --- a/.claude/commands/create-pr.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -allowed-tools: Bash(gh pr create:*), Bash(jj:*) -description: Create a GitHub PR using jj and gh ---- - -## Context - -- Current status: !`jj status` -- Current diff from `main`: !`jj diff -f main` -- Current commits from `main`: !`jj log -r main::` - -## Your task - -Based on the above changes: - -1. **Review the changes** before proceeding: - - Code quality and best practices - - Potential bugs or issues - - Performance considerations - - Memory safety (leaks, double-frees, proper use of `errdefer`) - - Test coverage - - Use the repository's AGENTS.md for guidance on style and conventions. If you find any issues, stop and report them to the user instead of creating the PR. - -2. Add commit description if empty with appropriate commit message using `jj describe -m "Commit description"` -3. Create a new empty change using `jj new` -4. Push the change to upstream using `jj git push -c @-` -5. Get autogenerated bookmark name (should be something like `push-*`) using `jj bookmark list -r 'main+::'` -6. Create a PR using the GitHub CLI -7. Enable auto-merge with `gh pr merge --auto --squash` diff --git a/.claude/settings.json b/.claude/settings.json deleted file mode 100644 index 7f45fcc..0000000 --- a/.claude/settings.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "hooks": { - "SessionStart": [ - { - "matcher": "startup", - "hooks": [ - { - "type": "command", - "command": "\"$CLAUDE_PROJECT_DIR\"/scripts/install_pkgs_on_remote.sh" - } - ] - } - ] - } -} diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 120000 index 47dc3e3..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -AGENTS.md \ No newline at end of file diff --git a/README.md b/README.md index e6bb3a9..e7125e7 100644 --- a/README.md +++ b/README.md @@ -107,3 +107,53 @@ Supported logical types: - **Temporal**: `Date`, `TimeMillis`, `TimeMicros`, `TimeNanos`, `TimestampMillis`, `TimestampMicros`, `TimestampNanos` - **Numeric**: `Int8`, `UInt8`, `Int16`, `UInt16`, `UInt32`, `UInt64`, `Float16`, `Decimal` - **Other**: `UUID`, `String`, `Enum`, `Json`, `Bson` + +### Schema Inspection + +After reading a file, you can inspect its schema through `file.metadata.schema`, which is an array of `SchemaElement` entries. The first element is always the root; the rest describe individual fields. + +**Listing all fields and their types:** +```zig +for (file.metadata.schema[1..]) |elem| { + std.debug.print("name={s} type={any} repetition={any} logical={any}\n", .{ + elem.name, + elem.type, + elem.repetition_type, + elem.logicalType, + }); +} +``` + +Each `SchemaElement` exposes: +- `name` — field name +- `type` — physical type (`BOOLEAN`, `INT32`, `INT64`, `INT96`, `FLOAT`, `DOUBLE`, `BYTE_ARRAY`, `FIXED_LEN_BYTE_ARRAY`) +- `repetition_type` — `REQUIRED`, `OPTIONAL`, or `REPEATED` +- `logicalType` — logical type (`STRING`, `DATE`, `TIMESTAMP`, `DECIMAL`, `UUID`, `MAP`, `LIST`, etc.) +- `converted_type` — legacy converted type +- `num_children` — non-null for group (struct/nested) elements +- `type_length` — byte width for `FIXED_LEN_BYTE_ARRAY` +- `scale` / `precision` — for decimal types + +**Looking up a column by name:** +```zig +const info = file.findSchemaElement(&.{"fare_amount"}).?; +// info.column_index — index to pass to readColumn / readColumnDynamic +// info.max_definition_level — for nullable columns +// info.max_repetition_level — for repeated (list) columns +// info.elem — the SchemaElement with full type info +``` + +For nested schemas, pass the full path: +```zig +const nested = file.findSchemaElement(&.{ "address", "city" }).?; +``` + +**File-level metadata** is also available: +```zig +std.debug.print("version: {d}\n", .{file.metadata.version}); +std.debug.print("num_rows: {d}\n", .{file.metadata.num_rows}); +std.debug.print("row_groups: {d}\n", .{file.metadata.row_groups.len}); +if (file.metadata.created_by) |created_by| { + std.debug.print("created_by: {s}\n", .{created_by}); +} +```