Skip to content
Prompt

llml — Cursor Rules

by zenbase-ai

AI Summary

A Cursor IDE rule set that enforces consistent Rust coding standards, project structure, and architectural patterns for the LLML library. Developers working on LLML in Cursor will benefit from automated guidance on module organization, naming conventions, and API design.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "llml — Cursor Rules" prompt rules to my project.
Repository: https://github.com/zenbase-ai/llml

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

Compose data structures, serialize them to prompts.

Type Usage & Data Handling

• Primary Data Type: The library's core data input is &serde_json::Value. This ensures compatibility with any data that can be serialized to JSON. • String Handling: • Use format! for constructing simple strings. • For building strings from multiple parts in a loop, collect parts into a Vec<String> and then use parts.join("") for efficiency. • Use &str as function arguments for string slices instead of String where possible. • Recursion: The core formatting logic is recursive. New formatting rules should be integrated into the existing recursive format_value and format_key_value functions.

Rust Coding Rules for LLML Project

These guidelines are designed to maintain the existing quality, style, and architectural patterns of the codebase.

Project Structure & Modules

• Public API (src/lib.rs): The src/lib.rs file is the public face of the library. It should only contain the public API (llml, llml_with_options, Options struct) and its associated documentation and unit tests. • Core Logic (src/formatters.rs): All internal formatting logic should reside in the src/formatters.rs module. Functions within this module should remain private to the crate (i.e., not marked with pub). • Tests: • Unit Tests: Place unit tests within the module they are testing, using a #[cfg(test)] mod tests { ... } block. • Integration Tests: Place integration tests in the tests/ directory. These tests should only call the public API from lib.rs. • Examples: Add new usage examples to the examples/ directory.

Coding Style & Formatting

• Formatting: All code must be formatted with rustfmt using the default settings. • Naming Conventions: • Functions & Variables: Use snake_case (e.g., format_value, kebab_key). • Types (Structs, Enums): Use PascalCase (e.g., Options). • Constants & Statics: Use SCREAMING_SNAKE_CASE (e.g., MULTI_HYPHEN_RE). • Clarity: Prioritize clear, readable code. Use descriptive variable names.

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 9mo ago
Stale
AdoptionUnder 100 stars
71 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars71
Forks1
Issues1
Updated9mo ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more