Skip to content

Add agent skills + fix missed Spark writeFormat impl#11

Merged
richardwooding merged 1 commit into
mainfrom
feat/agent-skills
Apr 27, 2026
Merged

Add agent skills + fix missed Spark writeFormat impl#11
richardwooding merged 1 commit into
mainfrom
feat/agent-skills

Conversation

@richardwooding
Copy link
Copy Markdown
Contributor

Summary

Adds three repo-local agent skills that codify the multi-file workflows we've been hand-cranking on every recent feature. Authored against the existing skill-authoring skill (also committed here — it had been staged on main but never committed) and lint-clean.

Skills

Skill When it triggers
add-cel-function Adding a CEL function (trim, format, getMonth, etc.) — touches Converter constants/dispatch, Dialect interface, all 6 dialect impls, tests.
add-sql-dialect Adding a new dialect (CockroachDB, Snowflake, Redshift, etc.) — scaffold script, ~35-method checklist, test-file inventory, README/CLAUDE.md table updates.
port-from-upstream Syncing from github.com/spandigital/cel2sql — script that auto-detects the last port commit and lists candidates, Go-to-Java idiom mapping, two-PR shape guidance.

Each SKILL.md is well under the 200-line target (88 / 113 / 94) and passes python3 .claude/skills/skill-authoring/scripts/lint_skill.py with no errors or warnings. Two helper scripts ship alongside:

  • add-sql-dialect/scripts/scaffold_dialect.sh <template> <new-name> <NewClassPrefix> — copies an existing dialect package and renames via sed. Safe by default (refuses to overwrite, validates template exists, derives repo root by walking up).
  • port-from-upstream/scripts/list_upstream_changes.sh [<since-sha>] — lists upstream tags + commits, auto-detecting the last port via the cel2sql4j commit log.

Bug fix discovered while validating

Building the skills branch surfaced a real bug on main: PR #10 (Spark dialect) merged on top of PR #9 without rebasing, so SparkDialect is missing the writeFormat method that PR #9 added to the Dialect interface. main currently doesn't compile. This PR adds the missing method using Spark's format_string() (its printf-equivalent: supports %s/%d/%f directly, like SQLite/DuckDB) and adds a Spark case to Cel2SqlOptionsTest.formatTests.

This is a minor scope expansion but the right call — the skills PR can't pass CI on a broken main either, and the fix is tiny.

Test plan

  • All 392 unit tests pass (./gradlew test)
  • ./gradlew build clean
  • All four skills lint-clean (lint_skill.py exits 0)
  • scaffold_dialect.sh smoke-tested (refuses to run without args, errors clearly on missing template)
  • list_upstream_changes.sh smoke-tested (auto-detects ef505ab from PR Add Apache Spark SQL dialect #10's commit message; lists candidate commits since)
  • CI green on this branch
  • Integration tests pass on CI

🤖 Generated with Claude Code

Three new project-local skills under .claude/skills/, each authored against
the existing skill-authoring conventions and passing the lint script:

- add-cel-function: walks adding a new CEL function to all 6 dialects
  (constant + dispatch + Dialect interface method + 6 impls + tests).
  Includes references/sql-writer-pattern.md and references/conversion-exception.md.
- add-sql-dialect: walks adding a new SQL dialect (e.g. CockroachDB,
  Snowflake). Includes a scaffold_dialect.sh script that copies an
  existing dialect package and renames classes via sed, plus references/
  dialect-method-checklist.md and references/test-files.md.
- port-from-upstream: walks porting from the Go upstream cel2sql repo.
  Includes a list_upstream_changes.sh script that auto-detects the last
  port commit on cel2sql4j and lists candidate upstream commits, plus
  references/go-to-java-idioms.md and references/two-pr-shape.md.

Also includes the previously-uncommitted skill-authoring skill that was
staged on main (the foundation these new skills are authored against).

While running the build-verification step on this PR, discovered that
SparkDialect (PR #10) was merged on top of PR #9 without rebasing and
silently lost the writeFormat method that PR #9 added to the Dialect
interface — main currently does not compile. Fixed in this PR by
adding SparkDialect.writeFormat using Spark's format_string() function
(its printf-equivalent), and added a Spark case to Cel2SqlOptionsTest's
formatTests.

All 392 unit tests pass; ./gradlew build clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@richardwooding richardwooding merged commit 5e8eaa6 into main Apr 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant