antivibe-code-learning
```markdown
What this skill does
```markdown
---
name: antivibe-code-learning
description: Transform AI-generated code into educational deep dives with AntiVibe, a Claude Code skill that explains what code does, why it was written that way, and how to learn from it.
triggers:
- "deep dive into this code"
- "explain what AI wrote"
- "learn from this code"
- "understand what AI wrote"
- "generate a learning guide"
- "antivibe this code"
- "explain the design decisions here"
- "turn this into a learning resource"
---
# AntiVibe Code Learning
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
AntiVibe is a Claude Code skill that fights vibe-coding by turning AI-generated code into structured, educational deep dives. Instead of copy-pasting code you don't understand, AntiVibe generates Markdown learning guides explaining **what** code does, **why** it was written that way, **when** to use these patterns, and **what alternatives** exist.
---
## Installation
```bash
# Clone and install as a global Claude Code skill
git clone https://github.com/mohi-devhub/antivibe.git
cp -r antivibe ~/.claude/skills/antivibe
```
For project-scoped installation:
```bash
cp -r antivibe .claude/skills/antivibe
```
To enable auto-trigger hooks (automatic deep dives after task completion):
```bash
cp antivibe/hooks/hooks.json .claude/hooks.json
```
---
## File Structure
```
antivibe/
├── SKILL.md # Main skill definition
├── hooks/
│ └── hooks.json # SubagentStop / Stop hooks
├── scripts/
│ ├── capture-phase.sh # Detect implementation phases
│ ├── analyze-code.sh # Parse code structure
│ ├── find-resources.sh # Find external resources
│ └── generate-deep-dive.sh # Generate markdown output
├── agents/
│ └── explainer.md # Subagent for detailed analysis
├── templates/
│ └── deep-dive.md # Output template
└── reference/
├── language-patterns.md # Framework-specific patterns
└── resource-curation.md # Curated learning resources
```
---
## Core Commands
AntiVibe responds to natural language triggers inside Claude Code sessions:
| Trigger | Action |
|--------|--------|
| `/antivibe` | Start an interactive deep dive |
| `"deep dive"` | Analyze recently written code |
| `"learn from this code"` | Generate a full learning guide |
| `"explain what AI wrote"` | Explain specific files |
| `"understand what AI wrote"` | Focus on design decisions |
Output is saved to:
```
deep-dive/<topic>-<date>.md
```
---
## Example Output
After triggering a deep dive on an auth system, AntiVibe generates:
```markdown
# Deep Dive: Authentication System
## Overview
This auth system uses JWT tokens with refresh token rotation...
## Code Walkthrough
### auth/service.ts
- **Purpose**: Token generation and validation
- **Key Components**:
- `generateTokens()`: Creates access/refresh token pair
- `verifyToken()`: Validates JWT signatures against secret
## Concepts Explained
### JWT (JSON Web Tokens)
- **What**: Stateless, signed tokens encoding user claims
- **Why**: Server avoids session storage; tokens are self-contained
- **When**: APIs, SPAs, microservices needing stateless auth
- **Alternatives**: Sessions + cookies, Paseto tokens, opaque tokens
## Learning Resources
- [JWT.io](https://jwt.io) — Interactive decoder and official docs
- [Auth0 Best Practices](https://auth0.com/blog) — Real-world patterns
## Next Steps
1. Study refresh token rotation to prevent reuse attacks
2. Read OWASP JWT Security Cheat Sheet
3. Explore token revocation strategies
```
---
## Configuration
### Change Output Directory
Edit `scripts/generate-deep-dive.sh`:
```bash
#!/usr/bin/env bash
OUTPUT_DIR="learning-notes" # Default is "deep-dive"
DATE=$(date +%Y-%m-%d)
TOPIC="${1:-general}"
mkdir -p "$OUTPUT_DIR"
OUTPUT_FILE="$OUTPUT_DIR/${TOPIC}-${DATE}.md"
# Render the deep-dive template with analyzed content
cat > "$OUTPUT_FILE" << EOF
# Deep Dive: $TOPIC
...
EOF
echo "Saved to: $OUTPUT_FILE"
```
### Auto-Trigger Hooks
`hooks/hooks.json` wires AntiVibe into Claude Code's event system:
```json
{
"hooks": [
{
"event": "SubagentStop",
"command": "bash ~/.claude/skills/antivibe/scripts/capture-phase.sh"
},
{
"event": "Stop",
"command": "bash ~/.claude/skills/antivibe/scripts/generate-deep-dive.sh session-summary"
}
]
}
```
- **SubagentStop**: Fires when a sub-task finishes — captures phase-level explanations
- **Stop**: Fires when the session ends — generates a full session summary
---
## Scripts Reference
### `capture-phase.sh`
Detects which implementation phase just completed (e.g., "auth", "database", "API layer") and tags the context for the final deep dive.
```bash
#!/usr/bin/env bash
# Reads recent git diff or file changes to detect phase
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || echo "")
echo "Phase context: $CHANGED_FILES" >> /tmp/antivibe-phase.log
```
### `analyze-code.sh`
Parses code structure — functions, classes, imports — and feeds them to the explainer agent.
```bash
#!/usr/bin/env bash
TARGET="${1:-.}"
# List all source files modified recently
find "$TARGET" -name "*.ts" -o -name "*.py" -o -name "*.go" \
| xargs grep -l "export\|def \|func " 2>/dev/null
```
### `find-resources.sh`
Maps detected concepts (JWT, React hooks, goroutines, etc.) to curated resources in `reference/resource-curation.md`.
```bash
#!/usr/bin/env bash
CONCEPT="$1"
grep -A 3 "### $CONCEPT" \
~/.claude/skills/antivibe/reference/resource-curation.md
```
---
## Extending AntiVibe
### Add Language Patterns
Edit `reference/language-patterns.md` to add framework-specific explanations:
```markdown
## Go
### Goroutines
- **Pattern**: `go func() { ... }()`
- **Why**: Lightweight concurrency without OS threads
- **Gotchas**: Always handle done channels to avoid leaks
- **Resources**: [Go Tour Concurrency](https://tour.golang.org/concurrency/1)
### Error Wrapping
- **Pattern**: `fmt.Errorf("context: %w", err)`
- **Why**: Preserves error chain for `errors.Is` / `errors.As`
```
### Add Curated Resources
Edit `reference/resource-curation.md`:
```markdown
## Authentication
### JWT
- [jwt.io](https://jwt.io) — Decoder + library list
- [OWASP JWT Cheat Sheet](https://cheatsheetseries.owasp.org) — Security patterns
### OAuth2
- [OAuth2 Simplified](https://aaronparecki.com/oauth-2-simplified/) — Plain-language guide
```
### Customize the Template
Edit `templates/deep-dive.md` to match your team's style:
```markdown
# Deep Dive: {{TOPIC}}
Generated: {{DATE}}
## TL;DR
{{SUMMARY}}
## Code Walkthrough
{{WALKTHROUGH}}
## Concepts
{{CONCEPTS}}
## Resources
{{RESOURCES}}
## What to Study Next
{{NEXT_STEPS}}
```
---
## Supported Languages & Frameworks
AntiVibe's pattern library covers:
| Language | Frameworks |
|----------|-----------|
| TypeScript/JavaScript | React, Node.js, Express, Next.js |
| Python | Django, FastAPI, Flask |
| Go | Standard library, Gin, Echo |
| Rust | Standard library, Actix-web |
| Java | Spring Boot |
Add more in `reference/language-patterns.md`.
---
## AntiVibe Principles
When generating deep dives, always follow these rules:
1. **Why over what** — Design decisions matter more than syntax
2. **Context matters** — Explain when and why to use each pattern
3. **Curated resources** — Link to authoritative docs, not random blogs
4. **Phase-aware** — Group explanations by implementation phase
5. **Learning path** — Always end with "What to Study Next"
6. **Concept mapping** — Connect implementation to underlying CS concepts
---
## Troubleshooting
**Deep dive not generating?**
- Confirm the skill is installed: `ls ~/.claude/skills/antivibe/SKILL.md`
- Check script permissions: `chmod +x ~/.claude/skills/antivibe/scripts/*.sh`
**Hooks not firing?**
- Verify hooks.json is in `.claude/hooks.json` (project root), not the skill folder
- Check hook event names match Claude Code's supported events (`SubagenRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.