The docs mention four rule types. But if I make a rule in the app and then view the raw file contents, there’s no rule type key. And, further, if I select “Agent Requested” it is saved as alwaysApply: false
. So how should I understand the rule types if it seems like they get boiled down to alwaysApply
T/F?
description:
globs:
alwaysApply: false
Let’s say this is the base state.
1- when it is like this, it only works when you mention the rule.
2- if you write something in the description that tells ai when it should use it, like “USE WHEN you code”, you can think of it as ai only seeing the description and using it if necessary.
3- if you write the file extensions it will use in the globs instead of the description. it only uses the rule when it will process files with that extension.
4- if you don’t change any of them and set it to “alwaysApply: true”, as it turns out, the rule is always applied.
I guess you are not applying any of these together. In other words, you will either write description, or globs, or alwaysApply will be true, or it will stay like this.
Hi @taylorOntologize and welcome to the forum.
From the docu you linked, the details are shown as yusufdanis explains including the template examples. There is no rule type key in the created mdc file.
What could be changed to make the rules easier to understand?
Thanks everyone for the clarification. That was very helpful.
Here’s why I found the docs confusion. They read “… lightweight format that supports metadata and content in a single file. Rules supports the following types [the list of types comes next]”. This phrasing, and the formatting of rule type names as code, implies that the rule type is some enum that should be included in the metadata. Apparently, the reality is that the four different rule types describe the behavior rather than dictate the behavior. Adding a version of the example that @yusufdanis provided above would help clarify.
Thanks again!