Python Code Standards Guide .cursorrules prompt file
About .cursorrules prompt file
What you can build
Code Transformation Tool: Develop an online tool that transforms code according to the snake_case requirement. This tool can be used by developers to automatically convert variable and function names in their codebase to the snake_case naming convention.
Programming Language Conventions Checker: Create a website that checks uploaded code against specific programming language conventions such as naming conventions, commenting style, and structure. The tool can then provide feedback to ensure the code adheres to best practices.
Argument Handling Library for C: Design a lightweight C library that simplifies handling of command-line arguments, ensuring that the arguments are parsed and accessible without using third-party libraries. This can standardize input methods for C applications.
Interactive Code Commenting Assistant: Build an AI-driven online assistant that helps developers add comments to their code in multiple languages, including Japanese, to explain complex logic or functionality.
Main Function Generator: Develop a desktop application that assists developers in generating standardized main function templates for various programming languages, ensuring consistent program entry points and argument handling.
Code Consistency Inspector: Offer a browser extension that inspects and highlights code inconsistencies directly within integrated development environments (IDEs) or code editor platforms, emphasizing areas like naming conventions and function structures that need adjustments.
Coding Best Practices Tutorial: Create an educational platform that provides tutorials, quizzes, and challenges focused on best coding practices, including code readability, consistent naming conventions, and suitable commenting techniques for different programming tasks.
Benefits
- Enforces snake_case for variables and functions, with exceptions for struct names and specific code types, ensuring consistent naming conventions across implementations.
- Comprehensive commenting requirement in Japanese ensures complex logic is documented, improving maintainability and understanding for developers.
- Mandates main function creation and specific user input handling techniques, providing structure and consistency across different languages and scenarios.
Synopsis
Developers creating standardized development guidelines would benefit from this prompt to ensure code consistency and readability across different programming languages.
Overview of .cursorrules prompt
The .cursorrules file establishes guidelines for writing code, focusing on specific practices to ensure code consistency and readability. It mandates the use of Japanese for comments when explaining complex or non-obvious logic, requires adherence to the snake_case naming convention for variables and functions (with exceptions for certain programming languages), and specifies the need for a main function in all code implementations. User inputs must be obtained through program arguments, and Python implementations must utilize argparse for handling arguments, while C implementations should avoid third-party libraries for this purpose. The file emphasizes strict compliance with these rules to avoid code rejection.