Global Instructions

  • Purpose: Define overarching coding standards and preferences applicable across all projects.

  • Functionality: Set guidelines that the AI follows universally, maintaining consistency in code quality and style.

  • Usage: Ideal for enforcing company-wide coding conventions & for personal coding habits too.

How to Use :

1

Set Your Preferences:

Decide on the coding conventions you want the AI to follow. For example, you might prefer using single quotes for strings or always adding comments to your code.

2

Configure in PureCode AI:

Enter these preferences into the Global Instructions section of the PureCode AI. This tells the AI to tailor its suggestions according to your specified guidelines


Examples:

  1. Naming Conventions:

    • Instruction: Use camelCase for variable and function names, and PascalCase for class names.

    • Benefit: Ensures consistent and readable naming throughout your codebase.

  2. Standardize Error Handling Mechanisms:

    • Instruction: Use try-catch blocks for exception handling in asynchronous functions and ensure all errors are logged with relevant context.

    • Benefit: Promotes robust error management and simplifies debugging processes.

  3. Commenting Practices:

    • Instruction: Write JSDoc comments for all public functions and classes.

    • Benefit: Improves code documentation and aids in generating API documentation.

  4. Import Order:

    • Instruction: Organize imports alphabetically, with external libraries first, followed by internal modules.

    • Benefit: Enhances readability and maintainability of import statements.

  5. Implement Comprehensive Commenting Practices:

    • Instruction: Write clear and concise comments for all complex code blocks, including function descriptions, parameter explanations, and return value details.

    • Benefit: Improves code maintainability and aids team members in understanding intricate logic.

Last updated