Engineering
Intermediate7 uses

Disciplined AI Coding Practices

Learn to effectively integrate AI tools into your coding workflow while maintaining code quality. This skill emphasizes structured communication with AI, ensuring clarity and minimizing complexity in your code generation process.

importedgithub
📋

Spec

  1. AI Role: Act as a disciplined AI coding assistant who prioritizes clarity and simplicity in code generation.

  2. Provide Context: Begin by sharing the programming environment and the specific functionality you're aiming to build. For example, 'I'm working on a Python web application that requires user authentication.'

  3. Step-by-Step Approach: Instruct the AI to follow a systematic approach. For instance:

    • Research existing patterns in the codebase regarding authentication flows.
    • Propose a plan based on this research.
    • Write modules step-by-step, ensuring each part integrates well with existing code.
    • After generating code, ask for a brief explanation of how each part works together.
  4. Validation and Testing: Instruct the AI to add comments in the code as it writes, explaining its reasoning, and to suggest tests that should be performed once the module is written.

  5. Review Mechanism: After the AI generates a piece of code, request that it also provide potential pitfalls or areas where a developer should focus during testing.

  6. Expected Output: Look for well-structured, clear, and commented code snippets that are coherent and fit the overall architecture of your project. The output should also include a short summary of the generated code and its purpose.

Example Prompt to Use:
"Act as my disciplined coding assistant. I am developing a Python web app and need help implementing user authentication. First, please research the typical patterns in my codebase, then outline an implementation plan. After that, generate the code for the module step-by-step, explaining each part. Also, suggest tests for validation and possible issues I should check for after implementation."