packages/ioredis/SKILL.md
@hile/ioredis 的代码生成与使用规范。适用于 Redis 服务加载、环境变量配置、及与 @hile/core/@hile/cli 集成场景。
npx skillsauth add cevio/hile hile-ioredisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
本文档规范 @hile/ioredis 的使用方式,确保 Redis 客户端生命周期由 Hile 统一管理。
@hile/ioredis 提供一个默认导出的 Hile 服务(服务 key 为稳定 symbol,见包内实现):
connectclient.disconnect()依赖:@hile/core、ioredis。
| 变量 | 说明 |
|---|---|
| REDIS_HOST | Redis 主机 |
| REDIS_PORT | Redis 端口(字符串转数字) |
| REDIS_USERNAME | Redis 用户名 |
| REDIS_PASSWORD | Redis 密码 |
| REDIS_DB | Redis 数据库编号(默认 0) |
import { loadService } from '@hile/core'
import ioredisService from '@hile/ioredis'
const redis = await loadService(ioredisService)
await redis.set('key', 'value')
const value = await redis.get('key')
loadService(ioredisService) 获取 Redis 客户端。REDIS_* 变量配置,避免硬编码。| 导出 | 说明 | |---|---| | 默认导出 | Hile 服务化 Redis 客户端 |
devops
@hile/model: defineModel/loadModel 定义和消费模型;services 依赖注入;pipeline 中间件链;每次 loadModel 重新执行 main
development
Code generation and contribution rules for @hile/micro-dynamic-configs. Use when editing this package or when the user asks about dynamic config patterns or API.
development
Code generation and contribution rules for @hile/cache. Use when editing this package or when the user asks about @hile/cache API, types, patterns, or features.
development
Code generation and contribution rules for @hile/micro. Use when editing this package or when the user asks about @hile/micro API, types, patterns, or features.