---
title: "AI Coding Guidelines"
description: "Enforces the rules and skills your team wrote for coding agents, such as AGENTS.md, CLAUDE.md, Cursor rules, and SKILL.md files, on every pull request."
canonical: "https://baz.ai/docs/agents/build/ai-coding-guidelines"
---

# AI Coding Guidelines

Enforces the rules and skills your team wrote for coding agents, such as AGENTS.md, CLAUDE.md, Cursor rules, and SKILL.md files, on every pull request.

AI Coding Guidelines checks each pull request against the instructions your team already maintains for coding agents. It never invents a convention: every finding cites the guideline file it comes from. Use it to make sure code written by people and by AI agents follows the same rules.

## What it catches

Violations of rules in your instruction files and skills that apply to the changed files, for example "use the shared `db` helper, never raw SQL" in a `CLAUDE.md`, or a framework convention in a `SKILL.md`. Baz reads files such as:

- `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, `*BUGBOT.md`
- `.cursor/rules/**/*.md` and `.mdc`, `.claude/*.md`, `.claude/agents/**`, `.claude/rules/**`
- `.github/instructions/**`
- Skill folders under `.cursor`, `.claude`, `.agent`, `.agents`, or `.github` `skills/`
- Baz skills you create in the app

The full list is in [Instruction files](/docs/reference/instruction-files).

## Why you can trust it

Baz checks only the guidelines that apply to the files you changed, and reads every one of them, so no matched rule is skipped silently. Every finding names the rule and file it comes from, and a finding another agent already raised is merged into one comment. When no guideline is in scope, the agent stays quiet on that pull request.

## What you see

```markdown title="PR comment"
### Raw SQL bypasses the query builder

`getOpenInvoices` builds a SQL string with template interpolation. The
repository guidelines require Drizzle helpers (`eq`, `and`) and allow the
`sql` template only for fragments with no helper.

[AI Coding Guidelines · Severity: Medium] [Guidelines: `bff/CLAUDE.md`]

**Baz can fix this** - reply `apply commit` / `apply pr` to fix without changes, or comment to modify the plan. You can also update your AI coding guidelines based on this comment by `apply skill update`
```

Reply `apply skill update` when the finding shows a rule should change rather than the code. Baz opens a pull request with a minimal edit to the skill.

### Skills in the app

On **Software Factory → Build**, the AI Coding Guidelines row has **Edit**, which opens your skills.

The **Your skills** tab holds files from your repositories, and **Baz skills** holds skills Baz maintains for you. **Add files** imports files by **Repository** and **File glob** (default `**/SKILL.md`) or by upload, and **Create skill** lets you write one from scratch. Use **Enable selected** or **Disable selected** to choose which files count in review; each edit is saved with **Create a new version**, so you keep the history.

The **Baz skills** tab shows **Last scan**, **Next scan**, and **View session** for the scan that proposes skills from your code. See [Skills and instructions](/docs/brain/skills-and-instructions).

## Prerequisites

At least one instruction file or skill in a connected repository, or a Baz skill.

## Settings

On/off switch, minimum severity, **Scope**, and **Reviewer memory**, like every Build agent. See [Agent settings](/docs/agents/agent-settings).

## Related

<CardGroup cols={2}>
  <Card title="Skills and instructions" href="/docs/brain/skills-and-instructions" icon="book-open">
    Import, create, and version skills.
  </Card>
  <Card title="Skill Maintainer" href="/docs/agents/maintain/skill-maintainer" icon="sparkles">
    Keep skills in sync with the code.
  </Card>
  <Card title="Instruction files" href="/docs/reference/instruction-files" icon="file-code">
    Every file and glob Baz reads.
  </Card>
</CardGroup>
