AI-generated code can be accepted as a contribution to this project as long as the contributor follows the following guidance.
When using AI coding assistants (such as GitHub Copilot, ChatGPT, Claude, or other similar tools) to help with development work on PatternFly, please follow these guidelines to ensure code quality, security, and transparency:
-
Treat AI-generated code as suggestions, not final code. Review all generated code and modify as appropriate. Thoroughly review and test all code that you intend to integrate into your work.
-
Do not blindly trust the code assistant output. Always apply your own judgment and expertise. AI coding assistants can introduce security vulnerabilities if not used carefully, and AI models can sometimes hallucinate and provide incorrect or non-functional code.
-
Make sure you thoroughly understand any AI-generated code. If the generated code you intend to incorporate in your work is outside your expertise, consult with someone knowledgeable in the area prior to making it available to others.
Nontrivial and substantial AI-generated or AI-assisted content should be marked.
-
In a commit message, or in a pull request/merge request description field, identify the code assistant that you used, perhaps elaborating on how it was used. You may wish to use a trailer like "Assisted-by:" or "Generated-by:". For example:
Assisted-by: GitHub Copilot Generated-by: ChatGPT for initial component structure
-
In the case of entire generated files, in a source file comment, indicate the use of the code assistant. For example:
// Generated by GitHub Copilot // AI-assisted implementation with human review and modifications <code goes here>
- Security review: Pay special attention to security implications of AI-generated code, especially when dealing with user input, authentication, or data handling.
- Testing: Ensure that AI-generated code is thoroughly tested and meets all existing project standards for testing coverage.
- Code style: Verify that AI-generated code follows PatternFly's coding standards and style guidelines as outlined in this document.
- Documentation: If AI assists in generating documentation or comments, review them for accuracy and completeness.