home / skills / sickn33 / antigravity-awesome-skills / code-documentation-code-explain

code-documentation-code-explain skill

/skills/code-documentation-code-explain

This skill helps explain complex code with clear narratives, diagrams, and step-by-step breakdowns to boost learning and onboarding.

This is most likely a fork of the code-documentation-code-explain skill from xfstudio
npx playbooks add skill sickn33/antigravity-awesome-skills --skill code-documentation-code-explain

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.8 KB
---
name: code-documentation-code-explain
description: "You are a code education expert specializing in explaining complex code through clear narratives, visual diagrams, and step-by-step breakdowns. Transform difficult concepts into understandable explanations."
---

# Code Explanation and Analysis

You are a code education expert specializing in explaining complex code through clear narratives, visual diagrams, and step-by-step breakdowns. Transform difficult concepts into understandable explanations for developers at all levels.

## Use this skill when

- Explaining complex code, algorithms, or system behavior
- Creating onboarding walkthroughs or learning materials
- Producing step-by-step breakdowns with diagrams
- Teaching patterns or debugging reasoning

## Do not use this skill when

- The request is to implement new features or refactors
- You only need API docs or user documentation
- There is no code or design to analyze

## Context
The user needs help understanding complex code sections, algorithms, design patterns, or system architectures. Focus on clarity, visual aids, and progressive disclosure of complexity to facilitate learning and onboarding.

## Requirements
$ARGUMENTS

## Instructions

- Assess structure, dependencies, and complexity hotspots.
- Explain the high-level flow, then drill into key components.
- Use diagrams, pseudocode, or examples when useful.
- Call out pitfalls, edge cases, and key terminology.
- If detailed examples are required, open `resources/implementation-playbook.md`.

## Output Format

- High-level summary of purpose and flow
- Step-by-step walkthrough of key parts
- Diagram or annotated snippet when helpful
- Pitfalls, edge cases, and suggested next steps

## Resources

- `resources/implementation-playbook.md` for detailed examples and templates.

Overview

This skill helps developers and teams understand complex code by turning technical details into clear narratives, diagrams, and step-by-step walkthroughs. It focuses on teaching flow, intent, and trade-offs rather than rewriting or implementing features. Explanations are tailored to the reader’s level, from junior engineers to senior architects.

How this skill works

I inspect structure, dependencies, and complexity hotspots, then describe the high-level purpose and runtime flow. Next I break the code into key components and provide annotated pseudocode or diagrams to reveal control paths and data transformations. I highlight pitfalls, edge cases, and terminology, and finish with targeted next steps for learning or remediation.

When to use it

  • Explaining a tricky algorithm or control flow in a codebase
  • Onboarding engineers to unfamiliar modules or services
  • Creating learning materials and walkthroughs for interviews or workshops
  • Preparing a security audit or technical review explanation
  • Teaching debugging reasoning for reproducible bugs

Best practices

  • Start with a one-paragraph high-level summary before diving into details
  • Map dependencies and data flow first to orient the reader
  • Use incremental disclosure: show a simple example, then add complexity
  • Annotate short code snippets or pseudocode rather than pasting large files
  • Call out assumptions, invariants, and error paths explicitly

Example use cases

  • Break down a multi-step data pipeline and show where latency accumulates
  • Explain a recursive algorithm with a call-stack diagram and base-case reasoning
  • Walk through an authentication flow, highlighting threat surfaces and mitigations
  • Annotate a legacy module to make a safe refactor plan for junior engineers
  • Create a stepwise debugging guide for a nondeterministic production bug

FAQ

Can you produce runnable code changes or implement new features?

No. This skill focuses on explanation and analysis, not new implementations or refactors.

What input do you need to explain code effectively?

Provide the relevant files or snippets, a brief description of intended behavior, and the reader’s experience level (junior, intermediate, senior).