Articles in this section
Category / Section

How to Migrate Code Studio Rules to Custom Instructions

Published:

Beginning with Code Studio version 2.0.0, legacy rule formats (config.yaml and .sfcoderules) are no longer supported. All rule definitions must be migrated to the Custom Instructions file format to ensure Code Studio continues applying your rules correctly.

Why Migration Is Required

Earlier versions of Code Studio automatically loaded rules from:

  • config.yaml (inside the user profile)

  • .sfcoderules (inside the workspace)

Starting from version 2.0.0, Code Studio only reads rules from the Custom Instructions file. Any rules stored in old file locations will not be detected.

Resolution Steps

Step 1: Create a New Instruction File

  1. Open Code Studio.
  2. Create a new instruction file following the Custom Instructions structure.
  3. Ensure you are using version 2.0.0 or later, as Custom Instructions are not supported in older versions.

Step 2: Migrate Existing Rules

You may have rules stored in either config.yaml or .sfcoderules. Follow the steps below depending on where your rules are located.

If Your Rules Were in config.yaml

Windows Location

C:\Users<YourName>.sfcodestudio.codestudio\config.yaml

rules.png

macOS Location

/Users//.sfcodestudio/.codestudio/config.yaml

rules.png

Migration Steps:

  1. Open the config.yaml file.
  2. Locate the rules: section.
    rules.png
  3. Copy all the rule definitions listed under it.
  4. Open your newly created instruction file.
  5. Paste the copied rules below the applyTo section.
    rules.gif
  6. Save the file.

If Your Rules Were in a .sfcoderules File

Migration Steps:

  1. Open the .sfcoderules file in your workspace.
    rules.png
  2. Copy all the rules or lines contained in it.
  3. Open your new instruction file.
  4. Paste the content below the applyTo section.
    rules6.gif
  5. Save the file.

How Instruction Files Work in Version 2.0.0 and Later

Once your instruction file is saved:

  • Code Studio will automatically detect and load it.
  • All instructions will be applied to every future request.
    rules.gif

    Legacy files (config.yaml, .sfcoderules) will no longer be used.
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied