Rules help Firebender understand how to write high quality code. Define rules usingDocumentation Index
Fetch the complete documentation index at: https://docs.firebender.com/llms.txt
Use this file to discover all available pages before exploring further.
.mdc files in the .firebender/rules/ directory.
Type
/help in the chat to get help creating rulesConfiguration Locations
Firebender supports two rule scopes:- Project Rules:
.firebender/rules/*.mdcin your project root - Personal Rules:
~/.firebender/rules/*.mdcfor rules that apply across all projects
File Format
Rule files use the.mdc extension with optional YAML frontmatter:
.firebender/rules/kotlin-style.mdc
Frontmatter Fields
All frontmatter fields are optional:| Field | Type | Description |
|---|---|---|
description | string | Brief description of the rule’s purpose |
globs | string | Comma-separated glob patterns for file matching |
alwaysApply | boolean | If true, rule applies to all files (default: false) |
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..gitignore syntax:
*.ktmatches all Kotlin files**/*Test.ktmatches test files in any directorysrc/main/**/*.ktmatches Kotlin files under src/main
alwaysApply
Whentrue, the rule applies to all files regardless of globs. Useful for project-wide guidelines.
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
Symbolic Links
Rules support symbolic links. You can symlink rule files from a shared location:Migration from firebender.json
If you have rules defined infirebender.json, migrate them to .mdc files:
Before (deprecated):
.firebender/rules/general.mdc
.firebender/rules/test-rules.mdc
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.