|
| 1 | +# F´ Generative AI Usage Guidelines |
| 2 | + |
| 3 | +We're excited about the potential of generative AI to help make [F´](https://github.com/nasa/fprime) development more productive, enjoyable, and accessible! Whether you're using AI to write code, improve documentation, or learn about complex systems, we welcome the thoughtful use of these powerful tools in your F´ contributions. |
| 4 | + |
| 5 | +This guide shares our community's approach to using generative AI effectively and responsibly. You'll find practical tips, best practices, and simple guidelines to help you get the most out of AI tools while maintaining the quality standards that make F´ great. |
| 6 | + |
| 7 | +## Our Position on Generative AI |
| 8 | + |
| 9 | +F´ embraces technological advancement and innovation. Generative AI tools can assist with: |
| 10 | + |
| 11 | +- Code generation and refactoring |
| 12 | +- Documentation creation and improvement |
| 13 | +- Test case development |
| 14 | +- Debugging assistance |
| 15 | +- Design pattern suggestions |
| 16 | +- Learning and understanding our codebases |
| 17 | + |
| 18 | +However, the use of generative AI must align with our commitment to high technical standards, quality, and the collaborative nature of open source development. |
| 19 | + |
| 20 | +## Disclosure |
| 21 | + |
| 22 | +To maintain transparency and enable effective code review, contributors **must disclose all generative AI usage**. |
| 23 | +This includes contributions in the forms of **Pull Requests**, **Issues** or **Discussions**. |
| 24 | + |
| 25 | +### Pull Request Submissions for Contributors |
| 26 | + |
| 27 | +1. **Fill-In the "AI Used (y/n)" table entry** in the pull request template disclosing whether Gen AI was used in the pull request |
| 28 | +2. **Provide details in the "AI Usage" section** describing how generative AI was utilized |
| 29 | + |
| 30 | +### What to Disclose |
| 31 | + |
| 32 | +Include information about: |
| 33 | + |
| 34 | +- **Type of assistance**: Code generation, documentation, debugging, testing, refactoring, etc. |
| 35 | +- **Scope of usage**: Which files, functions, or sections were AI-assisted |
| 36 | +- **Tool(s) used**: Name of the AI system(s) employed (e.g., GitHub Copilot, ChatGPT, etc.) |
| 37 | +- **Level of modification**: Whether AI-generated content was used as-is, modified, or used as inspiration |
| 38 | + |
| 39 | + |
| 40 | +### What AI Cannot Replace |
| 41 | + |
| 42 | +- **Domain expertise** in flight software and embedded systems |
| 43 | +- **Understanding of F Prime architecture** and design patterns |
| 44 | +- **Critical thinking** about system requirements and constraints |
| 45 | +- **Human judgment** on safety-critical decisions |
| 46 | +- **Community collaboration** and peer review processes |
| 47 | + |
| 48 | +## Best Practices |
| 49 | + |
| 50 | +### Providing Guidelines to AI Tools |
| 51 | + |
| 52 | +When working with generative AI, provide clear rules and context to improve code quality and consistency. For Example: |
| 53 | + |
| 54 | +- **Reference F´ Style Guidelines**: Include the [F´ Style Guidelines](https://github.com/nasa/fprime/wiki/F%C2%B4-Style-Guidelines) in your prompts |
| 55 | +- **Enforce coding standards**: Instruct AI to avoid "magic numbers" and use descriptive variable names or comments |
| 56 | +- **Provide project context**: Share relevant F´ architectural patterns and component structures |
| 57 | + |
| 58 | +### Quality and Responsibility |
| 59 | + |
| 60 | +- **Review all AI-generated code** thoroughly before submission |
| 61 | +- **Verify necessity and relevance** - Remove verbose or unnecessary AI-generated content |
| 62 | +- **Be concise** - Edit AI output to be clear and to-the-point |
| 63 | +- **Ensure compliance** with F Prime coding standards and style guidelines |
| 64 | +- **Verify correctness** and test all AI-assisted implementations |
| 65 | +- **Maintain authorship responsibility** - you are accountable for all submitted code regardless of its origin |
| 66 | + |
| 67 | +### Security |
| 68 | + |
| 69 | +- **Be cautious with external dependencies** suggested by AI tools |
| 70 | +- **Validate security implications** of AI-generated code, especially for flight software |
| 71 | + |
| 72 | +### Code Review Considerations |
| 73 | + |
| 74 | +- **Provide context** to reviewers about AI usage to enable informed evaluation |
| 75 | +- **Be prepared to explain** AI-generated logic and design decisions |
| 76 | +- **Accept feedback gracefully** - AI-generated code is not exempt from revision requests |
| 77 | +- **Document complex AI-assisted algorithms** clearly for future maintainers |
| 78 | + |
| 79 | +## Getting Help |
| 80 | + |
| 81 | +If you have questions about appropriate AI usage or need guidance on disclosure: |
| 82 | + |
| 83 | +- Open a [Discussion](https://github.com/nasa/fprime/discussions) for community input |
| 84 | +- Contact the Community Managers for specific guidance |
0 commit comments