Inspiration

Every software team faces the same daily grind: a developer opens a GitLab issue, reads it, writes code, writes tests (if they have time), waits for security review (days later), and finally deploys (another day). Total: 1-3 days of repetitive, automatable work per feature.

As a developer in Tanzania, I wanted to build something that makes every developer โ€” regardless of location โ€” as productive as a full team. What if one AI agent could do all six steps automatically?

What it does

AutoPilot DevFlow is a custom AI agent built on the GitLab Duo Agent Platform that autonomously handles the complete software development lifecycle in 6 steps:

  1. ๐Ÿ” ANALYZE โ€” Reads the GitLab issue, extracts requirements, rates complexity
  2. ๐Ÿ’ป CODE โ€” Generates production-ready implementation with proper architecture
  3. ๐Ÿงช TEST โ€” Creates comprehensive test plans targeting 80%+ coverage
  4. ๐Ÿ”’ SECURITY โ€” Scans for OWASP Top 10 vulnerabilities, gives security score
  5. ๐ŸŒฑ OPTIMIZE โ€” Suggests green/sustainable optimizations (UN SDG 13 Climate Action)
  6. ๐Ÿš€ DEPLOY โ€” Generates CI/CD pipeline config and creates merge requests

One issue. One prompt. Six steps. Zero tool-switching.

How I built it

  • GitLab Duo Agent Platform โ€” Custom agent defined in YAML with the AI Catalog
  • Flow Registry v1 โ€” Ambient environment with AgentComponent orchestration
  • 25 GitLab platform tools โ€” get_issue, create_commit, create_merge_request, list_vulnerabilities, and more
  • No external APIs โ€” Everything runs inside GitLab. No API keys, no .env files, no Python dependencies
  • AI Model โ€” Claude (Anthropic) via GitLab Duo Chat

The entire agent is defined in two YAML files:

  • agents/autopilot-devflow.yml โ€” Agent definition with system prompt and tools
  • flows/autopilot-devflow.yml โ€” Flow definition with v1 spec

Challenges I faced

  • Token limits โ€” The agent initially tried to generate full code for every file, hitting output limits before completing all 6 steps. I had to optimize the system prompt to use create_commit for code and keep steps 3-6 as concise summaries.
  • AI Catalog sync โ€” Getting the YAML schema exactly right for the ai-catalog-sync CI component took multiple iterations. The consumers field and tool names had to match the vendored tool_mapping.json exactly.
  • Free tier limitations โ€” GitLab Duo custom agents require Ultimate. I activated a 30-day trial to build and test the agent.
  • Prompt engineering โ€” Balancing between comprehensive output and staying within model limits required careful prompt design with strict constraints.

What I learned

  • The GitLab Duo Agent Platform is incredibly powerful โ€” you can build complex multi-step automations with just YAML
  • Prompt engineering for agents is fundamentally different from chatbot prompts โ€” you need to think about tool usage, token budgets, and sequential execution
  • Green computing is not just a buzzword โ€” even small optimizations like connection pooling and caching can significantly reduce compute waste

What's next

  • Add support for multi-issue batch processing
  • Implement automatic branch creation and code review cycles
  • Add cost estimation for cloud deployments
  • Expand green optimization with carbon footprint tracking

Built With

Share this project:

Updates