Prompt
Choose names that precisely reflect the component’s purpose and behavior, avoiding ambiguous terms or shortcuts. Names should be self-documenting and consistent with related components.
Key guidelines:
- Use exact technical terms (e.g., ‘identity_loader’ not ‘noop_loader’ for a function that returns its input)
- Maintain semantic precision (e.g., ‘metadata_collection’ not ‘meta_collection’ since it stores data about data)
- Ensure component names match their behavior (e.g., ‘SchematicGenerator’ not ‘JSONGenerator’ if JSON is just an implementation detail)
- Use consistent terminology within related components
Example:
# Incorrect - ambiguous or imprecise names
class JSONGenerator:
def generate(self, data: dict) -> dict:
pass
meta_collection = db.get_collection("meta")
def noop_loader(doc: dict) -> dict:
return doc
# Correct - precise, semantic names
class SchematicGenerator:
def generate(self, data: dict) -> dict:
pass
metadata_collection = db.get_collection("metadata")
def identity_loader(doc: dict) -> dict:
return doc