Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Enable Bzlmod for every Bazel command
common --enable_bzlmod

build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17

test --test_output=errors
56 changes: 56 additions & 0 deletions .github/workflows/go-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CEL Skills Go Update & Test

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- copybara-sync
push:
branches:
- main

jobs:
go-update-and-test:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout PR Branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.25.0'

- name: Install Protoc & protoc-gen-go
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

- name: Regenerate Protobuf Go Code
run: |
protoc --go_out=. --go_opt=paths=source_relative internal/proto/test_schema.proto

- name: Run go mod tidy
run: go mod tidy

- name: Run go test
run: go test ./...

- name: Commit updated files if changed
run: |
if ! git diff --quiet go.mod go.sum internal/proto/test_schema.pb.go; then
git config user.name "copybara-service[bot]"
git config user.email "copybara-service[bot]@users.noreply.github.com"
git add go.mod go.sum internal/proto/test_schema.pb.go
git commit -m "chore(go): regenerate test_schema.pb.go and tidy go.mod/go.sum"
git push
else
echo "All generated files are up to date."
fi
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bazel-bin/
bazel-out/
bazel-skills/
bazel-testlogs/
60 changes: 60 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Common Expression Language (CEL) Skills

This repository provides tools and skills to author, test, and debug Common
Expression Language (CEL) expressions.

## Project Structure & Architecture

- `cmd/mcp`: Entry point for the Model Context Protocol (MCP) server
(`cel-expr-mcp`).
- `internal/tools`: Internal implementation for environment loading,
compilation, evaluation, and prompt generation.
- `skills/`: Agent skills directory containing guidelines and workflows:
- `cel-authoring`: Authoring, configuring, and testing expressions and
JSON environment definitions.
- `cel-debugging`: Diagnosing and resolving compilation and evaluation
errors.

## Build and Test Commands

### Go CLI

- **Build MCP server**: `go build ./cmd/mcp`
- **Run tests**: `go test ./...`
- **Run MCP server**: `go run ./cmd/mcp`

### Bazel

- **Build all targets**: `bazel build //...`
- **Run all tests**: `bazel test //...`

## Provided Tools

The `cel-expr-mcp` MCP server provides the following tools for AI agents:

- `cel_create_environment`: Defines the variables, functions, and types for a
CEL expression environment.
- `cel_generate_prompt`: Generates an authoring prompt for a CEL expression
based on the configuration and requirement.
- `cel_compile`: Compiles a CEL expression to validate syntax, correctness,
and type checking against an environment definition.
- `cel_evaluate`: Evaluates a compiled expression against provided test cases.

### Startup Flags

The server accepts startup flags to tailor the tool experience:

- `-environment` (alias `-env`): Path to a JSON file or JSON string containing
the CEL environment configuration.
- `-file_descriptor_set` (alias `-file_descriptors`): Path to a binary
`FileDescriptorSet` file containing protobuf definitions referenced as types
within an environment.

## Available Skills

To understand how to best use these tools, refer to the skills in `skills/`:

- `cel-authoring`: Guidelines for creating CEL environment configurations,
generating expressions, and compiling.
- `cel-debugging`: Diagnostic steps for troubleshooting syntax, type, and
evaluation errors.
17 changes: 12 additions & 5 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
# Google Common Expression Language (CEL) Extension
# Common Expression Language (CEL) Skills

This extension provides the Gemini CLI with tools and skills to author, test,
and debug CEL expressions.
This repository provides tools and skills to author and debug CEL expressions.

## Provided Tools

The `cel` MCP server provides the following tools:
The `cel-expr-mcp` MCP server provides the following tools:

- `cel_create_environment`: Defines the the variables, functions, types for an
- `cel_create_environment`: Defines the variables, functions, types for an
expression.
- `cel_generate_prompt`: Generates an authoring prompt for an expression based
on the configuration and requirement.
- `cel_compile`: Compiles a CEL expression to validate syntax, correctness, and
type checking against an environment definition.
- `cel_evaluate`: Evaluates a compiled expression against provided test cases.

The server accepts startup flags to tailor the tool experience:

- `-environment` (alias `-env`): Path to a JSON file or JSON string containing
the CEL environment configuration.
- `-file_descriptor_set` (alias `-file_descriptors`): Path to a binary
`FileDescriptorSet` file containing protobuf definitions referenced as types
within an environment.

## Available Skills

To understand how to best use these tools, please refer to the `cel_authoring`
Expand Down
6 changes: 6 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ go_deps.gazelle_default_attributes(
],
)
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_google_cel_go",
"com_github_modelcontextprotocol_go_sdk",
"org_golang_google_protobuf",
)
158 changes: 53 additions & 105 deletions internal/proto/test_schema.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading