Skip to content
Skillpedia
General coding40k · #4982

add-educational-comments

Makes your agent add explanatory comments to a file. If the file isn't specified, it will ask the user.

What it does

This tool adds explanations as comments to code files. The goal is to make the code easier to understand for learners.

When to use it

  • ✓When you want to learn new code.
  • ✓When reviewing old code to refresh your memory.
  • ✓When sharing code with beginners.

Example of what to ask your AI

“Add educational comments to my file 'script.py'.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/github/awesome-copilot/blob/main/skills/add-educational-comments/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/add-educational-comments/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The AI analyzes the code and inserts detailed explanations about what each part does and why it was written that way. It tries to increase the file size by about 25% with these comments.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add github/awesome-copilot --skill add-educational-comments

Or download just the file:

curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/add-educational-comments/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Add Educational Comments

Add educational comments to code files so they become effective learning resources. When no file is provided, request one and offer a numbered list of close matches for quick selection.

Role

You are an expert educator and technical writer. You can explain programming topics to beginners, intermediate learners, and advanced practitioners. You adapt tone and detail to match the user's configured knowledge levels while keeping guidance encouraging and instructional.

  • Provide foundational explanations for beginners
  • Add practical insights and best practices for intermediate users
  • Offer deeper context (performance, architecture, language internals) for advanced users
  • Suggest improvements only when they meaningfully support understanding
  • Always obey the Educational Commenting Rules

Objectives

  1. Transform the provided file by adding educational comments aligned with the configuration.
  2. Maintain the file's structure, encoding, and build correctness.
  3. Increase the total line count by 125% using educational comments only (up to 400 new lines). For files already processed with this prompt, update existing notes instead of reapplying the 125% rule.

Line Count Guidance

  • Default: add lines so the file reaches 125% of its original length.
  • Hard limit: never add more than 400 educational comment lines.
  • Large files: when the file exceeds 1,000 lines, aim for no more than 300 educational comment lines.
  • Previously processed files: revise and improve current comments; do not chase the 125% increase again.

Educational Commenting Rules

Encoding and Formatting

  • Determine the file's encoding before editing and keep it unchanged.
  • Use only characters available on a standard QWERTY keyboard.
  • Do not insert emojis or other special symbols.
  • Preserve the original end-of-line style (LF or CRLF).
  • Keep single-line comments on a single line.
  • Maintain the indentation style required by the language (Python, Haskell, F#, Nim, Cobra, YAML, Makefiles, etc.).
  • When instructed with Line Number Referencing = yes, prefix each new comment with Note <number> (e.g., Note 1).

Content Expectations

  • Focus on lines and blocks that best illustrate language or platform concepts.
  • Explain the "why" behind syntax, idioms, and design choices.
  • Reinforce previous concepts only when it improves comprehension (Repetitiveness).
  • Highlight potential improvements gently and only when they serve an educational purpose.
  • If Line Number Referencing = yes, use note numbers to connect related explanations.

Safety and Compliance

  • Do not alter namespaces, imports, module declarations, or encoding headers in a way that breaks execution.
  • Avoid introducing syntax errors (for example, Python encoding errors per PEP 263).
  • Input data as if typed on the user's keyboard.

Workflow

  1. Confirm Inputs – Ensure at least one target file is provided. If missing, respond with: Please provide a file or files to add educational comments to. Preferably as chat variable or attached context.
  2. Identify File(s) – If multiple matches exist, present an ordered list so the user can choose by number or name.
  3. Review Configuration – Combine the prompt defaults with user-specified values. Interpret obvious typos (e.g., Line Numer) using context.
  4. Plan Comments – Decide which sections of the code best support the configured learning goals.
  5. Add Comments – Apply educational comments following the configured detail, repetitiveness, and knowledge levels. Respect indentation and language syntax.
  6. Validate – Confirm formatting, encoding, and syntax remain intact. Ensure the 125% rule and line limits are satisfied.

Configuration Reference

Properties

  • Numeric Scale: 1-3
  • Numeric Sequence: ordered (higher numbers represent higher knowledge or intensity)

Parameters

  • File Name (required): Target file(s) for commenting.
  • Comment Detail (1-3): Depth of each explanation (default 2).
  • Repetitiveness (1-3): Frequency of revisiting similar concepts (default 2).
  • Educational Nature: Domain focus (default Computer Science).
  • User Knowledge (1-3): General CS/SE familiarity (default 2).
  • Educational Level (1-3): Familiarity with the specific language or framework (default 1).

…

FAQ

What happens if I don't provide a file?

The AI will ask you to provide a file so it can add the comments.

Will the AI change the code?

No, the AI only adds explanatory comments. The code itself is not altered.

Can I control the level of detail in the comments?

Yes, you can adjust 'Comment Detail' to make explanations more basic or in-depth.

Details

Original description by the author

Add educational comments to the file specified, or prompt asking for file to comment if one is not provided.

repo: github/awesome-copilot

Popularity

GitHub stars
40k
Ranking position
#4982
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills