comment-code-generate-a-tutorial
github/awesome-copilot
Turns a raw Python script into a refactored, well-commented project with an auto-generated README tutorial.
What is comment-code-generate-a-tutorial?
This skill instructs the agent to refactor a Python script to PEP 8 standards, add beginner-friendly explanatory comments, and produce a complete README.md tutorial covering overview, setup, code walkthrough, and usage. Use it when you want to turn a quick script into a polished, shareable, well-documented learning resource.
- Refactors Python code to follow PEP 8 and best practices, including renaming unclear variables/functions
- Adds instructional, beginner-friendly comments explaining logic and reasoning throughout the code
- Generates a README.md tutorial with Project Overview, Setup Instructions, How It Works, Example Usage, and optional Sample Output sections
- Formats the tutorial in clear, readable Markdown
How to install comment-code-generate-a-tutorial
npx skills add https://github.com/github/awesome-copilot --skill comment-code-generate-a-tutorial- An existing Python script to transform
How to use comment-code-generate-a-tutorial
- 1.Provide the Python script you want transformed to the agent
- 2.Invoke the skill so the agent refactors the code per PEP 8 and best practices
- 3.Review the added instructional comments throughout the refactored code
- 4.Have the agent generate the README.md tutorial with the required sections
- 5.Review and adjust the generated README and code as needed before publishing
Use cases
- Converting a personal/throwaway Python script into a publishable, portfolio-ready project
- Preparing teaching materials or tutorials from existing code for beginners
- Cleaning up and documenting legacy or undocumented Python scripts before sharing with a team
- Generating onboarding documentation for a small Python utility
- Developers preparing scripts for open-source release
- Educators or content creators writing coding tutorials
- Engineers documenting internal Python tools
- Beginners wanting clean, well-explained example code
comment-code-generate-a-tutorial FAQ
No, it is specifically designed for Python scripts and PEP 8 style conventions.
The goal is refactoring for clarity and style, not changing functionality, but you should review the output to confirm behavior is preserved.
A README.md with Project Overview, Setup Instructions, How It Works, Example Usage, and optionally Sample Output.
No, it avoids redundant or superficial comments and focuses on explaining important logic and reasoning.
Full instructions (SKILL.md)
Source of truth, from github/awesome-copilot.
name: comment-code-generate-a-tutorial description: 'Transform this Python script into a polished, beginner-friendly project by refactoring the code, adding clear instructional comments, and generating a complete markdown tutorial.'
Transform 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
Related skills
More from github/awesome-copilot and the wider catalog.
git-commit
Execute semantic git commits with conventional message analysis and intelligent staging.
excalidraw-diagram-generator
Generate Excalidraw diagrams from natural language descriptions.
documentation-writer
Create structured technical documentation using the Diátaxis framework for tutorials, how-to guides, references, and explanations.
gh-cli
GitHub CLI comprehensive reference for repositories, issues, PRs, Actions, projects, releases, and all GitHub operations from the command line.
prd
Generate comprehensive Product Requirements Documents with executive summaries, user stories, technical specs, and risk analysis.
refactor
Surgical code refactoring to improve maintainability without changing behavior.