You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rulefy --description "guidelines for extending the component using the base interface"
68
67
69
-
# Specify rule type
68
+
# Specify Cursor AI rule type
70
69
rulefy --rule-type "agent" --description "coding standards for React components"
71
70
```
72
71
73
72
This will:
74
-
1. Fetch the repository content using repomix
75
-
2. Read the cursor rules guidelines
76
-
3. Generate cursor rules using Claude Sonnet 3.5
77
-
4. Save the output to a `<repo-name>.rules.mdc` file
78
-
79
-
80
-
## Installing Rules in Cursor
81
-
82
-
After generating your rules file, you'll need to install it in Cursor:
83
-
84
-
1. Open Cursor editor
85
-
2. Go to Settings > AI > Rules
86
-
3. Click "Add Rules File" and select your generated `.rules.mdc` file
87
-
4. Restart Cursor to apply the new rules
88
-
89
-
For more detailed instructions, see the [official Cursor documentation](https://docs.cursor.com/context/rules-for-ai).
73
+
1. Fetch the repository content
74
+
2. Based on the content, generate rules for Cursor AI
75
+
3. Save the output to a `<repo-name>.rules.mdc` file
90
76
91
77
### Options
92
78
93
79
```
94
80
Options:
95
-
--provider <provider> LLM provider to use (default: "claude-sonnet-3.5-latest")
81
+
--provider <provider> LLM model to use (default: "claude-sonnet-3.7-latest") (currently only claude models are supported)
96
82
-o, --output <file> Output file name (defaults to <repo-name>.rules.mdc)
97
83
--guidelines <file> Path to cursor rules guidelines file (default: "./cursorrules-guidelines.md")
98
-
--include <patterns> Include patterns for files (glob pattern, e.g., "**/*.py")
99
84
--description <text> Description of what should be rulefied
100
85
--rule-type <type> Type of rule to generate (auto, manual, agent, always)
101
86
-h, --help display help for command
102
87
```
103
88
104
-
## How It Works
89
+
`rulefy` supports [all options supported by `repomix`](https://github.com/yamadashy/repomix/tree/main?tab=readme-ov-file#-usage). For example, select specific files:
105
90
106
-
1.**Repository Conversion**: Uses repomix to convert GitHub repositories into a textual representation
107
-
2.**Guidelines Integration**: Reads cursor rules guidelines from the specified file
108
-
3.**LLM Generation**: Passes the repository content and guidelines to LLM with progressive summarization
109
-
4.**Output**: Saves the generated cursor rules to a markdown file
91
+
```bash
92
+
rulefy --include "src/**/*.ts" --compress
93
+
```
94
+
95
+
## Installing Rules in Cursor
96
+
97
+
After generating your rules file, you'll need to install it in Cursor:
98
+
99
+
1. Open Cursor editor
100
+
2. Go to Settings > AI > Rules
101
+
3. Click "Add Rules File" and select your generated `<filename>.rules.mdc` file
102
+
4. Restart Cursor to apply the new rules
103
+
104
+
For more detailed instructions, see the [official Cursor documentation](https://docs.cursor.com/context/rules-for-ai).
110
105
111
106
## Example Output
112
107
@@ -128,6 +123,18 @@ This project is a TypeScript application that...
128
123
...
129
124
```
130
125
126
+
## Best Practices
127
+
128
+
### Minimize context length, cost and rate limits
129
+
130
+
If you encounter rate limits or ihigh costs, try to minimize the context length using the following ways:
131
+
132
+
- Use `rulefy --compress` to compress the context length
133
+
- Use `rulefy --include` to include only the files you need with globs
134
+
- Use `rulefy --exclude` to exclude the files you don't need with globs
135
+
- Specify the size of the chunks via `CHUNK_SIZE=1024` environment variable.
136
+
137
+
131
138
## Contributing
132
139
133
140
Contributions are welcome! Please feel free to submit a Pull Request.
0 commit comments