Skip to content

Commit a5ecc2e

Browse files
docs(Contribute): add guidelines for contributing ai generated code (#4680)
* docs(Contribute): add guidelines for contributing ai generated code * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * Update packages/documentation-site/patternfly-docs/content/get-started/contribute.md Co-authored-by: Erin Donehoo <[email protected]> * update README --------- Co-authored-by: Erin Donehoo <[email protected]>
1 parent 5569289 commit a5ecc2e

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,7 @@ To contribute to PatternFly's HTML/CSS core repo, refer to the [core contributio
5959
### pf-docs-framework documentation
6060

6161
There is some historic documentation on pf-docs-framework at [packages/documentation-framework/README.md](packages/documentation-framework/README.md).
62+
63+
## AI-assisted development guidelines
64+
65+
Please reference [PatternFly's AI-assisted development guidelines](https://github.com/patternfly/.github/blob/main/CONTRIBUTING.md) if you'd like to contribute code generated using AI.

packages/documentation-site/patternfly-docs/content/get-started/contribute.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,42 @@ If you believe that you've come across a PatternFly bug, alert our team, so that
5555
- If the bug can be seen on both the React and HTML/CSS side, [create a bug issue in patternfly](https://github.com/patternfly/patternfly/issues).
5656
1. Be sure to mention which project the bug was noticed in and if there is a deadline that the fix is needed for.
5757

58+
### AI-assisted development guidelines
59+
60+
AI-generated code can be accepted as a contribution to this project as long as the contributor adheres to the following guidance.
61+
62+
When using AI coding assistants (such as GitHub Copilot, ChatGPT, Claude, or other similar tools) to help with development work on PatternFly React, please follow these guidelines to ensure code quality, security, and transparency:
63+
64+
1. **Verify and validate AI-generated code.**
65+
66+
- **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.
67+
68+
- **Do not automatically 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.
69+
70+
- **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.
71+
72+
1. **Mark any substantial AI-generated code portions.**
73+
74+
- Nontrivial and substantial AI-generated or AI-assisted content should be "marked", using one of the following approaches:
75+
76+
- **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 might also use a trailer like "Assisted-by:" or "Generated-by:". For example:
77+
78+
```
79+
Assisted-by: GitHub Copilot
80+
Generated-by: ChatGPT for initial component structure
81+
```
82+
83+
- **In a source file comment:** Indicate the use of the code assistant. For example:
84+
85+
```javascript
86+
// Generated by GitHub Copilot
87+
// AI-assisted implementation with human review and modifications
88+
```
89+
90+
1. **Review security:** Pay special attention to security implications of AI-generated code, especially when dealing with user input, authentication, or data handling.
91+
1. **Test your code:** Ensure that AI-generated code is thoroughly tested and meets all existing project standards for testing coverage.
92+
1. **Review code style:** Verify that AI-generated code follows PatternFly React's coding standards and style guidelines as outlined in this document.
93+
1. **Review documentation:** If AI assists in generating documentation or comments, review them for accuracy and completeness.
5894
## Documentation
5995

6096
Across our website, you can find PatternFly documentation that explains concepts, provides guidance, and outlines important resources for PatternFly users. Our documentation can always be improved, and we love to hear input from the people who use it.

0 commit comments

Comments
 (0)