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/ghostswap1/ghostswap-agents/maingit clone --depth 1 https://github.com/ghostswap1/ghostswap-agentsWhat 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.00682 |
| Opus 5 | $0.00000 | $0.00341 |
| Sonnet 5 | $0.00000 | $0.00136 |
| Haiku 4.5 | $0.00000 | $0.00068 |
Grade A, and why
main 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 — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GhostSwap Partners API — Cursor project rules
Apply these rules whenever you generate or edit code that calls the GhostSwap Partners API.
Authoritative references (always consult before writing API code)
- @../../AGENTS.md — cross-tool conventions, the 6-step workflow, anti-patterns
- @../../skills/ghostswap-partners-api/SKILL.md — full Claude Skill body, includes a minimal Node.js reference proxy
- @../../openapi/openapi.yaml — typed request/response shapes for every endpoint
- @../../mcp-server/src/index.ts — MCP tool definitions if you want typed tool access
Non-negotiables (these are the rules that prevent real bugs)
-
Server-side only. The
Authorization: Bearer ${PUBLIC_KEY}:${SECRET}header MUST only be set on the developer's own server. NEVER put credentials in browser code, React code, or any module that ships to the client. -
POST /v1/swapsrequires anIdempotency-Keyheader (UUID v4). Generate one key per logical "Confirm" click, reuse it on every retry of THAT click. Regenerating creates duplicate swaps. Reset the key only after success. -
Display
amountUserReceivesfrom the quote (not rawamountTo). The network-fee subtraction is already done. -
Refund address is OPTIONAL for float swaps, REQUIRED for fixed. When unknown, omit the field — never send an empty string.
-
Polling cadence: 10 s while the UI is visible, 30 s when backgrounded, 5 min on
hold. Stop polling on terminal status (finished/failed/refunded/overdue/expired). -
On 5xx after
POST /v1/swaps, do NOT auto-retry. CallGET /v1/swaps?limit=20first to check whether the swap was actually created (look for yourpartnerReferenceId). -
Read the base URL from
GHOSTSWAP_API_BASEenv. Don't hard-codehttps://partners-api.ghostswap.ioin your code.
Error envelope (always handle it)
type ApiError = {
error: {
type: 'validation_error' | 'authentication_error' | 'rate_limit_error' | 'conflict' | 'unprocessable' | 'upstream_error' | string;
code: string;
message: string;
param?: string;
};
};
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 · 54 lines · 0 tokens per session scan A 8d8dd7f5dc41
main is a cursor rule published in the GitHub repository ghostswap1/ghostswap-agents (3 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 682 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
hypergrok-team
Run HyperGrok as a seven-role Hyperliquid trading desk.
cursorrules
You have access to perp-cli, a multi-DEX perpetual futures CLI supporting Pacifica (Solana), Hyperliquid (HyperEVM), and Lighter (Ethereum).
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.