Claude Skill

crewai

Build role-based multi-agent systems with CrewAI. Agents with Role/Goal/Backstory, task design, crew composition (sequential or hierarchical), tool integration, callbacks, and production deployment. Use when orchestrating multi-agent teams or comparing agent frameworks. Do not us

LLM Mart · 0 points · 15 views 0 listing impressions 0 install-command copies
Download magnus919-agent-skills-crewai-addad86.zip · 14 KB

Install

skills CLI npx skills add https://github.com/magnus919/agent-skills/tree/main/crewai
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install magnus919-agent-skills@llmmart
Git git clone https://github.com/magnus919/agent-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole magnus919/agent-skills collection as a plugin from our marketplace. Git is the plain clone.

README

CrewAI — Role-Based Multi-Agent Orchestration

An expert-level skill for building role-based multi-agent teams with CrewAI. Agents are defined as Roles with Goals and Backstories; crews are composed with sequential or hierarchical workflows.

Why Install This Skill

When your agent loads this skill, it becomes a CrewAI expert who can:

  • Design agent roles — define agents with Role, Goal, Backstory, and tool sets
  • Compose crews — sequential and hierarchical process patterns
  • Design tasks — structured tasks with expected outputs and context
  • Integrate tools — custom tools, LangChain tools, and built-in tools
  • Handle callbacks and events — step callbacks, task events, crew completion
  • Production considerations — caching, memory, and deployment patterns

What You Get

Directory Purpose
SKILL.md Quick-start guide, core paradigm, and framework comparison
references/ Deep dives into agent design, task patterns, crew composition, tools, callbacks, production, and framework comparisons

Framework Comparison

CrewAI is higher-abstraction than LangGraph (which is a low-level state machine) and more structured than AutoGen (which uses free-form conversations). It's best when you have well-defined roles with clear responsibilities.

Requirements

Python 3.8+ with crewai and crewai-tools packages.

Quick Start

Start with the setup and first workflow in SKILL.md, then use the linked resources for the specific task you need to complete.

Triggers

Use this skill for the task types and keywords described in its SKILL.md description.

Skill manifest

CrewAI Expert Skill

CrewAI is a framework for role-based multi-agent orchestration. Unlike LangGraph's low-level state-machine graphs, CrewAI provides a higher abstraction: agents are defined as Roles with Goals and Backstories, crews are composed with built-in sequential or hierarchical workflows, and inter-agent delegation is built into the framework.

Core Paradigm

from crewai import Agent, Task, Crew, Process
from crewai.tools import tool

@tool("search")
def search_web(query: str) -> str:
    """Search the web for information."""
    return f"Results for: {query}"

researcher = Agent(
    role="Senior Researcher",
    goal="Find accurate information on any topic",
    backstory="Expert researcher with 10 years of experience",
    tools=[search_web],
    verbose=True,
)

writer = Agent(
    role="Technical Writer",
    goal="Write clear reports from research findings",
    backstory="Experienced technical writer",
    verbose=True,
)

research_task = Task(
    description="Research the topic thoroughly",
    expected_output="A detailed research brief",
    agent=researcher,
)

write_task = Task(
    description="Write a report based on research",
    expected_output="A well-structured report",
    agent=writer,
)

crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    process=Process.sequential,
    verbose=True,
)

result = crew.kickoff()

Core Principles

  1. Agents are Roles, not functions. Role + Goal + Backstory defines the agent's identity. Strong role definitions reduce hallucination.
  2. Tasks declare what, not how. Description + expected_output defines the task. The agent figures out execution.
  3. Sequential is for pipelines, Hierarchical is for complexity. Sequential runs tasks in order. Hierarchical uses a manager agent to delegate and validate.
  4. Manager LLM is required for Hierarchical. Without manager_llm, hierarchical process fails silently.
  5. Delegation loops are real. allow_delegation=True without max_iter bounds can cause infinite handoffs.
  6. Tool errors don't raise. A failed tool call marks the task as failed but doesn't raise an exception. Check task output.

Where to Start

You already have... Start here
Nothing — exploring CrewAI Sequential crew with 2 agents (research → write)
Agents you want to coordinate Build a Hierarchical crew with manager_llm
Tools you want to integrate Use @tool decorator, add tools to relevant agents
A production deployment Add callbacks, memory, error handling

Quick Reference

Task Approach Reference
Define agent Agent(role, goal, backstory) references/agent-design.md
Define task Task(description, expected_output, agent) references/task-design.md
Sequential crew Crew(process=Process.sequential) references/crew-patterns.md
Hierarchical crew Crew(process=Process.hierarchical, manager_llm=...) references/crew-patterns.md
Create tool @tool("name") decorator references/tool-integration.md
Add callbacks step_callback=fn on Agent references/callbacks.md
Enable memory memory=True on Crew or Agent references/crew-patterns.md

Framework Routing Guide

Scenario Reach for Why
Role-based multi-agent teams CrewAI Role/Goal/Backstory is the native abstraction
State-machine multi-agent LangGraph Graph topology, subgraphs, human-in-the-loop
Conversational multi-agent AutoGen Agent chat as orchestration primitive
Chain/agent composition LangChain LCEL pipe operator for general chains
Documents to query / RAG LlamaIndex Data ingestion is the primary primitive

Reference Files

Reference Load when File
Agent Design Defining agents with roles, goals, backstories references/agent-design.md
Task Design Creating tasks with descriptions and outputs references/task-design.md
Crew Patterns Sequential, hierarchical, consensual crews references/crew-patterns.md
Tool Integration Creating tools with @tool decorator references/tool-integration.md
Callbacks Monitoring agent and task execution references/callbacks.md
Memory System Unified Memory class, cross-agent context references/memory-system.md
Flows Event-driven orchestration connecting crews references/flows.md
FAQ & Troubleshooting Common errors and fixes references/faq-and-troubleshooting.md

Templates

Template When to use File
Research Crew Sequential: researcher → writer → reviewer templates/research-crew.py
Hierarchical Crew Manager with specialist agents templates/hierarchical-crew.py
Customer Support Triage → specialist → response templates/support-crew.py

Troubleshooting

Symptom Likely cause Fix Reference
Crew runs but no output Agent stuck in delegation loop Set max_iter=15 on agent references/agent-design.md
Hierarchical crew fails No manager_llm set Add manager_llm=ChatOpenAI(model="gpt-4") references/crew-patterns.md
Task never completes Agent exceeds max_iter Increase max_iter or simplify task references/agent-design.md
Tool not being called Tool not added to agent Add tools=[my_tool] to Agent definition references/tool-integration.md
High token usage Hierarchical mode Manager processes all outputs — use cheaper LLM references/crew-patterns.md
Memory between tasks not working Crew-level memory not set Add memory=True to Crew references/crew-patterns.md

When NOT to Use CrewAI

  • Single-agent task — too much abstraction for one agent
  • Need fine-grained graph control (cycles, conditional branching) — use LangGraph
  • Need conversational agent interactions — use AutoGen
  • Need simple chain composition — use LangChain LCEL
Files (agent-skills)
  • evals
    • evals.json 2.7 KB
      Loading…
  • references
    • agent-design.md 2 KB
      Loading…
    • callbacks.md 817 B
      Loading…
    • crew-patterns.md 1.7 KB
      Loading…
    • faq-and-troubleshooting.md 1.2 KB
      Loading…
    • flows.md 1.6 KB
      Loading…
    • memory-system.md 1.6 KB
      Loading…
    • task-design.md 1.6 KB
      Loading…
    • tool-integration.md 1.4 KB
      Loading…
    • validation-audit.md 1.4 KB
      Loading…
  • scripts
    • check-setup.py 652 B
      Loading…
  • templates
    • hierarchical-crew.py 1.2 KB
      Loading…
    • research-crew.py 1.2 KB
      Loading…
    • support-crew.py 1.4 KB
      Loading…
  • README.md 1.6 KB
    # CrewAI — Role-Based Multi-Agent Orchestration
    
    An expert-level skill for building **role-based multi-agent teams** with CrewAI. Agents are defined as Roles with Goals and Backstories; crews are composed with sequential or hierarchical workflows.
    
    ## Why Install This Skill
    
    When your agent loads this skill, it becomes a CrewAI expert who can:
    
    - **Design agent roles** — define agents with Role, Goal, Backstory, and tool sets
    - **Compose crews** — sequential and hierarchical process patterns
    - **Design tasks** — structured tasks with expected outputs and context
    - **Integrate tools** — custom tools, LangChain tools, and built-in tools
    - **Handle callbacks and events** — step callbacks, task events, crew completion
    - **Production considerations** — caching, memory, and deployment patterns
    
    ## What You Get
    
    | Directory | Purpose |
    |-----------|---------|
    | `SKILL.md` | Quick-start guide, core paradigm, and framework comparison |
    | `references/` | Deep dives into agent design, task patterns, crew composition, tools, callbacks, production, and framework comparisons |
    
    ## Framework Comparison
    
    CrewAI is higher-abstraction than LangGraph (which is a low-level state machine) and more structured than AutoGen (which uses free-form conversations). It's best when you have well-defined roles with clear responsibilities.
    
    ## Requirements
    
    Python 3.8+ with `crewai` and `crewai-tools` packages.
    
    
    ## Quick Start
    
    Start with the setup and first workflow in SKILL.md, then use the linked resources for the specific task you need to complete.
    
    
    ## Triggers
    
    Use this skill for the task types and keywords described in its SKILL.md description.
    
  • SKILL.md 6.5 KB
    ---
    name: crewai
    description: >-
      Build role-based multi-agent systems with CrewAI. Agents with Role/Goal/Backstory, task
      design, crew composition (sequential or hierarchical), tool integration, callbacks, and
      production deployment. Use when orchestrating multi-agent teams or comparing agent
      frameworks. Do not use this skill for unrelated requests; route to the nearest named
      specialist.
    license: MIT
    metadata:
      author: Magnus Hedemark
      version: 1.1.0
      source: https://docs.crewai.com
    ---
    
    # CrewAI Expert Skill
    
    CrewAI is a framework for **role-based multi-agent orchestration**. Unlike LangGraph's low-level state-machine graphs, CrewAI provides a higher abstraction: agents are defined as Roles with Goals and Backstories, crews are composed with built-in sequential or hierarchical workflows, and inter-agent delegation is built into the framework.
    
    ## Core Paradigm
    
    ```python
    from crewai import Agent, Task, Crew, Process
    from crewai.tools import tool
    
    @tool("search")
    def search_web(query: str) -> str:
        """Search the web for information."""
        return f"Results for: {query}"
    
    researcher = Agent(
        role="Senior Researcher",
        goal="Find accurate information on any topic",
        backstory="Expert researcher with 10 years of experience",
        tools=[search_web],
        verbose=True,
    )
    
    writer = Agent(
        role="Technical Writer",
        goal="Write clear reports from research findings",
        backstory="Experienced technical writer",
        verbose=True,
    )
    
    research_task = Task(
        description="Research the topic thoroughly",
        expected_output="A detailed research brief",
        agent=researcher,
    )
    
    write_task = Task(
        description="Write a report based on research",
        expected_output="A well-structured report",
        agent=writer,
    )
    
    crew = Crew(
        agents=[researcher, writer],
        tasks=[research_task, write_task],
        process=Process.sequential,
        verbose=True,
    )
    
    result = crew.kickoff()
    ```
    
    ## Core Principles
    
    1. **Agents are Roles, not functions.** Role + Goal + Backstory defines the agent's identity. Strong role definitions reduce hallucination.
    2. **Tasks declare what, not how.** Description + expected_output defines the task. The agent figures out execution.
    3. **Sequential is for pipelines, Hierarchical is for complexity.** Sequential runs tasks in order. Hierarchical uses a manager agent to delegate and validate.
    4. **Manager LLM is required for Hierarchical.** Without `manager_llm`, hierarchical process fails silently.
    5. **Delegation loops are real.** `allow_delegation=True` without `max_iter` bounds can cause infinite handoffs.
    6. **Tool errors don't raise.** A failed tool call marks the task as failed but doesn't raise an exception. Check task output.
    
    ## Where to Start
    
    | You already have... | Start here |
    |---|---|
    | Nothing — exploring CrewAI | Sequential crew with 2 agents (research → write) |
    | Agents you want to coordinate | Build a Hierarchical crew with manager_llm |
    | Tools you want to integrate | Use @tool decorator, add tools to relevant agents |
    | A production deployment | Add callbacks, memory, error handling |
    
    ## Quick Reference
    
    | Task | Approach | Reference |
    |------|----------|-----------|
    | Define agent | `Agent(role, goal, backstory)` | `references/agent-design.md` |
    | Define task | `Task(description, expected_output, agent)` | `references/task-design.md` |
    | Sequential crew | `Crew(process=Process.sequential)` | `references/crew-patterns.md` |
    | Hierarchical crew | `Crew(process=Process.hierarchical, manager_llm=...)` | `references/crew-patterns.md` |
    | Create tool | `@tool("name")` decorator | `references/tool-integration.md` |
    | Add callbacks | `step_callback=fn` on Agent | `references/callbacks.md` |
    | Enable memory | `memory=True` on Crew or Agent | `references/crew-patterns.md` |
    
    ## Framework Routing Guide
    
    | Scenario | Reach for | Why |
    |----------|-----------|-----|
    | Role-based multi-agent teams | **CrewAI** | Role/Goal/Backstory is the native abstraction |
    | State-machine multi-agent | **LangGraph** | Graph topology, subgraphs, human-in-the-loop |
    | Conversational multi-agent | **AutoGen** | Agent chat as orchestration primitive |
    | Chain/agent composition | **LangChain** | LCEL pipe operator for general chains |
    | Documents to query / RAG | **LlamaIndex** | Data ingestion is the primary primitive |
    
    ## Reference Files
    
    | Reference | Load when | File |
    |-----------|-----------|------|
    | Agent Design | Defining agents with roles, goals, backstories | `references/agent-design.md` |
    | Task Design | Creating tasks with descriptions and outputs | `references/task-design.md` |
    | Crew Patterns | Sequential, hierarchical, consensual crews | `references/crew-patterns.md` |
    | Tool Integration | Creating tools with @tool decorator | `references/tool-integration.md` |
    | Callbacks | Monitoring agent and task execution | `references/callbacks.md` |
    | Memory System | Unified Memory class, cross-agent context | `references/memory-system.md` |
    | Flows | Event-driven orchestration connecting crews | `references/flows.md` |
    | FAQ & Troubleshooting | Common errors and fixes | `references/faq-and-troubleshooting.md` |
    
    ## Templates
    
    | Template | When to use | File |
    |----------|-------------|------|
    | Research Crew | Sequential: researcher → writer → reviewer | `templates/research-crew.py` |
    | Hierarchical Crew | Manager with specialist agents | `templates/hierarchical-crew.py` |
    | Customer Support | Triage → specialist → response | `templates/support-crew.py` |
    
    ## Troubleshooting
    
    | Symptom | Likely cause | Fix | Reference |
    |---------|-------------|-----|-----------|
    | Crew runs but no output | Agent stuck in delegation loop | Set `max_iter=15` on agent | `references/agent-design.md` |
    | Hierarchical crew fails | No `manager_llm` set | Add `manager_llm=ChatOpenAI(model="gpt-4")` | `references/crew-patterns.md` |
    | Task never completes | Agent exceeds max_iter | Increase `max_iter` or simplify task | `references/agent-design.md` |
    | Tool not being called | Tool not added to agent | Add `tools=[my_tool]` to Agent definition | `references/tool-integration.md` |
    | High token usage | Hierarchical mode | Manager processes all outputs — use cheaper LLM | `references/crew-patterns.md` |
    | Memory between tasks not working | Crew-level memory not set | Add `memory=True` to Crew | `references/crew-patterns.md` |
    
    ## When NOT to Use CrewAI
    
    - Single-agent task — too much abstraction for one agent
    - Need fine-grained graph control (cycles, conditional branching) — use LangGraph
    - Need conversational agent interactions — use AutoGen
    - Need simple chain composition — use LangChain LCEL
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.