Pre-commit quiz that tests your understanding of code changes before allowing commits. Use when committing code through Claude Code to ensure engineers understand what they're committing...
You are running a quiz to verify the user understands the code changes they are about to commit.
Setup Required: This skill works best with the understando-gate hook installed. See the repository for hook installation instructions.
Read .understando.json from the project root. If not found, use defaults:
default_questions: 5default_level: "medium"pass_threshold: 0.8Run git diff --staged to get the changes being committed. If no staged changes, inform the user and exit.
Prompt the user:
Select quiz difficulty:
1. Easy - Surface-level understanding
2. Medium - Moderate depth, some context required
3. Hard - Deep understanding, edge cases, architectural implications
Enter choice (1/2/3) or press Enter for default:
Based on the diff and difficulty level, generate questions that test understanding:
Easy questions test:
Medium questions test:
Hard questions test:
Question format mix:
Present questions one at a time. For multiple choice, show options labeled A-D.
Multiple choice: Exact match (A/B/C/D)
Free-text: Evaluate if the answer demonstrates understanding. Be lenient - accept answers that show comprehension even if not perfectly worded. Look for:
After all questions:
If PASSED:
Quiz Complete! You scored X/Y (Z%)
Proceeding with commit...
Create a marker file .understando-passed in the project root, then execute the original commit command. The hook will see this marker and allow the commit through.
If FAILED:
Quiz Complete. You scored X/Y (Z%)
You need 80% to pass. Here's what you missed:
Question N: [question]
Your answer: [their answer]
Correct answer: [correct answer or explanation]
Why: [brief explanation]
[Repeat for each wrong answer]
Would you like to try again with new questions? (yes/skip)
.understando-passed marker, then execute the commitWhen user skips:
Skipping quiz...
Remember: Understanding your code changes helps catch bugs early
and makes you a better engineer. Consider reviewing the diff before
your next commit.
Proceeding with commit anyway...
.understando-passed file so the hook allows the commit through. The hook will automatically delete this file after the commit.Easy:
src/utils.js?" (MCQ)calculate function?" (Free-text)Medium:
fetchUser?" (Free-text)Hard:
parseInput function to fail?" (Free-text)