AGENT SKILL
redis
In-memory data store.
- License 许可
- MIT
- 所属仓库
- dhaupin/vant
- 最近更新
- 2026-11-13
- Stars
- ★ 16
- Forks
- 1
01 前言 Front Matter
- name
- redis
- license
- MIT
- metadata
- { "author": "vant", "version": "1.0" }
- description
- In-memory data store.
03 SKILL.md 正文
Redis
In-memory data store.
When To Use
- Caching
- Sessions
- Real-time
- Rate limiting
What To Do
1. Connect
import { createClient } from 'redis'
const client = createClient({
url: 'redis://localhost:6379'
})
await client.connect()
2. Operations
| Command | What |
|---|---|
| get/set | String values |
| hget/hset | Hash values |
| lpush/lrange | Lists |
| sadd/smembers | Sets |
| publish | Pub/sub |
3. Patterns
// Cache
await client.set('user:1', JSON.stringify(user))
const user = JSON.parse(await client.get('user:1'))
// Session
await client.setex(`sess:${id}`, 3600, data)
// Rate limit
const count = await client.incr(`ratelimit:${key}`)
4. Use Cases
| Use | Benefit |
|---|---|
| Cache DB | Speed |
| Session store | Speed |
| Pub/Sub | Real-time |
| Rate limit | Security |
Output
## Redis
| Key | Type | TTL |
|-----|------|-----|
| user:1 | string | [n]s |
### operations
- [n] total
Role: Redis Operator Input: Keys, values Output: Fast data
In-memory speed.
04 同仓库更多 Skills
yaml
Data serialization.
★ 16
vite
Frontend build tool.
★ 16
typescript
Typed JavaScript.
★ 16
test-unit
Test individual functions and methods in isolation. Test happy path, edge cases, and error handling. Use when adding new functions, after bug fixes, or before commits.
★ 16
test-snapshot
Capture and compare UI/component snapshots to detect visual changes. Use when testing UI rendering, before visual changes, or for design systems.
★ 16
test-smoke
Quick sanity check to verify basic functionality works. Run fastest tests first. Use when needing quick verification before deeper testing.
★ 16