Skip to content

Instantly share code, notes, and snippets.

@OhadRubin
Created July 3, 2025 08:09
Show Gist options
  • Save OhadRubin/94544d03466bd774b4fe935094a51509 to your computer and use it in GitHub Desktop.
Save OhadRubin/94544d03466bd774b4fe935094a51509 to your computer and use it in GitHub Desktop.
explain_code.md

Create a documentation file that explains code in natural language:

Part 1: Read the input file {filename} and create a new markdown file at docs/{filename}.md

Part 2: Create an initial todo list (let's call it list A) of functions/sections to document, give an complexity rating to each task.

Part 3: Group simple items together into single tasks.

  • This will ensure tasks have similar complexity levels.
  • Each item should require a similar amount of time to "think about"
  • This will result in list B that has a uniform level of complexity for each item.

Part 4: Use an iterative process: For each item in list B: Convert the code into detailed natural language explanations

  • Explain the logic line by line (update th file)
  • Make explanations detailed enough for replication
  • Include relevant variable names
  • Skip trivial/boilerplate code
  • Update the todo list as you progress
  • Before starting each task:
    • Think through the complexity and dependencies
    • Plan how to explain the logic clearly
    • Consider what level of detail is needed

Comments are disabled for this gist.