Generate interactive technical diagnosis exercises from git commits. Use when user wants to create learning materials from code fixes, debug sessions, or technical problem-solving. Takes two git commits (before/after a fix) and a problem description to create structured diagnostic exercises that teach technical anatomy, troubleshooting patterns, and systems thinking. Ideal for creating educational content from real-world debugging experiences.
This skill generates interactive learning exercises from git commit histories. It transforms debugging sessions into structured diagnostic lessons that teach systems thinking and technical problem-solving.
Given two git commits and a problem description, this skill creates:
Collect three key pieces:
Before commit (broken state)
After commit (fixed state)
Problem description
Example request format:
Create a diagnosis exercise comparing commits abc123 and def456.
The problem: Flask app worked locally but broke in GitHub Codespaces
because URL generation didn't account for the proxy.
Use git tools to extract the changes:
git diff <before-commit> <after-commit>
For each changed file, identify:
Analysis framework:
Create a layer-by-layer map of the system involved. For each layer, document:
For each layer:
Common layer patterns:
For web applications:
For data processing:
For APIs:
The pattern: Always identify what DIDN'T break to highlight what DID by contrast.
Create the exercise in this exact structure:
Format:
## The Symptom
[Concrete description of what the user experienced]
Locally: [what happened in working environment]
[Output, screenshots, or logs showing it working]
In [broken environment]: [what happened in broken environment]
[Output, screenshots, or logs showing it broken]
**Starting Question: [High-level diagnostic question]**
Guidelines:
Format:
## Diagnostic Framework: [System Name] Anatomy
Let's map the journey of [primary entity: request/data/command] through the system,
identifying what's the same and what's different.
### Layer 1: [Layer Name] [Status Icon]
**What's here:**
- [Component/file 1]
- [Component/file 2]
- [Component/file 3]
**Why it didn't break:** [or "Why it broke:" or "What changed:"]
- [Reason 1]
- [Reason 2]
**Key insight:** [One-sentence takeaway about this layer]
---
[Repeat for each layer...]
Status icons:
(UNCHANGED) - worked before and after(CHANGED) - modified as part of fix(BROKEN) - the problem layer(NEW) - added in the fixFormat:
## The Anatomical Fix
### What needs to change:
**1. [Change description]:**
```[language]
[Actual code from the after commit]
What this does:
2. [Additional change if applicable]:
[Repeat pattern...]
**Include:**
- The actual code from the fix
- Line-by-line explanation of what changed
- Why each change addresses the root cause
- Any configuration or setup changes
#### 4. Diagnosis Questions (for learners)
**Format:**
```markdown
## Diagnosis Questions (for learners)
### Question 1: Why didn't [unchanged system] break?
**Answer:** [Explain the reasoning]
### Question 2: [Diagnostic question about the failure]
**Answer:** [Explain the root cause]
### Question 3: What would break WITHOUT the fix?
- [Consequence 1]
- [Consequence 2]
- [Consequence 3]
### Question 4: What WOULDN'T break even without the fix?
- [Thing 1 that still works]
- [Thing 2 that still works]
Question patterns:
Format:
## The Pattern: What This Teaches
### Core Concepts:
1. **[Concept name]**
- [Learning point]
- [Learning point]
2. **[Concept name]**
- [Learning point]
### Diagnostic Skill Building:
**When [this symptom pattern], ask:**
1. [Diagnostic question 1]
2. [Diagnostic question 2]
3. [Diagnostic question 3]
Extract:
Format:
## Practice Exercise
**Given this error:** "[New but related error message]"
**Walk through:**
1. Which layer is this happening in? ([Expected answer])
2. What's working? ([Expected answer])
3. What's the gap? ([Expected answer])
4. What information exists but isn't being used? ([Expected answer])
5. What's the minimal fix? ([Expected answer])
Create a similar-but-different scenario that tests the same diagnostic pattern.
For enhanced interactivity, add sections like:
Progressive Reveal Pattern:
<details>
<summary>🤔 Before reading on, try to answer: What layer would you investigate first?</summary>
[Provide the answer and reasoning after they've thought about it]
</details>
Hypothesis Testing:
## Test Your Hypothesis
If you think the problem is in [Layer X], you would expect to see:
- ✅ [Observable thing 1]
- ✅ [Observable thing 2]
- ❌ But we actually see [contradictory evidence]
This rules out [Layer X]. Let's look at [Layer Y]...
Common Misdiagnoses:
## Common Misdiagnoses
❌ **Misdiagnosis 1**: "It's a [wrong layer] problem"
- Why this seems right: [Surface evidence]
- Why this is wrong: [Counterevidence]
✅ **Correct diagnosis**: "It's a [right layer] problem"
- Key evidence: [What proves it]
Before finalizing, verify:
The most powerful teaching comes from identifying what DIDN'T need to change:
This teaches layer boundaries and system decomposition.
The goal isn't "here's how to fix proxy issues" but "here's how to diagnose proxy issues":
Pull out the transferable thinking:
Don't paraphrase the fix—show the actual diff:
# Before
app = Flask(__name__)
# After
from werkzeug.middleware.proxy_fix import ProxyFix
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1)
This grounds the learning in reality.
See references/example-proxy-exercise.md for a complete example following this format.
The user may want variations:
Shorter format: Skip "Common Misdiagnoses" and "Interactive Elements", focus on core anatomy Deeper format: Add more diagnostic questions, multiple practice exercises Specific audience: Adjust technical depth for beginners vs. experienced developers Different medium: Format for video script, workshop handout, or documentation
Always ask what format would be most useful before generating.
❌ Don't: Just show the diff without explaining the reasoning ✅ Do: Map the system layers and explain why each did/didn't need to change
❌ Don't: Assume the reader knows what a proxy is ✅ Do: Build from first principles (but concisely)
❌ Don't: Make it a tutorial on the fix itself ✅ Do: Make it a lesson in diagnostic thinking using this fix as the example
❌ Don't: Use vague descriptions like "the network layer changed" ✅ Do: Show the actual code/config that changed and explain mechanistically
❌ Don't: Overwhelm with every possible related concept ✅ Do: Focus on 2-3 core concepts that emerge from this specific case
Best commit pairs:
Less ideal commit pairs: