mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-27 13:12:55 +08:00
d7934036612e503313b7e7e5da57bb9cb9698f5e
Add documentation for the new test_conversion.py script, explaining how to generate and analyze the conversion report. Improve formatting and clarity of existing usage instructions.
Cursor Rules MDC Converter
This script converts Cursor rules from various formats to the .mdc format, using LLM to intelligently process and structure the rules.
Setup
- Install dependencies using
uv:
uv venv
source .venv/bin/activate # On Unix/macOS
.venv\Scripts\activate # On Windows
uv sync
- Set up your environment variables:
Create a
.envfile with your LLM API key:
GEMINI_API_KEY=your_api_key_here
Usage
The script processes files from the awesome-cursorrules/rules directory and:
- Creates
.mdcversions in the same folder as the original files. - Creates a new folder structure in
awesome-cursor-mdc-ruleswith the converted files. - Generates a conversion report in
conversion_report.jsonafter processing.
Test Mode
By default, the script runs in test mode, which only processes 2 folders. To process all folders:
- Open
convert_to_mdc.py - Find the line
test_mode = True - Change it to
test_mode = False
Running the Script
uv run convert_to_mdc.py
Analyzing Conversion Status
To analyze the conversion status and generate a report, run the following command:
uv run test_conversion.py
This will compare the source and output folders, providing a summary of the conversion process and saving the report as conversion_report.json.
Features
- Retries on API failures with exponential backoff
- Processes files in both original location and separate directory
- Maintains folder structure
- Detailed logging
- Test mode for initial validation
Error Handling
The script includes comprehensive error handling:
- Logs errors for individual file processing
- Continues processing even if some files fail
- Retries LLM API calls on failure
Languages
Python
100%