AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How Do Engineering Teams Configure Custom Guidelines and .bito.yaml in Bito to Enforce Architectural Standards in AI Code Reviews?

松下祥子 · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Most engineering teams abandon generic AI code review bots within three weeks of installing them. The reason is not that the underlying language models are unintelligent. It is that they are architectural outsiders.

A stock LLM pointed at a GitHub pull request will nitpick variable naming casing, debate comment style, suggest hypothetical micro-optimizations, and completely miss that a junior engineer just imported a raw database repository directly into a React presentation controller. Senior engineers and backend architects then spend hours reviewing the bot's commentary, fielding confused questions from authors, and eventually muting the integration out of pure review fatigue.

At 365Finds, our conviction is straightforward: an AI code reviewer that lacks repository architectural context is worse than having no bot at all. It generates noise, erodes trust, and distracts senior reviewers from critical design boundaries.

Bito addresses this structural failure through a two-sided mechanism: declarative repo-level orchestration via .bito.yaml (which can directly digest existing IDE instruction files like CLAUDE.md and .cursor/rules) and an adaptive feedback loop called Learned Rules that turns engineering pushback into permanent suppression rules.

Here is the operational blueprint for configuring custom guidelines, tailoring .bito.yaml, and turning Bito into a disciplined architectural gatekeeper.


1. Zero-Friction Context: Reusing Existing Assistant Rules

Before authoring proprietary Bito syntax from scratch, engineering teams should evaluate what instruction files already exist inside their repositories.

Modern teams frequently maintain rules for developer tools such as Cursor, Claude Code, Windsurf, or Codex. Bito's Code Review Agent natively reads and parses these files during pull request analysis if repo_level_guidelines_enabled is set to true.

Specifically, Bito detects:

When a developer touches files in a pull request, Bito matches the changed paths against directory-level or root-level guideline files. Every review comment generated through this path displays a Citations section linking directly back to the exact line number of the repository rule that triggered it.

365Finds strongly favors this design. Maintaining divergent rule documents for code generation in the IDE and code verification in Git pull requests guarantees architectural drift. Linking the PR reviewer to the identical markdown file your engineers already consult in their IDE creates immediate consistency.


2. Declarative Repository Governance: The .bito.yaml Anatomy

To establish version-controlled, fine-grained review criteria, place a .bito.yaml configuration file in the root directory of your repository.

Bito automatically detects .bito.yaml in the pull request's source branch and uses its directives to supersede agent settings established in the Bito Cloud web dashboard.

Core Architecture of .bito.yaml

# 1. Review Stance & Tone
suggestion_mode: essential         # 365Finds recommended: 'essential' blocks noise; 'comprehensive' adds nitpicks
exclude_draft_pr: true             # Do not evaluate work-in-progress branches
post_description: true             # Append auto-generated overview to PR body
post_changelist: true              # Include structured walkthrough of modified logic

# 2. Scope & Filtration
include_source_branches: "feature/*, bugfix/*, refactor/*"
include_target_branches: "main, develop, staging"
exclude_files: "*.lock, *.min.js, migrations/*, generated/**, swagger.yaml"
labels_excluded: "wip, chore, dependencies, (?i)^do-not-review$"

# 3. Static Analysis & Gatekeeping
linters_feedback: true
secret_scanner_feedback: true
post_as_request_changes: true      # Converts critical feedback into formal blocking 'Request Changes' reviews

# 4. Context Engine & Assistant Reuse
repo_level_guidelines_enabled: true
sequence_diagram_enabled: true     # Generates Mermaid-like sequence diagrams for component impact

# 5. Custom Guidelines Definition
custom_guidelines:
  general:
    - name: "Layered Architecture Boundaries"
      path: "./.bito/guidelines/architecture-boundaries.md"
    - name: "Security & PII Hygiene"
      path: "./.bito/guidelines/security-pii.md"
  per_language:
    typescript:
      name: "Domain Driven Design & Typing"
      path: "./.bito/guidelines/typescript-invariants.md"
    python:
      name: "FastAPI & Async Connection Rules"
      path: "./.bito/guidelines/python-backend.md"
    java:
      name: "Spring Boot Microservice Standards"
      path: "./.bito/guidelines/java-standards.md"

Strategic Decisions within the Configuration


3. Writing Effective Architectural Guidelines

A common mistake is writing vague guidelines like "write clean code" or "ensure high test coverage." Large language models interpret these as license to hallucinate formatting opinions.

Guidelines must be written as testable, declarative architectural invariants.

Example: Architectural Boundaries (./.bito/guidelines/architecture-boundaries.md)

# Repository Architectural Invariants

## Strict Layer Separation
1. Presentation Layer (controllers, route handlers, GraphQL resolvers) must never query data storage engines directly. They must invoke Domain Services.
2. Direct calls to database ORM models (e.g., Prisma, TypeORM, SQLAlchemy) from files matching `**/controllers/**` or `**/routes/**` are prohibited.
3. Cross-module imports must only occur through each module's public `index.ts` interface. Importing internal private files across domain boundaries must be flagged as Critical.

## Idempotency and State
1. Any state-mutating endpoint handler handling payment, billing, or ledger events must accept an `Idempotency-Key` header and validate it via Redis.
2. In-memory variable caching outside of Redis is forbidden across all horizontally scalable container services.

When an author submits a PR containing an ORM query inside an Express route handler, Bito identifies the file pattern, correlates it with the "Strict Layer Separation" rule in the guideline file, flags the exact line, and cites ./.bito/guidelines/architecture-boundaries.md#L4.


4. Learned Rules: The Self-Correcting Defense Against Noise

No matter how carefully you configure .bito.yaml, LLMs will occasionally misunderstand legacy compromises or generate false positives. This is where most tools require continuous admin editing.

Bito solves this via Learned Rules (adaptive feedback):

  1. Triggering the feedback:
    • GitHub: Authors or reviewers click the negative feedback checkbox embedded at the bottom of the Bito PR comment, or post a comment explaining why the suggestion is invalid or irrelevant.
    • GitLab: Reviewers add a negative emoji reaction (such as thumbs-down) or leave an explanatory negative comment.
    • Bitbucket: Reviewers submit an explanatory negative comment.
  2. Cluster Analysis & Synthesis:
    • Bito's agent parses the criticism, analyzes why the suggestion was rejected, and abstracts the complaint into a structured exclusion rule.
    • If a reviewer states "We intentionally allow raw SQL queries in legacy reporting migrations under db/reports," Bito formulates a domain-specific exclusion.
  3. Threshold and Activation:
    • Newly synthesized Learned Rules appear on the Learned Rules dashboard (https://alpha.bito.ai/home/ai-agents/review-rules) in Bito Cloud.
    • By default, a new rule starts in a Disabled state. Once identical negative feedback on that pattern reaches a threshold of 3, Bito flips the rule to Enabled automatically.
    • Workspace admins can also review the queue and manually toggle rules from Disabled to Enabled immediately.

Positive feedback emojis (such as thumbs-up) have no effect on rule creation; the mechanism is designed strictly as a noise-elimination filter.


5. Centralized Workspace Governance vs Repo Autonomy

For engineering leadership managing tens or hundreds of repositories, configuration management requires clear boundaries.

                  ┌──────────────────────────────────────────────┐
                  │          Bito Cloud Workspace                │
                  │   - Professional Plan Subscription           │
                  │   - Global Agent Defaults                    │
                  │   - "Allow config file settings" Toggle     │
                  └───────────────────────┬──────────────────────┘
                                          │
                  ┌───────────────────────┴──────────────────────┐
                  │                                              │
         Toggle = Enabled                               Toggle = Disabled
                  │                                              │
                  ▼                                              ▼
┌───────────────────────────────────┐          ┌───────────────────────────────────┐
│     Repository .bito.yaml         │          │     Global Agent Settings         │
│ - Source branch precedence        │          │ - Enforced from Cloud UI          │
│ - Reads CLAUDE.md & Cursor rules  │          │ - Repo-level .bito.yaml ignored   │
│ - Scoped architecture rules       │          │ - Centralized company baseline    │
└───────────────────────────────────┘          └───────────────────────────────────┘

Crucial Administrative Constraints

  1. The Global Gatekeeper Switch: Repositories can only override agent settings if the workspace administrator has activated "Allow config file settings" in the Bito Cloud Agent Settings panel (Repositories -> Target Agent -> Settings). While this is turned on by default, admins running tightly regulated banking or healthcare codebases can switch it off to enforce unalterable corporate review postures.
  2. Failure Handling: If a .bito.yaml contains malformed YAML syntax or invalid keys, Bito rejects the entire configuration file and falls back to global workspace defaults. It does not attempt partial interpretation.
  3. Missing Properties: Any property omitted from .bito.yaml transparently inherits its value from the organization-level Bito Cloud settings.
  4. Subscription Requirement: Custom Guidelines and repository-level rule configurations require Bito's Professional Plan. Enacting custom guidelines automatically moves an unmanaged workspace onto this tier.

If a repository defines local custom_guidelines, Bito silences agent-level guidelines configured in the Cloud UI for that specific repository, ensuring that local architectural specifications always take full precedence.


References