Skip to main content
Rules help Firebender understand how to write high quality code. Define rules using .mdc files in the .firebender/rules/ directory.
Type /help in the chat to get help creating rules

Configuration Locations

Firebender supports two rule scopes:
  • Project Rules: .firebender/rules/*.mdc in your project root
  • Personal Rules: ~/.firebender/rules/*.mdc for rules that apply across all projects
Merge behavior: All rules from both locations are combined and applied together.
Rules apply to all features of Firebender: autocomplete, chat, and inline AI changes

File Format

Rule files use the .mdc extension with optional YAML frontmatter:
.firebender/rules/kotlin-style.mdc

Frontmatter Fields

All frontmatter fields are optional:

No Frontmatter

If you omit the frontmatter, the rule always applies to all files:
.firebender/rules/project-context.mdc

Frontmatter Reference

description

A brief description of what the rule covers. Helps identify the rule’s purpose.

globs

Comma-separated glob patterns to match files. The rule only applies when working with matching files.
Glob patterns follow .gitignore syntax:
  • *.kt matches all Kotlin files
  • **/*Test.kt matches test files in any directory
  • src/main/**/*.kt matches Kotlin files under src/main

alwaysApply

When true, the rule applies to all files regardless of globs. Useful for project-wide guidelines.
If both alwaysApply: true and globs are specified, alwaysApply takes precedence.

Examples

Always-Apply Project Rules

.firebender/rules/project-context.mdc

Conditional Test Rules

.firebender/rules/test-rules.mdc

UI Component Rules

.firebender/rules/compose-guidelines.mdc

Personal Rules

~/.firebender/rules/personal-preferences.mdc
Rules support symbolic links. You can symlink rule files from a shared location:

Migration from firebender.json

If you have rules defined in firebender.json, migrate them to .mdc files: Before (deprecated):
After:
.firebender/rules/general.mdc
.firebender/rules/test-rules.mdc
The rules field in firebender.json is deprecated. Use .firebender/rules/*.mdc files instead.

Cursor Rules Compatibility

Firebender also supports .cursor/rules/*.mdc files for teams migrating from Cursor. This can be disabled by setting useCursorRules: false in firebender.json. For user-facing overview and examples, see Rules.