skills/builderx_api-redis/SKILL.md
Patterns for using Redis caching, PubSub, and Poolboy in BuilderX API
npx skillsauth add vuluu2k/skills builderx_api-redisInstall 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.
The builderx_api project uses the redix library combined with Erlang's :poolboy for connection pooling. Standard usages revolve entirely around the Redis.PubSub module (lib/redis/redis_pubsub.ex).
The Redis.PubSub module exposes wrapper functions for common Redis operations. Under the hood, they use Redix.command/2 within a :poolboy.transaction/2 call targeting the :redis_poolex pool.
# GET a key
{:ok, value} = Redis.PubSub.get("my_key")
# SET a key
{:ok, "OK"} = Redis.PubSub.set("my_key", "value")
# SET a key with expiration (in seconds)
{:ok, "OK"} = Redis.PubSub.set("my_key", "value", 3600)
# Delete keys
{:ok, deleted_count} = Redis.PubSub.del("my_key")
{:ok, deleted_count} = Redis.PubSub.del(["key1", "key2"])
# Expire an existing key
{:ok, 1} = Redis.PubSub.expire("my_key", 60)
# Increment by 1
{:ok, new_val} = Redis.PubSub.incr("visits")
# Increment by N
{:ok, new_val} = Redis.PubSub.incr("visits", 5)
# Increment a field inside a hash
{:ok, new_val} = Redis.PubSub.hincrby("user:123", "login_count", 1)
# Get a field from a hash
{:ok, value} = Redis.PubSub.hget("user:123", "name")
# Get entire hash
{:ok, list_of_pairs} = Redis.PubSub.hgetall("user:123")
# Add to Set
{:ok, added_count} = Redis.PubSub.sadd("my_set", "item1")
{:ok, added_count} = Redis.PubSub.sadd("my_set", ["item2", "item3"])
# Remove from Set
{:ok, removed_count} = Redis.PubSub.srem("my_set", "item1")
{:ok, removed_count} = Redis.PubSub.srem("my_set", ["item2", "item3"])
# Get all members
{:ok, members} = Redis.PubSub.smembers("my_set")
You can execute Redis commands transactionally via MULTI and EXEC using the wrappers:
Redis.PubSub.transaction() # Sends MULTI
Redis.PubSub.set("key1", "val1")
Redis.PubSub.set("key2", "val2")
Redis.PubSub.commit() # Sends EXEC
Note: Since these execute under standard HTTP pools without locking the connection strictly contextually in the Redix API wrappers mapped here, be cautious when using Redis transactions via standard global pool dispatch; ensure your pipeline design handles concurrency correctly.
Through :redis_pubsub pool, builderx_api can support pub-sub channels.
# To subscribe the current process to a channel
Redis.PubSub.subscribe("chat_room_1", self())
# To unsubscribe
Redis.PubSub.unsubscribe("chat_room_1", self())
# To publish to a channel
{:ok, subscribers_received} = Redis.PubSub.publish("chat_room_1", "Hello World!")
development
Vue 3 Composition API — <script setup>, reactivity (shallowRef/ref), props without destructure, computed, watch, provide/inject, and composables. Use when the project uses modern Vue 3 Composition API style.
development
Vue 3 Options API — data, props, computed, methods, watch, emits, provide/inject, lifecycle hooks, and mixins. Use when the project uses Options API style (Vue 2 legacy or explicit Vue 3 Options API preference).
tools
Best practices for mixing Ant Design Vue components with Tailwind CSS utility classes. Use this skill to keep styling consistent without custom CSS files.
development
Pinia state management for Vue 3 using Composition API (Setup Stores) — TypeScript-first, storeToRefs for reactivity, focused stores, and API calls in composables. Use when the project uses Vue 3 Composition API / <script setup>.