Conversation
Implement centralized rule management for AI coding assistants using Rulesync. This establishes a single source of truth for code style guidelines across multiple AI development tools. Changes include: - Set up Rulesync with 5 rule categories (code style, formatting, Maven standards, Vector API, and PR guidelines) - Generate configurations for Claude Code, Cursor, and Copilot - Add comprehensive documentation for rule management This enables consistent AI assistance across the development team and reduces maintenance overhead by managing rules in one location (.rulesync/rules/).
|
This PR should be reviewed by |
|
Agreed @ebyhr .. in fact I believe we might want to even get this right separately in multiple phases and figure out how to sync it. A lot of this arguably belongs into airlift first and foremost and then into some sort of centralized setup for all trinodb project (which could be the airlift base and more). Also there are a LOT of rules already to start with .. how did you generate those? As a result the airlift contributors and all Trino maintainers should be potentially involved. Maybe we need to discuss this more in the maintainer channel or on a contributor call. |
Oh i tagged him because because we were talking in slack about it. Yes we have to talk, this is simply a draft to see and discuss |
I got help from cursor to create the rules, with the information provided from 3 sources |
Description
This PR implements a centralized rule management system for AI coding assistants using Rulesync. It establishes a Single Source of Truth (SSOT) for code style guidelines that automatically generates configurations for multiple AI development tools (Claude Code, Cursor, and GitHub Copilot).
Key changes:
Rulesync setup - Created
.rulesync/rules/directory with 5 rule categories:trino-code-style.md- Core Java coding standards (naming, collections, error handling)airlift-formatting.md- Code formatting based on Airlift template (imports, braces, spacing)trino-maven.md- Maven and pom.xml standardstrino-vector-api.md- Java Vector API (JEP 508) implementation guidelinespull-request-guidelines.md- PR and commit message best practicesGenerated configurations - Rulesync automatically generates tool-specific files:
.claude/rules/*.mdfor Claude Code.cursor/rules/*.mdcfor Cursor IDE.github/instructions/*.mdfor GitHub CopilotDocumentation - Added
docs/ai-agent-rules.mdwith:mkdocs.ymlto include the new documentation pageBenefits:
Additional context and related issues
Source for Rules
I refered to Trino's guide on code style, pull-request-and-commit-guidelines
Why Rulesync?
Previously, maintaining separate rule files for different AI tools (.cursorrules, CLAUDE.md, etc.) led to duplication and inconsistency. Rulesync solves this by:
.rulesync/rules/Rule sources:
The rules are based on official Trino project guidelines:
Installation requirement:
Contributors and maintainers who want to update rules will need to install Rulesync:
npm install -g rulesync
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required, with the following suggested text:
* Fix some things.