Home › LLM apps & agents › CrewAI multi-agent AGENTS.md

CrewAI multi-agent AGENTS.md

AGENTS.md for CrewAI 1.x projects: YAML agents and tasks, crews and flows, tools, and cost-aware runs.

AGENTS.mdLLM apps & agents

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

AGENTS.mdDownload  
# AGENTS.md: CrewAI project

## Commands
- `crewai install` (uv-based) · `crewai run` · `crewai test -n 3` · `uv run pytest -q`
- CrewAI releases often; check `pyproject.toml` for the pinned version and its docs before using new APIs.

## Structure (from `crewai create crew`)
- `src/<project>/config/agents.yaml`: role, goal, backstory per agent. `config/tasks.yaml`: description, expected_output, agent.
- `crew.py`: `@CrewBase` class with `@agent`, `@task`, `@crew` methods that load the YAML. `main.py`: inputs and kickoff.
- Custom tools in `tools/` subclassing `BaseTool` with a Pydantic `args_schema`.

## Rules
- Each agent has one clear responsibility; prefer 2-4 agents over many overlapping ones.
- Tasks state a concrete `expected_output` (format, length, fields). Use `output_pydantic` for structured results that code consumes.
- Use `Process.sequential` unless a manager really adds value; hierarchical runs cost more.
- Use Flows (`@start`, `@listen`, `@router`, typed state) for deterministic orchestration; put crews inside flow steps for the fuzzy parts.
- LLMs configured per agent via `LLM(model=...)` from config/env; set `max_iter` and `max_rpm` to cap loops and spend.
- Tools that write, send, or spend need explicit human input (`human_input=True` on the task) or an allowlist.
- Enable `memory`/knowledge only when needed; it adds embedding calls.

## Done
Tool unit tests pass; one `crewai test` run on sample inputs produces outputs matching `expected_output`. Report token usage from `crew.usage_metrics`.

Related rules

REST API design AGENTS.md

AGENTS.md for designing consistent HTTP/JSON APIs: resource naming, status codes, errors, pagination, and versioning.

AGENTS.mdAPI design

Bevy game engine AGENTS.md

AGENTS.md for Bevy (0.16+) games in Rust: ECS systems, plugins, required components, and fast dev builds.

AGENTS.mdBevy (Rust)

Claude Agent SDK CLAUDE.md

CLAUDE.md for building agents with the Claude Agent SDK (Python/TypeScript): options, tools, permissions, and hooks.

Claude Code (CLAUDE.md)LLM apps & agents

Git commits & PRs AGENTS.md

AGENTS.md rules for how agents commit: Conventional Commits, atomic changes, safe git commands, and PR descriptions.

AGENTS.mdAgent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.