---
name: mohitagw15856-code-explainer
description: "Explain what a piece of code does in plain English, at the depth the reader needs. Use when asked to explain code, walk through a function, understand an unfamiliar snippet, or onboard to a file. Produces a one-line summary, a step-by-step walkthrough, the non-obvious parts called out, and any bugs or smells spotted along the way."
license: "MIT"
metadata:
  decimalai-skill-id: "01e16d7b-b59c-4d5b-b93b-6ff7ad6d6c31"
  decimalai-version-id: "97250c45-16e9-4214-a916-d9743ecf46d7"
  decimalai-version: "3"
  decimalai-body-sha256: "7f5f28dc2833f5a2fc65e7b6eca6aad0ac5755244f93c4f8b542bc804e90354d"
  decimalai-name: "mohitagw15856/code-explainer"
  decimalai-format: "1"
  decimalai-invocation: "model"
  decimalai-category: "documentation"
  decimalai-source: "https://app.decimal.ai/s/mohitagw15856-code-explainer@3/SKILL.md"
---
# Code Explainer Skill

Make unfamiliar code understandable — fast — without dumbing it down.

## Working from a brief

Infer the language and intent from the code itself; label assumptions *(assumed — confirm)*. Always produce a complete explanation even from a fragment. Match depth to the apparent level of the question.

## Input

The code snippet or file, plus (if given) the language, the reader's level, and what they're trying to understand. Infer the rest.

## Output Structure

### In one line
What this code does, in a single sentence a busy reader can repeat.

### Step by step
A walkthrough of the logic in order — group by block/function. Explain *why*, not just *what*, for anything non-trivial. Reference line ranges where helpful.

### Worth knowing
The non-obvious bits: clever tricks, gotchas, side effects, complexity, dependencies, or assumptions the code makes.

### Anything off?
Bugs, edge cases, or smells you noticed while reading — with the fix. (If it's clean, say so.)

## Quality Checks

- [ ] The one-line summary stands alone
- [ ] The walkthrough explains *why*, not just restating the code in words
- [ ] Non-obvious behaviour (side effects, complexity, edge cases) is surfaced
- [ ] Any bug/smell spotted is flagged with a fix

## Anti-Patterns

- [ ] Do not narrate line-by-line in English ("this line sets x to 5") — explain intent and structure
- [ ] Do not skip the gotchas — the value is in the non-obvious parts
- [ ] Do not assume expert level if the question reads like a beginner's (or vice-versa)
- [ ] Do not ignore a bug you can see just because you weren't asked to review it
