# VibeDB Skills for Claude

Official Claude Code skills for working with VibeDB efficiently.

## Available Skills

### `/vibedb-quickstart`
**Use when**: First time using VibeDB, need quick reference, or basic CRUD operations
- 30-second start guide
- All CRUD operations
- Query operators and patterns
- Common use cases with examples

### `/vibedb-indexing`
**Use when**: Queries are slow (>100ms), working with large collections, or need performance optimization
- Create indexes for 10-1000x speedup
- Auto-suggestions based on slow queries
- Index management and best practices

### `/vibedb-patterns`
**Use when**: Building specific features like sessions, caching, logging, job queues, or agent state
- 9+ production-ready patterns
- Copy-paste code for common scenarios
- Fully working examples

## How to Use

### Invoke as slash command
```
/vibedb-quickstart
/vibedb-indexing
/vibedb-patterns
```

Claude will automatically load the appropriate skill when mentioned.

### Auto-activation

Claude automatically activates skills based on context:
- Working with VibeDB → loads vibedb-quickstart
- Slow queries mentioned → suggests vibedb-indexing
- Need caching/sessions → suggests vibedb-patterns

## Skill Structure

Each skill follows Claude Code format:

```
skill-name/
├── SKILL.md         # Main skill with YAML frontmatter
├── reference.md     # Detailed API docs (loaded when needed)
└── examples.md      # Usage examples (loaded when needed)
```

### Progressive Disclosure

1. **SKILL.md** loads first - quick overview and essentials
2. **reference.md** loads on demand - complete API documentation
3. **examples.md** loads on demand - copy-paste ready code

## Quick Start

### For first-time users
```
/vibedb-quickstart
```

Follow the 30-second example, then explore as needed.

### For performance optimization
```
/vibedb-indexing
```

Learn to create indexes and use auto-suggestions.

### For building features
```
/vibedb-patterns
```

Find and copy the pattern that matches your need.

## Learning Path

### Level 1: Get Started (5 min)
1. Use `/vibedb-quickstart`
2. Try the 30-second example
3. Read essential operations
4. Start coding!

### Level 2: Build Features (15 min)
1. Reference `/vibedb-patterns` for your use case
2. Copy relevant pattern
3. Adapt to your needs
4. Check `/vibedb-quickstart` reference as needed

### Level 3: Optimize (10 min)
1. Use `/vibedb-indexing` when queries slow
2. Create indexes on frequent queries
3. Apply auto-suggestions
4. Monitor performance

## Skill Selection Guide

**Choose based on your need:**

| I need to... | Use this skill |
|--------------|---------------|
| Get started with VibeDB | `/vibedb-quickstart` |
| Insert/update/delete data | `/vibedb-quickstart` |
| Query and filter data | `/vibedb-quickstart` |
| Speed up slow queries | `/vibedb-indexing` |
| Ensure uniqueness | `/vibedb-indexing` |
| Build cache system | `/vibedb-patterns` |
| Manage sessions | `/vibedb-patterns` |
| Log events | `/vibedb-patterns` |
| Process background jobs | `/vibedb-patterns` |
| Save agent state | `/vibedb-patterns` |

## Examples

### Example 1: Quick prototype
```
User: "Help me store user data in VibeDB"
Claude: /vibedb-quickstart
[Shows 30-second example and CRUD operations]
```

### Example 2: Performance issue
```
User: "My queries are taking 200ms, how do I speed this up?"
Claude: /vibedb-indexing
[Shows how to create indexes and use auto-suggestions]
```

### Example 3: Feature building
```
User: "I need to implement session management"
Claude: /vibedb-patterns
[Shows session management pattern with TTL]
```

## Best Practices

1. **Start minimal**: Use `/vibedb-quickstart` first
2. **Progress when needed**: Load reference/examples only when stuck
3. **Copy patterns**: Use `/vibedb-patterns` for proven code
4. **Optimize later**: Add indexes with `/vibedb-indexing` when slow

## Contributing

To add a new skill:

1. Create folder: `skills/vibedb-skillname/`
2. Add `SKILL.md` with YAML frontmatter
3. Add optional `reference.md` and `examples.md`
4. Test with Claude Code
5. Update this README

## Related Resources

- **Main README**: `../README.md`
- **Examples**: `../examples/` - Complete working examples
- **Source**: `../src/vibedb/` - Implementation

---

**Start now**: Type `/vibedb-quickstart` to begin!
