Open Custom Instructions
- Navigate to Refacto → Settings → Custom Instructions.
- You’ll see two tabs:
- PR Review – controls how the AI analyzes pull requests.
- Custom Instructions – lets you define rules and coding standards using YAML.
Choose How to Start
You can begin in two ways:
- Load Example & Get Started – creates a sample YAML with one org rule and two repo rules.
- Start from Scratch – starts with an empty config.
Edit the Template
When you load the example, a YAML editor opens with three prefilled blocks (1 org, 2 repo-specific).You can click Add Repository to insert a new block.
Field | Description | Example |
---|---|---|
match.paths | Regex to match file paths | src/java* |
match.extensions | File extensions to include | .ts, .js |
instructions | The actual review rule text | "All PRs must include unit tests." |
Only the content under instructions counts toward the 500-character limit per block.
Submit for Review
Below the editor, you’ll find a summary table showing:
- Character usage per block
- Status (No Status, Approved, In Review, Rejected)
- Rejection reason (if any)
Status | Meaning |
---|---|
No status | Not yet submitted |
In Review | Under validation (usually a few days) |
Approved | Instructions are active |
Rejected | Invalid or security violation (reason shown) |
Verify Rules in PRs
When Refacto reviews a PR, it posts a summary comment with:
- Applied Instructions – which rules were used
- Unapplied Instructions – skipped rules and reasons (e.g., repo mismatch)
Once approved, your rules automatically apply to all matching PRs across the organization.