Understand your vibe-coded changes by taking a comprehension quiz on your branch's diff
Reduce "vibe debt" by ensuring you understand the code you vibe-coded on your current Git branch.
Invoke this skill with /doi when you want to:
When invoked, this skill will:
Detect Git Context
main, master, develop)Analyze the Diff
Generate Comprehension Questions
Interactive Quiz
Track Vibe Debt
VibeDebt/<branch-name>_<YYYY-MM-DD>.jsonExecute the following steps in order:
Use the Bash tool to run these git commands and capture the output:
# Get current branch name
git rev-parse --abbrev-ref HEAD
# Get the base branch (the branch the current branch was built on top of)
# Priority: 1) Remote's default branch, 2) Upstream tracking branch, 3) Closest ancestor branch
CURRENT=$(git rev-parse --abbrev-ref HEAD)
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || \
git config --get branch.$CURRENT.merge 2>/dev/null | sed 's@^refs/heads/@@' || \
(for b in $(git branch -r | grep -v HEAD | grep -v "origin/$CURRENT" | sed 's/^ *//'); do \
git merge-base HEAD "$b" >/dev/null 2>&1 && \
echo "$(git rev-list --count $(git merge-base HEAD "$b")..HEAD) ${b#origin/}"; \
done | sort -n | head -1 | awk '{print $2}')
# Get the merge base (common ancestor)
git merge-base <default-branch> HEAD
# Get the full diff with context
git diff <merge-base>..HEAD
# Get list of changed files with stats
git diff --stat <merge-base>..HEAD
# Get commit messages on this branch
git log <merge-base>..HEAD --oneline
If the current branch IS the main branch, inform the user that there are no changes to analyze and exit gracefully.
If there are no changes in the diff, inform the user and exit gracefully.
IMPORTANT - Branch Sync Check: After finding the merge base, verify the branch is up to date with the default branch:
# Check if default branch has commits not in current branch
git rev-list HEAD..<default-branch> --count
If the count is greater than 0, the branch is behind the default branch. Display an error message in red and exit:
ERROR: Your branch is not up to date with
<default-branch>.Your branch is X commit(s) behind. Please update your branch first:
git fetch origin git merge origin/<default-branch>Or rebase:
git fetch origin git rebase origin/<default-branch>This ensures the quiz covers all relevant changes.
Do NOT proceed with the quiz until the branch is up to date.
NEVER run git merge, git rebase, git pull, or any command that modifies the git history for the user. Only inform them and exit.
Based on the git diff output, create a structured summary:
Present this summary to the user before starting the quiz.
CRITICAL FOR SPEED: Generate a complete question bank WITH pre-rendered feedback strings BEFORE starting the quiz.
For each question, prepare AND STORE as a structured block:
=== QUESTION 1 ===
QUESTION_TEXT: <the question>
OPTION_A: <option A>
OPTION_B: <option B>
OPTION_C: <option C>
OPTION_D: <option D>
CORRECT: <A|B|C|D>
FEEDBACK_CORRECT: ✅ **Correct!** <full explanation with code snippet if applicable>
FEEDBACK_WRONG: ❌ **Incorrect.** The correct answer is **<X>**: "<answer text>"
<full explanation with code snippet if applicable>
FEEDBACK_REVEALED: 💡 **Answer: <X>** - "<answer text>"
<full explanation with code snippet if applicable>
=== END QUESTION 1 ===
Output this entire question bank before proceeding to Step 4. This ensures:
The only processing needed per answer is matching user input to CORRECT and selecting the right FEEDBACK_* string.
Question Count (scales with complexity):
Question Types (mix these):
Answer Format:
Code Snippet Format (when applicable):
{
"codeSnippet": {
"code": "function example() { ... }",
"language": "typescript",
"description": "This shows how the validation works"
}
}
Present questions one at a time using AskUserQuestion tool. Since all questions are pre-generated, there should be no delay between questions.
Question Format:
IMPORTANT: AskUserQuestion only supports 2-4 options. We use all 4 for answer choices. "Show Me" and "Skip" are accessed via the system-provided "Other" option where users type the command.
{
"questions": [{
"question": "Question N/M: <question text>\n\n_💡 Type \"show me\" or \"skip\" in Other for special actions_",
"header": "QN",
"multiSelect": false,
"options": [
{ "label": "A", "description": "<option A text>" },
{ "label": "B", "description": "<option B text>" },
{ "label": "C", "description": "<option C text>" },
{ "label": "D", "description": "<option D text>" }
]
}]
}
After user responds - USE PRE-RENDERED FEEDBACK (do not regenerate):
If A/B/C/D (correct answer):
If A/B/C/D (wrong answer):
If Other contains "show" (case-insensitive):
If Other contains "skip" (case-insensitive):
⏭️ Skipped N remaining questions. These will be saved as Vibe Debt.If Other (anything else):
Track:
Save questions that were:
If any of the above occurred:
VibeDebt/ directory in the project root if it doesn't exist<branch-name>_<YYYY-MM-DD>.json{
"branchName": "feature/my-branch",
"date": "2024-01-15",
"diffSummary": {
"overview": "...",
"filesChanged": [...],
"linesAdded": 123,
"linesRemoved": 45
},
"vibeDebt": [
{
"id": "q1",
"question": "Why was X implemented this way?",
"options": {
"A": "...",
"B": "...",
"C": "...",
"D": "..."
},
"correctAnswer": "B",
"explanation": "...",
"status": "skipped|incorrect|revealed",
"userAnswer": null|"A",
"relatedFiles": ["src/file.ts"],
"category": "why|how|what-if|impact"
}
],
"stats": {
"totalQuestions": 5,
"correct": 2,
"incorrect": 1,
"skipped": 2
},
"schemaVersion": 1
}
Status field values:
"incorrect" - User answered wrong"revealed" - User chose "Show Me""skipped" - User chose "Skip All" or question was skippedDisplay a summary:
If Vibe Debt was stored, inform the user of the file location.
Provide encouragement based on score:
The skill respects these environment variables or config:
DOI_DEFAULT_BRANCH: Override the default branch name (default: auto-detect from origin/HEAD, falls back to main or master)DOI_MIN_QUESTIONS: Minimum questions to generate (default: 2)DOI_MAX_QUESTIONS: Maximum questions to generate (default: 10)