This document defines rules and guidelines for AI agents working on this repository.
All documentation and comments must follow these rules:
- Use clear, simple language
- Be spartan and informative
- Use short, impactful sentences
- Use active voice. Avoid passive voice
- Focus on practical, actionable insights
- Use data and examples to support claims when possible
- Use "you" and "your" to directly address the reader
- Double check your claims, and if possible do maths with scripts or whatever to not make errors.
- Do not use em dashes anywhere. Use only commas, periods, or other standard punctuation
- Do not use constructions like "not just this, but also this"
- Do not use metaphors and clichés
- Do not use generalizations
- Do not use common setup language including: in conclusion, in closing, etc.
- Do not use unnecessary or excessive adjectives and adverbs
- Do not use hashtags
- Do not use semicolons
- Do not use markdown formatting in prose (no asterisks for bold, no emphasis markers)
- Do not use asterisks for formatting
- Use backticks for all code elements: commands, opcodes, format strings, file paths
- Use backticks for RESP format strings:
*2\r\n$3\r\nGET\r\n - Use backticks for binary formats:
[0x0001][0x0000][0x0003] - Use backticks for command examples:
GET key,SET foo bar - Use backticks for file names and paths:
respb-specs.md,respb_converter.py
- NO TODO COMMENTS
- NO BOGUS TEST CASES
- NO SHORTCUTS TO MAKE TEST PASS
- If there is existing script/file that is doing the same function as what youa are doing reuse it
- Only create scripts for repeated tasks not one time
- If you have to create script for one time tasks, delete it immediately
- No additional md files unless asked for. Plans/Report/Achievements should stay out of md files unless asked for.
- Follow PEP 8 style guidelines
- Use type hints where appropriate
- Keep functions focused and single-purpose
- Add docstrings for public functions and classes
- Use meaningful variable names
- Follow existing code style in protocol-bench/
- Use consistent indentation (spaces, not tabs)
- Add comments for complex logic
- Follow Valkey/Redis coding conventions where applicable
- Clone repos to /tmp if you want to read code or investigate something
- Keep Mendeley-related files in
mendeley/directory - Keep benchmark code in
protocol-bench/directory - Keep documentation in root directory
- Keep Python tools in root directory
- Use lowercase with underscores for Python files:
respb_converter.py - Use lowercase with hyphens for markdown files:
respb-specs.md - Use descriptive names that indicate purpose
- Write clear, descriptive commit messages
- Group related changes together
- Squash commits when appropriate (user will handle force push)
- Do not commit large data files or generated artifacts
- Large AOF files (
*.aof,*.aof.*) - Dataset zip files (
*.zipin mendeley/) - Generated data directories (
mendeley/data/,mendeley/redis_data/) - Build artifacts and temporary files
- Use proper heading hierarchy
- Keep sections focused and concise
- Use code blocks with language tags for examples
- Use tables for structured data
- Keep line length reasonable (80-100 characters)
- Explain why, not what
- Keep comments up to date with code changes
- Remove commented-out code before committing
- Always use hexadecimal format with 0x prefix:
0x0001,0xF000 - Be consistent with opcode ranges and allocations
- Reference
respb-commands.mdfor opcode mappings
- Use clear notation for binary formats:
[2B keylen][key] - Show RESP format with backticks:
`*2\r\n$3\r\nGET\r\n` - Use consistent terminology (mux ID, opcode, payload, etc.)
- Ensure code runs without errors
- Verify tests pass if test suite exists
- Check for linter errors
- Verify documentation renders correctly
- Maintain compatibility with Valkey's production parser
- Keep benchmark results accurate and reproducible
- Document any assumptions or limitations
- Be direct and clear about errors
- Provide actionable solutions
- Avoid technical jargon when possible
- Use examples to illustrate problems
- Handle edge cases gracefully
- Provide meaningful error messages
- Log errors appropriately
- Do not silently fail
- Profile before optimizing
- Document performance improvements with data
- Maintain readability over micro-optimizations
- Consider memory usage alongside CPU usage
- Use real production code for comparisons
- Report accurate numbers with context
- Explain methodology clearly
- Acknowledge limitations
- Follow existing patterns
- Update documentation simultaneously
- Consider backward compatibility
- Maintain opcode space organization
- Use module opcode 0xF000 for module commands
- Document module ID allocations
- Support RESP passthrough for unknown commands
- Provide fallback mechanisms
Before submitting changes, verify:
- Writing style follows all guidelines
- Code is properly formatted
- Documentation is updated
- No linter errors
- Tests pass (if applicable)
- Commit message is clear
- No large files committed
- Code examples use backticks
- No em dashes or semicolons in prose
- Active voice used throughout
When in doubt:
- Follow existing patterns in the codebase
- Prefer simplicity over cleverness
- Ask for clarification rather than guessing
- Maintain consistency with established conventions