/ai-ide-rules

an AI-based IDE rules management tool designed to improve development efficiency and code quality. Help developers write and manage code more easily with smart rules and highlighting.

MIT LicenseMIT

IDE-AI-Rules

Project Rules for Agent (not Cursor)

This is an AI-powered IDE rule management tool designed to improve development efficiency and code quality.
It helps developers write and manage code more easily through intelligent rules and highlighting features. This repository is a Proof of Concept (PoC) for managing hierarchical rules using nested rule files to guide AI agent behavior. The rules architecture is designed to be flexible, maintainable, and context-aware.

Objectives

  • Create a scalable rules management structure.
  • Enable context-specific rule selection.
  • Support hierarchical rule inheritance.
  • Provide clear rule organization and documentation.
  • Facilitate easy rule updates and maintenance.

Current Rule Implementation

The rules architecture currently includes:

  • Root-level .clinerules configuration.
  • Context detection based on project type and technology stack.
  • Rule inheritance and priority resolution.
  • Directory-based rule organization.
  • Markdown/YAML rule file format.

Key Components

  • Base Rules: Global rules that apply to all projects.
  • Context Detection: Automatic rule selection based on project characteristics.
  • Rule Application: Priority-based rule resolution.
  • Directory Structure: Organized rule storage in .clinerules.d/.

Future Rule Development Plans

  • Rule Versioning: Add version control for rules.
  • Rule Validation: Implement schema validation for rule files.
  • Rule Testing Framework: Create automated testing for rule application.
  • Rule Documentation Generator: Auto-generate rule documentation.
  • Rule Performance Monitoring: Add metrics for rule effectiveness.

Rules Hub Structure

The Rules Hub serves as the central point for rule management:

Core Features

  • Hierarchical Organization: Rules are organized by project type and technology stack.
  • Context Awareness: Automatic rule selection based on project context.
  • Inheritance System: Child rules inherit from parent rules.
  • Conflict Resolution: Priority-based resolution of rule conflicts.
  • Extensibility: Easy addition of new rule categories.

Rule Application Flow

  1. Context Detection
  2. Rule Selection
  3. Priority Resolution
  4. Rule Application
  5. Result Validation

Connecting to Original Objectives

The current implementation and future plans directly support the original objectives by:

  1. Providing a scalable rules management structure through hierarchical organization.
  2. Enabling context-specific behavior through automatic rule selection.
  3. Supporting inheritance through the rules hierarchy.
  4. Maintaining clear documentation through structured rule files.
  5. Facilitating updates through the modular directory structure.

Usage

To use the rules architecture:

  1. Add your project-specific rules in the appropriate .clinerules.d subdirectory.
  2. The rules engine will automatically detect and apply the relevant rules.
  3. Use the base rules as a foundation for all projects.
  4. Override specific rules in context-specific rule files as needed.

Inspired Projects