Introduction
In addition toSTABLY.md (which applies to all agent modes), you can create mode-specific rules files that are only loaded for a particular command. This is a great way to customize the agent to match your team’s workflow — your conventions, your folder structure, your assertion style — while still getting the full benefit of Stably’s built-in browser management, test debugging tooling (e.g. Playwright Trace Viewer), and intelligent test generation under the hood.
Quick Start
- STABLY-CREATE.md
- STABLY-FIX.md
1
Create the file
Add a
STABLY-CREATE.md file to your project root:STABLY-CREATE.md
2
Run a test generation command
The rules are automatically loaded and applied:You’ll see a confirmation in the CLI output:
File Location and Naming
Both files follow the same conventions:Commit these files to your repository so your entire team shares the same conventions. This is especially important when commands run in CI pipelines or are invoked by background agents.
File Format
Both files use freeform markdown. There’s no required structure — write whatever instructions you want the agent to follow. The content is appended directly to the agent’s system prompt. Maximum length: 10,000 characters (~2,500 tokens) per file. Files exceeding this limit are automatically truncated with a CLI warning.When to Use Each File
STABLY-CREATE.md
Use for rules specific to test generation:- Test file naming conventions and folder structure
- Test patterns and frameworks (Page Object Model, fixtures, etc.)
- Assertion strategies and test data patterns
- Tags and annotations (
@smoke,@regression) - Which Stably SDK methods to prefer (
agent.act(),aiAssert(), etc.)
STABLY-FIX.md
Use for rules specific to test fixing:- Selector replacement strategies (e.g., prefer
data-testidover CSS classes) - How to handle flaky tests vs genuinely broken tests
- Timeout and retry policies
- Which files or directories the agent should or shouldn’t modify
- Comment and documentation requirements for changes
- When to flag a test for human review instead of auto-fixing
Examples
- STABLY-CREATE.md
- STABLY-FIX.md
STABLY-CREATE.md
STABLY-FIX.md vs agent.fix.rules in stably.yaml
You can also define fix rules in stably.yaml under agent.fix.rules:
stably.yaml
STABLY-FIX.md and agent.fix.rules are present, they are concatenated — agent.fix.rules is loaded first, then STABLY-FIX.md. They are complementary, not competing.
Relationship to Other Config Files
When multiple files are present, they are concatenated in this order: