Skip to content
Skillpedia
General coding40k Β· #7039

add-educational-comments

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.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

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.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œAdd educational comments to my file 'script.py'.”

5 new skills a week. 1 minute to read.

add-educational-comments: full guide

Code without comments can be hard to learn from, even when it works. You open a file, see a loop and a few function calls, and still do not know why it was written that way. This skill tells your agent to act as a teacher and write the explanations for you, directly inside the file.

It is useful if you are learning a language, inheriting a script from someone else, or preparing code for a class, a workshop or a new team member. The agent adds comments only. It is written to keep your file's encoding, line endings and indentation as they are. By default it assumes you are new to the language but not new to programming, and you can change that.

Use cases

Learning from a script you did not write

A colleague sends you a 200-line Python script that renames files in bulk. You have never used the libraries it imports. You ask the agent to comment it at a basic level, so each import and each loop is explained before you edit anything.

Preparing teaching material

You run a small evening course and want to hand out a working example. You set the detail low and turn off note numbers, so students get short, clean comments. You keep your own copy of the original to compare against.

Coming back to your own old code

You wrote a data-cleaning script two years ago and cannot remember why one step sorts the rows twice. You ask for deeper comments, with the user knowledge level set higher, so the explanations focus on design choices instead of basic syntax.

Step by step

  1. 1Put the skill folder in ~/.claude/skills/add-educational-comments/ (or your project's .claude/skills/ folder), then start a new session so the agent finds it.
  2. 2Make a copy of the file you want commented, or check that it is saved in git, so you can compare before and after.
  3. 3Ask the agent to add educational comments to your file. Name the file or attach it. If you name none, the agent asks for one.
  4. 4Add settings in plain words if the defaults do not fit, for example 'Comment Detail = 1' or 'Line Number Referencing = no'.
  5. 5Open the result, read the comments from top to bottom, then run the file to confirm it still works the same.

Example

What to ask

β€œAdd educational comments to report.py. Comment Detail = 3, Line Number Referencing = no. I know Excel formulas well but have never used Python.”

What you get

The agent returns report.py with the same code and new comments above key lines. It explains what a list comprehension is, why the file is opened with a 'with' block, and what the pandas groupby call does. The file grows by roughly a quarter, and no note numbers are added.

Tips

  • βœ“Tell the agent your experience level. The skill separates general programming knowledge from knowledge of the specific language, and the default assumes you are new to the language. Setting both avoids comments that are too easy or too hard.
  • βœ“Do not run it again and again on the same file expecting more comments. On a file it already processed, it is meant to improve the existing notes, not add more.
  • βœ“The skill is written to add up to about 400 comment lines, and fewer on very large files. A long file will not be explained line by line, so ask for one section at a time if you need that.
  • βœ“Check the result yourself. The skill says it validates syntax and encoding, but running the file is the only sure check.

Alternatives

  • commit-archaeologist

    Pick it when you need to know why a piece of code exists and who changed it, since it reads git history instead of explaining syntax.

  • code-review

    Pick it when you want feedback on whether changes are correct and well made, instead of a lesson on how the code works.

  • graphify

    Pick it when you want to understand how many files or documents connect to each other, not one file in detail.

Questions and answers

Which programming languages does it work with?

The skill does not list supported languages. It mentions rules for indentation-sensitive languages such as Python, Haskell, F#, YAML and Makefiles, so it is meant to work across many. Test it on a small file first.

Will it add the same number of comments to every file?

No, it aims for the file to reach about 125% of its original length, with a cap of 400 added lines. Files over 1,000 lines get a lower cap of about 300.

Can I make it write notes with numbers I can refer back to?

Yes. Line Number Referencing is on by default, so each new comment starts with 'Note 1', 'Note 2' and so on. Related explanations can point to each other. Set it to no for plain comments.

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.

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
#7039
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills