Skip to main content

Introduction

In addition to STABLY.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.
If a rule applies to all modes (create, fix, init), put it in STABLY.md instead.

Quick Start

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:
Filenames must be uppercase. macOS is case-insensitive, so stably-create.md will work locally — but Linux (used in CI/ECS) is case-sensitive and will silently ignore the wrong case.
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-testid over 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 vs agent.fix.rules in stably.yaml

You can also define fix rules in stably.yaml under agent.fix.rules:
stably.yaml
When both 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:
Don’t duplicate rules across files. Put general project rules in STABLY.md, test-generation-specific conventions in STABLY-CREATE.md, and fix-specific conventions in STABLY-FIX.md.

Best Practices