hermes

Explain a concept with code

Explains a programming concept through the problem it solves, a minimal runnable example, a common mistake and a quick self-check, pitched at the learner's level. Use to learn or teach a concept.

context

People understand a concept when they see the problem it solves before the solution, run a small example, and then see it break in a realistic way. Definitions alone do not stick, and analogies mislead when they are stretched. The example is the core of the explanation, so it has to run exactly as written.

task

Explain to a learner at the levelOnly if [LANGUAGE] is given: , with examples in .

  1. Give a one-sentence definition in plain words.
  2. Show the problem first: a few lines of code that are awkward, buggy or slow without the concept.
  3. Show the same code using the concept: a minimal, complete, runnable example with imports and a main or entry point if the language needs one, and the expected output as a comment.
  4. Walk through how it works, step by step, referring to specific lines. For beginner, define every new term; for expert, go to the mechanism (memory, scheduling, complexity, the spec) and skip the basics.
  5. Show one common mistake with the concept, what happens, and the fix.
  6. Say when not to use it, and what to use instead.
  7. End with two short questions the learner can answer to check understanding, with answers after a separator.
constraints
  • The examples must run as written on a current stable version of the language. State the version or runtime if behaviour depends on it.
  • If the concept is used differently in different languages, say so in one line and stay with the language of the examples.
  • Use at most one analogy, and say where it stops being accurate.
  • Do not claim performance numbers without saying they depend on the workload.
  • Separate what you verified from what you inferred. Mark inferences as such.
  • When you do not know, say "I don't know" once and state what would settle it.
output format

Markdown with these ## headings, in order: In one sentence, Why it exists, Example, How it works, Common mistake, When not to use it, Check yourself. Code blocks have a language tag. Keep each example under 30 lines.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Learning to code
level
Beginner
made for
Software engineer, Student
risk
read-only
version
v1.0.0 · experimental
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md, ChatGPT, claude.ai

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install explain-concept-with-code --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill explain-concept-with-code -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

PersonaTutoring

Socratic tutor

Tutors by asking guiding questions and giving graded hints instead of answers, so the learner reaches the solution and can explain it. Use for studying, homework help and learning to code.

socratic-tutor
StyleOutput styles

Beginner friendly

Adapts answers for newcomers by defining jargon, explaining why each step matters and avoiding assumed knowledge, from light glossing to full guidance. Use when the reader is new to the topic.

beginner-friendly
PromptLearning to code

Explain a codebase

Explains an unfamiliar codebase. Maps its structure, traces one real request end to end and names the concepts and gotchas a newcomer needs. Use when joining a project or reading an unknown repo.

explain-codebase
PromptLearning to code

Explain a SQL query

Explains a complex SQL query clause by clause in logical execution order, shows intermediate results on a tiny example, and points out bugs and performance traps. Use when inheriting a query.

explain-sql-query
PromptLearning to code

Plan a learning path for a technology

Builds a week-by-week plan to get productive in a new language, framework or tool, built around hands-on milestones and skipping what the learner already knows. Use when picking up a new stack.

plan-learning-path
PersonaLearning to code

Coding mentor

Acts as a senior developer mentoring a junior, asking what they tried, explaining the why behind fixes and reviewing code to teach. Use for early-career developers who want to grow.

coding-mentor