Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/latestaiagents/agent-skills/code-explanation-generatornpx skills add latestaiagents/agent-skills --skill code-explanation-generatorgit clone --depth 1 https://github.com/latestaiagents/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/latestaiagents/agent-skills/code-explanation-generator)<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/code-explanation-generator"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/code-explanation-generator.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00056 | $0.01678 |
| Opus 5 | $0.00028 | $0.00839 |
| Sonnet 5 | $0.00011 | $0.00336 |
| Haiku 4.5 | $0.00006 | $0.00168 |
Grade A, and why
code-explanation-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 331 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Explanation Generator
Generate clear explanations for complex code to aid understanding and knowledge transfer.
When to Use
- Understanding unfamiliar or complex code
- Creating documentation for code
- Onboarding new team members
- Code review explanations
- Educational content creation
Explanation Levels
| Level | Audience | Focus |
|---|---|---|
| Beginner | Junior devs, non-technical | What it does, simple terms |
| Intermediate | Mid-level devs | How it works, patterns used |
| Expert | Senior devs, architects | Why decisions made, trade-offs |
AI Prompts by Level
Beginner Explanation
Explain this code for someone new to programming:
```[paste code]```
- Use simple, non-technical language
- Explain what the code accomplishes
- Use real-world analogies
- Avoid jargon or define terms used
Intermediate Explanation
Explain how this code works:
```[paste code]```
Include:
- Step-by-step execution flow
- Design patterns used
- Key functions and their purposes
- How components interact
Expert Explanation
Provide an architectural analysis of this code:
```[paste code]```
Cover:
- Design decisions and alternatives
- Performance characteristics
- Trade-offs made
- Potential improvements
- Edge cases and limitations
Explanation Formats
Line-by-Line Comments
AI Prompt:
Add explanatory comments to each significant line of this code:
```[paste code]```
Comments should explain WHY, not WHAT (the code shows what).
Output:
// Debounce user input to prevent excessive API calls
const debouncedSearch = useMemo(
// Create a new debounced function only when delay changes
() => debounce((query: string) => {
// Skip empty queries to avoid unnecessary requests
if (!query.trim()) return;
// Trigger the actual search with the debounced value
onSearch(query);
}, delay),
[delay, onSearch] // Recreate when these dependencies change
);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 331 lines · 56 tokens per session scan A a796ae6f728d
code-explanation-generator is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 56 tokens to every session and 1,678 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
ai-course-outline-market-positioning
业务诊断助手适合运营、市场营销、教育培训、内容媒体在用户提出“这件事该怎么做”这类问题,需要快速拆解目标、判断重点并形成可执行结果时使用,帮助基于输入材料生成摘要、诊断结论、行动建议和可复用交付物。.
ai-education-data-explorer
教育数据分析助手适合市场营销、运营、software、教育培训在用户提出“教学数据说明什么”这类问题,需要快速拆解目标、判断重点并形成可执行结果时使用,帮助基于输入材料生成教学或招聘诊断、改进建议、评分/活动清单。.
ai-educational-research-methods
教育研究方法助手适合市场营销、运营、software、教育培训在用户提出“研究方法选对了吗”这类问题,需要快速拆解目标、判断重点并形成可执行结果时使用,帮助基于输入材料生成教学或招聘诊断、改进建议、评分/活动清单。.
ai-lesson-plan-activity-designer
视觉质量诊断助手适合运营、市场营销、教育培训、内容媒体在用户提出“这张图够发布吗”这类问题,需要快速拆解目标、判断重点并形成可执行结果时使用,帮助基于输入材料生成摘要、诊断结论、行动建议和可复用交付物。.
ai-patient-education-readability-review
资料整理助手适合运营、市场营销、healthcare、教育培训在用户提出“这份材料重点是什么”这类问题,需要快速拆解目标、判断重点并形成可执行结果时使用,帮助基于输入材料生成摘要、诊断结论、行动建议和可复用交付物。.
ai-question-bank-explanation-quality-check
业务诊断助手适合运营、市场营销、教育培训、内容媒体在用户提出“这件事该怎么做”这类问题,需要快速拆解目标、判断重点并形成可执行结果时使用,帮助基于输入材料生成摘要、诊断结论、行动建议和可复用交付物。.