comment-code-generate-a-tutorial
作者: github
将Python脚本重构为适合初学者的项目,包含教学注释和Markdown教程。遵循PEP 8风格指南和标准Python最佳实践以提升代码质量,在代码中添加贯穿始终的教学注释,解释逻辑、原理及对学习者的重要性。生成完整的README.md教程,包含项目概述、设置说明、代码解析、使用示例和示例输出。重命名不清晰的变量和函数以提高可读性...
npx skills add https://github.com/github/awesome-copilot --skill comment-code-generate-a-tutorialTransform this Python script into a polished, beginner-friendly project by refactoring the code, adding clear instructional comments, and generating a complete markdown tutorial.
-
Refactor the code
- Apply standard Python best practices
- Ensure code follows the PEP 8 style guide
- Rename unclear variables and functions if needed for clarity
-
Add comments throughout the code
- Use a beginner-friendly, instructional tone
- Explain what each part of the code is doing and why it's important
- Focus on the logic and reasoning, not just syntax
- Avoid redundant or superficial comments
-
Generate a tutorial as a
README.mdfile
Include the following sections:- Project Overview: What the script does and why it's useful
- Setup Instructions: Prerequisites, dependencies, and how to run the script
- How It Works: A breakdown of the code logic based on the comments
- Example Usage: A code snippet showing how to use it
- Sample Output: (Optional) Include if the script returns visible results
- Use clear, readable Markdown formatting