LEAP
LEAP builds skills through two pipelines: Branch A distills a skill from raw data, while Branch B combines multiple skills into one. It is called by the main…
SOP for building multi-agent systems with CrewAI — role-based collaboration, sequential/hierarchical processes, Flows, memory, delegation. Use when modeling agent teams with clear roles and task pipelines.
$ npx -y skills add agentsope/SkillAlchemy --skill agentsop-crewai --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/agentsop-crewaiContext preview
The summary Claude sees to decide when to auto-load this skill.
SOP for building multi-agent systems with CrewAI — role-based collaboration, sequential/hierarchical processes, Flows, memory, delegation. Use when modeling agent teams with clear roles and task pipelines.
name: agentsop-crewai version: 1.0.0 description: SOP for building multi-agent systems with CrewAI — role-based collaboration, sequential/hierarchical processes, Flows, memory, delegation. Use when modeling agent teams with clear roles and task pipelines. domain: multi-agent-orchestration framework: crewAI framework_version: ">=0.80, current 1.14.x (May 2026)" trigger_keywords: - "multi-agent crew" - "role-based agents" - "agent collaboration" - "sequential process" - "hierarchical agents" - "manager agent" - "CrewAI Flow" - "agent delegation" when_to_use: - "modeling 2-5 specialized agents with clear roles (researcher + writer + reviewer)" - "linear or hierarchical content pipelines where role separation is intuitive" - "rapid prototyping of agent teams without graph-state engineering" - "business workflows where ops/PM can reason about agents as 'team members'" when_not_to_use: - "single-agent tasks (~80% of use cases per production guides — use plain LLM call)" - "cyclic / state-rich workflows with branching logic (use LangGraph)" - "real-time / sub-second latency (multi-agent handshakes add 30–50% tokens)" - "conversational debate / negotiation patterns (use AutoGen)" - "deterministic routing with strict SLA (CrewAI hierarchical executes tasks sequentially regardless of triage)"
> 框架口号: "Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly." [github.com/crewAIInc/crewAI]
---
> "An agent needs agency, otherwise it's just another script." — João Moura, CrewAI 创始人 [softwareengineeringdaily.com/2025/06/03/crew-ai-with-joao-moura/]
如果你能用 `if/else` 提前写死流程,**不要用 Crew**。Crew 的本质是把"决策权"让渡给 LLM 角色。
---
Agent (role + goal + backstory) ← 谁 ↓ 持有 Task (description + expected_output + agent + context) ← 做什么 ↓ 组装 Crew (agents + tasks + process) ← 怎么协作 ↓ 选择 Process (sequential | hierarchical) + Flow (event-driven 编排) ← 控制流
CrewAI 的核心假设:**LLM 在 role-playing 状态下表现更好**。
> "Backstory provides depth to the agent's persona, enriching its motivations and engagements within the crew." [docs.crewai.com/en/concepts/agents]
**关键洞察**: backstory 不是装饰。它是 system prompt 的最大杠杆——同一个 role+goal,换 backstory 会显著改变产出质量与风格。
| 维度 | Sequential | Hierarchical | Flow | |---|---|---|---| | 任务路由 | 静态列表顺序 | manager LLM 动态分派 | `@listen` 事件驱动 | | 控制力 | 高 (写死顺序) | 低 (manager 自由发挥) | 最高 (代码 + 状态) | | Token 开销 | 1× 基线 | 1.3–1.5× (manager overhead) | 接近 1× | | 调试难度 | 低 | 高 (manager 黑盒) | 中 | | 何时用 | 80% 场景默认 | 真正需要动态分派 | 复杂分支 + 多 Crew 编排 | | 已知坑 | task context 自动透传可能膨胀 | manager 会"执行所有 task"而非"按需调用" | 学习曲线 + 状态设计 |
参考: [docs.crewai.com/en/learn/hierarchical-process], [docs.crewai.com/en/concepts/flows], [towardsdatascience.com/why-crewais-manager-worker-architecture-fails-and-how-to-fix-it/]
CrewAI **从零写成、零 LangChain 依赖**,是 João Moura 刻意决定。这带来:
---
[问] 这个任务是否需要 ≥2 个截然不同的"专业视角"协作? ├─ 否 → 用单 agent + tools,停止使用 CrewAI └─ 是 → 继续 [问] 流程是否有循环 / 状态依赖 / 人工中断点? ├─ 是 → 转 LangGraph (或 CrewAI Flow + 简化的 Crew) └─ 否 → 进入 Phase 1
researcher = Agent(
role="Senior AI Research Analyst", # ← 名词性头衔,含"高级/资深"提升先验
goal="Uncover cutting-edge developments in {topic} with citations", # ← 含 {var} 模板 + 验收标准
backstory=(
"You're a methodical researcher with 10 years at top AI labs. "
"You distrust hype and always cross-check with primary sources." # ← 注入判断偏好
),
allow_delegation=False, # ← 默认 False,避免 ping-pong
max_iter=10, # ← 显式收敛上限(默认 20–25)
verbose=True, # ← 开发期必开
tools=[search_tool],
)配置与代码分离,使用 `@CrewBase` 装饰器 + `config/agents.yaml` + `config/tasks.yaml`,便于非工程人员迭代提示词 [docs.crewai.com YAML Configuration]。
analysis_task = Task(
descriptiTurn people, methods, and experience into installable, reusable agent skills. SkillAlchemy is an open-world agent skill creation system that turns underspecified skill briefs and open-world sources into installable, reusable agent skills.
LEAP builds skills through two pipelines: Branch A distills a skill from raw data, while Branch B combines multiple skills into one. It is called by the main…
Lens — Add a cognitive lens to any problem. It accepts a task description and produces an enhanced description that surfaces hidden dimensions, prerequisites,…
Cross-framework enhancement overlay for choosing a multi-agent topology BEFORE writing any agent. A binary-question rubric — is single-agent + tools enough? do…
SOP for terminal-based, git-native AI pair programming with Aider (git work-tree + tree-sitter repo-map + edit-format + human-in-loop REPL). Use when editing…
Screens biomedical / life-science papers for signs of data fabrication, image manipulation, and statistical anomalies, using the detection techniques distilled…
Universal discipline for any LM-driven loop — agent retries, plan-act-observe, multi-agent handoffs, optimiser passes, test-fix cycles. Encodes the one rule…