Skip to main content

Rules

Qoder CN IDE supports project rules and user rules. Project rules are stored in .qoder/rules and apply to the current project. Choose the scope when creating a rule, then configure when it applies to guide coding style, framework usage, and other preferences.

How rules work

Large language models (LLMs) rely on general knowledge, so they lack your project's specific context and rules. Qoder CN IDE rules address this limitation by strategically injecting predefined context into prompts, which helps guide AI responses to more consistently align with your project’s standards and requirements.

Storage and sharing

ScopeDirectory
User~/.qoder-cn/rules/
Project.qoder/rules/ in the project root
Share project rules through Git. For local-only project rules, add .qoder/rules/ to .gitignore.

Limitations

  • All active rule files can contain up to 100,000 characters in total. Excess content is truncated.
  • Use natural-language text; images and linked content are not parsed.

Rule types

TypeWhen it appliesUse case
Apply ManuallySelect the rule through @rule in Chat or Inline Chat.On-demand workflows and custom prompts
Model DecisionThe Agent decides from the rule description.Tasks such as generating unit tests or code comments
Always ApplyEvery Chat and Inline Chat request.Project standards such as coding style or documentation format
Specific FilesFiles matching the configured patterns, such as *.js or src/**/*.ts.Rules for a language or directory

AGENTS.md compatibility

Place AGENTS.md in your project directory. The Agent recognizes its instructions without additional configuration. If it conflicts with rule content, rules take precedence.

Best practices

  • Be concise. Keep rules focused and unambiguous.
  • Structure clearly. Use bullets, numbered lists, or Markdown formatting.
  • Include examples. Show the model what a good result looks like.
  • Iterate and optimize. Refine rules based on model output and feedback.

Configure rules

  1. Select the user icon in the upper-right corner of Qoder CN IDE and open IDE settings. You can also use ⌘ ⇧ , on macOS or Ctrl Shift , on Windows.
  2. Select Rules in the sidebar.
  3. Select Add, then choose Project Rule or User Rule. Open the target project before creating a project rule.
  4. Enter a unique rule name and press Enter to confirm.
  5. In the rule editor, choose a rule type and enter the rule content.
    • Apply Manually: Use @rule in chat to select the rule.
    • Model Decision: Describe when to apply the rule, such as “Generate a unit test.”
    • Specific Files: Enter comma-separated path patterns, such as *.md and src/*.java.
    • Always Apply: Apply the rule to every chat and inline chat request.
  6. Save the rule file.

Next steps

To edit or delete an existing rule, select the corresponding action on the Rules page.