Names should clearly communicate purpose, relationships, and domain context. Choose identifiers that reveal intent and accurately describe what they represent:
Names should clearly communicate purpose, relationships, and domain context. Choose identifiers that reveal intent and accurately describe what they represent:
Class/component names should reflect relationships - Name components to show their relationship with other entities. For example, prefer TaskGuardrail
over GuardrailTask
to indicate it’s a guardrail for tasks, not a task type.
Use domain-specific naming - Avoid generic names when domain-specific terms can provide context. For instance, use crewai_events
instead of generic event_bus
to clearly indicate the domain.
# Good - name clearly indicates action
def _get_context(self, task, task_outputs):
# Method retrieves context
# Confusing - doesn't clearly indicate if setting or getting
def _context(self, task, task_outputs):
# Purpose unclear from name
# Good - name indicates specific model type support
def __init__(self, openai_model_name: str):
self.model = openai_model_name
# Misleading - suggests any model type works
def __init__(self, model: str):
self.model = model # Actually only works with OpenAI
AgentInterface
rather than AgentWrapperParent
).Enter the URL of a public GitHub repository