Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

12.5 KB
Raw Blame
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

tone_instructions: >-
    Be direct and concise. State the issue, impact, and fix with no preamble, praise,
    or repetition. In pull request conversations, never reply with agreement alone or
    restate the author's explanation. Reply only to add actionable information.

reviews:
    # Surface only the highest-signal feedback.
    profile: 'quiet'

    # The review lands as comments only. These surfaces mirror Greptile's
    # statusCheck and statusCommentsEnabled, both off, so neither bot adds a
    # check the merge queue has to wait on.
    review_status: false
    review_progress: false
    commit_status: false
    poem: false

    # CodeRabbit writes this summary into the pull request description by
    # default, so it would edit the body the author wrote.
    high_level_summary: false

    # Each section below renders in the walkthrough comment, the second comment
    # CodeRabbit posts on a pull request. CodeRabbit has no setting that
    # suppresses that comment, so the sections are off to keep it short. The
    # walkthrough prose and the merge risk line have no toggle and stay.
    changed_files_summary: false
    sequence_diagrams: false
    estimate_code_review_effort: false
    assess_linked_issues: false
    related_issues: false
    related_prs: false
    suggested_labels: false
    suggested_reviewers: false
    in_progress_fortune: false

    # Agents read the raw comment body, and that body includes the folded
    # sections. The AI agent prompt block in each inline comment repeats the
    # finding, so it only adds tokens to the agent context.
    enable_prompt_for_ai_agents: false

    # Keep the lists of ignored files, extra context, and suppressed comments
    # out of the review body for the same reason. This is the default value,
    # and it is set here so that nobody turns it on by accident.
    review_details: false

    auto_review:
        # CodeRabbit is retired on this repository in favor of PostHog Review.
        # The rest of this file is kept so a deliberate
        # re-enable restores the tuned setup rather than the vendor defaults.
        enabled: false

        # Review the commits pushed after the first review too, so work added
        # while a pull request is open is not merged unreviewed. An incremental
        # review reads only the diff since the last one, so it does not repeat
        # findings already handled.
        auto_incremental_review: true

        # Most agent-authored pull requests open as drafts, which is where the
        # findings are cheapest to act on.
        drafts: true

        ignore_usernames:
            - trunk-io
            - 'trunk-io[bot]'

        # Without this, only pull requests into the default branch are reviewed,
        # so every layer of a stack above the first would be skipped.
        base_branches:
            - '.*'

    # Content rules shared with Greptile (.greptile/config.json "instructions"), so the two reviews can be compared.
    path_instructions:
        - path: '**/*'
          instructions: >-
              Do not comment on alphabetical sorting, trailing commas, or formatting. Linters catch these.
              Judge code by four simplicity rules: it passes all the tests, expresses every idea it needs
              to express, says everything once and only once, and has no superfluous parts.
              Prefer parameterised tests over near-duplicate test functions.
              In async Python, flag blocking synchronous calls such as ORM queries, HTTP requests, file I/O, and sleep.

        - path: 'products/*/skills/**'
          instructions: >-
              These skills ship to every MCP client. Flag any instruction that uses a command, flag, tool, or
              capability not available to every MCP user: flag-gated, client-specific, or mode-specific.
              Example: the `learn` cli forms (`learn -s`, `learn posthog:`, `learn project:`), `--no-skills`.

    pre_merge_checks:
        # PostHog documents selectively and does not enforce docstring coverage.
        docstrings:
            mode: 'off'

        # PostHog already validates Conventional Commit titles in GitHub Actions.
        title:
            mode: 'off'

        # Retain the description check as useful, non-blocking PR context.
        description:
            mode: 'warning'

        # PostHog does not consistently link issues to PRs.
        issue_assessment:
            mode: 'off'

chat:
    # No replies in PR conversations unless someone @mentions the bot.
    auto_reply: false

knowledge_base:
    code_guidelines:
        enabled: true
        filePatterns:
            # AGENTS.md is omitted because CodeRabbit detects it automatically.

            - files: '.agents/security.md'
              applyTo: '**/*'

            # Comment conventions apply to every language, so the entry is repository-wide.
            - files: '.agents/skills/writing-code-comments/SKILL.md'
              applyTo: '**/*'

            # General frontend and backend conventions.
            - files: '.claude/commands/conventions.md'
              applyTo: 'posthog/**,frontend/src/**,products/**'

            # Test conventions. These set the bar for whether a test earns its place.
            - files: '.agents/skills/writing-tests/SKILL.md'
              applyTo: '**/test_*.py,**/tests/**/*.py,**/*.test.ts,**/*.test.tsx,playwright/**/*.ts'

            # Voice and word choices for text a person reads.
            - files: '.agents/skills/writing-user-facing-copy/SKILL.md'
              applyTo: 'frontend/src/**,products/**/frontend/**,posthog/templates/**'

            # Python dataclass house rules.
            - files: '.agents/skills/writing-dataclasses/SKILL.md'
              applyTo: '**/*.py'

            # Person-data access rules.
            - files: 'docs/internal/person-data-access.md'
              applyTo: 'posthog/**/*.py,products/**/backend/**/*.py'

            # Activity logging conventions and implementation requirements.
            - files: 'docs/internal/activity-logging.md,.agents/skills/adding-activity-logging/SKILL.md'
              applyTo: 'posthog/models/activity_logging/**,products/**/backend/activity_logging.py,products/**/frontend/activityDescriber.tsx,frontend/src/lib/components/ActivityLog/**'

            # Generated API and frontend types.
            - files: 'docs/published/handbook/engineering/type-system.md,.agents/skills/adopting-generated-api-types/SKILL.md'
              applyTo: 'posthog/api/**,frontend/src/**,products/**/backend/**,products/**/frontend/**'

            # MCP implementation.
            - files: 'docs/published/handbook/engineering/ai/implementing-mcp-tools.md,.agents/skills/implementing-mcp-tools/SKILL.md,.agents/skills/implementing-mcp-ui-apps/SKILL.md'
              applyTo: 'services/mcp/**,products/**/mcp/**'

            # Django migrations.
            - files: 'docs/published/handbook/engineering/safe-django-migrations.md,docs/published/handbook/engineering/databases/async-migrations.md,docs/published/handbook/engineering/databases/schema-changes.md,.agents/skills/django-migrations/SKILL.md'
              applyTo: '**/migrations/**/*.py'

            # ClickHouse migrations.
            - files: 'posthog/clickhouse/migrations/README.md,docs/published/handbook/engineering/databases/clickhouse-event-table-migrations.md,.agents/skills/clickhouse-migrations/SKILL.md'
              applyTo: 'posthog/clickhouse/migrations/**'

            # ClickHouse and HogQL query writing.
            - files: '.agents/skills/writing-clickhouse-queries/SKILL.md'
              applyTo: 'posthog/hogql/**,posthog/hogql_queries/**'

            # Frontend implementation conventions.
            - files: '.agents/skills/writing-kea-logics/SKILL.md,.agents/skills/writing-ui-components/SKILL.md,.agents/skills/using-kea-disposables/SKILL.md,.agents/skills/placing-product-frontend-code/SKILL.md'
              applyTo: 'frontend/src/**,products/**/frontend/**'

            # Feature flags in Storybook stories.
            - files: 'common/storybook/docs/writing-stories.md'
              applyTo: '**/*.stories.tsx'

            # The taxonomic filter, which is easy to break from the outside.
            - files: '.agents/skills/modifying-taxonomic-filter/SKILL.md'
              applyTo: 'frontend/src/lib/components/TaxonomicFilter/**'

            # Django REST Framework endpoints.
            - files: '.agents/skills/improving-drf-endpoints/SKILL.md'
              applyTo: 'posthog/api/**,products/**/backend/**/api.py,products/**/backend/api/**'

            # In-app notifications sent from backend code.
            - files: '.agents/skills/sending-notifications/SKILL.md'
              applyTo: 'posthog/**/*.py,products/**/backend/**/*.py'

            # The personhog coordination protocol, where a mistake is hard to see.
            - files: '.agents/skills/reviewing-personhog-protocol/SKILL.md,.agents/skills/adding-personhog-rpc/SKILL.md'
              applyTo: 'posthog/personhog_client/**,rust/personhog-coordination/**,rust/personhog-test-harness/**'

            - files: '.agents/skills/working-with-charts/SKILL.md,packages/quill/packages/charts/src/docs/**/*.md'
              applyTo: 'packages/quill/packages/charts/**'

            - files: '.agents/skills/posthog-desktop/SKILL.md,products/desktop/.claude/skills/storybook-stories/SKILL.md,products/desktop/docs/ARCHITECTURE.md,products/desktop/docs/CONVENTIONS.md,products/desktop/docs/TESTING.md'
              applyTo: 'products/desktop/**'

            # Product-specific implementation guidance.
            - files: 'products/conversations/skills/organizing-conversations-code/SKILL.md'
              applyTo: 'products/conversations/**/*'

            - files: 'products/endpoints/skills/auditing-endpoints/SKILL.md,products/endpoints/skills/consuming-endpoints-from-client-code/SKILL.md,products/endpoints/skills/copying-endpoints-across-projects/SKILL.md,products/endpoints/skills/creating-an-endpoint/SKILL.md,products/endpoints/skills/managing-endpoint-versions/SKILL.md'
              applyTo: 'products/endpoints/**/*'

            # GitHub Actions. A workflow edit reaches every open pull request at once.
            - files: '.agents/skills/authoring-ci-workflows/SKILL.md,.agents/skills/gating-production-deploys/SKILL.md'
              applyTo: '.github/workflows/**,.github/actions/**'

            # Eval suites, cases, scorers, and harness code.
            - files: '.agents/skills/writing-evals/SKILL.md'
              applyTo: 'products/posthog_ai/evals/**,products/**/evals/**'

            # Skill authoring.
            - files: '.agents/skills/writing-skills/SKILL.md'
              applyTo: '**/skills/**/SKILL.md'

            # Architecture and design documents, wherever they live. Each one applies
            # to its own directory and below, so the scope follows the document.
            - '**/ARCHITECTURE.md'
            - '**/DESIGN.md'

            # Contribution guides that carry review criteria rather than onboarding
            # or release steps. The repository root guide is left out on purpose:
            # it would apply to every file.
            - 'common/hogql_parser/CONTRIBUTING.md'
            - 'frontend/src/scenes/surveys/CONTRIBUTING.md'
            - 'products/dashboards/CONTRIBUTING.md'
            - 'products/workflows/CONTRIBUTING.md'
            - 'services/mcp/CONTRIBUTING.md'

            # Product and service architecture.
            - 'products/README.md'
            - 'products/architecture.md'
            - 'services/llm-gateway/PARITY.md'

            # Backend, data, API, and protocol contracts.
            - 'posthog/clickhouse/hcl/README.md'
            - 'posthog/hogql/ACCESS_CONTROL.md'
            - 'posthog/models/scoping/README.md'
            - 'posthog/models/team/README.md'
            - 'posthog/schema_migrations/README.md'
            - 'posthog/personhog_client/README.md'
            - 'posthog/egress/README.md'
            - 'proto/README.md'
            - 'products/data_warehouse/backend/presentation/README.md'
            - 'products/warehouse_sources/backend/temporal/data_imports/sources/README.md'
            - 'products/revenue_analytics/backend/views/README.md'

            # Service implementation guides stored below docs directories.
            - files: 'services/agent-proxy/docs/SECURITY.md'
              applyTo: 'services/agent-proxy/**/*'

            - 'services/llm-gateway/README.md'
            - 'services/mcp/src/tools/README.md'
            - 'products/mcp_store/README.md'
            - 'services/oauth-proxy/README.md'