Prompt
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
TaskGuardrailoverGuardrailTaskto 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_eventsinstead of genericevent_busto clearly indicate the domain. - Method names should indicate actions - Name methods with verbs that describe what they do:
# 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 - Parameter names should indicate limitations - When parameters have specific constraints, reflect this in the 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 - Interface naming should follow conventions - Use recognized naming patterns for interfaces and abstract classes (e.g.,
AgentInterfacerather thanAgentWrapperParent).