A containerized CI tool that analyzes pull or git diffs, and provides feedback via AI-powered code review.
docker image build --tag='ci-agent:latest' .Analyze the difference between two git commits locally. The output is printed to stdout.
- A git repository in the mounted volume
- Two valid commit hashes (base and head)
docker container run --rm -it --mount="type=bind,source=$(pwd),target=/github/workspace" --workdir='/github/workspace' --env="BASE_COMMIT=$(git rev-parse HEAD~1)" --env="HEAD_COMMIT=$(git rev-parse HEAD)" ci-agent:latestBASE_COMMIT- The base commit hash (required)HEAD_COMMIT- The head commit hash (required)AGENTS- Comma-separated list of agent names to run (optional, defaults to all user agents orDefault)
Fetch a pull request from GitHub and submit a review with AI-generated feedback.
- A GitHub access token with
pull_requestsscope - The repository owner/name and PR number
docker run -it \
-e GITHUB_TOKEN="your-github-token" \
-e PR_NUMBER="123" \
-e REPO="owner/repo-name" \
ci-agent:latestGITHUB_TOKEN- Your GitHub personal access token (required)PR_NUMBER- The pull request number (required)REPO- The repository inowner/nameformat (required)GITHUB_API_URL- Custom GitHub API URL (optional, defaults tohttps://api.github.com)AGENTS- Comma-separated list of agent names to run (optional, defaults to all user agents orDefault)
When running in GitHub Actions, the agent can be triggered via PR comments:
/review- Run CI analysis/review SecurityAgent, StyleAgent- Run specific agents (comma-separated)/review- Run all user-provided agents or Default if none exist
The CI Agent uses a multi-agent architecture where each agent provides feedback in prose form, and an Aggregator agent consolidates the results.
To add custom agents, create markdown files in /github/workspace/.ci-agents/:
/github/workspace/.ci-agents/
├── SecurityAgent.md
├── StyleAgent.md
└── PerformanceAgent.md
Each markdown file should contain instructions for that agent. The filename (without .md) becomes the agent's name.
Agents are resolved in the following order:
- User-provided agents in
/github/workspace/.ci-agents/(case-insensitive) - Builtin agents in
/github/workspace/agents/(case-insensitive)
If an agent is not found, the process exits with a fatal error.
The Aggregator agent is responsible for consolidating feedback from all other agents and producing the final output. It is always run last.
You can override the default aggregator by providing your own Aggregator.md file (case-insensitive) in /github/workspace/.ci-agents/.
The Default agent is used only when:
- No agents are specified via environment variable or comment trigger, AND
- No user-provided agents exist in
/github/workspace/.ci-agents/
If user-provided agents exist, they are all used by default (except Aggregator).
AGENTS="SecurityAgent,StyleAgent" docker run .../review SecurityAgent, StyleAgent
Output is printed to stdout in a human-readable format:
## CI Agent Review
[AI-generated summary of the changes]
### Line Comments
- file.ts:42 (RIGHT): [Specific feedback]
- other.ts:10 (LEFT): [Specific feedback]
### Files Analyzed
- file.ts (modified): +10 -5
- other.ts (added): +20 -0
A review is submitted to the pull request with:
- An overall comment containing the AI summary
- Line-specific comments on relevant code changes
See .github/workflows/ci-agent.yml for the workflow configuration.
The workflow triggers on:
pull_request_targetevents (opened, synchronize, reopened)issue_commentevents (when trigger commands are detected)- Manual
workflow_dispatch
See agents/Aggregator.md for detailed instructions on how the Aggregator consolidates feedback from multiple agents.