Skip to content

Rule management requires code changes #67

@mkczarkowski

Description

@mkczarkowski

Currently, all AI coding rules are stored as static TypeScript files in the codebase (src/data/rules/). This creates several significant limitations for maintaining and scaling the rules system:

🚫 Current Limitations

  • Adding a new rule requires a code change and full deployment
  • Non-technical contributors cannot add rules without developer assistance
  • Rules are scattered across multiple TypeScript files
  • No centralized interface to view, search, or manage all rules
  • Difficult to temporarily disable problematic rules
  • Contributors must understand TypeScript and project structure
  • Pull request process required for simple rule additions
  • Maintainers bottlenecked reviewing rule PRs
  • High barrier to entry for domain experts who aren't developers
  • Cannot personalize rules based on user preferences or project types

🔍 Current Architecture Analysis

File-Based System:

src/data/rules/
├── frontend.ts     # React, Vue, Angular rules
├── backend.ts      # Node, Python, Java rules
├── database.ts     # SQL, MongoDB rules
├── testing.ts      # Jest, Cypress rules
└── ...

Issues with Current Approach:

  • Rules hard-coded in TypeScript objects
  • Build-time compilation required for changes
  • No runtime rule modifications possible
  • Tight coupling between rules and application code

💡 Proposed Solution Requirements

  1. Database Storage

    • Move rules from files to database storage
    • Maintain existing rule structure and organization
    • Support for metadata (created_at, sort_order, is_active, etc.)
  2. Backward Compatibility

    • Existing application functionality must not break
    • Gradual migration path with fallback mechanisms
  3. Type Safety

    • Maintain TypeScript type safety throughout
    • Ensure rule data integrity
    • Proper validation of rule content

📋 Success Criteria

This issue will be resolved when:

  • Rules can be added/edited without code changes
  • Type safety and data integrity preserved
  • Fallback mechanism works if database unavailable
  • Migration script successfully transfers existing rules
  • Documentation updated for new workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions