← 返回 Skills 市场
jhauga

Add Educational Comments

作者 John Haugabook · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
122
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install add-educational-comment
功能描述
Add educational comments to the file specified, or prompt asking for file to comment if one is not provided.
使用说明 (SKILL.md)

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 \x3Cnumber> (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).
  • Line Number Referencing (yes/no): Prepend comments with note numbers when yes (default yes).
  • Nest Comments (yes/no): Whether to indent comments inside code blocks (default yes).
  • Fetch List: Optional URLs for authoritative references.

If a configurable element is missing, use the default value. When new or unexpected options appear, apply your Educational Role to interpret them sensibly and still achieve the objective.

Default Configuration

  • File Name
  • Comment Detail = 2
  • Repetitiveness = 2
  • Educational Nature = Computer Science
  • User Knowledge = 2
  • Educational Level = 1
  • Line Number Referencing = yes
  • Nest Comments = yes
  • Fetch List:
    • \x3Chttps://peps.python.org/pep-0263/>

Examples

Missing File

[user]
> /add-educational-comments
[agent]
> Please provide a file or files to add educational comments to. Preferably as chat variable or attached context.

Custom Configuration

[user]
> /add-educational-comments #file:output_name.py Comment Detail = 1, Repetitiveness = 1, Line Numer = no

Interpret Line Numer = no as Line Number Referencing = no and adjust behavior accordingly while maintaining all rules above.

Final Checklist

  • Ensure the transformed file satisfies the 125% rule without exceeding limits.
  • Keep encoding, end-of-line style, and indentation unchanged.
  • Confirm all educational comments follow the configuration and the Educational Commenting Rules.
  • Provide clarifying suggestions only when they aid learning.
  • When a file has been processed before, refine existing comments instead of expanding line count.
安全使用建议
This skill appears coherent and low-risk, but review the changes it produces before committing: it is designed to add up to 125% more lines (capped at 400 lines) of comments, which can create large diffs and increase file size. Provide only the files you intend the agent to edit (avoid giving it access to secrets/config files). If you use this on code in a repo, run it on a copy or a feature branch and run your build/tests after comments are added to confirm nothing broke. Note the default behavior prepends 'Note <number>' when line-number referencing is enabled and will update previously-processed files rather than reapplying the 125% increase.
功能分析
Type: OpenClaw Skill Name: add-educational-comment Version: 1.0.0 The skill bundle is designed to add educational comments to code files to assist learners. The instructions in SKILL.md focus on maintaining code integrity, following specific formatting rules, and adapting to user knowledge levels, with no evidence of malicious intent, data exfiltration, or unauthorized execution.
能力评估
Purpose & Capability
Name and description match the behavior in SKILL.md: the skill's goal is to add educational comments to a provided file. It requests no binaries, env vars, or installs, which is appropriate for an instruction-only commenting tool.
Instruction Scope
Runtime instructions focus on receiving a target file, planning and inserting comments, preserving encoding/format/EOL/indentation, and validating that edits do not break execution. The workflow asks the user to provide files rather than instructing the agent to search arbitrary system paths or access unrelated secrets.
Install Mechanism
No install spec or code files are present. This is lower-risk and consistent with an instruction-only skill.
Credentials
The skill requests no environment variables, credentials, or config paths. The declared configuration parameters (comment detail, repetitiveness, etc.) are appropriate for the stated functionality.
Persistence & Privilege
always is false and the skill has no install-time persistence or system-wide configuration changes. It does not request elevated persistence or modify other skills' settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install add-educational-comment
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /add-educational-comment 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the "add-educational-comments" skill. - Adds educational comments to code files to enhance their value as learning resources. - Supports configurable depth, repetitiveness, user knowledge, and educational level for comments. - Maintains file formatting, encoding, build correctness, and adapts comment line counts based on file size. - Handles missing or multiple target files by prompting users for input or selection. - Enforces strict commenting and safety rules to ensure code remains executable and beginner-friendly.
元数据
Slug add-educational-comment
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Add Educational Comments 是什么?

Add educational comments to the file specified, or prompt asking for file to comment if one is not provided. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 122 次。

如何安装 Add Educational Comments?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install add-educational-comment」即可一键安装,无需额外配置。

Add Educational Comments 是免费的吗?

是的,Add Educational Comments 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Add Educational Comments 支持哪些平台?

Add Educational Comments 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Add Educational Comments?

由 John Haugabook(@jhauga)开发并维护,当前版本 v1.0.0。

💬 留言讨论