comment-code-generate-a-tutorial

Refactor Python scripts to PEP 8, add beginner comments, and generate a README tutorial.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/serpro-workshop-fortaleza/sifap-modernization-paula --skill comment-code-generate-a-tutorial-serpro-workshop-fortaleza
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: comment-code-generate-a-tutorial
Source: https://github.com/serpro-workshop-fortaleza/sifap-modernization-paula/tree/main/.github/skills/comment-code-generate-a-tutorial
Command: npx skills add https://github.com/serpro-workshop-fortaleza/sifap-modernization-paula --skill comment-code-generate-a-tutorial-serpro-workshop-fortaleza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Turning a working script into a teachable artifact is tedious: you must clean up the code without changing behavior, write comments that explain reasoning rather than syntax, and produce a README that beginners can actually follow. This Skill standardizes that three-step process so the result is consistent and verified. ## Core Features & Use Cases - Behavior-preserving refactoring: Applies the language style guide (PEP 8 for Python), renames unclear identifiers, and extracts long blocks into named functions while keeping output identical. - Instructive commenting: Adds comments that explain design decisions, language idioms, and edge cases instead of narrating obvious syntax. - Tutorial generation: Produces a README.md with project overview, setup instructions, how-it-works explanation, usage example, and optional sample output. - Use Case: You have a utility script like wordcount.py that works but is cryptic. Use this Skill to refactor it, annotate it for beginners, and publish a tested step-by-step guide in Brazilian Portuguese. ## Quick Start Refactor my Python script wordcount.py for clarity, add beginner-friendly comments explaining the reasoning, and generate a complete README.md tutorial with setup and usage examples.

Frequently Asked Questions about comment-code-generate-a-tutorial

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a Python script and write a tutorial for it?

Follow a three-step process: refactor the code to PEP 8 without changing behavior, add comments explaining design reasoning rather than syntax, then write a README.md with overview, setup, how-it-works, and usage example sections.

What makes a good code comment for beginners?

Good comments explain why a design decision was made, introduce a language idiom at its first occurrence, or warn about edge cases and invariants. Avoid comments that merely restate what a line of code does.

Does refactoring change the script's behavior?

No. The refactoring step only improves readability through renaming and function extraction. The public interface, observable output, file encoding, and line endings must remain identical, and the script must still run correctly.

Can this process be used for languages other than Python?

Yes. Although the example uses Python and PEP 8, the same three-step procedure of refactoring, instructive commenting, and tutorial generation applies to any programming language using its own style guide.

What sections should a tutorial README include?

A tutorial README should include a project overview, setup instructions with requirements, a how-it-works explanation, a usage example, and optionally a sample output. The setup command and example should be executed and verified before publishing.