AI Crews
Example: Software Dev Team

Example: Software Development Team

This is the "just tell it what to build" crew. You describe an application, and a team of agents designs it, writes it, tests it, and delivers working code to your project directory.

What it does

"Build me a video surveillance web app"


┌──────────────────────┐
│  Product Manager     │  Turns your request into a structured spec:
│                      │  features, user stories, acceptance criteria
└──────────┬───────────┘
           │ spec.md

┌──────────────────────┐
│  Solution Architect  │  Designs the system: components, data models,
│                      │  API contracts, technology choices
└──────────┬───────────┘
           │ architecture.md

┌──────────────────────┐
│  Software Engineer   │  Writes the code file by file, runs it in the
│                      │  sandbox to verify it works
└──────────┬───────────┘
           │ working code

┌──────────────────────┐
│    QA Engineer       │  Writes and runs tests, reports bugs back
│                      │  to the engineer (up to 3 fix cycles)
└──────────┬───────────┘
           │ test results

┌──────────────────────┐
│  Tech Writer         │  Writes README, setup guide, and API docs
└──────────────────────┘


  ~/projects/your-app/
  ├── README.md
  ├── architecture.md
  ├── spec.md
  └── src/
      └── ... (working application code)

Setting it up

1. Create the project

bash /srv/shared/projects/new-project.sh research-crew my-dev-team
cd ~/projects/my-dev-team
source .venv/bin/activate

2. Write your brief

Create ~/obsidian/projects/my-app-brief.md:

# Video Surveillance Web App — Brief
 
## What I want
A web application that:
- Accepts an RTSP stream URL from a camera
- Displays the live feed in a browser
- Detects motion and saves a clip to disk
- Sends a notification when motion is detected
 
## Tech preferences
- Python backend (FastAPI)
- Simple HTML/JS frontend (no framework)
- OpenCV for video processing
- SQLite for clip metadata
 
## What "done" looks like
- I can run it with `python app.py`
- I can open localhost:8080 and see my camera feed
- Motion clips are saved to ./clips/

The more specific your brief, the better the output.

3. Configure .env

PM_MODEL=claude-sonnet         # needs to understand product thinking
ARCHITECT_MODEL=claude-sonnet  # needs to design systems well
ENGINEER_MODEL=qwen3-coder     # best local model for code
QA_MODEL=qwen3-coder
WRITER_MODEL=qwen3-general
OUTPUT_DIR=/home/yourname/projects/my-app
OBSIDIAN_VAULT=/home/yourname/obsidian

4. Add a file writing tool

The code sandbox runs code but doesn't persist files outside /tmp. For the engineer to write actual project files, add a FileWriteTool:

# src/dev_crew/tools/files.py
import os
from pathlib import Path
from crewai.tools import BaseTool
 
class ProjectFileTool(BaseTool):
    name: str = "Write project file"
    description: str = (
        "Write a file to the project output directory. "
        "Args: path (relative to project root, e.g. 'src/app.py'), content (file contents)."
    )
 
    def _run(self, path: str, content: str) -> str:
        output_dir = Path(os.environ["OUTPUT_DIR"])
        target = output_dir / path
        target.parent.mkdir(parents=True, exist_ok=True)
        target.write_text(content)
        return f"Written: {target}"
 
class ReadProjectFileTool(BaseTool):
    name: str = "Read project file"
    description: str = "Read a file from the project output directory."
 
    def _run(self, path: str) -> str:
        target = Path(os.environ["OUTPUT_DIR"]) / path
        if not target.exists():
            return f"File not found: {path}"
        return target.read_text()

5. Run it

PYTHONPATH=src python -m dev_crew.main \
  "Build a video surveillance web app — see brief at projects/my-app-brief.md"

Go make a coffee. Come back in 15–30 minutes.

How to get good results

Be specific in your brief

The PM agent turns your brief into a spec. Vague input → vague spec → bad code. Include: what the app does, who uses it, what "done" looks like, and any tech constraints.

Use Claude Sonnet for PM and Architect

These roles require judgment and systems thinking. The local Qwen models are great at writing code but weaker at high-level design. Use claude-sonnet for PM and Architect, qwen3-coder for Engineer and QA.

Iterate in rounds

The crew won't build a perfect app in one shot for complex requirements. Treat the first run as a working prototype. Review the code, write feedback in a new Obsidian note, and run the crew again with that feedback as additional context.

Complex apps need sub-crews

For a large app (> 5 files, multiple services), break it into sub-crews:

  1. Planning crew — PM + Architect produce spec + architecture
  2. Backend crew — Engineer builds the API
  3. Frontend crew — Engineer builds the UI
  4. Integration crew — Engineer wires them together + QA tests

Run them sequentially, passing each crew's Obsidian output as the next crew's input.

What the sandbox can and can't do

The PythonSandboxTool runs code in a locked-down Docker container:

CapabilityStatus
Run Python
Import standard library
Install packages with pip✅ (add import subprocess; subprocess.run(['pip', 'install', 'X']))
Write files❌ (read-only filesystem — use ProjectFileTool instead)
Make network requests❌ (no network — test logic only, not API calls)
Run for more than 30 seconds❌ (timeout — break long operations into steps)

Reviewing the output

When the crew finishes, you'll find everything in ~/projects/my-app/. Review it like a code review:

  1. Read spec.md — does it match what you wanted?
  2. Read architecture.md — does the design make sense?
  3. Run the code locally — does it work?
  4. Read the tests — do they actually test the right things?

Feed your review back as a new brief and run the crew again for iteration 2.