This project showcases a basic CrewAI setup for automating code generation. The agents take the high-level requirements described in prompt.yaml and coordinate the design, implementation and testing of a small Python project.
Four specialized agents collaborate on this project:
- Engineering Lead – prepares a detailed design for the module based on the high-level requirements.
- Backend Engineer – implements the Python module described in the design.
- Frontend Engineer – provides a simple Gradio interface demonstrating the backend.
- Test Engineer – writes unit tests for the generated module.
They execute the following tasks in order:
- design_task – produces a Markdown design document outlining classes and functions.
- code_task – generates the backend module implementing the design.
- frontend_task – creates a minimal Gradio app showcasing the backend.
- test_task – generates automated tests for the backend module.
auto-dev-agents/
├── prompt.yaml # Project requirements and module/class names
├── pyproject.toml # Packaging configuration
├── uv.lock # Dependency lock file for uv
└── src/
└── auto_dev_agents/
├── crew.py # Crew and task definitions
├── main.py # Entry point used by the crewai CLI
└── config/
├── agents.yaml # Description of each agent
└── tasks.yaml # Description of the tasks
The output/ directory will be created when running the crew and will contain the design, generated code and tests.
This project uses uv to manage its Python dependencies. The locked requirements are stored in uv.lock.
-
Install
uvcurl -Ls https://astral.sh/uv/install | sh -
Create a virtual environment
uv venv source .venv/bin/activate -
Install dependencies and the CrewAI CLI
uv pip install crewai[tools] uv tool install crewai
-
Run the crew
crewai run
The crew relies on Docker to safely execute code generated by the agents.
The file prompt.yaml defines the project requirements the crew will work on. Edit it to request something different:
requirements: |
Describe here your idea or the functionality you want to implement.
module_name: "my_module.py"
class_name: "MyClass"Changing those values will alter the generated module, class and files.
When you are happy with the prompt, run crewai run again to generate the new code and tests inside the output/ folder.
You can modify agents.yaml to change the agent profiles or tasks.yaml to adjust the workflow. Each agent focuses on a specific phase (design, backend, frontend and tests) but you can add or remove any as needed.
This project is distributed under the MIT license.