xiaohongshu
xiaohongshu
explain-like-senior
Senior-level code explanations with deep technical insights and context
Full skill instructions
I'll explain this code as a senior developer would, focusing on the why behind decisions.
Target Reduction: 60% (4,000-6,000 → 1,500-2,500 tokens) Optimization Status: ✅ Optimized (Phase 2 Batch 3B, 2026-01-26)
Problem: Reading entire codebase for context wastes tokens Solution: Laser-focus on specified file/function only
# ❌ AVOID: Exploring entire codebase
Glob **/*.ts # 500+ tokens
Read all related files # 2,000+ tokens
# ✅ PREFER: Targeted analysis
Grep "class UserService" --output_mode files_with_matches # 50 tokens
Read src/services/UserService.ts # 300 tokens
Token impact: 2,500 → 350 tokens (86% reduction)
Problem: Re-analyzing project architecture each time
Solution: Leverage cached /understand results
# ❌ AVOID: Fresh architecture analysis
Glob src/** # 400 tokens
Read package.json, tsconfig.json # 500 tokens
Analyze framework patterns # 800 tokens
# ✅ PREFER: Reuse cached architecture
Read .claude/cache/understand/architecture.json # 100 tokens
# Contains: framework, patterns, conventions, tech stack
Token impact: 1,700 → 100 tokens (94% reduction)
Problem: Reading multiple files to find similar implementations Solution: Grep for code patterns before reading files
# ❌ AVOID: Speculative file reads
Read src/services/*.ts # 2,000+ tokens across 10 files
# ✅ PREFER: Grep-then-read approach
Grep "implements Repository" --output_mode files_with_matches # 30 tokens
Grep "async.*transaction" --output_mode content -A 3 -B 1 # 150 tokens
Read only the 2-3 most relevant files # 600 tokens
Token impact: 2,000 → 780 tokens (61% reduction)
Problem: Providing deep technical details when overview suffices Solution: Start with overview, dive deeper only on request
# Initial explanation (quick overview)
- High-level architecture explanation: 400 tokens
- Key design decisions: 300 tokens
- Trade-offs summary: 200 tokens
Total: 900 tokens
# Only if user requests --deep flag
- Alternative approaches analysis: 600 tokens
- Performance implications: 400 tokens
- Scalability considerations: 400 tokens
Additional: 1,400 tokens
Token impact: 2,300 → 900 tokens base (61% reduction)
Problem: Re-reading code context in follow-up questions Solution: Track explained code in session state
# First explanation
Read src/auth/AuthService.ts # 400 tokens
Explain implementation # 800 tokens
# Follow-up question: "Why did they use JWT instead of sessions?"
# ❌ AVOID: Re-reading file (400 tokens)
# ✅ PREFER: Use session state (0 tokens - already in context)
Reference previous explanation, focus on JWT rationale # 300 tokens
Token impact: Per follow-up: 700 → 300 tokens (57% reduction)
Problem: Over-analyzing straightforward implementations Solution: Detect simple patterns and provide concise explanation
# Detection criteria for early exit:
- Single-purpose utility function (< 20 lines)
- Standard CRUD operations following framework conventions
- Simple data transformations without business logic
- Obvious design patterns (Factory, Singleton, etc.)
# ❌ AVOID: Deep analysis of simple utility
Read context files: 600 tokens
Analyze alternatives: 500 tokens
Performance considerations: 400 tokens
Total: 1,500 tokens
# ✅ PREFER: Concise explanation
Brief overview: 200 tokens
Key insight: 150 tokens
Total: 350 tokens (77% reduction)
Token impact: 1,500 → 350 tokens (77% reduction)
Cache Location: .claude/cache/explain-like-senior/
Cached Data:
Cache Sharing:
/understand architecture analysis (saves 800-1,200 tokens)/refactor for consistency (saves 400-600 tokens)/review code patterns cache (saves 300-500 tokens)Cache Validity:
| Scope | Token Range | Use Case |
|---|---|---|
| Single function | 600-1,200 | Explain specific function logic |
| Single file | 800-1,500 | Explain module/class implementation |
| Related files | 1,200-2,000 | Explain feature across 2-3 files |
| Deep analysis | 1,500-2,500 | Comprehensive analysis with alternatives |
Comparison with unoptimized approach:
# Minimal explanation (600-1,200 tokens)
explain-like-senior src/utils/formatDate.ts
# File-level explanation (800-1,500 tokens)
explain-like-senior src/services/UserService.ts
# Function-specific explanation (600-1,200 tokens)
explain-like-senior src/services/UserService.ts:createUser
# Deep analysis with alternatives (1,500-2,500 tokens)
explain-like-senior --deep src/core/auth/JWTStrategy.ts
# Multi-turn conversation (leverages session state)
explain-like-senior src/api/PaymentController.ts # Initial: 1,200 tokens
# Follow-up: "Why Stripe over PayPal?" # Follow-up: 300 tokens (57% savings)
Before explanation:
/understand cache exists (reuse architecture context)During explanation:
After explanation:
I'll analyze the code using native tools:
Technical Context:
Business Context:
Senior-Level Insights:
Experience-Based Guidance:
Mentoring Approach:
Code Evolution Perspective:
Important: I will NEVER:
This provides the kind of contextual, experience-driven explanation that helps developers grow from junior to senior level thinking.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience