AFAdocs
Getting Started

GitHub App Setup

Install the AFA Gate Check GitHub App for automated PR analysis.

GitHub App Setup

The AFA Gate Check GitHub App analyzes pull requests automatically and posts results as a Check Run.

Install

  1. Visit github.com/apps/afa-gate-check
  2. Click Install
  3. Select the repositories you want AFA to analyze
  4. Done -- AFA starts analyzing PRs immediately

What happens on a PR

When you open or update a pull request:

  1. GitHub sends a webhook to AFA
  2. AFA fetches the PR diff (paginated, up to 3 pages)
  3. Each changed function is parsed and analyzed by four agents (security, performance, maintainability, documentation)
  4. Results are posted as a Check Run on the PR
  5. A summary comment is added with findings and scores

The GitHub App runs analysis only -- it does not generate enhancements or modify your code. This is the free funnel: analysis costs no LLM tokens for enhancement generation.

Configuration

Add a .afa.yaml to your repository root to customize analysis behavior:

version: "1.0"

model:
  provider: gemini
  model: gemini-3-flash-preview

analysis:
  languages:
    - python
    - typescript
  exclude:
    - "tests/**"
    - "vendor/**"
    - "migrations/**"

Without a config file, AFA uses sensible defaults (Anthropic provider, Python + TypeScript, standard exclusions).

Billing

The GitHub App is available on all tiers including Community (free). Analysis usage counts against your monthly quota:

TierMonthly analysesRate limit
Community20015/min
Developer2,00030/min
Team10,000100/min
Enterprise50,000500/min

When you exceed your quota, AFA posts a comment with an upgrade link instead of analysis results.

Self-hosted

If you're running AFA on your own infrastructure, set up webhook forwarding:

# Terminal 1: Forward webhooks from smee.io to localhost
npx smee-client -u https://smee.io/<channel-id> -t http://localhost:3000/webhook

# Terminal 2: Start the webhook receiver
uvicorn afa.server.github:github_app --host 0.0.0.0 --port 3000

Required environment variables for self-hosted:

AFA_GITHUB_APP_ID=<your-app-id>
AFA_GITHUB_PRIVATE_KEY_PATH=config/github-app.pem
AFA_GITHUB_WEBHOOK_SECRET=<your-secret>
AFA_GITHUB_INSTALLATION_ID=<your-installation-id>

On this page