Skip to main content

Codebase Assistants

AI agents that understand your codebase — reviewing PRs, answering “how does X work?”, and keeping your team unblocked.

What you can build

PR Reviewer

Automatically reviews pull requests for security issues, performance problems, and style violations. Posts constructive comments on GitHub.

Code Q&A Agent

Answers “how does X work?” questions by reading the actual source code — not hallucinating from memory.

Issue Triage Bot

Reads incoming GitHub issues, classifies them (bug/feature/docs), adds labels, and assigns to the right team.

Docs Generator

Reads functions and modules, generates docstrings and README sections, and opens PRs with the generated docs.

Setup

1

Connect GitHub

IntegrationsGitHubConnect with GitHub → authorize the repos you want the agent to access.
Only grant access to repositories the agent needs. Use a dedicated GitHub App or OAuth App — not your personal account — for production agents.
2

Write your agent

Use GitHub capabilities in HiveLang:
3

Configure PR review trigger

Set up a GitHub webhook to trigger the agent on new PRs:In GitHub repo → SettingsWebhooks → Add webhook:
  • Payload URL: https://api.bothive.cloud/v1/bots/{bot_id}/webhook
  • Content type: application/json
  • Events: Pull requests
4

Test on a draft PR

Open a draft PR → confirm the agent posts a review comment → check the trace to verify the diff was read correctly.

Full swarm example — code review team

GitHub capabilities reference

Best practices for code agents

Code agents should always open PRs or suggest changes — never commit directly to main. Add explicit rules: “Always create a PR, never push directly.”
For PR review and Q&A agents, connect only read scopes. Write access (github.addComment) should be a deliberate, minimal addition.
Upload your team’s style guide, security checklist, and architecture decisions as a knowledge base. Connect it to the agent so it reviews against your actual standards, not generic ones.
Claude 3.5 Sonnet is excellent for code review. GPT-4o is good for mixed text + code. Set model: claude-3-5-sonnet in your HiveLang for best code quality.

Next reads

Custom Integrations

Integration Capabilities

HiveLang v5