Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/synmux/myriad/richgit clone --depth 1 https://github.com/synmux/myriadWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02180 |
| Opus 5 | $0.00000 | $0.01090 |
| Sonnet 5 | $0.00000 | $0.00436 |
| Haiku 4.5 | $0.00000 | $0.00218 |
Grade A, and why
rich scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
-
General Guidelines
- Adhere to PEP 8 coding style guidelines for Python code, emphasizing readability and consistency.
- Limit lines to a maximum of 79 characters to enhance readability across different environments.
- Prioritize code clarity and simplicity, making it easy to understand and maintain.
- Use UTF-8 encoding for source files to ensure compatibility with a wide range of characters.
-
Installation and Environment
- Use
uvfor installing dependencies to improve speed and reliability, if appropriate. - Specify Python 3.12 or later to leverage the latest language features and performance improvements. (If applicable for the specific features of rich you are using)
- Use
-
Code Organization and Structure
-
Directory Structure: Follow a logical directory structure.
project_root/ ├── src/ │ ├── main.py # Entry point of the application │ ├── utils/ │ │ ├── init.py │ │ ├── helper_functions.py │ ├── modules/ │ │ ├── init.py │ │ ├── module_a.py # Rich-related components │ │ ├── module_b.py ├── tests/ │ ├── init.py │ ├── test_main.py │ ├── test_module_a.py ├── README.md ├── pyproject.toml # Or requirements.txt
-
File Naming: Use descriptive lowercase names with underscores (e.g.,
console_output.py). -
Module Organization: Group related functionalities into separate modules (e.g.,
rich_display.py,data_formatting.py). -
Component Architecture: Design modular components with clear interfaces for reusability and maintainability.
-
Code Splitting: Break down large files into smaller, more manageable pieces based on functionality. Consider lazy loading of less-frequently used modules.
-
-
Coding Style and Best Practices
- Indentation: Use 4 spaces for indentation.
- Blank Lines: Separate top-level functions and classes with two blank lines, and methods within a class with one blank line.
- Imports:
- Group imports in the following order:
- Standard library imports
- Third-party library imports (including Rich)
- Local application imports
- Use absolute imports for clarity, unless relative imports significantly improve readability within a package.
- Avoid wildcard imports (
from module import *).
- Group imports in the following order:
- Naming Conventions:
- Use lowercase with underscores for function and variable names (
my_variable,my_function). - Use CapWords for class names (
MyClass). - Use UPPER_CASE_WITH_UNDERSCORES for constants (
MAX_VALUE).
- Use lowercase with underscores for function and variable names (
- String Quotes: Use double quotes consistently for strings, especially for docstrings.
-
Rich Library Specific Best Practices
-
Console Instantiation: Create a single
Consoleinstance for your application and reuse it throughout. python from rich.console import Consoleconsole = Console()
def my_function(): console.print("Hello, [bold red]World![/bold red]")
-
Styling: Use Rich's markup system for styling text. Refer to the Rich documentation for available styles and their usage. python console.print("[link=https://example.com]Click here[/link] to visit example.com")
-
Tables: Utilize the
Tableclass for structured data display. Configure columns and rows appropriately. python from rich.table import Tabletable = Table(title="My Data") table.add_column("Name", style="cyan", no_wrap=True) table.add_column("Age", style="magenta") table.add_row("Alice", "30") table.add_row("Bob", "25") console.print(table)
-
Progress Bars: Employ the
Progressclass for tracking long-running tasks. Configure the progress bar to accurately reflect the task's progress. python from rich.progress import Progress import timewith Progress() as progress: task1 = progress.add_task("[red]Downloading...", total=1000) task2 = progress.add_task("[green]Processing...", total=100)
-
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 160 lines · 2,180 tokens per session scan A d1d60d9b1137
rich is a cursor rule published in the GitHub repository synmux/myriad (2 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,180 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
python_tests
We use the unit tests to cover internal behavior that can work without the web / backend counterpart. We aim for 95%+ unit test coverage of our Python code in lib/streamlit.
fastapi-production-architecture-cursorrules-prompt-file
Cursor rules for FastAPI services with router/service/repository boundaries, typed provider adapters, bulkhead isolation, idempotency, and domain exceptions.
django
Definitive guidelines for writing maintainable, performant, and secure Django applications, emphasizing modern best practices, clear code organization, and efficient patterns.
sqlmodel
Satisfying the type checker when working with SQLModel.
python
Python开发规则 - Python最佳实践和项目结构 (python, pip, django, flask, fastapi).
virtual-environment
Rules for using Python virtual environments - check requirements.txt for installed libraries and use the existing virtual environment directory.