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
Integrations → GitHub → Connect with GitHub → authorize the repos you want the agent to access.
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 → Settings → Webhooks → 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
Never auto-push code without human approval
Never auto-push code without human approval
Code agents should always open PRs or suggest changes — never commit directly to main. Add explicit rules: “Always create a PR, never push directly.”
Use read-only access where possible
Use read-only access where possible
For PR review and Q&A agents, connect only read scopes. Write access (
github.addComment) should be a deliberate, minimal addition.Provide your coding standards in the knowledge base
Provide your coding standards in the knowledge base
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.
Tune the model for code
Tune the model for code
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.