cursorrules

A set of Cursor rules for the XFuel Protocol, a blockchain project whose smart contracts are written in Solidity. The rules cover contract versions, architecture, security patterns, gas use, and testing.

In plain words
What is it for?
Writing or reviewing XFuel Solidity contracts, choosing project architecture, optimizing transaction costs, and running local Hardhat tests.
Why use it?
It keeps generated and edited code aligned with the project's technical decisions and testing boundaries.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/xfuel-lab/xfuel-protocol/cursorrules
Clone the repo
git clone --depth 1 https://github.com/XFuel-Lab/xfuel-protocol

Made for: Cursor.

Per session 889 This file is loaded in full into every session.
When invoked 889 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00889 $0.00889
Opus 5 $0.00445 $0.00445
Sonnet 5 $0.00178 $0.00178
Haiku 4.5 $0.00089 $0.00089

Measured yesterday against content hash 0727eb41288c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules 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 yesterday.

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.

.cursorrules · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.

XFuel Protocol – Cursor Rules

Based on Whitepaper v1.6 core with expansions to v2.4

Solidity

  • Use Solidity ^0.8.22 for all contracts in contracts/core/ and any new audit-scope contracts.
  • Use Solidity ^0.8.20 for all other contracts (contracts/circuits/, contracts/mocks/, contracts/legacy/, contracts/interfaces/).
  • Do NOT use versions below 0.8.20 in any new contract.
  • Follow OpenZeppelin patterns for access control, pausability, and safe transfers.

Architecture

  • Prioritize modularity per whitepaper Section 2: No shared state between circuits, event-driven interfaces.
  • Use SP1 hooks for zkML proofs per Section 7.
  • Money + proof home = Base (USDC/x402, ZKVerifierSP1). Theta EdgeCloud = optional GPU provider only (ADR 0002).

Gas Optimization

  • Target <300K gas per operation, <500K gas end-to-end per Section 3.5.

Code Comments

  • Comment code with whitepaper references (e.g., // Per Section 3.2 for Hyperlane relay).

Hardhat / Testing

  • Use ethers.js v6+ for all RPC interactions.
  • NEVER run npx hardhat test against a live Theta RPC. Tests run against Hardhat local (chain 1337) only.
  • Theta ETH-RPC adaptor does NOT support evm_snapshot, evm_revert, or evm_mine. Waffle fixtures will fail on-chain.
  • When writing Theta-live integration tests, replace revertedWith('custom message') with revertedWith('evm: execution reverted') — Theta always returns the generic message.

Base Networks (money + proof home — ADR 0002)

  • Mainnet: chain ID 8453, RPC https://mainnet.base.org (or Alchemy/Infura)
  • Sepolia: chain ID 84532, RPC https://sepolia.base.org
  • Hardhat networks: base, base-sepolia

Theta ETH-RPC (provider / EdgeCloud ops only — not settlement home)

  • Mainnet: chain ID 361 (0x169), RPC https://eth-rpc-api.thetatoken.org/rpc
  • Testnet: chain ID 365 (0x16d), RPC https://eth-rpc-api-testnet.thetatoken.org/rpc
  • Privatenet: chain ID 366, RPC http://localhost:18888/rpc
  • Subchain Testnet: chain ID 365001; Mainnet: 361001; Privatenet: 360777

Read the full file on GitHub · 54 lines

Changes

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.

  1. yesterday First seen · 54 lines · 889 tokens per session scan A 0727eb41288c

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository XFuel-Lab/xfuel-protocol (1 stars, last pushed yesterday), licensed Apache-2.0. It adds 889 tokens to every session, about $0.0044 per session on Opus 5. 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.

Related

Other cursor rules, from other repositories

agoragentic-assure

Prepare and evaluate an autonomous agent transaction without self-granting authority or moving money. Use for bounded authority requests, pre-execution checks, payment and delivery evidence, safe retry decisions, outcome verification, and reconciliation.

rhein1/agoragentic-integrations · 43 tokens

agoragentic

Route an Agoragentic task to the smallest applicable skill. Use when the request involves Agoragentic execution, governance, transaction assurance, proof/receipts, deployment, selling, or integration and the correct branch is not yet known.

rhein1/agoragentic-integrations · 49 tokens

agoragentic-govern

Apply Agoragentic local governance before an agent performs side effects. Use for policy checks, approval packets, authority boundaries, and no-spend Harness or ECF preparation.

rhein1/agoragentic-integrations · 35 tokens

agoragentic-integrate

Connect an external agent host, framework, tool, or specialist engine to Agoragentic governance and receipts. Use for adapters, lifecycle mapping, MCP/tool discovery, and bounded integration design.

rhein1/agoragentic-integrations · 38 tokens

agoragentic-prove

Produce or inspect Agoragentic local proof and receipt evidence for an agent run. Use for evidence refs, hashes, run status, policy decisions, approval linkage, and reconciliation.

rhein1/agoragentic-integrations · 36 tokens

agoragentic-sell

Prepare an Agoragentic capability for commercial listing or paid routing. Use for listing readiness, pricing/payment metadata checks, seller evidence, and marketplace handoff without publishing or spending automatically.

rhein1/agoragentic-integrations · 37 tokens