code-explainer
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.
git clone --depth 1 https://github.com/mohitagw15856/pm-claude-skills /tmp/code-explainer && cp -r /tmp/code-explainer/plugins/pm-engineering/skills/code-explainer ~/.claude/skills/code-explainerSKILL.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 itConduct a structured ethical review of an AI or ML feature, model, or product. Use when preparing to deploy an AI system, assessing algorithmic risk, auditing a model for bias, or producing a responsible AI impact assessment. Produces a structured ethics review covering fairness, transparency, privacy, safety, accountability, and societal impact with a risk tier score, pre-deployment checklist, and prioritised mitigations.
Structure AI and ML product decisions with the rigour of any product decision. Use when building AI-powered features, evaluating LLM integrations, designing AI products, or assessing AI readiness. Produces a complete AI product canvas covering problem definition, model approach, data requirements, evaluation framework, UX design, responsible AI checklist, and launch monitoring plan.
Transform feature briefs into structured design briefs that give designers the context they need before opening Figma. Use when asked to write a design brief, create a design handoff, brief a designer on a new feature, or translate a PRD into design requirements. Produces a brief with user goal, emotional context, success criteria, constraints, edge cases, and out-of-scope boundaries.
Design statistically rigorous A/B tests and interpret experiment results. Use when asked to design an experiment, run an A/B test, calculate sample size, interpret test results, or assess whether an experiment was successful. Produces a complete experiment design with hypothesis, sample size, run time, success criteria, and risk flags — or a results interpretation with ship/iterate/kill recommendation.
Synthesises user signals from multiple research sources into a unified, weighted insight brief. Use when you have data from interviews, support tickets, NPS verbatims, app reviews, or sales calls and need to reconcile contradictions, surface the underlying need behind requests, or answer 'what are users really telling us'. Produces ranked insights with confidence ratings, source weighting rationale, divergent signal analysis by user segment, and a research gap identification section.
Structure a product data analysis, metric deep-dive, funnel analysis, or cohort study. Use when asked to analyse product metrics, investigate a drop in conversion, explain a data change to stakeholders, or find the root cause of a metric movement. Produces a structured analysis with question, root cause, confidence level, and recommended action.
Interpret product metrics against goals and surface actionable signals. Use when asked to analyse product health, review key metrics, investigate a performance issue, produce a health report, or assess product-market fit signals. Produces a structured health report with RAG status, trend analysis, root cause hypotheses, and prioritised actions.
Structure a retention analysis, churn investigation, or engagement deep-dive for any product team. Use when asked to analyse user retention, investigate churn, measure DAU/MAU, or build a retention improvement plan. Produces a retention snapshot with root cause hypotheses, aha-moment correlation, and prioritised interventions.