Skip to content

Add AI agent rules using Rulesync#930

Draft
Chaho12 wants to merge 1 commit intotrinodb:mainfrom
Chaho12:feature/jyoo/add-agent-rules
Draft

Add AI agent rules using Rulesync#930
Chaho12 wants to merge 1 commit intotrinodb:mainfrom
Chaho12:feature/jyoo/add-agent-rules

Conversation

@Chaho12
Copy link
Member

@Chaho12 Chaho12 commented Feb 19, 2026

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:

  1. 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 standards
    • trino-vector-api.md - Java Vector API (JEP 508) implementation guidelines
    • pull-request-guidelines.md - PR and commit message best practices
  2. Generated configurations - Rulesync automatically generates tool-specific files:

    • .claude/rules/*.md for Claude Code
    • .cursor/rules/*.mdc for Cursor IDE
    • .github/instructions/*.md for GitHub Copilot
  3. Documentation - Added docs/ai-agent-rules.md with:

    • Architecture overview and SSOT approach
    • Detailed description of each rule category
    • Instructions for managing and updating rules
    • Best practices and troubleshooting guide
    • Updated mkdocs.yml to include the new documentation page

Benefits:

  • Ensures consistent AI assistance across the development team
  • Reduces maintenance overhead by managing rules in one location
  • Easy to add support for new AI tools without duplicating rules
  • Clear guidelines for both developers and AI assistants

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:

  • Providing a single source of truth in .rulesync/rules/
  • Automatically generating tool-specific formats
  • Supporting 15+ AI development tools

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.

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/).
@Chaho12 Chaho12 requested a review from mosabua February 19, 2026 06:05
@ebyhr ebyhr requested review from a team and removed request for mosabua February 19, 2026 06:08
@ebyhr
Copy link
Member

ebyhr commented Feb 19, 2026

This PR should be reviewed by @trinodb/maintainers-gateway (not only @mosabua). Please don't merge this PR prematurely.

@mosabua
Copy link
Member

mosabua commented Feb 19, 2026

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.

@Chaho12
Copy link
Member Author

Chaho12 commented Feb 19, 2026

This PR should be reviewed by @trinodb/maintainers-gateway (not only @mosabua). Please don't merge this PR prematurely.

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

@Chaho12
Copy link
Member Author

Chaho12 commented Feb 19, 2026

Also there are a LOT of rules already to start with .. how did you generate those?

I got help from cursor to create the rules, with the information provided from 3 sources

@Chaho12 Chaho12 marked this pull request as draft February 19, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments