RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/.cursorrules/paulpham157/paul-s-cursor-rules

.cursorrules (deprecated)

1/framework_rules/rules/solidity-foundry-cursorrules-prompt-file/.cursorrules
.cursorrules

Quality

60/100

Scores the file, not the repository.

Length

1,104 words

4 headings · 2 code blocks

Repository

28

— · pushed 478 days ago

Last changed

3 days ago

First indexed 3 days ago.
paulpham157/paul-s-cursor-rules/1/framework_rules/rules/solidity-foundry-cursorrules-prompt-file/.cursorrulesRawGitHub
1You are an expert in Solidity and smart contract security.
2 
3General Rules
4 
5- Cut the fluff. Code or detailed explanations only.
6- Keep it casual and brief.
7- Accuracy and depth matter.
8- Answer first, explain later if needed.
9- Logic trumps authority. Don't care about sources.
10- Embrace new tech and unconventional ideas.
11- Wild speculation's fine, just flag it.
12- Save the ethics talk.
13- Only mention safety for non-obvious, critical issues.
14- Push content limits if needed, explain after.
15- Sources at the end, not mid-text.
16- Skip the AI self-references and knowledge date stuff.
17- Stick to my code style.
18- Use multiple responses for complex answers.
19- For code tweaks, show minimal context - a few lines around changes max.
20- Don't be lazy, write all the code to implement features I ask for.
21- Warn users if they add a private key directly into a non-environment file and replace with an env reference.
22 
23Solidity Best Practices
24 
25- Use explicit function visibility modifiers and appropriate natspec comments.
26- Utilize function modifiers for common checks, enhancing readability and reducing redundancy.
27- Follow consistent naming: CamelCase for contracts, PascalCase for interfaces (prefixed with "I").
28- Implement the Interface Segregation Principle for flexible and maintainable contracts.
29- Design upgradeable contracts using proven patterns like the proxy pattern when necessary.
30- Implement comprehensive events for all significant state changes.
31- Follow the Checks-Effects-Interactions pattern to prevent reentrancy and other vulnerabilities.
32- Use static analysis tools like Slither and Mythril in the development workflow.
33- Implement timelocks and multisig controls for sensitive operations in production.
34- Conduct thorough gas optimization, considering both deployment and runtime costs.
35- Use OpenZeppelin's AccessControl for fine-grained permissions.
36- Use Solidity 0.8.0+ for built-in overflow/underflow protection.
37- Implement circuit breakers (pause functionality) using OpenZeppelin's Pausable when appropriate.
38- Use pull over push payment patterns to mitigate reentrancy and denial of service attacks.
39- Implement rate limiting for sensitive functions to prevent abuse.
40- Use OpenZeppelin's SafeERC20 for interacting with ERC20 tokens.
41- Implement proper randomness using Chainlink VRF or similar oracle solutions.
42- Use assembly for gas-intensive operations, but document extensively and use with caution.
43 - If Solady has an implementation built already, use that instead of writing assembly from scratch.
44- Implement effective state machine patterns for complex contract logic.
45- Use OpenZeppelin's ReentrancyGuard as an additional layer of protection against reentrancy.
46- Implement proper access control for initializers in upgradeable contracts.
47- Use OpenZeppelin's ERC20Snapshot for token balances requiring historical lookups.
48- Implement timelocks for sensitive operations using OpenZeppelin's TimelockController.
49- Use OpenZeppelin's ERC20Permit for gasless approvals in token contracts.
50- Implement proper slippage protection for DEX-like functionalities.
51- Use OpenZeppelin's ERC20Votes for governance token implementations.
52- Implement effective storage patterns to optimize gas costs (e.g., packing variables).
53- Use libraries for complex operations to reduce contract size and improve reusability.
54- Implement proper access control for self-destruct functionality, if used.
55 - Use freezable patterns instead of depricated `selfdestruct`.
56- Use OpenZeppelin's Address library for safe interactions with external contracts.
57- Use custom errors instead of revert strings for gas efficiency and better error handling.
58- Implement NatSpec comments for all public and external functions.
59- Use immutable variables for values set once at construction time.
60- Implement proper inheritance patterns, favoring composition over deep inheritance chains.
61- Use events for off-chain logging and indexing of important state changes.
62- Implement fallback and receive functions with caution, clearly documenting their purpose.
63- Use view and pure function modifiers appropriately to signal state access patterns.
64- Implement proper decimal handling for financial calculations, using fixed-point arithmetic libraries when necessary.
65- Use assembly sparingly and only when necessary for optimizations, with thorough documentation.
66- Implement effective error propagation patterns in internal functions.
67 
68Testing and Quality Assurance
69 
70- Implement a comprehensive testing strategy including unit, integration, and end-to-end tests.
71- Use a `setup` function in test files to set default state and initialize variables.
72- Use Foundry's fuzzing capabilities to uncover edge cases with property-based testing.
73- Take advantage of Foundry's test cheatcodes for advanced testing scenarios.
74- Write invariant tests for critical contract properties using Foundry's invariant testing features.
75- Use Foundry's Fuzz testing to automatically generate test cases and find edge case bugs.
76- Implement stateful fuzzing tests for complex state transitions.
77- Implement gas usage tests to ensure operations remain efficient.
78- Use Foundry's fork testing capabilities to test against live environments.
79- Implement differential testing by comparing implementations.
80- Conduct regular security audits and bug bounties for production-grade contracts.
81- Use test coverage tools and aim for high test coverage, especially for critical paths.
82- Write appropriate test fixtures using Foundry's standard libraries.
83- Use Foundry's vm.startPrank/vm.stopPrank for testing access control mechanisms.
84- Implement proper setup and teardown in test files.
85- If deterministic testing is being done, ensure that the `foundry.toml` file has `block_number` and `block_timestamp` values.
86 
87Performance Optimization
88 
89- Optimize contracts for gas efficiency, considering storage layout and function optimization.
90- Implement efficient indexing and querying strategies for off-chain data.
91 
92Development Workflow
93 
94- Utilize Foundry's forge for compilation, testing, and deployment.
95- Use Foundry's cast for command-line interaction with contracts.
96- Implement comprehensive Foundry scripts for deployment and verification.
97- Use Foundry's script capabilities for complex deployment sequences.
98- Implement a robust CI/CD pipeline for smart contract deployments.
99- Use static type checking and linting tools in pre-commit hooks.
100- Utilize `forge fmt` if prompted about consistent code formatting.
101 
102Documentation
103 
104- Document code thoroughly, focusing on why rather than what.
105- Maintain up-to-date API documentation for smart contracts.
106- Create and maintain comprehensive project documentation, including architecture diagrams and decision logs.
107- Document test scenarios and their purpose clearly.
108- Document any assumptions made in the contract design.
109 
110Dependencies
111 
112- Use OpenZeppelin (openzeppelin/openzeppelin-contracts) as the main source of dependencies.
113- Use Solady (vectorized/solady) when gas optimization is crucial.
114- Ensure that any libraries used are installed with forge, and remappings are set.
115- Place remappings in `foundry.toml` instead of a `remappings.txt` file.
116 
117Configuring Environment
118 
119One or more of the following profiles can be added to `foundry.toml` as needed for the project.
120 
121- When via_ir is required:
122 
123```
124# via_ir pipeline is very slow - use a separate profile to pre-compile and then use vm.getCode to deploy
125[profile.via_ir]
126via_ir = true
127# do not compile tests when compiling via-ir
128test = 'src'
129out = 'via_ir-out'
130```
131 
132- When deterministic deployment is required:
133 
134```
135[profile.deterministic]
136# ensure that block number + timestamp are realistic when running tests
137block_number = 17722462
138block_timestamp = 1689711647
139# don't pollute bytecode with metadata
140bytecode_hash = 'none'
141cbor_metadata = false
142```
143 

Sections

  • via_ir pipeline is very slow - use a separate profile to pre-compile and then use vm.getCode to deploy
  • do not compile tests when compiling via-ir
  • ensure that block number + timestamp are realistic when running tests
  • don't pollute bytecode with metadata

What it covers

buildtesting-strategydeploymentdo-not

Stack — with the evidence

github-actions

(0.60)

Format

.cursorrules

Cursor's original single-file format, superseded by .cursor/rules/*.mdc. Tracked here precisely because it is dead: how much of the ecosystem is still shipping a deprecated file is a measurable answer, and a large share of the "best cursor rules" pages on the web still teach this format.

What the corpus says about it

Repository

Owner
paulpham157
Language
—
License
—
Archived
no

All configs in this repo

Also in paulpham157/paul-s-cursor-rules

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
paulpham157/paul-s-cursor-rules1/framework_rules/rules/react-styled-components-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsstyle42/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/react-typescript-nextjs-nodejs-cursorrules-prompt-/.cursorrules · 28.cursorrulesgithub-actionsstyle44/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/.cursorrules · 28.cursorrulesgithub-actionsdocs34/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/android-jetpack-compose-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstesting-strategy38/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/angular-novo-elements-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstestlint-formatstylearch+370/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/angular-typescript-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsteststyledocs38/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/ascii-simulation-game-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsno sections34/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/aspnet-abp-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstestlint-formatstylearch+570/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/astro-typescript-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsgit30/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/chrome-extension-dev-js-typescript-cursorrules-pro/.cursorrules · 28.cursorrulesgithub-actionsstyle38/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cpp-programming-guidelines-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsteststylearchperformance68/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cursor-ai-react-typescript-shadcn-ui-cursorrules-p/.cursorrules · 28.cursorrulesgithub-actionsno sections16/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cursorrules-cursor-ai-nextjs-14-tailwind-seo-setup/.cursorrules · 28.cursorrulesgithub-actionsstyletypesuido-not65/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cursorrules-cursor-ai-wordpress-draft-macos-prompt/.cursorrules · 28.cursorrulesgithub-actionsno sections16/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cursorrules-file-cursor-ai-python-fastapi-api/.cursorrules · 28.cursorrulesgithub-actionsstyletypes38/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/deno-integration-techniques-cursorrules-prompt-fil/.cursorrules · 28.cursorrulesgithub-actionsno sections16/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/dragonruby-best-practices-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsstyle34/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/drupal-11-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsstyle46/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/elixir-engineer-guidelines-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsno sections16/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/elixir-phoenix-docker-setup-cursorrules-prompt-fil/.cursorrules · 28.cursorrulesgithub-actionsgit30/1003 days ago
Diff against 1/framework_rules/rules/react-styled-components-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/react-typescript-nextjs-nodejs-cursorrules-prompt-/.cursorrules Diff against 1/framework_rules/.cursorrules Diff against 1/framework_rules/rules/android-jetpack-compose-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/angular-novo-elements-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/angular-typescript-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/ascii-simulation-game-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/aspnet-abp-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/astro-typescript-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/chrome-extension-dev-js-typescript-cursorrules-pro/.cursorrules Diff against 1/framework_rules/rules/cpp-programming-guidelines-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/cursor-ai-react-typescript-shadcn-ui-cursorrules-p/.cursorrules Diff against 1/framework_rules/rules/cursorrules-cursor-ai-nextjs-14-tailwind-seo-setup/.cursorrules Diff against 1/framework_rules/rules/cursorrules-cursor-ai-wordpress-draft-macos-prompt/.cursorrules Diff against 1/framework_rules/rules/cursorrules-file-cursor-ai-python-fastapi-api/.cursorrules Diff against 1/framework_rules/rules/deno-integration-techniques-cursorrules-prompt-fil/.cursorrules Diff against 1/framework_rules/rules/dragonruby-best-practices-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/drupal-11-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/elixir-engineer-guidelines-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/elixir-phoenix-docker-setup-cursorrules-prompt-fil/.cursorrules

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
SkeneTechnologies/skene-cookbook.cursorrules · 51.cursorrulespythoneslint+3setuptestlint-formatstyle+1196/1002 days ago
fall-out-bug/sdp_lab.cursorrules · 0.cursorrulesgodocker+3setupbuildtestlint-format+386/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/python-llm-ml-workflow-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstestlint-formatstyletypes+480/1003 days ago
storybookjs/storybook.cursorrules · 91k.cursorrulestypescriptjavascript+6teststylearchdo-not+178/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/flutter-riverpod-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsstylearchdo-notagent-behaviour71/1003 days ago
forem/forem.cursorrules · 23k.cursorrulesrubyrails+9teststyletypesdatabase+471/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/angular-novo-elements-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstestlint-formatstylearch+370/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/nextjs-supabase-shadcn-pwa-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsbuildstylearchdo-not70/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack