{"id":896,"date":"2025-07-25T11:40:17","date_gmt":"2025-07-25T18:40:17","guid":{"rendered":"https:\/\/sysprogs.com\/tutorials\/?p=896"},"modified":"2025-07-25T11:42:30","modified_gmt":"2025-07-25T18:42:30","slug":"hierarchical-ai-guidelines","status":"publish","type":"post","link":"https:\/\/sysprogs.com\/CodeVROOM\/documentation\/reuse\/guidelines\/","title":{"rendered":"Hierarchical AI Guidelines"},"content":{"rendered":"<p>AI guidelines are a fairly simple concept. Every time you ask AI to do some edit, CodeVROOM includes them in the prompt in a separate &#8220;general guidelines&#8221; section.<\/p>\n<h1>Overview<\/h1>\n<p>Guidelines can be defined globally (stored in <strong>%LOCALAPPDATA%\\CodeVROOM<\/strong> on Windows or <strong>~\/.codevroom<\/strong> on Linux\/Mac) or per workspace. You can open the guideline editor via <strong>AI-&gt;Manage Guidelines<\/strong>:<\/p>\n<p><a href=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/guidelines.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-897\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/guidelines.png\" alt=\"\" width=\"797\" height=\"580\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/guidelines.png 797w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/guidelines-300x218.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/guidelines-768x559.png 768w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/a>Guidelines can be enabled\/disabled globally by unchecking the corresponding checkbox, and you can also enable\/disable them for a particular editing session via the AI Context window:<\/p>\n<p><a href=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/encapsulate-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-900\" src=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/encapsulate-1.png\" alt=\"\" width=\"1077\" height=\"859\" srcset=\"https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/encapsulate-1.png 1077w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/encapsulate-1-300x239.png 300w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/encapsulate-1-1024x817.png 1024w, https:\/\/sysprogs.com\/tutorials\/wp-content\/uploads\/2025\/07\/encapsulate-1-768x613.png 768w\" sizes=\"(max-width: 1077px) 100vw, 1077px\" \/><\/a>If you are running language models on a slow GPU and want to heavily reduce the prompt size, you can uncheck individual guidelines, and CodeVROOM will immediately show you how it affects the prompt.<\/p>\n<h1>Typical Use<\/h1>\n<p>Guidelines are useful when your coding style or other preferences differ from what the model typically produces. E.g. when we started using collection expressions in C# (<strong>[&#8220;foo&#8221;, &#8220;bar&#8221;]<\/strong>), some models were not very familiar with them, and kept changing them back into the older syntax (<strong>new string[]{&#8220;foo&#8221;, &#8220;bar&#8221;}<\/strong>). It&#8217;s not very difficult to decline such edits via the reviewing GUI or to tell &#8220;<strong>don&#8217;t change [] to new()<\/strong>&#8220;, but it&#8217;s annoying to do that every time.<\/p>\n<p>A rather concise guideline like this fixed it once and for all:<\/p>\n<pre>If you encounter collection expressions in the code (e.g. [x, y] instead of new int[]{x, y}), do not change them back to old-style expressions. The C# compiler handles them correctly.<\/pre>\n<p>Language models have no problem ignoring irrelevant instructions, so guidelines don&#8217;t have to make sense for every edit. If the guideline says &#8220;don&#8217;t change collection expressions&#8221; and the code outright doesn&#8217;t contain any collection expressions, the model will simply ignore it.<\/p>\n<p>The only drawback is that all active guidelines contribute to the context window usage (and token costs), so if you want to define guidelines for a specific rare task, you can use <a href=\"https:\/\/sysprogs.com\/CodeVROOM\/documentation\/reuse\/techniques\/\">AI techniques<\/a> instead.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI guidelines are a fairly simple concept. Every time you ask AI to do some edit, CodeVROOM includes them in<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"_links":{"self":[{"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/posts\/896"}],"collection":[{"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/comments?post=896"}],"version-history":[{"count":2,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/posts\/896\/revisions"}],"predecessor-version":[{"id":904,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/posts\/896\/revisions\/904"}],"wp:attachment":[{"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/media?parent=896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/categories?post=896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sysprogs.com\/tutorials\/wp-json\/wp\/v2\/tags?post=896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}