Inspiration

Every engineering team faces three silent killers: code review bottlenecks, documentation drift, and invisible carbon waste from inefficient code. We built EcoReview to solve all three with a single Merge Request trigger.

What it does

EcoReview is a multi-agent GitLab Flow that deploys 4 specialized AI agents on every Merge Request:

  • 🔍 SmartReview Agent — Reviews diffs for bugs, security vulnerabilities, and code quality using Anthropic Claude via GitLab Duo. Returns a code score (0-100) with file:line references.
  • 📝 DocSync Agent — Automatically writes docstrings, updates README sections, and generates CHANGELOG entries. Commits docs directly to the MR branch.
  • 🌱 GreenCode Agent — Calculates a Green Score (0-100) using Software Carbon Intensity methodology. Detects N+1 queries, blocking I/O, nested loops, and rewards caching and async patterns.
  • 📊 ReportBot Agent — Synthesizes all outputs into one MR comment and uploads a full JSON report + HTML dashboard to Google Cloud Storage.

How we built it

Built entirely on the GitLab Duo Agent Platform using YAML agent configurations. All 4 agents use Anthropic Claude as the underlying model through GitLab Duo. The Flow orchestrates agents in a dependency graph: SmartReview runs first, DocSync and GreenCode run in parallel, then ReportBot waits for both before synthesizing. Google Cloud Storage handles persistent report storage with a per-region carbon intensity calculator (gCO₂/kWh). The GreenCode logic is also available as a standalone Python utility with 21 passing tests.

Challenges we ran into

Designing prompts that return consistent, parseable JSON across all four agents was the biggest challenge. We solved it with strict system prompts specifying exact JSON schemas. Managing the agent dependency graph to ensure parallel execution while maintaining data flow required careful Flow design. We also had to ensure the green scoring methodology was scientifically grounded using Software Carbon Intensity (SCI) standards.

Accomplishments that we're proud of

  • 4 fully functional agents working in a real GitLab Duo Flow
  • Green Score catches real issues: our demo bad_code_example.py scores 26/100 (F) — detecting 7 distinct energy inefficiencies
  • 21/21 tests passing with full coverage of the sustainability scorer
  • GCP integration with real carbon intensity data by region
  • Zero-config setup: copy 5 YAML files, enable the flow — done

What we learned

Building multi-agent flows requires thinking in dependency graphs, not sequential steps. The GitLab Duo Agent Platform's trigger system is powerful — a single merge_request trigger can fan out to a full team of specialized agents. We also learned that sustainability scoring needs to be both technically accurate and developer-friendly: a grade (A-F) communicates more than a raw number.

What's next for EcoReview

  • IDE plugin to show green scores before committing
  • Historical trend dashboard showing green score over time per project
  • PR-level carbon budget alerts ("this MR increases your monthly CO₂ by X%")
  • Integration with the GCP Carbon Footprint API for real-time project-level emissions
  • Support for more languages beyond Python (JavaScript, Go, Ruby)

Built With

  • agent
  • anthropic
  • carbon
  • ci/cd
  • claude
  • cloud
  • duo
  • gitlab
  • google
  • intensity
  • platform
  • python
  • software
  • storage
  • yaml
Share this project:

Updates