Learn how to improve your code output with the creation of custom configuration files. These files instruct the AI on how to generate code.
- There are several ways to instruct Fusion's AI during code generation.
- No configuration files are required to generate code with Fusion.
- The type of configuration files you use depend on your application's size, purpose, and design requirements.
AI agents can produce sophisticated code while simultaneously making basic mistakes that contradict project conventions. Configuration files address this inconsistency by providing agents with project-specific guidelines and standards.
Fusion provides 3 ways to instruct the AI:
- Through an AGENTS.md file. This file is an industry standard that can be used by several AI coding agents. Visit AGENTS.md for details.
- Through several files placed within a .builder/rules/ directory. These files can be scoped to discuss specific files or topics.
- Through one or more files called .builderrules which can be placed within the root directory or any directory within your application. These configuration files can live side-by-side with the functional files that they describe.
All of these files work very similarly, and Fusion will process all of them. The key difference between them lies in how you wish to architect your application's instructions.
Each of these files act like a rule book for AI assistants working on your project. They tell the AI what it's supposed to do, what it has access to, and how it should behave.
Every time you or your team uses AI through Fusion for code generation, you get consistent, appropriate results that fit your specific needs thanks to these instruction files.
While Fusion accepts several configuration files, choose an instructional architecture strategy that matches your application's needs.
An AGENTS.md file should be within the root directory of your application. If your applications repository is particularly large or complex, place additional AGENTS.md files within relevant directories.
.
├── components/
│ ├── application/
│ │ ├── header-navigation.tsx
│ │ ├── footer-navigation.tsx
│ │ └── ...
│ └── base/
│ ├── AGENTS.md ⬅
│ ├── badge.tsx
│ ├── button.tsx
│ ├── checkbox.tsx
│ └── ...
├── AGENTS.md ⬅
├── package.json
└── readme.md
Creating an AGENTS.md doc is an excellent choice no matter the size and scope of your project, but is particularly excellent for applications that may be interacted with by other AI agents.
Because it can be read by tools like Claude Code or Cursor, software developers in particular will benefit from an AGENTS.md file that will influence code generation across their workflow.
For a deeper dive into this file, including best practices and examples, visit Builder's AGENTS.md doc.
To locate all of your AI instructions in one place, while allowing for multiple instruction files, create a .builder/rules/ directory. Within this directory, create multiple .mdc files that provide instructions to the AI.
.
├── .builder/
│ └── rules/
│ ├── application-overview.mdc ⬅
│ ├── component-architecture.mdc ⬅
│ ├── component-reuse.mdc ⬅
│ └── internal-api-overview.mdc ⬅
├── components/
│ ├── application/
│ │ ├── header-navigation.tsx
│ │ ├── footer-navigation.tsx
│ │ └── ...
│ └── base/
│ ├── badge.tsx
│ ├── button.tsx
│ ├── checkbox.tsx
│ └── ...
├── package.json
└── readme.md
These files function similarly to an AGENTS.md file in that they provide instructions to the AI. However, these multiple files can be more precisely named and scoped than a single file.
A .builder/rules/ directory is an excellent choice if you have a large project and several instructions for AI. This directory helps organize all of your instructions in a single place.
For a deeper dive into this file, including best practices and examples, visit Builder's Builder Rules doc.
Multiple .builderrules file can exist within your application. Fusion will recursively search through your project to join each file. Files closer to the root directory take precedence over files in parent directories.
.
├── components/
│ ├── application/
│ │ ├── .builderrules ⬅
│ │ ├── header-navigation.tsx
│ │ ├── footer-navigation.tsx
│ │ └── ...
│ └── base/
│ ├── .builderrules ⬅
│ ├── badge.tsx
│ ├── button.tsx
│ ├── checkbox.tsx
│ └── ...
├── package.json
├── .builderrules ⬅
└── readme.md
These files function similarly to an AGENTS.md file in that they provide instructions to the AI. However, these files are Fusion-specific and may therefore be focused on
Using one or more .builderrules files is an excellent choice if your project's architecture is highly segmented by directories.
For a deeper dive into this file, including best practices and examples, visit Builder's Builder Rules doc.
To learn more about how to write excellent AI instructions within your configuration files, visit AI instructions best practices.