Skip to main content
Rules help Firebender understand how to write high quality code. Add rules to the rules array in firebender.json to specify guidelines.
Rules apply to all features of Firebender such as autocomplete, chat, and inline AI changes
Firebender supports both project-specific rules and personal rules that apply across all projects. See Project vs Personal Config for details on setting up personal rules.
To setup rules, you need to create a json file at the project root firebender.json.

General Rules Example: Food delivery app

In $projectRoot/firebender.json:
firebender.json
{
  "rules": [
    "Project is a food delivery app (Doordash)",
    "Never use runBlocking",
    "Don't hardcode dpi",
    "Use `@SerializedName` for data/retrofit classes because code gets obfuscated",
    "Follow Material Design 3 guidelines and components",
    "Use Kotlin coroutines and Flow for asynchronous operations",
  ]
}

Situational Rules Example: Test files

Here’s an example situational rule:
firebender.json
{
  "rules": [
    "Project is a food delivery app (Doordash)",
    {
      "filePathMatches": ["*Kotest.kt"],
      "rules": [
        "Use Kotest framework/BDD for tests"
      ]
    }
  ]
}
If you modify the file ProfileViewModelKotest.kt, AI will follow the rule Use Kotest framework/BDD for tests. If you modify MainActivity.kt, AI will not be provided the irrelevant rule.
filePathMatches follows the same regex notation as typical line in .gitignore.

Full file rules

For complex or extensive rules, you can use external markdown files instead of embedding all rules in firebender.json. This solves several problems:
  • JSON has limitations for long strings
  • Projects often already have documentation (like README.md or ARCHITECTURE.md) that can be reused
  • Keeps rules organized and easier to maintain
firebender.json
{
  "rules": [
    "Use Kotlin for all new code",
    {
      "filePathMatches": "**/*.kt",
      "rulesPaths": "docs/architecture.md"
    }
  ]
}
With a corresponding docs/architecture.md file:
docs/architecture.md
# Android Architecture Guidelines

## UI Layer
- Use Jetpack Compose for new UI components
- Follow Material Design 3 guidelines
- Implement unidirectional data flow with ViewModels

## Data Layer
- Use Room for local database storage
- Implement Repository pattern for data access
- Use Retrofit for network operations
Firebender will include both inline rules and rules from the referenced external files when processing matching files.

Reading Errors

Rules will use the latest file saved immediately. If there are parsing errors it will tell you which fields were incorrect: Unable to parse firebender.json feedback In this case, rules[0].filePathMatches is supposed to be a string and not an array. For a complete reference of the rules syntax including advanced patterns and configuration options, see the Rules Syntax Documentation.

Ignore Files

Firebender reads your project’s codebase to power its features like autocomplete and chat context. You can control which files Firebender can access automatically to protect sensitive information and improve performance.

How it works

Firebender respects ignore patterns for:
  • Implicit context: Files added automatically to chat context
  • Autocomplete: Code suggestions from ignored files are completely blocked
Firebender ignores patterns when:
  • Explicit mentions: You manually paste code from an ignored file into chat
  • Direct edits: You run inline edit commands on ignored files
  • Terminal/MCP tools: These tools cannot be restricted by ignore patterns

Why ignore files?

Security: Keep API keys, credentials, and secrets out of AI context. While Firebender blocks ignored files from implicit context, complete protection isn’t guaranteed due to LLM unpredictability. Performance: In large codebases or monorepos, exclude irrelevant portions for more accurate file discovery and faster responses.
Never store production API keys in your local development environment. Ignore patterns provide defense-in-depth but are not foolproof security.
Type /help I want you to ignore these files... in chat to get AI assistance setting up ignore patterns for your project.
For configuration details and syntax, see Ignore Files Configuration.