vibe-code-build
Version:
Real-time code monitoring with teaching explanations, CLAUDE.md compliance checking, and interactive chat
254 lines (193 loc) ⢠8.09 kB
Markdown
# Vibe Code
Real-time code monitoring tool that teaches you while you code. Features three powerful modes switchable with Shift+Tab: Diff Mode with teaching explanations, Rules Mode for CLAUDE.md compliance, and Chat Mode for interactive Q&A.
## Quick Start
```bash
npx vibe-code-build
```
Or install globally:
```bash
npm install -g vibe-code-build
vibe-code
```
## Features
### š One Unified Monitor with Three Modes
Switch between modes instantly using **Shift+Tab**:
#### 1. š **Diff Mode** - Code Changes with Teaching
- Shows exact git diff for every file change
- Provides AI-powered explanations of what changed
- Teaches programming concepts related to the changes
- Helps you understand the "why" behind code modifications
#### 2. š **Rules Mode** - CLAUDE.md Compliance & Best Practices
- Monitors code against your project's CLAUDE.md guidelines
- Real-time security vulnerability detection
- Performance issue identification
- Best practice enforcement
- Architectural pattern checking
#### 4. š **Checks Mode** - Comprehensive Quality Monitoring
- **Build & Compilation**: TypeScript, linting, test validation
- **Dependencies**: Vulnerability scanning, outdated package detection
- **Security**: God mode patterns, exposed secrets, injection vulnerabilities
- **CLAUDE.md**: AI guideline compliance checking
- **Performance**: Bundle size analysis, image optimization
- **SEO Analysis** (NEW):
- Overall SEO score (0-100) with letter grades
- Technical SEO: robots.txt, sitemap.xml, HTTPS, mobile config
- Content SEO: Title tags, meta descriptions, heading hierarchy
- Social SEO: Open Graph, Twitter Cards
- Performance SEO: Core Web Vitals, image optimization
- Detailed explanations for each issue
- Priority-based recommendations with time estimates
#### 3. š¬ **Chat Mode** - Interactive Q&A
- Ask questions while coding
- Get explanations about recent changes
- Learn programming concepts on demand
- Context-aware responses based on your code
## Usage
### Start Monitoring
```bash
npx vibe-code-build
```
Choose "Start Monitoring" from the menu, and the unified monitor will begin watching your files.
### Mode Switching
Once monitoring starts, press **Shift+Tab** at any time to cycle through the three modes:
```
š Vibe Code
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š Available Modes:
⢠Diff - Code changes with teaching explanations
⢠Rules - Monitor CLAUDE.md compliance
⢠Chat - Interactive Q&A
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
⨠Switched to: š Diff Mode - See code changes with teaching explanations
Press Shift+Tab to switch modes ⢠Ctrl+C to exit
```
### Watch a Specific Directory
```bash
npx vibe-code watch /path/to/project
```
### Initialize for Claude Code Integration
```bash
npx vibe-code init
```
## Mode Examples
### Diff Mode Example
```
š Vibe Code - Diff Mode
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š UPDATE #1 | 2:45:32 PM
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š auth-service.js
Changes:
@@ -15,6 +15,8 @@
const existingUser = await this.userRepository.findByEmail(email);
if (existingUser) {
throw new ValidationError('User already exists');
}
+
+ // Add rate limiting
+ await this.checkRateLimit(email);
š What this change does:
This change modifies auth-service.js with 2 additions and 0 deletions.
Key changes: Function implementation changed.
š” Teaching: This uses async/await for handling asynchronous operations,
making the code more readable than callbacks or promise chains.
```
### Rules Mode Example
```
š Vibe Code - Rules Mode
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š payment-handler.js 2:46:15 PM
šØ Rule Violations:
šØ Hardcoded secrets detected! Use environment variables instead.
Line 5
šØ SQL injection vulnerability! Use parameterized queries.
Line 12
š” Suggestions:
š” Use const/let instead of var for better scoping.
š” Consider adding "use strict" for safer JavaScript.
š§ Senior Dev Suggestions:
ā ļø Synchronous file operations block the event loop. Use async versions.
```
### Chat Mode Example
```
š Vibe Code - Chat Mode
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š Recent Changes:
š auth-service.js 2:45:32 PM
ā
auth-service.test.js 2:46:15 PM
š¬ Chat:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
You: What changed in the auth service?
Teacher: File auth-service.js was modified.
This change modifies auth-service.js with 2 additions and 0 deletions.
Key changes: Function implementation changed.
š” Teaching: This uses async/await for handling asynchronous operations,
making the code more readable than callbacks or promise chains.
You: What is rate limiting?
Teacher: Rate limiting is like a bouncer at a club - it controls how many
requests someone can make in a given time period. It prevents attackers
from trying thousands of passwords quickly!
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š¬
```
## CLAUDE.md Integration
The Rules Mode automatically reads your project's `CLAUDE.md` file to understand:
- Project-specific commands
- Architecture patterns to enforce
- Security requirements
- Performance guidelines
If no CLAUDE.md exists, it uses sensible defaults for security and best practices.
## Chat Commands
In Chat Mode, you can use these commands:
- `/help` - Show available commands
- `/clear` - Clear chat history
- `/quit` - Exit the program
## Development
```bash
# Clone the repo
git clone https://github.com/yourusername/vibe-code.git
cd vibe-code
# Install dependencies
npm install
# Run locally
npm start
```
## SEO Analysis Features
The enhanced SEO checker in Checks Mode provides comprehensive search engine optimization analysis:
### š Comprehensive Analysis
- **Technical SEO**: robots.txt, sitemap.xml, structured data, HTTPS, mobile viewport
- **Content SEO**: Title optimization, meta descriptions, heading hierarchy, alt text
- **Social SEO**: Open Graph tags, Twitter Cards, social sharing optimization
- **Performance SEO**: Image optimization, lazy loading, Core Web Vitals factors
### š” Educational Explanations
Each SEO issue includes:
- **What it is**: Clear explanation of the SEO element
- **Why it matters**: Impact on search rankings and user experience
- **How to fix**: Step-by-step recommendations with code examples
- **Priority level**: Critical, High, Medium, or Low severity
### šÆ Actionable Recommendations
- Priority-sorted action items
- Time estimates for implementation
- Expected impact on SEO performance
- Real-world examples and best practices
### š SEO Scoring System
- Overall score from 0-100 with letter grades (A+ to F)
- Category-specific scores for targeted improvements
- Competitive benchmarking suggestions
Example output:
```
ā
SEO Analysis:
šÆ Score: 73/100 (B)
š Category Scores:
⢠Technical: 85/100
⢠Content: 62/100
⢠Social: 70/100
⢠Performance: 75/100
ā ļø Top Issues:
⢠No robots.txt file found
š” Add a robots.txt file to control search engine crawling
⢠5 pages missing meta descriptions
š” Add compelling meta descriptions to improve CTR
```
## License
MIT