Single source of truth for AI rules content

Fix Copy for LLM functionality for rules 🔧

Changes

  • Fixed rawMarkdownUrl path to use /rules/ instead of /content/rules/
  • 📝 Created automated script to copy rule files from source to static directory
  • 🏗️ Added proper title headers during copy process using rule configurations
  • ⚙️ Integrated rules copy script into build process via package.json
  • 🔄 Refactored to use consistent fetch-based approach like postgres how-tos
  • 🧹 Eliminated duplicate implementations and unnecessary prop passing

Benefits

  • 🎯 Maintains true single source of truth for rule content
  • 📋 Copy for LLM now returns markdown instead of HTML/404 errors
  • 🔄 Automated sync ensures static files stay current with source content
  • 🚀 No manual duplication or maintenance overhead
  • Consistent implementation pattern across all Copy for LLM functionality
  • 🏛️ Cleaner architecture with better error handling and loading states

Files changed

  • src/components/RulePageWrapper/index.tsx - Removed unused markdownPath parameter
  • src/components/RuleTemplate/index.tsx - Simplified to use fetch-based approach
  • src/components/RulesPage/index.tsx - Updated to fetch content via HTTP like DocsActions
  • scripts/copy-rules-to-static.js - New automated copy script with title headers
  • package.json - Added build step for rules copy proces
Edited by Nikolay Samokhvalov

Merge request reports

Loading