This is an automated email from the ASF dual-hosted git repository. wusheng pushed a commit to branch add-claude-code-skills in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit a007a4356d5f58a3c3644bfcae6deb3fc11c21cd Author: Wu Sheng <[email protected]> AuthorDate: Tue Mar 31 10:07:48 2026 +0800 Add Claude Code skills for compiling and PR creation Add reusable skill definitions for Claude Code to help contributors compile the project and create pull requests following project conventions. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --- .claude/skills/compiling/SKILL.md | 41 ++++++++++++++ .claude/skills/gh-pull-request/SKILL.md | 98 +++++++++++++++++++++++++++++++++ .gitignore | 6 +- 3 files changed, 141 insertions(+), 4 deletions(-) diff --git a/.claude/skills/compiling/SKILL.md b/.claude/skills/compiling/SKILL.md new file mode 100644 index 000000000..04c3812dc --- /dev/null +++ b/.claude/skills/compiling/SKILL.md @@ -0,0 +1,41 @@ +--- +name: compiling +description: Compile and build the SkyWalking BanyanDB project. Use when the user asks to compile, build, or generate code for this project. +allowed-tools: Bash, Read, Grep, Glob +--- + +# Compiling SkyWalking BanyanDB + +Follow these steps to compile the project. + +## Step 1: Generate protobuf and mock code + +Run `make generate` first. This regenerates `.pb.go` files from `.proto` definitions and mock files via mockgen. + +This step is **required** whenever: +- Proto files (`.proto`) have been added or modified +- Go interfaces used by mockgen have changed + +If generate fails, check: +- `protoc` and Go protobuf plugins are installed +- Proto file syntax is valid +- Interface signatures match mock expectations + +## Step 2: Build all binaries + +Run `make build` to compile all project components: ui, banyand, bydbctl, mcp, fodc/agent, fodc/proxy. + +Binaries are output to each component's `build/bin/dev/` directory. + +## Troubleshooting + +- **Missing fields in .pb.go**: Proto files were updated but `make generate` was not run. Run it first. +- **Mock generation failures**: An interface changed but the mock wasn't regenerated. `make generate` fixes this. +- **Import errors**: Check import aliases match CLAUDE.md conventions (e.g., `commonv1`, `databasev1`). + +## Other useful targets + +- `make clean` — clean all build artifacts +- `make clean-build` — clean only build binaries +- `make lint` — run linters +- `make test` — run tests diff --git a/.claude/skills/gh-pull-request/SKILL.md b/.claude/skills/gh-pull-request/SKILL.md new file mode 100644 index 000000000..15045f3bd --- /dev/null +++ b/.claude/skills/gh-pull-request/SKILL.md @@ -0,0 +1,98 @@ +--- +name: gh-pull-request +description: Create a GitHub pull request for SkyWalking BanyanDB. Use when the user asks to create a PR, submit changes, or open a pull request. +allowed-tools: Bash, Read, Grep, Glob +--- + +# Creating a Pull Request for SkyWalking BanyanDB + +## Branch Rules + +**Always create a PR from a new branch.** Never push directly to `main`. This is the same convention as the main Apache SkyWalking repo (https://github.com/apache/skywalking). + +```bash +git checkout -b <descriptive-branch-name> +``` + +## Local Checks Before Creating PR + +Run these checks locally before pushing. They mirror the CI `check` job and PR-blocking tests in `.github/workflows/ci.yml`. + +### Required: Code Generation and Build + +```bash +make generate +make build +``` + +### Required: Linting and Formatting + +```bash +make lint +make check +``` + +`make check` verifies formatting (gofumpt), go mod tidy, and ensures no uncommitted generated file diffs. + +### Required: License Headers + +```bash +make license-check +``` + +All source files must have Apache 2.0 license headers. + +### Required: Update CHANGES.md + +Add a one-line entry under the current development version section in `CHANGES.md` (at the repo root). Place it under the appropriate subsection (`### Features`, `### Bug Fixes`, etc.). + +### Required: Run Unit Tests for Changed Packages + +Run tests for the packages you changed: + +```bash +make test PKG=./banyand/... +make test PKG=./bydbctl/... +make test PKG=./pkg/... +make test PKG=./fodc/... +``` + +### Recommended: Integration Tests + +```bash +make test PKG=./test/integration/standalone/... +make test PKG=./test/integration/distributed/... +``` + +### Optional: UI Changes + +If UI files were changed: + +```bash +cd ui && npm ci && npm run format && cd .. +``` + +### Optional: Doc Changes + +If markdown files were changed, check for dead links: + +```bash +make check-req +``` + +## Checks NOT Practical Locally + +These run in CI only — no need to run locally: +- **e2e tests** — require Docker + OAP stack (90 min timeout) +- **fodc-e2e tests** — require Kind Kubernetes cluster +- **dependency-review** — GitHub-specific action +- **slow/flaky/property-repair tests** — scheduled, not PR-blocking + +## Creating the PR + +```bash +git push -u origin <branch-name> +gh pr create --title "<title>" --body "<body>" +``` + +Follow the standard PR format with a summary and test plan. diff --git a/.gitignore b/.gitignore index e433fb61c..abd08dbe8 100644 --- a/.gitignore +++ b/.gitignore @@ -74,10 +74,8 @@ gomock_reflect* .cursorrules .cursor/ -# Claude -Claude.md -.claude/ -CLAUDE.md +# Claude Local setup. +.claude/settings.local.json # eBPF generated files and binaries fodc/agent/internal/ktm/iomonitor/ebpf/generated/vmlinux.h
