Skip to content

Conversation

@tomerdbz
Copy link
Collaborator

@tomerdbz tomerdbz commented Sep 18, 2025

Description

Introduce comprehensive development tooling infrastructure to
standardize and streamline development workflows across the
libxlio codebase.

Cursor Rules for Development Workflows:

  • commit-msg: Generate well-formatted commit messages
  • performance-issue: Investigate performance bottlenecks
  • solve-bug: Structured bug resolution workflow
  • test-plan: Comprehensive test plan generation
  • review-commit: Code review guidelines for commits
  • review-pr: Pull request review standards
  • research-functionality: Code exploration and documentation

Project-Specific Guidelines:

  • coding.mdc: C++ standards for performance-critical code
    (naming conventions, pointer usage, cache alignment)
  • testing.mdc: Google Test patterns and fork-based testing
    (ti_N/tu_N naming, LD_PRELOAD requirements)

Greptile Integration:

  • greptile.json: AI-powered code review automation
    (custom rules for core/tests/config, performance checks)

These rules leverage MCP tools (Redmine, Confluence, GitHub)
for context-aware assistance and integrate with existing
project documentation (coding-style.md, style.conf).

Benefits:

  • Standardized commit messages and documentation
  • Automated code quality checks via Greptile
  • Structured workflows for common development tasks
  • Better onboarding for new contributors
  • Context-aware AI assistance through Cursor rules
Why ?

Accelerate devs with Cursor.

How ?

It is optional but for complex PRs please provide information about the design,
architecture, approach, etc.

Change type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Tests
  • Other

Check list

  • Code follows the style de facto guidelines of this project
  • Comments have been inserted in hard to understand places
  • Documentation has been updated (if necessary)
  • Test has been added (if possible)

@tomerdbz tomerdbz requested review from Copilot and galnoam September 18, 2025 10:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive .cursorrules file to provide Cursor IDE with deep context about libxlio's architecture, development patterns, and workflows. The goal is to accelerate team development by giving the AI assistant detailed knowledge of the project's structure, coding conventions, and common development tasks.

  • Adds detailed architecture documentation covering socket interception, memory management, and hardware abstraction layers
  • Provides comprehensive development workflow guidance including testing, debugging, and performance profiling
  • Includes practical troubleshooting guides and common development task examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tomerdbz
Copy link
Collaborator Author

bot:retest

@BasharRadya
Copy link
Collaborator

Maybe add known issues?

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@tomerdbz
Copy link
Collaborator Author

bot:retest

1 similar comment
@tomerdbz
Copy link
Collaborator Author

bot:retest

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR introduces comprehensive AI-assisted development tooling for libxlio by adding Cursor IDE rule files and Greptile configuration. The three new .cursor/rules/*.mdc files (coding, testing, architecture) encode domain-specific knowledge about libxlio's performance-critical networking stack, RDMA/InfiniBand concepts, and testing patterns. The greptile.json configuration ties these together with scoped rules for different code areas. These documentation files integrate with Cursor IDE and Greptile to provide context-aware guidance when developers edit source files, aiming to accelerate onboarding by making tribal knowledge about socket interception, memory pools, fork-based testing, and hardware abstraction immediately accessible. The changes are purely documentation/tooling configuration with no runtime impact on libxlio itself.

Important Files Changed

Filename Score Overview
.cursor/rules/architecture.mdc 5/5 Comprehensive architecture documentation covering RDMA/InfiniBand concepts, execution modes, memory management, and hardware abstraction
.cursor/rules/testing.mdc 4/5 Google Test guidelines with fork-based patterns, LD_PRELOAD dual-mode testing, and critical exit() requirement for child processes
.cursor/rules/coding.mdc 4/5 C++ coding standards with naming conventions, cache alignment strategies, and performance-critical patterns; contains contradiction about visibility modifiers
greptile.json 4/5 Greptile AI review configuration with scoped rules and file references; ignorePatterns may exclude itself, hardcoded branch name needs maintenance

Confidence score: 4/5

  • This PR is safe to merge as it only adds documentation and tooling configuration files without modifying production code or build system.
  • Score lowered from 5 because: (1) coding.mdc line 148 contradicts the example code by stating visibility modifiers don't need repetition while the example shows repeated modifiers at lines 154/158/161/164/167/170, (2) greptile.json ignorePatterns includes "*.json" which may cause self-exclusion from reviews, (3) hardcoded branch name "4480494_cursorrules" in includeBranches requires manual maintenance, and (4) testing.mdc and coding.mdc could benefit from consistency review (e.g., "200 instructions" class size metric is ambiguous).
  • Pay close attention to .cursor/rules/coding.mdc for the visibility modifier contradiction (lines 145-188) and consider whether the glob patterns in all three rule files correctly target intended code areas.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Cursor as Cursor IDE
    participant Rules as .cursor/rules/*.mdc
    participant Greptile as Greptile Config
    participant CI as CI/CD Pipeline

    Dev->>Cursor: "Edit libxlio code"
    Cursor->>Rules: "Load coding.mdc, testing.mdc, architecture.mdc"
    Rules-->>Cursor: "Apply development context & standards"
    
    Dev->>Cursor: "Request code assistance"
    Cursor->>Rules: "Check applicable rules (glob patterns)"
    Rules-->>Cursor: "Return relevant guidelines"
    Cursor-->>Dev: "Provide context-aware suggestions"
    
    Dev->>Dev: "Commit changes to branch"
    Dev->>CI: "Create PR to merge branch"
    
    CI->>Greptile: "Trigger AI code review"
    Greptile->>Rules: "Read customContext rules & files"
    Rules-->>Greptile: "Provide coding standards & architecture context"
    Greptile->>Greptile: "Analyze code changes"
    Greptile->>Greptile: "Apply scope-specific rules"
    Greptile-->>CI: "Generate review comments"
    CI-->>Dev: "Post review feedback on PR"
    
    Dev->>Dev: "Address review feedback"
    Dev->>CI: "Push updates"
    CI->>Greptile: "Re-review changes"
    Greptile-->>CI: "Approve or request more changes"
Loading

4 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR introduces a comprehensive suite of Cursor IDE rule files (.cursor/rules/*.mdc) and a Greptile configuration (greptile.json) to standardize development practices and accelerate onboarding for the libxlio project. The eleven new rule files cover the complete development lifecycle: coding standards (coding.mdc), testing patterns (testing.mdc), commit formatting (commit-msg.mdc), code review workflows (review-commit.mdc, review-pr.mdc), bug investigation (solve-bug.mdc), performance debugging (performance-issue.mdc), feature design (feature-design.mdc, feature-architecture.mdc), functionality research (research-functionality.mdc), and test planning (test-plan.mdc). These files codify tribal knowledge specific to XLIO's high-performance, kernel-bypass architecture—including RDMA/InfiniBand patterns, memory pool management, fork-based testing requirements, and performance optimization strategies. The greptile.json configuration enables AI-assisted code review by mapping these rules to specific file scopes. All changes are documentation-only with no runtime code impact.

Important Files Changed

Filename Score Overview
.cursor/rules/coding.mdc 4/5 Comprehensive C++ coding standards with XLIO-specific naming conventions (m_/s_/g_ prefixes), performance patterns, and class layout rules; minor inconsistency in field grouping examples
.cursor/rules/testing.mdc 4/5 Google Test guidelines documenting critical fork-based testing patterns and LD_PRELOAD modes; contains contradiction between optional vs mandatory @details documentation
.cursor/rules/review-commit.mdc 5/5 Complete commit review guideline consolidating XLIO architecture, coding style, and review priorities for AI-assisted reviews
.cursor/rules/review-pr.mdc 5/5 Comprehensive PR review checklist covering performance, thread safety, hardware offload, and POSIX compatibility for kernel-bypass library
.cursor/rules/commit-msg.mdc 3/5 Commit message template following libxlio conventions; contains git command instructions that Cursor AI cannot execute at runtime
.cursor/rules/solve-bug.mdc 4/5 Structured bug investigation workflow referencing Redmine MCP functions; "stop and ask" instruction not enforceable in Cursor rules
.cursor/rules/feature-design.mdc 5/5 Feature design document template with architecture, performance, and security sections; contains minor typo ('escribe')
.cursor/rules/feature-architecture.mdc 4/5 Architecture documentation template for new features; contains multiple typos and formatting issues requiring correction
.cursor/rules/research-functionality.mdc 5/5 Systematic 6-step methodology for code research using Confluence integration and mermaid.js diagrams; documentation-only change
.cursor/rules/performance-issue.mdc 4/5 Extensive 774-line performance debugging workflow with XLIO-specific profiling guidance; depends on external Redmine MCP and codebase_search tool availability
.cursor/rules/test-plan.mdc 5/5 Comprehensive test plan template bridging Confluence documentation with XLIO's multi-layered test infrastructure
greptile.json 3/5 AI code review configuration with context-aware rules; *.json exclusion prevents review of critical config files in src/core/config/

Confidence score: 4/5

  • This PR is safe to merge with low risk—all changes are documentation/tooling configuration with no runtime code modifications
  • Score reflects excellent consolidation of tribal knowledge and comprehensive coverage, with minor deductions for: (1) commit-msg.mdc containing unexecutable git commands, (2) greptile.json ignoring *.json files which excludes important config schema files, (3) several typos and documentation inconsistencies across templates, (4) dependencies on external MCP integrations that may not be universally available
  • Pay close attention to greptile.json ignore patterns (excludes important JSON config files), coding.mdc field grouping examples (inconsistent with stated rules), and testing.mdc documentation requirements (contradictory @details guidance)

Sequence Diagram

sequenceDiagram
    participant Developer
    participant Cursor IDE
    participant RuleFiles as .cursor/rules/*
    participant Codebase as libxlio Source
    
    Developer->>Cursor IDE: Open libxlio project
    Cursor IDE->>RuleFiles: Load rule files
    RuleFiles-->>Cursor IDE: coding.mdc (C++ standards)
    RuleFiles-->>Cursor IDE: testing.mdc (test guidelines)
    RuleFiles-->>Cursor IDE: commit-msg.mdc (commit format)
    RuleFiles-->>Cursor IDE: Other workflow rules
    
    Developer->>Cursor IDE: Request code assistance
    Cursor IDE->>RuleFiles: Check applicable rules (glob patterns)
    RuleFiles-->>Cursor IDE: Return matching rules
    Cursor IDE->>Codebase: Analyze code context
    Codebase-->>Cursor IDE: Code structure & patterns
    
    Cursor IDE->>Developer: Provide context-aware suggestions
    Note over Cursor IDE,Developer: Suggestions follow libxlio<br/>standards automatically
    
    Developer->>Cursor IDE: Write code/tests
    Cursor IDE->>RuleFiles: Validate against rules
    RuleFiles-->>Cursor IDE: Coding standards (m_ prefix, etc.)
    RuleFiles-->>Cursor IDE: Performance guidelines
    RuleFiles-->>Cursor IDE: Testing patterns
    
    Cursor IDE->>Developer: Real-time feedback
    
    Developer->>Cursor IDE: Request commit message
    Cursor IDE->>RuleFiles: Load commit-msg.mdc
    RuleFiles-->>Cursor IDE: Template format
    Cursor IDE->>Developer: Generate formatted commit
    Note over Developer: issue: XXXX <title><br/>Signed-off-by: ...
Loading

12 files reviewed, 9 comments

Edit Code Review Agent Settings | Greptile

@tomerdbz tomerdbz changed the title issue: 4480494 .cursorrules with dev context issue: 4480494 Add GenAI dev tooling Oct 27, 2025
@tomerdbz tomerdbz force-pushed the 4480494_cursorrule branch 3 times, most recently from 921300c to 18e56d3 Compare October 27, 2025 12:59
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR introduces a comprehensive GenAI development tooling infrastructure for libxlio, adding nine Cursor AI rules (.mdc files in .cursor/rules/) and a Greptile configuration (greptile.json). The rules provide structured workflows for common development tasks: commit message generation (commit-msg.mdc), performance debugging (performance-issue.mdc), bug resolution (solve-bug.mdc), test plan creation (test-plan.mdc), and code exploration (research-functionality.mdc). Project-specific guidelines are defined for C++ coding standards (coding.mdc) and Google Test patterns (testing.mdc), while review-commit.mdc and review-pr.mdc establish code review standards. The Greptile configuration automates code quality checks with custom rules for performance-critical paths and testing patterns, referencing existing documentation (docs/coding-style.md, docs/contributing.md). All rules integrate with MCP tools (Redmine, Confluence, GitHub) to provide context-aware AI assistance, though several rules reference non-existent MCP functions or assume shell execution capabilities that Cursor AI lacks.


Important Files Changed

Filename Score Overview
.cursor/rules/commit-msg.mdc 2/5 Adds commit message generation workflow with git command prerequisites that AI cannot execute
greptile.json 3/5 Configures AI code review automation with custom rules; references missing .cursor/rules/architecture.mdc
.cursor/rules/testing.mdc 4/5 Comprehensive Google Test guidelines covering fork-based tests, naming conventions, and LD_PRELOAD modes
.cursor/rules/solve-bug.mdc 4/5 Structured 5-phase bug-fixing workflow with Redmine integration via MCP tools
.cursor/rules/review-commit.mdc 0/5 File appears empty or content not provided in the diff
.cursor/rules/test-plan.mdc 4/5 Detailed test plan template referencing project infrastructure; contains incorrect Confluence MCP function name
.cursor/rules/review-pr.mdc 4/5 Comprehensive PR review guidelines for XLIO-specific patterns; duplicates some docs/coding-style.md content
.cursor/rules/coding.mdc 4/5 Performance-focused C++ style guide with naming conventions and cache-alignment rules
.cursor/rules/performance-issue.mdc 2/5 Performance investigation workflow with non-existent MCP function calls and shell commands AI cannot execute
.cursor/rules/research-functionality.mdc 4.5/5 Systematic code research workflow with Confluence integration; well-structured and safe

Confidence score: 2/5

  • This PR introduces valuable development tooling but contains critical implementation issues that will cause runtime failures when developers attempt to use several of the rules.
  • Score reduced because: (1) multiple rules reference non-existent MCP functions (yai__get_tickets, yai__get_comments, confluence_get_page) that will fail when invoked, (2) commit-msg.mdc and performance-issue.mdc assume AI can execute shell commands (git diff --staged, perf record, sudo strace) which is architecturally impossible for Cursor AI, (3) greptile.json references missing .cursor/rules/architecture.mdc file that will break architectural validation rules, and (4) review-commit.mdc appears to have no content in the diff.
  • Pay close attention to .cursor/rules/commit-msg.mdc, .cursor/rules/performance-issue.mdc, and greptile.json. Verify that the MCP function names match your actual MCP server implementation, add the missing architecture.mdc file, and replace shell execution prerequisites with user prompts to paste command output.

10 files reviewed, 15 comments

Edit Code Review Agent Settings | Greptile

{
"comment": "AI-generated code review for libxlio - High-performance network acceleration library",
"commentTypes": ["logic", "syntax", "style"],
"instructions": "This is a performance-critical C++11 networking library with kernel-bypass architecture. Review code with focus on: performance optimizations (cache alignment, zero-copy, memory pools), thread safety, memory management (avoid allocations in hot paths), adherence to coding style guidelines in docs/coding-style.md, proper testing patterns per .cursor/rules/testing.mdc, and architectural patterns per .cursor/rules/architecture.mdc. Pay special attention to data path operations, InfiniBand/RDMA integration, and socket interception mechanisms. Ensure compliance with C++11 standards, proper use of const/constexpr, and RAII principles.",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: references .cursor/rules/architecture.mdc but this file doesn't exist in the repository. Only coding.mdc, commit-msg.mdc, performance-issue.mdc, research-functionality.mdc, review-commit.mdc, review-pr.mdc, solve-bug.mdc, test-plan.mdc, and testing.mdc are present.

},
{
"scope": ["src/core/sock/*.h", "src/core/dev/*.h", "src/core/event/*.h"],
"rule": "Core architecture components. Verify: proper socket abstraction hierarchy (sockinfo base class), event-driven patterns, ring buffer implementations, hardware abstraction for InfiniBand verbs, proper inheritance and virtual method usage, adherence to architectural patterns described in .cursor/rules/architecture.mdc."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: references .cursor/rules/architecture.mdc again, but this file is missing from the PR and repository. Should this be research-functionality.mdc or another existing rule file?

- **Lock Granularity**: Check for appropriate lock scope (not too coarse, not too fine)
- **Deadlock Prevention**: Verify lock ordering, avoid nested locks when possible
- **Lock Types**: Spinlocks for short critical sections, mutexes for longer ones
- Configured via `performance.threading.mutex_over_spinlock`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: configuration parameter name should be wrapped in backticks: performance.threading.mutex_over_spinlock

- Reference counting correctness
- Buffer leaks detection
- **Memory Descriptors**: Proper allocation, usage, and return to pools
- **Memory Limits**: Respect configured limits (`core.resources.memory_limit`)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: configuration parameter name should be wrapped in backticks: core.resources.memory_limit

### 5. **Error Handling & Robustness**

- **Error Propagation**: Proper error codes returned to applications
- **Exception Handling Mode**: Respect `core.exception_handling.mode` settings
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: configuration parameter name should be wrapped in backticks: core.exception_handling.mode

## Prerequisites Check

Before starting, verify all requirements:
1. **Redmine MCP**: Stop and ask user to install if unavailable
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Redmine MCP tool availability should be verified using available tool invocation rather than requesting user installation. Should the rule attempt to validate MCP tool availability programmatically before asking the user?

## Phase 1: Problem Understanding & Data Gathering

### 1.1 Ticket Analysis
Fetch ticket using `yai__get_tickets` and extract:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: function yai__get_tickets is not defined in available tools; this will fail when rule is executed

- Consistency of reproduction

### 1.2 Related Context
- Review all ticket comments using `yai__get_comments`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: function yai__get_comments is not defined in available tools

### 1.2 Related Context
- Review all ticket comments using `yai__get_comments`
- Check attachments: logs, perf reports, flamegraphs, tcpdump
- Search similar issues using `yai__get_similar_issues`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: function yai__get_similar_issues is not defined in available tools

- **Control plane**: If connection setup is slow
- **Memory management**: If memory-related

Use `codebase_search` to locate:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: function codebase_search is not defined in available tools; should use get_file or web_search instead

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR introduces a comprehensive GenAI-powered development tooling infrastructure for the libxlio project. It adds nine Cursor rule files (.cursor/rules/*.mdc) that define structured workflows for common development tasks: commit message generation (commit-msg.mdc), code review at commit and PR level (review-commit.mdc, review-pr.mdc), performance investigation (performance-issue.mdc), bug resolution (solve-bug.mdc), test planning (test-plan.mdc), code exploration (research-functionality.mdc), C++ coding standards (coding.mdc), and Google Test patterns (testing.mdc). The rules are designed to provide context-aware AI assistance by referencing existing project documentation (docs/coding-style.md, contrib/jenkins_tests/style.conf) and leveraging MCP tool integration for Redmine, Confluence, and GitHub. Additionally, the PR adds greptile.json to enable automated AI code review with custom rules for core performance paths, test code, and configuration system. The tooling aims to standardize commit messages, enforce coding conventions, improve onboarding, and provide structured guidance for complex development workflows in this performance-critical kernel-bypass networking library.

Important Files Changed

Filename Score Overview
.cursor/rules/review-pr.mdc 5/5 Comprehensive PR review guideline for AI assistants; defines XLIO-specific review priorities (performance, thread safety, hardware offload) with checklists and examples
.cursor/rules/review-commit.mdc 5/5 Structured commit review rule with extensive XLIO architecture context, 12 critical review areas, and file-type-specific focus guidance
.cursor/rules/research-functionality.mdc 4/5 Six-step workflow for code research with mermaid visualization; references unavailable tools (semantic search, incorrect Confluence tool names)
greptile.json 3/5 AI code review configuration with custom rules per directory; references non-existent .cursor/rules/architecture.mdc file that will cause failures
.cursor/rules/solve-bug.mdc 4/5 Five-phase bug resolution workflow; references undefined Redmine MCP functions (yai__get_tickets, yai__get_comments, yai__get_similar_issues)
.cursor/rules/commit-msg.mdc 3/5 Commit message generation template; incorrectly assumes AI can execute git commands (git diff --staged, git config)
.cursor/rules/test-plan.mdc 4/5 Comprehensive test plan template with appendices showing gtest patterns; incorrect Confluence tool name and malformed gtest filter syntax in examples
.cursor/rules/testing.mdc 4/5 Google Test guidelines with fork-based testing patterns; contains contradiction about mandatory vs optional @details documentation tags
.cursor/rules/performance-issue.mdc 2/5 Seven-phase performance debugging workflow; references multiple undefined tools (yai__get_tickets, codebase_search) that will fail at runtime
.cursor/rules/coding.mdc 3/5 C++ coding standards for libxlio; class layout example contradicts stated guideline, inconsistent pointer/reference spacing rules

Confidence score: 3/5

  • This PR introduces valuable development tooling but contains multiple implementation issues that prevent the rules from executing as designed.
  • Score reflects three categories of problems: (1) broken tool references – multiple rules call undefined MCP functions (yai__get_tickets, yai__get_comments, yai__get_similar_issues, codebase_search) that will cause runtime failures; (2) impossible operations – commit-msg.mdc assumes AI can execute shell commands (git diff, git config) which Cursor cannot do; (3) missing dependencies – greptile.json references non-existent architecture.mdc file (lines 4, 52). Additionally, internal documentation inconsistencies exist (testing.mdc contradicts itself on @details requirement, coding.mdc class layout example conflicts with its own guideline).
  • Pay close attention to performance-issue.mdc (references four undefined tools), commit-msg.mdc (git execution assumptions), greptile.json (missing architecture.mdc file), and solve-bug.mdc (three undefined Redmine functions). The documentation files (review-pr.mdc, review-commit.mdc, coding.mdc, testing.mdc) are safer but need consistency fixes before becoming authoritative references.

Sequence Diagram

sequenceDiagram
    participant User
    participant Cursor
    participant RulesEngine
    participant MCPTools
    participant Repository

    User->>Cursor: "Write commit message"
    Cursor->>RulesEngine: Load commit-msg.mdc
    RulesEngine->>Repository: git diff --staged
    Repository-->>RulesEngine: Changed files
    RulesEngine->>Repository: git config user.name, user.email
    Repository-->>RulesEngine: User details
    RulesEngine->>Cursor: Generate formatted commit message
    Cursor-->>User: Commit message with issue ID and sign-off

    User->>Cursor: "Review this PR"
    Cursor->>RulesEngine: Load review-pr.mdc
    RulesEngine->>MCPTools: Fetch PR details (GitHub MCP)
    MCPTools-->>RulesEngine: PR metadata, files changed, comments
    RulesEngine->>Repository: Analyze changed files
    Repository-->>RulesEngine: File contents
    RulesEngine->>Cursor: Generate review with priorities
    Cursor-->>User: Code review (CRITICAL/IMPORTANT/MINOR issues)

    User->>Cursor: "Fix bug in ticket 12345"
    Cursor->>RulesEngine: Load solve-bug.mdc
    RulesEngine->>MCPTools: yai__get_tickets(12345)
    MCPTools-->>RulesEngine: Ticket details
    RulesEngine->>MCPTools: yai__get_comments(12345)
    MCPTools-->>RulesEngine: Comments and attachments
    RulesEngine->>Repository: Search codebase for affected code
    Repository-->>RulesEngine: Relevant files
    RulesEngine->>Cursor: Generate bug fix plan with solutions
    Cursor-->>User: Root cause analysis and recommended fix

    User->>Cursor: "Investigate performance issue"
    Cursor->>RulesEngine: Load performance-issue.mdc
    RulesEngine->>MCPTools: Fetch Redmine ticket
    MCPTools-->>RulesEngine: Performance metrics
    RulesEngine->>MCPTools: Request PRM document
    MCPTools-->>RulesEngine: Hardware specifications
    RulesEngine->>Repository: Check xlio_config_schema.json
    Repository-->>RulesEngine: Configuration options
    RulesEngine->>Cursor: Generate investigation plan
    Cursor-->>User: Configuration analysis + code analysis plan

    User->>Cursor: "Create test plan for feature"
    Cursor->>RulesEngine: Load test-plan.mdc
    RulesEngine->>MCPTools: confluence_search for design docs
    MCPTools-->>RulesEngine: Confluence pages
    RulesEngine->>Repository: Analyze test infrastructure
    Repository-->>RulesEngine: Existing test patterns
    RulesEngine->>Cursor: Generate comprehensive test plan
    Cursor-->>User: Test cases with gtest/unit/python tests

    User->>Cursor: "Remember to use snake_case"
    Cursor->>RulesEngine: Trigger create_rule
    RulesEngine->>Repository: Store rule in .cursor/rules/coding.mdc
    Repository-->>RulesEngine: Rule saved
    RulesEngine-->>User: Rule dashboard URL
Loading

10 files reviewed, 9 comments

Edit Code Review Agent Settings | Greptile

Follow a systematic approach to research the functionality:

### 1. Initial Context Gathering
- **If Confluence MCP is available**: Search Confluence for design docs, architecture docs, and any existing documentation about the functionality
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: instruction references Confluence MCP but confluence_search and confluence_read_page are the actual available tools; MCP terminology may confuse AI assistants. Should the instruction reference confluence_search and confluence_read_page tools directly, or does 'Confluence MCP' refer to an organizational-specific integration layer?

Comment on lines 16 to 23
1. Fetch the full ticket using `yai__get_tickets` with ticket ID
2. Extract key information:
- Bug description and reproduction steps
- Affected versions, components, priority
- Reporter and any assignees
- Attachments (logs, screenshots, stack traces)
3. Review all comments using `yai__get_comments`
4. Search for similar/related issues using `yai__get_similar_issues`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: references MCP functions yai__get_tickets, yai__get_comments, and yai__get_similar_issues which are not available in Cursor's tool suite; these calls will fail when the rule is executed. Should this rule document a manual workflow where users paste Redmine ticket information, or does a working Redmine MCP integration exist in your Cursor environment?

Comment on lines 26 to 28
1. Locate affected code components (use semantic search and grep)
2. Trace the execution path from entry point to bug location
3. Review recent changes to affected files (git history)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: instructions assume AI can execute git commands (git history) but Cursor AI cannot run shell commands; users must provide this information or the rule should prompt users to paste git log output

Build a comprehensive plan to fix the given Redmine ticket by following a structured investigation and analysis process.

## Prerequisites
**Stop and ask user to install Redmine MCP if unavailable.**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: prerequisite check cannot be automated since AI has no mechanism to verify MCP availability; consider phrasing as "Ensure Redmine MCP is installed" or prompt user to confirm

- Use values from git config (never hardcode)

## Error Handling
- If Redmine issue ID is missing: Check branch name first (e.g., "bugfix/12345-description"), then ask user
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: branch name parsing logic (e.g., 'bugfix/12345-description') is not specified; AI may struggle with variations like '12345_description', 'feature-12345', etc. Should the rule document supported branch naming patterns or provide a regex for issue ID extraction?

| CI-002 | Basic IPv6 | Default | `GTEST_TAP=2 LD_PRELOAD=libxlio.so` | `--gtest_filter=-xlio_*` | All tests pass |
| CI-003 | Delegated TCP Timers IPv4 | Delegated | `XLIO_RX_POLL_ON_TX_TCP=1 XLIO_TCP_ABORT_ON_CLOSE=1 XLIO_TCP_CTL_THREAD=delegate` | `--gtest_filter=-xlio_*` | All tests pass |
| CI-004 | Delegated TCP Timers IPv6 | Delegated | Same as CI-003 | `--gtest_filter=-xlio_*` | All tests pass |
| CI-005 | EXTRA API IPv4 | EXTRA API enabled | Build with `-DEXTRA_API_ENABLED=1` | `--gtest_filter=xlio_*:-socketxtreme_poll.*:socketxtreme_ring.*:xlio_send_zc.*` | All tests pass |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: gtest filter syntax error: should be --gtest_filter='xlio_*:-socketxtreme_poll.*:-socketxtreme_ring.*:-xlio_send_zc.*' (colons separate exclusion patterns, not additional colons within the pattern). Should the filter exclude all three test categories (socketxtreme_poll, socketxtreme_ring, xlio_send_zc) or only specific tests within those categories?

tests/gtest/gtest \
--addr=192.168.1.1,192.168.1.2 \
-r <gateway_ip> \
--gtest_filter=xlio_*:-socketxtreme_poll.*:socketxtreme_ring.*:xlio_send_zc.*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: same gtest filter syntax issue as line 223- colons should separate patterns: --gtest_filter='xlio_*:-socketxtreme_poll.*:-socketxtreme_ring.*:-xlio_send_zc.*'

tests/gtest/gtest \
--addr=<ipv6_addr1>,<ipv6_addr2> \
-r fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff \
--gtest_filter=xlio_*:-socketxtreme_poll.*:socketxtreme_ring.*:xlio_send_zc.*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: duplicate of filter syntax issue at line 648

Comment on lines +185 to +197
```bash
# Record CPU samples for the workload
sudo perf record -F 99 -a -g -- <your_test_command>

# Or attach to running process
sudo perf record -F 99 -g -p <pid> -- sleep 30

# Generate report
perf report --stdio

# For flamegraph (requires flamegraph.pl)
perf script | stackcollapse-perf.pl | flamegraph.pl > flamegraph.svg
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: code blocks include placeholder <your_test_command> which may confuse users; consider adding a concrete XLIO-specific example like sockperf server -i <ip> or referencing test suite

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR introduces comprehensive AI-assisted development tooling infrastructure for libxlio, including 10 Cursor rules (.mdc files) and Greptile configuration for automated code review.

Key additions:

  • Cursor rules for structured workflows: commit messages, bug evaluation/solving, performance analysis, test planning, code review
  • Project-specific guidelines: C++ coding standards (coding.mdc), Google Test patterns (testing.mdc)
  • Greptile integration: Custom review rules for performance-critical code, thread safety, and testing patterns

Critical issue found:

  • greptile.json references non-existent .cursor/rules/architecture.mdc file (line 52) - this will cause Greptile to fail when applying review rules

Minor issues:

  • test-plan.mdc uses incorrect tool name confluence_get_page instead of confluence_read_page

Benefits:

  • Standardizes development workflows (commit messages, bug fixing, performance investigation)
  • Provides context-aware AI assistance with MCP tool integrations (Redmine, Confluence, GitHub)
  • Automates code quality checks through Greptile
  • Improves onboarding with documented patterns and examples

Confidence Score: 3/5

  • Safe to merge after fixing the broken architecture.mdc reference in greptile.json
  • Score reflects that this is pure documentation/tooling infrastructure (no production code changes), but contains a critical broken reference that will cause Greptile to malfunction. The architecture.mdc file is referenced but doesn't exist, which will cause the review automation to fail when trying to apply rules.
  • greptile.json (line 52) - must fix broken reference to non-existent architecture.mdc before merge

Important Files Changed

File Analysis

Filename Score Overview
greptile.json 3/5 Configuration file with broken references to non-existent architecture.mdc file in multiple rules
.cursor/rules/test-plan.mdc 4/5 Comprehensive test plan template with incorrect tool reference (confluence_get_page should be confluence_read_page)

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Cursor as Cursor IDE
    participant Rules as Cursor Rules
    participant MCP as MCP Tools
    participant Greptile as Greptile AI
    participant Repo as Repository

    Note over Dev,Repo: Development Workflow Setup

    Dev->>Repo: Clone libxlio repository
    Repo-->>Dev: Repository with .cursor/rules/
    
    Note over Dev,Cursor: Using Cursor Rules for Development
    
    Dev->>Cursor: Write code changes
    Dev->>Cursor: Invoke @commit-msg
    Cursor->>Rules: Load commit-msg.mdc
    Rules->>MCP: git diff --staged
    Rules->>MCP: Extract Redmine issue ID
    Rules-->>Cursor: Generate formatted commit
    Cursor-->>Dev: Present commit message
    
    Dev->>Cursor: Investigate bug @evaluate-bug
    Cursor->>Rules: Load evaluate-bug.mdc
    Rules->>MCP: yai__get_tickets (Redmine)
    Rules->>MCP: yai__get_comments (Redmine)
    Rules->>Repo: Search codebase
    Rules-->>Cursor: Root cause analysis
    Cursor-->>Dev: Bug evaluation report
    
    Dev->>Cursor: Create test plan @test-plan
    Cursor->>Rules: Load test-plan.mdc
    Rules->>MCP: confluence_search
    Rules->>MCP: confluence_read_page
    Rules->>Repo: Analyze test infrastructure
    Rules-->>Cursor: Comprehensive test plan
    Cursor-->>Dev: Test plan document
    
    Note over Dev,Repo: Code Review Automation
    
    Dev->>Repo: Create Pull Request
    Repo->>Greptile: Trigger automated review
    Greptile->>Repo: Read greptile.json config
    Greptile->>Repo: Apply custom rules (performance, thread safety)
    Greptile->>Repo: Reference .cursor/rules/testing.mdc
    Greptile->>Repo: Check docs/coding-style.md compliance
    Greptile-->>Repo: Post review comments
    Repo-->>Dev: Review feedback
Loading

11 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

},
{
"scope": ["src/core/sock/*.h", "src/core/dev/*.h", "src/core/event/*.h"],
"rule": "Core architecture components. Verify: proper socket abstraction hierarchy (sockinfo base class), event-driven patterns, ring buffer implementations, hardware abstraction for InfiniBand verbs, proper inheritance and virtual method usage, adherence to architectural patterns described in .cursor/rules/architecture.mdc."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: references non-existent .cursor/rules/architecture.mdc - this file doesn't exist in the PR. Available files are: coding.mdc, commit-msg.mdc, evaluate-bug.mdc, performance-issue.mdc, research-functionality.mdc, review-commit.mdc, review-pr.mdc, solve-bug.mdc, test-plan.mdc, testing.mdc

> **Instructions for AI/GenAI:**
> 1. **Fetch Context from Confluence:**
> - Use `confluence_search` to find relevant documents for the feature
> - Use `confluence_get_page` to retrieve full content of relevant pages
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: confluence_get_page doesn't exist - the correct tool name is confluence_read_page

Suggested change
> - Use `confluence_get_page` to retrieve full content of relevant pages
> - Use `confluence_read_page` to retrieve full content of relevant pages

Introduce comprehensive development tooling infrastructure to
standardize and streamline development workflows across the
libxlio codebase.

Cursor Rules for Development Workflows:
- commit-msg: Generate well-formatted commit messages
- performance-issue: Investigate performance bottlenecks
- solve-bug: Structured bug resolution workflow
- test-plan: Comprehensive test plan generation
- review-commit: Code review guidelines for commits
- review-pr: Pull request review standards
- research-functionality: Code exploration and documentation

Project-Specific Guidelines:
- coding.mdc: C++ standards for performance-critical code
  (naming conventions, pointer usage, cache alignment)
- testing.mdc: Google Test patterns and fork-based testing
  (ti_N/tu_N naming, LD_PRELOAD requirements)

Greptile Integration:
- greptile.json: AI-powered code review automation
  (custom rules for core/tests/config, performance checks)

These rules leverage MCP tools (Redmine, Confluence, GitHub)
for context-aware assistance and integrate with existing
project documentation (coding-style.md, style.conf).

Benefits:
- Standardized commit messages and documentation
- Automated code quality checks via Greptile
- Structured workflows for common development tasks
- Better onboarding for new contributors
- Context-aware AI assistance through Cursor rules

Signed-off-by: Tomer Cabouly <[email protected]>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR introduces GenAI development tooling infrastructure for the libxlio project, adding 11 new files that provide AI-assisted workflows through Cursor rules and Greptile code review automation.

Major Changes:

  • Added 10 Cursor rule files (.cursor/rules/*.mdc) providing structured workflows for commit messages, bug evaluation/resolution, performance investigation, code review, test planning, and code research
  • Added greptile.json configuration for AI-powered code review with XLIO-specific rules for performance-critical code, thread safety, testing patterns, and architectural compliance
  • Total addition of ~3,800 lines of development tooling documentation

Key Issues Identified:

  • Broken references: greptile.json references non-existent .cursor/rules/architecture.mdc file (appears 3 times in config)
  • Unavailable MCP tools: Multiple rules reference undefined functions (yai__get_tickets, yai__get_comments, yai__get_similar_issues, codebase_search) that will fail when executed
  • Wrong tool names: test-plan.mdc uses confluence_get_page instead of correct confluence_read_page
  • AI execution limitations: Several rules instruct AI to execute git/bash commands which Cursor AI cannot perform
  • Syntax errors: gtest filter syntax errors in test-plan.mdc and typos in feature design templates
  • Logical contradictions: testing.mdc marks @details as optional in examples but required in documentation

Positive Aspects:

  • Comprehensive XLIO-specific context in review rules (performance-critical patterns, thread safety, hardware offload)
  • Well-structured workflow documentation
  • Good integration with existing project docs (docs/coding-style.md, docs/contributing.md)

Confidence Score: 3/5

  • Safe to merge after fixing broken file references and MCP tool names; current state will cause runtime failures
  • Score reflects that this is documentation/tooling (not production code) with no runtime impact on libxlio itself, but the tooling contains multiple broken references that will prevent it from working as intended. The missing architecture.mdc file and undefined MCP functions are blockers for actual usage. These are straightforward fixes but essential for the tooling to function.
  • greptile.json (fix architecture.mdc references), .cursor/rules/evaluate-bug.mdc, .cursor/rules/performance-issue.mdc, .cursor/rules/solve-bug.mdc (fix MCP function names), and .cursor/rules/test-plan.mdc (fix tool names and gtest syntax)

Important Files Changed

File Analysis

Filename Score Overview
greptile.json 3/5 AI code review config with broken references to missing architecture.mdc file (lines 4, 52) and ignoring its own .json type
.cursor/rules/commit-msg.mdc 3/5 Commit message generator with impossible git command execution logic for AI assistants
.cursor/rules/evaluate-bug.mdc 3/5 Bug evaluation workflow using undefined Redmine MCP functions (yai__get_tickets, etc.)
.cursor/rules/performance-issue.mdc 3/5 Performance investigation guide referencing non-existent MCP functions and missing codebase_search tool
.cursor/rules/solve-bug.mdc 3/5 Bug resolution workflow relying on unavailable MCP functions and unexecutable git commands
.cursor/rules/test-plan.mdc 3/5 Test planning guide with wrong Confluence tool name, gtest filter syntax errors, and placeholder examples

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Cursor as Cursor AI
    participant Rules as .cursor/rules/*.mdc
    participant MCP as MCP Tools
    participant Greptile as Greptile Review
    participant Repo as libxlio Repository

    Note over Dev,Repo: PR Development Workflow

    Dev->>Cursor: Trigger rule (e.g., @commit-msg)
    Cursor->>Rules: Load rule file
    Rules-->>Cursor: Return workflow instructions
    
    alt MCP Integration Required
        Cursor->>MCP: Call tool (yai__get_tickets, confluence_search)
        MCP-->>Cursor: Return context data
    end

    Cursor->>Repo: Read codebase files
    Repo-->>Cursor: Return file contents
    
    Cursor->>Dev: Generate output (commit msg, test plan, etc.)

    Note over Dev,Repo: PR Review Workflow

    Dev->>Greptile: Submit PR for review
    Greptile->>Repo: Read greptile.json config
    Repo-->>Greptile: Return review rules & context
    
    Greptile->>Rules: Apply .cursor/rules referenced in config
    Rules-->>Greptile: Provide review guidelines
    
    Greptile->>Repo: Analyze PR changes
    Repo-->>Greptile: Return diff & files
    
    Greptile->>Dev: Post review comments & summary
Loading

11 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@tomerdbz
Copy link
Collaborator Author

Pilot will be with specific rules. can close

@tomerdbz tomerdbz closed this Nov 18, 2025
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.

2 participants