Prompt
Use names that clearly convey purpose and maintain consistency across related components. Avoid generic identifiers (like dir) in favor of descriptive ones (like codex_home), and ensure placeholder names in string templates are self-explanatory (prefer SUMMARY_TEXT over {}). For related functions or elements, establish consistent naming patterns with meaningful symmetry, particularly for operations that are conceptually opposite.
When naming variables, functions, or constants:
- Choose semantically rich names that reveal intent
- Remove unnecessary prefixes for general-purpose elements (e.g., avoid
openai_request_max_retrieswhen it applies to all providers) - Ensure naming symmetry between related functions (if you have
fully_qualified_tool_name(), its counterpart should beparse_fully_qualified_tool_name())
Example:
// Poor naming
const TEMPLATE: &str = "Summary: {}";
fn get_name(s: &str, t: &str) -> String { /* ... */ }
fn extract(name: &str) -> (&str, &str) { /* ... */ }
// Better naming
const SUMMARY_TEMPLATE: &str = "Summary: {SUMMARY_TEXT}";
fn fully_qualified_tool_name(server: &str, tool: &str) -> String { /* ... */ }
fn parse_fully_qualified_tool_name(name: &str) -> (&str, &str) { /* ... */ }