tfmcp / rules
Cursor rule373 starsChanged 58 days agoMITView on GitHub
Rust coding standards and architecture guidelines for tfmcp.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/000_general.mdcCursor rule
- .cursor/rules/002_terraform.mdcCursor rule
- .cursor/rules/003_mcp.mdcCursor rule
- .cursor/rules/project.jsonCursor rule
- .cursor/rules/README.mdCursor rule
- .cursor/rules/rust.jsonCursor rule
- .cursor/rules/terraform.jsonCursor rule
- analyzeSkill
- e2e-testSkill
- refactorSkill
- releaseSkill
- reviewSkill
- similaritySkill
The file
Show its rules and text
We split this 001_rust.mdc into the rules it gives an agent
19 rules. About 0 are common, 8 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Follow the Rust style guide as enforced by rustfmt and cargo fmt.
- Distinctive: line 11
Use 4 spaces for indentation, not tabs.
- Very specific: line 13
Always run cargo fmt before committing code.
- Very specific: line 16
Use Result and Option types appropriately.
- Distinctive: line 18
Create custom error types in modules with complex error handling.
- Very specific: line 19
Use thiserror for defining error types.
- Very specific: line 20
Use anyhow for error propagation in application code.
- Distinctive: line 23
Document all public functions, methods, and types with rustdoc comments.
- Distinctive: line 25
Document complex or non-obvious code sections.
- Very specific: line 28
Prefer immutable variables (let instead of let mut) when possible.
- Distinctive: line 29
Use strong typing rather than type aliases for clarity.
- Very specific: line 31
Avoid unsafe code unless absolutely necessary.
- Very specific: line 32
Use clippy to catch common mistakes.
- Very specific: line 37
Follow the modular structure in src/:
- Distinctive: line 47
Keep implementation details private whenever possible.
- Distinctive: line 48
Use feature flags for optional functionality.
- Very specific: line 59
Use async/await for asynchronous code.
- Very specific: line 60
Use tokio for async runtime.
- Distinctive: line 62
Consider using channels for communication between components.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: Rust coding standards and architecture guidelines for tfmcp. globs: **/*.rs alwaysApply: false --- # Rust Coding Style Guide ## Code Style - Follow the Rust style guide as enforced by `rustfmt` and `cargo fmt`. - Use 4 spaces for indentation, not tabs. - Maximum line length is 100 characters. - Always run `cargo fmt` before committing code. ## Error Handling - Use `Result` and `Option` types appropriately. - Propagate errors with the `?` operator where appropriate. - Create custom error types in modules with complex error handling. - Use `thiserror` for defining error types. - Use `anyhow` for error propagation in application code. ## Documentation - Document all public functions, methods, and types with rustdoc comments. - Include examples in documentation when useful. - Document complex or non-obvious code sections. ## Best Practices - Prefer immutable variables (`let` instead of `let mut`) when possible. - Use strong typing rather than type aliases for clarity. - Leverage Rust's ownership system properly. - Avoid `unsafe` code unless absolutely necessary. - Use `clippy` to catch common mistakes. # Rust Architecture Guidelines ## Project Structure - Follow the modular structure in `src/`: - `core/`: Core tfmcp functionality and abstractions - `mcp/`: Model Context Protocol implementation - `terraform/`: Terraform integration services - `config/`: Configuration handling - `shared/`: Shared utilities ## Module Organization - Each module should have a clear, single responsibility. - Public APIs should be exposed through the module's `mod.rs` or `lib.rs`. - Keep implementation details private whenever possible. - Use feature flags for optional functionality. ## Dependencies - Be conservative with external dependencies. - Evaluate new dependencies carefully: - Is it actively maintained? - Is it widely used/trusted? - Would it be better to implement the functionality ourselves? - Pin dependency versions in Cargo.toml for reproducible builds. ## Asynchronous Programming - Use `async/await` for asynchronous code. - Use `tokio` for async runtime. - Be careful with blocking operations in async contexts. - Consider using channels for communication between components.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

