Skip to content

simba-git/redis-best-practices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis Best Practices - Contributor Guide

This repository contains Redis performance optimization rules optimized for AI agents and LLMs.

Quick Start

# From repository root
npm install

# Validate existing rules
npm run validate

# Build AGENTS.md
npm run build

Creating a New Rule

  1. Choose a section prefix based on the category:

    • data- Data Structures & Keys (HIGH)
    • ram- Memory & Expiration (HIGH)
    • conn- Connection & Performance (HIGH)
    • json- JSON Documents (MEDIUM)
    • rqe- Redis Query Engine (HIGH)
    • vector- Vector Search & RedisVL (HIGH)
    • semantic-cache- Semantic Caching (MEDIUM)
    • stream- Streams & Pub/Sub (MEDIUM)
    • cluster- Clustering & Replication (MEDIUM)
    • security- Security (HIGH)
    • observe- Observability (MEDIUM)
  2. Copy the template:

    cp rules/_template.md rules/data-your-rule-name.md
  3. Fill in the content following the template structure

  4. Validate and build:

    npm run validate
    npm run build
  5. Review the generated AGENTS.md

Repository Structure

redis-best-practices/
├── SKILL.md           # Agent-facing skill manifest
├── AGENTS.md          # [GENERATED] Compiled rules document
├── README.md          # This file
├── metadata.json      # Version and metadata
├── package.json       # Build scripts
├── scripts/
│   ├── build.js       # Compiles rules into AGENTS.md
│   └── validate.js    # Validates rule frontmatter
└── rules/
    ├── _template.md      # Rule template
    ├── _sections.md      # Section definitions
    ├── _contributing.md  # Writing guidelines
    └── *.md              # Individual rules

Rule File Structure

See rules/_template.md for the complete template. Key elements:

---
title: Clear, Action-Oriented Title
impact: HIGH|MEDIUM|LOW
impactDescription: Quantified benefit (e.g., "10x faster")
tags: relevant, keywords
---

## [Title]

[1-2 sentence explanation]

**Avoid:**

```python
# Comment explaining what's wrong
[Bad example]
```

**Recommended:**

```python
# Comment explaining why this is better
[Good example]
```

Writing Guidelines

See rules/_contributing.md for detailed guidelines. Key principles:

  1. Show concrete transformations - "Change X to Y", not abstract advice
  2. Problem-first structure - Show the problematic pattern before the solution
  3. Quantify impact - Include specific metrics (10x faster, 50% less memory)
  4. Self-contained examples - Complete, runnable code
  5. Semantic naming - Use meaningful names (user:1001, cache:api), not (key1, mykey)

References

About

Agent Skill to write better Redis code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors